From: Vlad Zahorodnii Date: Tue, 22 Nov 2022 12:46:05 +0000 (+0200) Subject: gdk/wayland: Improve readability of wl_output binding code X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~69^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=433734de215f2a729434feba79705e48caed8a1d;p=gtk4.git gdk/wayland: Improve readability of wl_output binding code Provide OUTPUT_VERSION macro to indicate the implemented version of wl_output in gtk rather than use a magical number. --- diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index bfda69ce82..ff6334904f 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -93,6 +93,7 @@ #define OUTPUT_VERSION_WITH_DONE 2 #define NO_XDG_OUTPUT_DONE_SINCE_VERSION 3 #define XDG_ACTIVATION_VERSION 1 +#define OUTPUT_VERSION 3 static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland); @@ -397,8 +398,10 @@ gdk_registry_handle_global (void *data, else if (strcmp (interface, "wl_output") == 0) { output = - wl_registry_bind (display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 3)); - gdk_wayland_display_add_output (display_wayland, id, output, MIN (version, 3)); + wl_registry_bind (display_wayland->wl_registry, id, &wl_output_interface, + MIN (version, OUTPUT_VERSION)); + gdk_wayland_display_add_output (display_wayland, id, output, + MIN (version, OUTPUT_VERSION)); _gdk_wayland_display_async_roundtrip (display_wayland); } else if (strcmp (interface, "wl_seat") == 0)