commit:     d0833eedb22acbf466d0a80e62bf4fdc9bf43fa3
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  6 18:15:19 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Apr  6 19:44:48 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0833eed

xfce-base/xfce4-panel: Fix building with USE=-wayland

Closes: https://bugs.gentoo.org/903802
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/xfce4-panel-4.19.1-no-wayland.patch      | 51 ++++++++++++++++++++++
 ...-4.19.1.ebuild => xfce4-panel-4.19.1-r1.ebuild} |  5 +++
 2 files changed, 56 insertions(+)

diff --git a/xfce-base/xfce4-panel/files/xfce4-panel-4.19.1-no-wayland.patch 
b/xfce-base/xfce4-panel/files/xfce4-panel-4.19.1-no-wayland.patch
new file mode 100644
index 000000000000..2c7c93e502d4
--- /dev/null
+++ b/xfce-base/xfce4-panel/files/xfce4-panel-4.19.1-no-wayland.patch
@@ -0,0 +1,51 @@
+From 7eea3cadc0140d6e252a9ed8e3fe3a30ca0d0e38 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ga=C3=ABl=20Bonithon?= <g...@xfce.org>
+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
+

diff --git a/xfce-base/xfce4-panel/xfce4-panel-4.19.1.ebuild 
b/xfce-base/xfce4-panel/xfce4-panel-4.19.1-r1.ebuild
similarity index 94%
rename from xfce-base/xfce4-panel/xfce4-panel-4.19.1.ebuild
rename to xfce-base/xfce4-panel/xfce4-panel-4.19.1-r1.ebuild
index b7665ab7ef89..970ea40fe46d 100644
--- a/xfce-base/xfce4-panel/xfce4-panel-4.19.1.ebuild
+++ b/xfce-base/xfce4-panel/xfce4-panel-4.19.1-r1.ebuild
@@ -55,6 +55,11 @@ BDEPEND="
        virtual/pkgconfig
 "
 
+PATCHES=(
+       # https://gitlab.xfce.org/xfce/xfce4-panel/-/issues/729
+       "${FILESDIR}"/${P}-no-wayland.patch
+)
+
 src_configure() {
        local myconf=(
                $(use_enable introspection)

Reply via email to