We assumed that a window will be ready after a single roundtrip but
that's actually not guaranteed by the XDG shell protocol.
This patch waits for an arbitrary timeout (10s) before erroring out and
forcefully closing the window. Since this exercised quite some code
paths, it also reworks some window handling logic and fixes a bunch of
synchronization issues.
(cherry picked from commit eb680bc8c3e4a811dc8736716fd9cf57567c21dd)
GNU debug link expects the file to have the same name as when compiled,
same solution as on Windows.
(cherry picked from commit 4e8cba2d225cd385bba2512d714d01197dc914b2)
`DisplayServer::window_set_size` is called lots of times in the code,
with the assumption (I suppose) that it's going to be idempotent.
We had checks in _update_window_rect but we still called
`WaylandThread::window_set_size`, which did a lot of stuff. In
particular, this caused issues with HiDPI as it "overrode" the window
size before it had a time to figure out its scale.
(cherry picked from commit 870631211f507b302b3fbc289a62891115ad7a29)
This editor setting is queried once every 3 seconds, as it is used
to check whether devices have been (dis)connected for one-click deploy.
This method may be called early on depending on initialization order,
which has led to occasional error messages when exporting a project.
The method now returns early if EditorSettings isn't ready yet
(it will be called again soon after anyway).
(cherry picked from commit 7d6d11f8d8a6c39d8077fe80937e5c000d1f832c)
Some compositors (e.g. COSMIC) can report *all* supported output modes,
not just the current mode. This is valid, albeit deprecated, so let's
add a check and ignore any non-current output events.
(cherry picked from commit dc8e7ef2ce5deb8353a688951e9686f4510629a6)
Freshly deleted objects are temporarily "inert" until their destruction
is acknowledged by the compositor.
Inert objects are ignored. By doing so, we mistakenly returned too
early and missed some FD cleanup logic. This patch ensures that any
outstanding FDs are always closed by moving its logic outside of the
message handling routine.
(cherry picked from commit 6e5d1e00e02cf9086224b5eb3258f901a26de413)
The spec tells us to ignore certain events if we didn't get an `enter`
event first. Certainly we need to at least acknowledge the `enter` event
itself 😅
Despite what I thought in the past, it is allowed, as long as we follow
certain limitations depending on the toplevel's state.
As usual I peppered the code with comments expaining what those
limitations are.
Regarding popups, AFAICT there are no major limitations, although we
should eventually use the new `reposition` method, which autoadjusts the
popup to follow the screen's borders and whatnot. I didn't do that in
this patch as it requires some elbow grease, especially if we want to do
it synchronously.