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
Specifically, SDL_WinRTRunApp, SDL_UIKitRunApp, and SDL_GDKRunApp macros were
removed, as likely unnecessary to SDL3 users. A note was added to the
migration doc about how to roll replacements. These are not going into
SDL_oldnames.h.
Fixes#8245.
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.
At the point that we run this, nothing SDL-specific is set up yet.
__APPLE__ is a compiler predefined macro that forms part of the API on
Apple platforms, so it's fine to rely on it.
This partially reverts commit 31d133db.
Fixes: 31d133db "Define SDL_PLATFORM_* macros instead of underscored ones (#8875)"
Signed-off-by: Simon McVittie <smcv@collabora.com>