Skip to content

Commit 102eb6c

Browse files
committed
Add Wayland support
1 parent 16afc0f commit 102eb6c

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

project/lib/custom/sdl/include/SDL_build_config.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@
271271
# define HAVE_GETAUXVAL 1 /**< Get auxiliary vector */
272272
# define HAVE_GETPAGESIZE 1 /**< Get memory page size */
273273
# define HAVE_GETRESUID 1 /**< Get real, effective, and saved user IDs */
274+
# define HAVE_GETRESGID 1 /**< Get real, effective, and saved group IDs */
274275
# define HAVE_INDEX 1 /**< Find character (legacy) */
275276
# define HAVE_INOTIFY 1 /**< File system event monitoring */
276277
# define HAVE_INOTIFY_INIT1 1 /**< Initialize inotify with flags */
@@ -549,6 +550,18 @@
549550
# define SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM "libgbm.so.1" /**< Dynamic libgbm loading */
550551
/** @} */
551552

553+
/**
554+
* @name Wayland Video Driver
555+
* @brief Wayland Window System video driver with extensions.
556+
* @{
557+
*/
558+
# define SDL_VIDEO_DRIVER_WAYLAND 1 /**< Wayland video driver */
559+
# define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC "libwayland-client.so.0" /**< Wayland client library */
560+
# define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR "libwayland-cursor.so.0" /**< Wayland cursor library */
561+
# define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL "libwayland-egl.so.1" /**< Wayland EGL library */
562+
# define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR "libdecor-0.so.0" /**< Wayland client-side decorations library */
563+
# define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON "libxkbcommon.so.0" /**< Wayland keymap library */
564+
552565
/**
553566
* @name X11 Video Driver
554567
* @brief X Window System video driver with extensions.

project/lib/sdl-files.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<files id="native-toolkit-sdl" tags="">
44
<section if="linux">
55
<compilerflag value="-I/usr/include/dbus-1.0" />
6+
<compilerflag value="-I/usr/lib/dbus-1.0/include" />
67

78
<compilerflag value="-I/usr/lib/aarch64-linux-gnu/dbus-1.0/include" if="HXCPP_ARM64" />
89
<compilerflag value="-I/usr/lib/x86_64-linux-gnu/dbus-1.0/include" if="HXCPP_M64" unless="HXCPP_ARM64" />
@@ -530,6 +531,49 @@
530531
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/windows/SDL_windowswindow.c" />
531532
</section>
532533

534+
<section if="linux">
535+
<compilerflag value="-Iobj/generated/wayland" if="linux" />
536+
537+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandclipboard.c" />
538+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandcolor.c" />
539+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylanddatamanager.c" />
540+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylanddyn.c" />
541+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandevents.c" />
542+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandkeyboard.c" />
543+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandmessagebox.c" />
544+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandmouse.c" />
545+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandopengles.c" />
546+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandshmbuffer.c" />
547+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandvideo.c" />
548+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandvulkan.c" />
549+
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/wayland/SDL_waylandwindow.c" />
550+
551+
<file name="obj/generated/wayland/alpha-modifier-v1-client-protocol.c" />
552+
<file name="obj/generated/wayland/color-management-v1-client-protocol.c" />
553+
<file name="obj/generated/wayland/cursor-shape-v1-client-protocol.c" />
554+
<file name="obj/generated/wayland/fractional-scale-v1-client-protocol.c" />
555+
<file name="obj/generated/wayland/frog-color-management-v1-client-protocol.c" />
556+
<file name="obj/generated/wayland/idle-inhibit-unstable-v1-client-protocol.c" />
557+
<file name="obj/generated/wayland/input-timestamps-unstable-v1-client-protocol.c" />
558+
<file name="obj/generated/wayland/keyboard-shortcuts-inhibit-unstable-v1-client-protocol.c" />
559+
<file name="obj/generated/wayland/pointer-constraints-unstable-v1-client-protocol.c" />
560+
<file name="obj/generated/wayland/pointer-gestures-unstable-v1-client-protocol.c" />
561+
<file name="obj/generated/wayland/pointer-warp-v1-client-protocol.c" />
562+
<file name="obj/generated/wayland/primary-selection-unstable-v1-client-protocol.c" />
563+
<file name="obj/generated/wayland/relative-pointer-unstable-v1-client-protocol.c" />
564+
<file name="obj/generated/wayland/tablet-v2-client-protocol.c" />
565+
<file name="obj/generated/wayland/text-input-unstable-v3-client-protocol.c" />
566+
<file name="obj/generated/wayland/viewporter-client-protocol.c" />
567+
<file name="obj/generated/wayland/wayland-client-protocol.c" />
568+
<file name="obj/generated/wayland/xdg-activation-v1-client-protocol.c" />
569+
<file name="obj/generated/wayland/xdg-decoration-unstable-v1-client-protocol.c" />
570+
<file name="obj/generated/wayland/xdg-dialog-v1-client-protocol.c" />
571+
<file name="obj/generated/wayland/xdg-foreign-unstable-v2-client-protocol.c" />
572+
<file name="obj/generated/wayland/xdg-output-unstable-v1-client-protocol.c" />
573+
<file name="obj/generated/wayland/xdg-shell-client-protocol.c" />
574+
<file name="obj/generated/wayland/xdg-toplevel-icon-v1-client-protocol.c" />
575+
</section>
576+
533577
<section if="linux">
534578
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/x11/edid-parse.c" />
535579
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/video/x11/SDL_x11clipboard.c" />

project/src/backend/sdl/SDLWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ namespace lime {
462462

463463
const char *name = SDL_GetRendererName (sdlRenderer);
464464

465-
if (name && std::strcmp (name, SDL_SOFTWARE_RENDERER)) {
465+
if (name && strcmp (name, SDL_SOFTWARE_RENDERER)) {
466466

467467
return "software";
468468

0 commit comments

Comments
 (0)