In this case, it means a newly-created window on a specific display won't
get mouse/keyboard input (which, presumably, will continue to go to a window
on a different physical display instead).
This also makes SDL_SetWindowFocusable() functional on the kmsdrm backend, to
change this flag later, but to be clear, there are no window focus events to
jump between displays in this backend, so this is only useful to manually
tweak things later.
Fixes#14289.
There is no guarantee that libdecor will always dispatch the main queue (a future plugin may run on its own queue), so ensure that the main queue is still dispatched when showing a libdecor window, as is already the case when pumping events.
The queue running on the cursor thread might flush color events before their queue has been set. Use proxy wrappers for their parent objects to assign the queue atomically at creation time.
If the main event handling thread runs slowly, so will cursor animations. Use a dedicated thread for cursor surface events, so that animations will always run at a consistent rate.
Clean up and implement some best practices for event polling and handling:
- Ensure that events are still pumped, even if existing events are in the queue, to ensure that the most recent data is always processed.
- Handle wl_display_flush returning EAGAIN by trying to poll the socket until it can be written to.
- Ensure that events are always pumped on interrupts and broken pipe errors to handle quit events.
- Minimize double-pumping of events, since returning a success code from a wait will implicitly pump events again.
- Wake to poll when using a DBus IME, but the text input protocol is not enabled, to ensure that text events are delivered.
The higher-level functions only convert the base image, so alternate scaled images for icons and cursors need to be converted when being copied to the buffers.
If the system doesn't have Zenity installed, message boxes can fall back to the X11 toolkit while the Wayland driver is in use, in which case, a Wayland window may be set as a parent to an X11 dialog. Ensure that the parent window for an X11 dialog is actually an X11 window.
Allows for finer grained timeout values, and fixes a FIXME.
This also drops the legacy select() fallback path in favor of presuming that poll() is always available. poll() is part of the POSIX.1-2001 standard, has been available in Unix since some time in the 1980s, the BSDs since at least the early 90s, and Linux since kernel 2.1, which predates kernel support for Pthreads. glibc also has its own emulation using select(), if necessary.