libdecor can send a size of zero as a valid value, the use of which will close the window. Make sure the minimum width/height are clamped to a minimum of 1.
Add a mode that forces Wayland windows to output with scaling that forces 1:1 pixel mapping.
This is intended to allow legacy applications to be displayed without desktop scaling being applied, and may have issues with some display configurations, as this forces the window to behave in a way that Wayland desktops were not designed to accommodate (rounding errors can result from certain combinations of window/scale values, the window may be unusably small, jump in size at times, or appear to be larger than the desktop space, and cursor precision may be reduced).
Windows flagged as DPI-aware are not affected by this.
The automated video test suite passes with the hint turned on.
KDE provides the kde_output_order_v1 protocol, which tells clients the preferred order of all connected displays. Sort SDL displays according to the provided list at init time.
When an app makes a fullscreen window on Windows, the window is really just resized to the monitor dimensions and positioned at 0, 0 and positioned on top of everything, including the taskbar. Added disabling rounded corners and some new DWM controlled border color (which seems to be defaulted to 1px transparent, but can be set to the theme color by users). Previous settings are restored when exiting fullscreen mode.
Fixes vulkan redefinition errors:
In file included from /tmp/SDL3/src/video/kmsdrm/.././khronos/vulkan/vulkan.h:11,
from /tmp/SDL3/src/video/kmsdrm/../SDL_vulkan_internal.h:52,
from /tmp/SDL3/src/video/kmsdrm/SDL_kmsdrmvulkan.h:32,
from /tmp/SDL3/src/video/kmsdrm/SDL_kmsdrmvideo.c:44:
/tmp/SDL3/src/video/kmsdrm/.././khronos/vulkan/vulkan_core.h:101: error: redefinition of typedef ‘VkInstance’
/tmp/SDL3/include/SDL3/SDL_vulkan.h:52: note: previous declaration of ‘VkInstance’ was here
In file included from /tmp/SDL3/src/video/kmsdrm/.././khronos/vulkan/vulkan.h:11,
from /tmp/SDL3/src/video/kmsdrm/../SDL_vulkan_internal.h:52,
from /tmp/SDL3/src/video/kmsdrm/SDL_kmsdrmvulkan.h:32,
from /tmp/SDL3/src/video/kmsdrm/SDL_kmsdrmvideo.c:44:
/tmp/SDL3/src/video/kmsdrm/.././khronos/vulkan/vulkan_core.h:7513: error: redefinition of typedef ‘VkSurfaceKHR’
/tmp/SDL3/include/SDL3/SDL_vulkan.h:53: note: previous declaration of ‘VkSurfaceKHR’ was here
make[2]: *** [CMakeFiles/SDL3-shared.dir/src/video/kmsdrm/SDL_kmsdrmvideo.c.o] Error 1
GNOME can deliver displays in arbitrary order, which can even change across sleep/wake cycles, so use a DBus method to find the primary display, and try to make sure it is the first exposed by SDL.
On other window managers, continue to assume that the order in which displays are exposed is the preferred order.
This can eventually be replaced by a Wayland protocol that serves the same purpose, if the pending ones are ever finalized.
We don't need to use the hack of setting a timer and waiting for a timer message, MsgWaitForMultipleObjects() will allow us to wait for input directly with a timeout.
Before this change, sleeping for 20 ms would actually sleep for around 30 ms, with this change the sleep time is pretty accurate at 20-21 ms.
These files don't #include SDL headers, so SDL-specific macros will
never be defined here.
This partially reverts commit 31d133db.
Fixes: 31d133db "Define SDL_PLATFORM_* macros instead of underscored ones (#8875)"
Signed-off-by: Simon McVittie <smcv@collabora.com>
These are third-party headers, so it's best if they're identical to the
upstream version rather than using SDL-specific macros or coding style.
This partially reverts commits b6ae281e and 31d133db.
Fixes: 31d133db "Define SDL_PLATFORM_* macros instead of underscored ones (#8875)"
Signed-off-by: Simon McVittie <smcv@collabora.com>
Fixes a crash if no seat was available at initialization, but still allows for one to still be created later if an input device is added.
Removes some unnecessary abstractions in the process.