commit:     6a48f9aa81348de4240df10eb44933acd5348412
Author:     Stephan Hartmann <sultan <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 18 17:05:34 2021 +0000
Commit:     Stephan Hartmann <sultan <AT> gentoo <DOT> org>
CommitDate: Thu Nov 18 17:05:47 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a48f9aa

xfce-base/xfwm4: add patch for handling GTK_FRAME_EXTENTS

Bug: https://bugs.gentoo.org/819771
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Stephan Hartmann <sultan <AT> gentoo.org>

 .../files/xfwm4-4.16.1-gtk_frame_extents.patch     | 56 ++++++++++++++++
 xfce-base/xfwm4/xfwm4-4.16.1-r1.ebuild             | 74 ++++++++++++++++++++++
 2 files changed, 130 insertions(+)

diff --git a/xfce-base/xfwm4/files/xfwm4-4.16.1-gtk_frame_extents.patch 
b/xfce-base/xfwm4/files/xfwm4-4.16.1-gtk_frame_extents.patch
new file mode 100644
index 000000000000..bb170d836b7f
--- /dev/null
+++ b/xfce-base/xfwm4/files/xfwm4-4.16.1-gtk_frame_extents.patch
@@ -0,0 +1,56 @@
+From 488288f6e35d5d3dc077e87fe2ed83129692f62e Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <[email protected]>
+Date: Sun, 14 Nov 2021 11:00:55 +0100
+Subject: [PATCH] client: Handle removal of GTK_FRAME_EXTENTS
+
+Chromium and GOOGLE Chrome have now support for GTK_FRAME_EXTENTS.
+
+When maximizing a window, Chromium/Chrome simply removes the property
+on its toplevel rather than setting all values to 0.
+
+xfwm4 would simply ignore the property change because it could not read
+the values and therefore apply the old, wrong values.
+
+Fix xfwm4 to handle the property removal like an actual property change
+to 0.
+
+Signed-off-by: Olivier Fourdan <[email protected]>
+Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/603
+---
+ src/client.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/client.c b/src/client.c
+index 4e6affcfd..310cf90aa 100644
+--- a/src/client.c
++++ b/src/client.c
+@@ -4200,6 +4200,7 @@ clientGetGtkFrameExtents (Client * c)
+     DisplayInfo *display_info;
+     gboolean value_changed = FALSE;
+     gulong *extents;
++    unsigned long old_value;
+     int nitems;
+     int i;
+ 
+@@ -4209,6 +4210,8 @@ clientGetGtkFrameExtents (Client * c)
+     screen_info = c->screen_info;
+     display_info = screen_info->display_info;
+     extents = NULL;
++
++    old_value = FLAG_TEST (c->flags, CLIENT_FLAG_HAS_FRAME_EXTENTS);
+     FLAG_UNSET (c->flags, CLIENT_FLAG_HAS_FRAME_EXTENTS);
+ 
+     if (getCardinalList (display_info, c->window, GTK_FRAME_EXTENTS, 
&extents, &nitems))
+@@ -4232,6 +4235,9 @@ clientGetGtkFrameExtents (Client * c)
+         XFree (extents);
+     }
+ 
++    /* Adding or removing the property also counts as a change */
++    value_changed |= (old_value ^ FLAG_TEST (c->flags, 
CLIENT_FLAG_HAS_FRAME_EXTENTS));
++
+     return value_changed;
+ }
+ 
+-- 
+2.32.0
+

diff --git a/xfce-base/xfwm4/xfwm4-4.16.1-r1.ebuild 
b/xfce-base/xfwm4/xfwm4-4.16.1-r1.ebuild
new file mode 100644
index 000000000000..485538b1b413
--- /dev/null
+++ b/xfce-base/xfwm4/xfwm4-4.16.1-r1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit xdg-utils
+
+DESCRIPTION="Window manager for the Xfce desktop environment"
+HOMEPAGE="https://www.xfce.org/projects/";
+SRC_URI="https://archive.xfce.org/src/xfce/${PN}/${PV%.*}/${P}.tar.bz2";
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv 
~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE="opengl startup-notification +xcomposite +xpresent"
+
+RDEPEND=">=dev-libs/glib-2.20
+       >=x11-libs/gtk+-3.22:3
+       x11-libs/libX11
+       x11-libs/libXext
+       x11-libs/libXi
+       x11-libs/libXinerama
+       x11-libs/libXrandr
+       x11-libs/libXrender
+       x11-libs/libXres
+       x11-libs/pango
+       >=x11-libs/libwnck-3.14:3
+       >=xfce-base/libxfce4util-4.10:=
+       >=xfce-base/libxfce4ui-4.12:=
+       >=xfce-base/xfconf-4.13:=
+       opengl? ( media-libs/libepoxy:=[X(+)] )
+       startup-notification? ( x11-libs/startup-notification )
+       xcomposite? (
+               x11-libs/libXcomposite
+               x11-libs/libXdamage
+               x11-libs/libXfixes
+       )
+       xpresent? ( x11-libs/libXpresent )"
+# libICE/libSM: not really used anywhere but checked by configure
+#   https://bugzilla.xfce.org/show_bug.cgi?id=11914
+DEPEND="${RDEPEND}
+       x11-libs/libICE
+       x11-libs/libSM"
+BDEPEND="
+       dev-util/intltool
+       sys-devel/gettext
+       virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}/${P}-gtk_frame_extents.patch" # bug 819771
+)
+
+src_configure() {
+       local myconf=(
+               $(use_enable opengl epoxy)
+               $(use_enable startup-notification)
+               $(use_enable xcomposite compositor)
+               $(use_enable xpresent)
+               --enable-randr
+               --enable-render
+               --enable-xi2
+               --enable-xsync
+       )
+
+       econf "${myconf[@]}"
+}
+
+pkg_postinst() {
+       xdg_icon_cache_update
+}
+
+pkg_postrm() {
+       xdg_icon_cache_update
+}

Reply via email to