From 7eea3cadc0140d6e252a9ed8e3fe3a30ca0d0e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Bonithon?= Date: Thu, 6 Apr 2023 18:22:59 +0200 Subject: [PATCH] build: Fix for Wayland backend disabled (Fixes #729) --- panel/panel-application.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/panel/panel-application.c b/panel/panel-application.c index 847352b44..0ade54c9c 100644 --- a/panel/panel-application.c +++ b/panel/panel-application.c @@ -199,7 +199,6 @@ panel_application_class_init (PanelApplicationClass *klass) static void panel_application_init (PanelApplication *application) { - GdkDisplay *display; GError *error = NULL; gint configver; @@ -237,21 +236,23 @@ panel_application_init (PanelApplication *application) application->autosave_timer_id = g_timeout_add_seconds (AUTOSAVE_INTERVAL, panel_application_autosave_timer, application); +#ifdef GDK_WINDOWING_WAYLAND /* warn the user about restricted features on Wayland */ - display = gdk_display_get_default (); - if (GDK_IS_WAYLAND_DISPLAY (display)) + if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) { if (! gtk_layer_is_supported ()) g_warning ("Wayland detected without layer-shell support (either because of your" " compositor or because Xfce4-panel was built without this support):" " Xfce4-panel might not look like a panel and many of its features will" " not be available"); - if (! gdk_wayland_display_query_registry (display, "zwlr_foreign_toplevel_manager_v1")) + if (! gdk_wayland_display_query_registry (gdk_display_get_default (), + "zwlr_foreign_toplevel_manager_v1")) g_warning ("Wayland detected without foreign-toplevel-management support (your" " compositor does not seem to support it): Some Xfce4-panel features will" " not work (e.g. intellihide), as well as some plugins (e.g. ShowDesktop," " Tasklist, WindowMenu)"); } +#endif } -- GitLab