Without this, the screen does go into idle after a few minutes on a RPi5 with default install (wayland w/ labwc), even
though `screen_keep_on` is set. DBUS is enabled but apparently, the screensaver call is not enough.
The `Vector2i` division operator casts doubles down to `int32_t`. It
would thus truncate the fractional scale factor to 0 if less than 1,
resulting in a FPE on x86_64.
Fixup to "Wayland: Check selection devices before using them"
This slipped under the radar... until for some reason optimized builds
started crashing, perhaps due to timing-related shenanigans, no idea.
Related #106229. The cursor-shape protocol allows us to not have to deal with cursor theming and instead depend on the
compositor for it.
This still does not quite solve the issue when the compositor doesn't implement the protocol
(or running under the x11 backend) but for gnome/kde and a few more this should resolve things.
This issue came from the frame-based refactoring done in the multiwin
PR.
It looks like some (all?) compositors group certain events alongside
`wl_pointer::leave`, which I absolutely did not expect. The docs don't
seem to mention it either from what I can tell.
We now fall-back on the old pointed window if and only if the current
window is invalid and the old one isn't. Each state fetch is guarded
with an `ERR_FAIL_NULL` so this should still catch any potentially
corrupted window with missing data but a valid ID.
I also added the usual big comment so that this "quirk" does not get
lost to time.
In #101774, some libdecor-specific code was added, but without adding the guards. This broke the build with
`libdecor=no`.
Add `#ifdef` guard as necessary.
Before, the WSI was unfortunately quite broken and we had work around it
by manually pacing frames. Needless to say it was not an ideal solution.
Now, the WSI can make use of the new fifo_v1 protocol to work properly.
If it's available, we'll trust the WSI by disabling manual frame pacing.
While we're at it, let's clean up the suspension code a bit by removing
some duplicated stuff and handling the suspension state through a switch
case.
I ported the new softclass macro too blindly. Apparently the various
window messages did not cast properly, skipping some important "deleted
window" checks.
The backend is now mature enough to not explode with multiple windows
but the `DisplayServer` API still cannot meet some guarantees required
by the various Wayland protocols we use. To meet those guarantees this
patch adds three new elements to the DisplayServer API, with relative
handling logic for `Window` and `Popup` nodes:
- `WINDOW_EVENT_FORCE_CLOSE`, which tells a window to *forcefully*
close itself and ensure a proper cleanup of its references, as Wayland
enforces this behavior;
- `WINDOW_FLAG_POPUP_WM_HINT`, which explicitly declares a window as a
"popup", as Wayland enforces this distinction and heuristics are not
reliable enough;
- `FEATURE_SELF_FITTING_WINDOWS`, which signals that the compositor can
fit windows to the screen automatically and that nodes should not do
that themselves.
Given the size of this feature, this patch also includes various
`WaylandThread` reworks and fixes including:
- Improvements to frame wait logic, with fixes to various stalls and a
configurable (through a `#define`) timeout amount;
- A proper implementation of `window_can_draw`;
- Complete overhaul of pointer and tablet handling. Now everything is
always accumulated and handled only on each respective `frame` event.
This makes their logic simpler and more robust.
- Better handling of pointer leaving and pointer enter/exit event
sending;
- Keyboard focus tracking;
- More solid window references using IDs instead of raw pointers as
windows can be deleted at any time;
- More aggressive messaging to window nodes to enforce rects imposed by
the compositor.