summaryrefslogtreecommitdiff
path: root/x11-libs/libwnck
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-12-19 13:48:26 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-12-19 13:48:26 +0000
commit844ae757702c53a56ee57056873a8204d256d47e (patch)
tree72fb217d6155c4468b6d34e67a37b45502cbaf1d /x11-libs/libwnck
parentfcefa9aa213e0ff26901b351fccd47393113ae5d (diff)
gentoo auto-resync : 19:12:2022 - 13:48:25
Diffstat (limited to 'x11-libs/libwnck')
-rw-r--r--x11-libs/libwnck/Manifest3
-rw-r--r--x11-libs/libwnck/files/libwnck-43.0-segfault_in_invalidate_icons.patch29
-rw-r--r--x11-libs/libwnck/files/libwnck-43.0-xres-extension.patch380
-rw-r--r--x11-libs/libwnck/libwnck-43.0-r1.ebuild60
4 files changed, 472 insertions, 0 deletions
diff --git a/x11-libs/libwnck/Manifest b/x11-libs/libwnck/Manifest
index 0a57abced82e..a6e60ca81e56 100644
--- a/x11-libs/libwnck/Manifest
+++ b/x11-libs/libwnck/Manifest
@@ -1,5 +1,8 @@
+AUX libwnck-43.0-segfault_in_invalidate_icons.patch 874 BLAKE2B 1666698fab101141ddee0fb1ca11593d33e9fd85f739c41d2ad543605312ca99c81e8343fda361d52c8e6277a2c5293ca2e3c4fcfb3dc536a1c8274296fcc14c SHA512 c2a18539099b7bc5fcc86b39be5a145b11de5e203bdd1748e1139e4727806bbc6822af863522caf9f658f78a617c2adf9fd9620e65656726fae1e2a6d3ce2476
+AUX libwnck-43.0-xres-extension.patch 11293 BLAKE2B a5ee7947941cc57f7e8f00b6fbecf08085c0af697d9a1618b70381543ad2c3d27cfd3e933b709bfe98e2f13a4e19c59ef8c339dde4f891b35ec16ef0d587f430 SHA512 367103f00bc3f6e55cd859941cf9abf6fb55a58b21eb3503155dfd586e56e7c262835e04065fdc2355ac2567645438784ade394f9fce5a712896e0f56448aefe
DIST libwnck-2.31.0.tar.xz 630792 BLAKE2B 8201537d3c9a8a0a8668fc16d33a8eaa05c14312401f1c763c922402df04ef03260dd259f5c46508f85390f7aefd551e83143e654b24b412272dddb7c7c4bd62 SHA512 54262a08882021f08f3ba7f2ddfa33fc1f02e391a0f61cf999a50a089e0d277dfe13ab133c1a46e9abf0599bd24c21dacff80b51013cbb1375d2cd71ac9abbe9
DIST libwnck-43.0.tar.xz 455464 BLAKE2B 591b7a9016f5149a2493d36ed8ec8a7e2a59b13043aed23bf87ef67520954d2e5cab0edb6f427c36f33fe80478ad363c9db6f4dacbc7c6d4295e79191e7f5043 SHA512 f6c14b0a650c6d5ab4d4013e6add3972a0f0bcdedfb9785f64199c9a65713d11c9d936e8b04d0f04707c3d165dd345bfa806f654bf82eabb765546b8914d68d2
EBUILD libwnck-2.31.0-r1.ebuild 1196 BLAKE2B f56f8e7d5661881c72b186a0f6b994408e7a255e604d7de96e70eae0df046c69908391666c649af5f5f96146990d4f71dbccf692f50e92adb4e097cb8d533e70 SHA512 712e14bfbdaba36227d35d6e8ce441471c465edb8b44fd07c372ed0056ac6d261d539adcd70bd0dd48b30d9538ff7374d47f0d915a191b90999c939febcf74f5
+EBUILD libwnck-43.0-r1.ebuild 1659 BLAKE2B 360e7df986b9c100fa2e06769c4322018a292f62652b4dc7aa29f42a16ef9afa415aaead37d282a5d26f2ff279f0359db1b322cdba5c33e79fdc54a4dc1b906e SHA512 048a9ddf61a93c9934fe4c4f262e23a518cb1cf31c2b3785ac784042f3d66bc5297423f9d374ab9b2d37774ebe5b57a589d786405847098706f578db0e9f2293
EBUILD libwnck-43.0.ebuild 1432 BLAKE2B c2679d12329ddc74b9487fe76600378f7f9b5dd6ac75a623fb0290f37eb16d77596299fed6728313865e144731c6499dfadab32d87276ebcc2135de4773efa05 SHA512 688a7a27ae27079fa6b526c59e032e225c81c3602a6dedc82457a9625e4cf4ac6ec9f138d682f751fb155c48e36d85e90076ebc96fa26e9becffc04fd3332c7e
MISC metadata.xml 460 BLAKE2B 891b6b8e3c900dd4e0d285bb440976a1539c2272e1dd5d269c6d840a410bc9fb511458dea304a96cfdb38437df99e1557a78e6d8610a2c47c9420d0eed73b562 SHA512 c9cead188269942beacef6ea2dfebd829f9851d7f41b4b4fb1f9659cc2b64a2eb8b71a4b536446fd26485c215d601f5d5db2e41fb6cc40222c6e87c085313ce3
diff --git a/x11-libs/libwnck/files/libwnck-43.0-segfault_in_invalidate_icons.patch b/x11-libs/libwnck/files/libwnck-43.0-segfault_in_invalidate_icons.patch
new file mode 100644
index 000000000000..d107f25d97c6
--- /dev/null
+++ b/x11-libs/libwnck/files/libwnck-43.0-segfault_in_invalidate_icons.patch
@@ -0,0 +1,29 @@
+From 6ceb684442eb26e3bdb8a38bf52264ad55f96a7b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= <alberts.muktupavels@gmail.com>
+Date: Tue, 20 Sep 2022 15:40:22 +0300
+Subject: [PATCH] handle: avoid segfault in invalidate_icons
+
+Screens variable won't be initialized if default icon sizes are
+set/changed before using wnck_screen_get_default.
+
+https://bugs.launchpad.net/ubuntu/+source/libwnck3/+bug/1990263
+---
+ libwnck/wnck-handle.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libwnck/wnck-handle.c b/libwnck/wnck-handle.c
+index e12ff882..8d5da45c 100644
+--- a/libwnck/wnck-handle.c
++++ b/libwnck/wnck-handle.c
+@@ -70,6 +70,9 @@ invalidate_icons (WnckHandle *self)
+ Display *xdisplay;
+ int i;
+
++ if (self->screens == NULL)
++ return;
++
+ xdisplay = _wnck_get_default_display ();
+
+ for (i = 0; i < ScreenCount (xdisplay); ++i)
+--
+
diff --git a/x11-libs/libwnck/files/libwnck-43.0-xres-extension.patch b/x11-libs/libwnck/files/libwnck-43.0-xres-extension.patch
new file mode 100644
index 000000000000..2003c7df59ab
--- /dev/null
+++ b/x11-libs/libwnck/files/libwnck-43.0-xres-extension.patch
@@ -0,0 +1,380 @@
+From 4ee0ab2b0665da5cb0ad16d6d163ad20549b7ba6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= <alberts.muktupavels@gmail.com>
+Date: Fri, 30 Sep 2022 17:32:09 +0300
+Subject: [PATCH 1/4] handle: init XRes extension
+
+XResQueryClientIds needs XRes 1.2 or newer.
+---
+ libwnck/wnck-handle-private.h | 2 ++
+ libwnck/wnck-handle.c | 48 +++++++++++++++++++++++++++++++++++
+ meson.build | 2 +-
+ 3 files changed, 51 insertions(+), 1 deletion(-)
+
+diff --git a/libwnck/wnck-handle-private.h b/libwnck/wnck-handle-private.h
+index c4217cef..06331040 100644
+--- a/libwnck/wnck-handle-private.h
++++ b/libwnck/wnck-handle-private.h
+@@ -26,6 +26,8 @@ G_BEGIN_DECLS
+
+ WnckClientType _wnck_handle_get_client_type (WnckHandle *self);
+
++gboolean _wnck_handle_has_xres (WnckHandle *self);
++
+ gsize _wnck_handle_get_default_icon_size (WnckHandle *self);
+
+ gsize _wnck_handle_get_default_mini_icon_size (WnckHandle *self);
+diff --git a/libwnck/wnck-handle.c b/libwnck/wnck-handle.c
+index e12ff882..710b7548 100644
+--- a/libwnck/wnck-handle.c
++++ b/libwnck/wnck-handle.c
+@@ -29,6 +29,11 @@
+ #include "config.h"
+ #include "wnck-handle-private.h"
+
++#include <X11/Xlib.h>
++#ifdef HAVE_XRES
++#include <X11/extensions/XRes.h>
++#endif
++
+ #include "private.h"
+ #include "screen.h"
+ #include "window.h"
+@@ -43,6 +48,8 @@ struct _WnckHandle
+
+ WnckClientType client_type;
+
++ gboolean have_xres;
++
+ gsize default_icon_size;
+ gsize default_mini_icon_size;
+
+@@ -164,6 +171,40 @@ filter_func (GdkXEvent *gdkxevent,
+ return GDK_FILTER_CONTINUE;
+ }
+
++static void
++init_xres (WnckHandle *self)
++{
++#ifdef HAVE_XRES
++ Display *xdisplay;
++ int event_base;
++ int error_base;
++ int major;
++ int minor;
++
++ xdisplay = _wnck_get_default_display ();
++ event_base = error_base = major = minor = 0;
++
++ if (XResQueryExtension (xdisplay, &event_base, &error_base) &&
++ XResQueryVersion (xdisplay, &major, &minor) == 1)
++ {
++ if (major > 1 || (major == 1 && minor >= 2))
++ self->have_xres = TRUE;
++ }
++#endif
++}
++
++static void
++wnck_handle_constructed (GObject *object)
++{
++ WnckHandle *self;
++
++ self = WNCK_HANDLE (object);
++
++ G_OBJECT_CLASS (wnck_handle_parent_class)->constructed (object);
++
++ init_xres (self);
++}
++
+ static void
+ wnck_handle_finalize (GObject *object)
+ {
+@@ -290,6 +331,7 @@ wnck_handle_class_init (WnckHandleClass *self_class)
+
+ object_class = G_OBJECT_CLASS (self_class);
+
++ object_class->constructed = wnck_handle_constructed;
+ object_class->finalize = wnck_handle_finalize;
+ object_class->get_property = wnck_handle_get_property;
+ object_class->set_property = wnck_handle_set_property;
+@@ -343,6 +385,12 @@ _wnck_handle_get_client_type (WnckHandle *self)
+ return self->client_type;
+ }
+
++gboolean
++_wnck_handle_has_xres (WnckHandle *self)
++{
++ return self->have_xres;
++}
++
+ /**
+ * wnck_handle_get_default_screen:
+ * @self: a #WnckHandle
+diff --git a/meson.build b/meson.build
+index 6b0eea97..907fdf26 100644
+--- a/meson.build
++++ b/meson.build
+@@ -45,7 +45,7 @@ pkg_deps = [
+ {'name': 'gtk+-3.0', 'version': '>= 3.22.0' },
+ {'name': STARTUP_NOTIFICATION_PACKAGE, 'version': '>= 0.4', 'required': get_option('startup_notification')},
+ {'name': X11_PACKAGE },
+- {'name': XRES_PACKAGE, 'required': false},
++ {'name': XRES_PACKAGE, 'version': '>= 1.2', 'required': false},
+ ]
+
+ foreach p: pkg_deps
+--
+GitLab
+
+
+From f6b973b1f15ac1d8b8203972195d9a1765c75ba2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= <alberts.muktupavels@gmail.com>
+Date: Fri, 30 Sep 2022 18:07:55 +0300
+Subject: [PATCH 2/4] xutils: move XRes code to separate function
+
+---
+ libwnck/xutils.c | 28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/libwnck/xutils.c b/libwnck/xutils.c
+index 60ae7b25..d120ff16 100644
+--- a/libwnck/xutils.c
++++ b/libwnck/xutils.c
+@@ -1145,13 +1145,12 @@ _wnck_get_session_id (Screen *screen,
+ _wnck_atom_get ("SM_CLIENT_ID"));
+ }
+
+-int
+-_wnck_get_pid (Screen *screen,
+- Window xwindow)
++#ifdef HAVE_XRES
++static int
++xres_get_pid (Screen *screen,
++ Window xwindow)
+ {
+ int pid = -1;
+-
+-#ifdef HAVE_XRES
+ XResClientIdSpec client_spec;
+ long client_id_count = 0;
+ XResClientIdValue *client_ids = NULL;
+@@ -1172,10 +1171,23 @@ _wnck_get_pid (Screen *screen,
+ }
+
+ XResClientIdsDestroy (client_id_count, client_ids);
+-
+- if (pid != -1)
+- return pid;
+ }
++
++ return pid;
++}
++#endif
++
++int
++_wnck_get_pid (Screen *screen,
++ Window xwindow)
++{
++ int pid = -1;
++
++#ifdef HAVE_XRES
++ pid = xres_get_pid (screen, xwindow);
++
++ if (pid != -1)
++ return pid;
+ #endif
+
+ if (!_wnck_get_cardinal (screen, xwindow,
+--
+GitLab
+
+
+From 6e61e5ef2ad6726cf607ea70c011f49e269472e7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= <alberts.muktupavels@gmail.com>
+Date: Fri, 30 Sep 2022 18:39:00 +0300
+Subject: [PATCH 3/4] xutils: use WnckScreen in _wnck_get_pid
+
+---
+ libwnck/application.c | 2 +-
+ libwnck/window.c | 2 +-
+ libwnck/wnck-resource-usage.c | 26 +++++++++++++-------------
+ libwnck/xutils.c | 16 ++++++++++------
+ libwnck/xutils.h | 4 ++--
+ 5 files changed, 27 insertions(+), 23 deletions(-)
+
+diff --git a/libwnck/application.c b/libwnck/application.c
+index 9ab7f489..31005ba4 100644
+--- a/libwnck/application.c
++++ b/libwnck/application.c
+@@ -524,7 +524,7 @@ _wnck_application_create (Window xwindow,
+ if (application->priv->name)
+ application->priv->name_from_leader = TRUE;
+
+- application->priv->pid = _wnck_get_pid (xscreen,
++ application->priv->pid = _wnck_get_pid (screen,
+ application->priv->xwindow);
+
+ application->priv->startup_id = _wnck_get_utf8_property (xscreen,
+diff --git a/libwnck/window.c b/libwnck/window.c
+index 35bb37c1..229b4cb1 100644
+--- a/libwnck/window.c
++++ b/libwnck/window.c
+@@ -510,7 +510,7 @@ _wnck_window_create (Window xwindow,
+ _wnck_get_session_id (xscreen, window->priv->xwindow);
+
+ window->priv->pid =
+- _wnck_get_pid (xscreen, window->priv->xwindow);
++ _wnck_get_pid (screen, window->priv->xwindow);
+
+ window->priv->x = 0;
+ window->priv->y = 0;
+diff --git a/libwnck/wnck-resource-usage.c b/libwnck/wnck-resource-usage.c
+index a845d82b..1d81c283 100644
+--- a/libwnck/wnck-resource-usage.c
++++ b/libwnck/wnck-resource-usage.c
+@@ -126,10 +126,10 @@ wnck_gulong_equal (gconstpointer a,
+ }
+
+ static gulong
+-wnck_check_window_for_pid (Screen *screen,
+- Window win,
+- XID match_xid,
+- XID mask)
++wnck_check_window_for_pid (WnckScreen *screen,
++ Window win,
++ XID match_xid,
++ XID mask)
+ {
+ if ((win & ~mask) == match_xid)
+ return _wnck_get_pid (screen, win);
+@@ -138,13 +138,13 @@ wnck_check_window_for_pid (Screen *screen,
+ }
+
+ static void
+-wnck_find_pid_for_resource_r (Display *xdisplay,
+- Screen *screen,
+- Window win_top,
+- XID match_xid,
+- XID mask,
+- gulong *xid,
+- gulong *pid)
++wnck_find_pid_for_resource_r (Display *xdisplay,
++ WnckScreen *screen,
++ Window win_top,
++ XID match_xid,
++ XID mask,
++ gulong *xid,
++ gulong *pid)
+ {
+ Status qtres;
+ int err;
+@@ -250,10 +250,10 @@ wnck_pid_read_resource_usage_fill_cache (struct xresclient_state *state)
+
+ for (i = 0; i < ScreenCount (state->xdisplay); i++)
+ {
+- Screen *screen;
++ WnckScreen *screen;
+ Window root;
+
+- screen = ScreenOfDisplay (state->xdisplay, i);
++ screen = wnck_handle_get_screen (_wnck_get_handle (), i);
+ root = RootWindow (state->xdisplay, i);
+
+ if (root == None)
+diff --git a/libwnck/xutils.c b/libwnck/xutils.c
+index d120ff16..08be8aa9 100644
+--- a/libwnck/xutils.c
++++ b/libwnck/xutils.c
+@@ -1147,18 +1147,21 @@ _wnck_get_session_id (Screen *screen,
+
+ #ifdef HAVE_XRES
+ static int
+-xres_get_pid (Screen *screen,
+- Window xwindow)
++xres_get_pid (WnckScreen *screen,
++ Window xwindow)
+ {
+ int pid = -1;
++ Screen *xscreen;
+ XResClientIdSpec client_spec;
+ long client_id_count = 0;
+ XResClientIdValue *client_ids = NULL;
+
++ xscreen = _wnck_screen_get_xscreen (screen);
++
+ client_spec.client = xwindow;
+ client_spec.mask = XRES_CLIENT_ID_PID_MASK;
+
+- if (XResQueryClientIds (DisplayOfScreen (screen), 1, &client_spec,
++ if (XResQueryClientIds (DisplayOfScreen (xscreen), 1, &client_spec,
+ &client_id_count, &client_ids) == Success)
+ {
+ long i;
+@@ -1178,8 +1181,8 @@ xres_get_pid (Screen *screen,
+ #endif
+
+ int
+-_wnck_get_pid (Screen *screen,
+- Window xwindow)
++_wnck_get_pid (WnckScreen *screen,
++ Window xwindow)
+ {
+ int pid = -1;
+
+@@ -1190,7 +1193,8 @@ _wnck_get_pid (Screen *screen,
+ return pid;
+ #endif
+
+- if (!_wnck_get_cardinal (screen, xwindow,
++ if (!_wnck_get_cardinal (_wnck_screen_get_xscreen (screen),
++ xwindow,
+ _wnck_atom_get ("_NET_WM_PID"),
+ &pid))
+ return 0;
+diff --git a/libwnck/xutils.h b/libwnck/xutils.h
+index 4e5c6204..700832a4 100644
+--- a/libwnck/xutils.h
++++ b/libwnck/xutils.h
+@@ -123,8 +123,8 @@ void _wnck_change_viewport (Screen *screen,
+
+ char* _wnck_get_session_id (Screen *screen,
+ Window xwindow);
+-int _wnck_get_pid (Screen *screen,
+- Window xwindow);
++int _wnck_get_pid (WnckScreen *screen,
++ Window xwindow);
+ char* _wnck_get_name (Screen *screen,
+ Window xwindow);
+ char* _wnck_get_icon_name (Screen *screen,
+--
+GitLab
+
+
+From dde756bc7788488f07b674cbe218943a62eb82e6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= <alberts.muktupavels@gmail.com>
+Date: Fri, 30 Sep 2022 18:43:07 +0300
+Subject: [PATCH 4/4] xutils: check if XRes is available before using
+ XResQueryClientIds
+
+https://gitlab.gnome.org/GNOME/libwnck/-/issues/154
+---
+ libwnck/xutils.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libwnck/xutils.c b/libwnck/xutils.c
+index 08be8aa9..91c2d50e 100644
+--- a/libwnck/xutils.c
++++ b/libwnck/xutils.c
+@@ -1156,6 +1156,9 @@ xres_get_pid (WnckScreen *screen,
+ long client_id_count = 0;
+ XResClientIdValue *client_ids = NULL;
+
++ if (!_wnck_handle_has_xres (wnck_screen_get_handle (screen)))
++ return -1;
++
+ xscreen = _wnck_screen_get_xscreen (screen);
+
+ client_spec.client = xwindow;
+--
+GitLab
+
diff --git a/x11-libs/libwnck/libwnck-43.0-r1.ebuild b/x11-libs/libwnck/libwnck-43.0-r1.ebuild
new file mode 100644
index 000000000000..b4aadd91facc
--- /dev/null
+++ b/x11-libs/libwnck/libwnck-43.0-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit gnome.org meson xdg
+
+DESCRIPTION="A window navigation construction kit"
+HOMEPAGE="https://developer.gnome.org/libwnck/stable/"
+
+LICENSE="LGPL-2+"
+SLOT="3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-solaris ~x86-solaris"
+
+IUSE="gtk-doc +introspection startup-notification tools"
+
+RDEPEND="
+ x11-libs/cairo[X]
+ >=dev-libs/glib-2.44:2
+ >=x11-libs/gtk+-3.22:3[X,introspection?]
+ startup-notification? ( >=x11-libs/startup-notification-0.4 )
+ x11-libs/libX11
+ x11-libs/libXres
+ introspection? ( >=dev-libs/gobject-introspection-1.56:= )
+"
+# libXi header used by wnckprop.c, which is compiled even with USE=-tools (just not installed then)
+DEPEND="${RDEPEND}
+ x11-libs/libXi"
+BDEPEND="
+ gtk-doc? ( >=dev-util/gtk-doc-1.9
+ app-text/docbook-xml-dtd:4.1.2 )
+ >=sys-devel/gettext-0.19.8
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ # https://gitlab.gnome.org/GNOME/libwnck/-/issues/154
+ "${FILESDIR}/${P}-xres-extension.patch"
+
+ # https://gitlab.gnome.org/GNOME/libwnck/-/issues/155
+ "${FILESDIR}/${P}-segfault_in_invalidate_icons.patch"
+)
+
+src_prepare() {
+ default
+ xdg_environment_reset
+ # Don't collide with SLOT=1 with USE=tools
+ sed -e "s|executable(prog|executable(prog + '-3'|" -i libwnck/meson.build || die
+}
+
+src_configure() {
+ local emesonargs=(
+ -Ddeprecation_flags=false
+ $(meson_use tools install_tools)
+ $(meson_feature startup-notification startup_notification)
+ $(meson_feature introspection)
+ $(meson_use gtk-doc gtk_doc)
+ )
+ meson_src_configure
+}