GTK 4 GdkWaylandSeat using linux-specific BTN_* defs which not available on Darwin
Steps to reproduce
Attempting to build GTK4 with Darwin/X11 combination with additional Wayland backend, as Wayland is portable by taking advantage of epoll-shim
, but gdk/wayland/gdkseat-wayland.c is using evdev/linux input methods, which causing mouse click listeners unable to build on Darwin
- meson setup --wrap-mode=nodownload --buildtype=plain --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=lib -Dauto_features=enabled -Dbroadway-backend=true -Dx11-backend=true -Dmacos-backend=false -Dcolord=disabled -Dman-pages=true -Dsysprof=disabled -Dvulkan=disabled -Dwayland-backend=true -Ddocumentation=true -Dbuild-examples=true -Ddemos=true -Dinstall-tests=true -Dmedia-ffmpeg=disabled -Dcloudproviders=enabled
- ninja build
- error: use of undeclared identifier 'BTN_LEFT'
Version information
GTK 4.12.4
Additional information
../../../gdk/wayland/gdkseat-wayland.c:819:10: error: use of undeclared identifier 'BTN_LEFT'
case BTN_LEFT:
^
../../../gdk/wayland/gdkseat-wayland.c:822:10: error: use of undeclared identifier 'BTN_MIDDLE'
case BTN_MIDDLE:
^
../../../gdk/wayland/gdkseat-wayland.c:825:10: error: use of undeclared identifier 'BTN_RIGHT'
case BTN_RIGHT:
^
../../../gdk/wayland/gdkseat-wayland.c:830:29: error: use of undeclared identifier 'BTN_LEFT'
gdk_button = button - BUTTON_BASE + 4;
^
../../../gdk/wayland/gdkseat-wayland.c:80:22: note: expanded from macro 'BUTTON_BASE'
#define BUTTON_BASE (BTN_LEFT - 1) /* Used to translate to 1-indexed buttons */
^
../../../gdk/wayland/gdkseat-wayland.c:853:10: error: use of undeclared identifier 'BTN_RIGHT'
case BTN_RIGHT:
^
../../../gdk/wayland/gdkseat-wayland.c:856:10: error: use of undeclared identifier 'BTN_MIDDLE'
case BTN_MIDDLE:
^
../../../gdk/wayland/gdkseat-wayland.c:860:49: error: use of undeclared identifier 'BTN_LEFT'
modifier = (GDK_BUTTON1_MASK << (button - BUTTON_BASE - 1)) & ALL_BUTTONS_MASK;
^
../../../gdk/wayland/gdkseat-wayland.c:80:22: note: expanded from macro 'BUTTON_BASE'
#define BUTTON_BASE (BTN_LEFT - 1) /* Used to translate to 1-indexed buttons */
^
../../../gdk/wayland/gdkseat-wayland.c:3066:17: error: use of undeclared identifier 'BTN_STYLUS'
if (button == BTN_STYLUS)
^
../../../gdk/wayland/gdkseat-wayland.c:3068:22: error: use of undeclared identifier 'BTN_STYLUS2'
else if (button == BTN_STYLUS2)
^
9 errors generated.
ninja: build stopped: subcommand failed.
iPad:/buildroot/x11/gtk-4.12.4 root# uname -a
Darwin iPad 20.4.0 Darwin Kernel Version 20.4.0: Sun Feb 28 21:05:09 PST 2021; root:xnu-7195.100.367~3/RELEASE_ARM64_T8101 arm64 arm Darwin
iPad:/buildroot/x11/gtk-4.12.4 root# sw_vers
ProductName: iPhone OS
ProductVersion: 14.5.1
BuildVersion: 18E212