1:46.2-2: Add shell tray icon patches from Ubuntu
Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
parent
58ed707432
commit
a0b10083e8
7 changed files with 485 additions and 3 deletions
19
.SRCINFO
19
.SRCINFO
|
@ -1,7 +1,7 @@
|
|||
pkgbase = gnome-shell-performance
|
||||
pkgdesc = Next generation desktop shell | Attempts to improve performances with non-upstreamed merge-requests and frequent stable branch resync
|
||||
pkgver = 46.2
|
||||
pkgrel = 1
|
||||
pkgrel = 2
|
||||
epoch = 1
|
||||
url = https://wiki.gnome.org/Projects/GnomeShell
|
||||
arch = x86_64
|
||||
|
@ -37,8 +37,25 @@ pkgbase = gnome-shell-performance
|
|||
depends = upower
|
||||
source = git+https://gitlab.gnome.org/GNOME/gnome-shell.git#commit=568152c22247efbb66cd13c15a638bf2d36bfadb
|
||||
source = git+https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
|
||||
source = build-Add-explicit-dependency-on-Xfixes.patch
|
||||
source = shell-tray-icon-Trigger-a-relayout-when-the-underneath-xe.patch
|
||||
source = shell-tray-icon-Use-available-space-when-that-s-defined.patch
|
||||
source = tray-na-xembed-Destroy-socket-window-when-ending-the-embe.patch
|
||||
source = tray-na-xembed-Use-XShape-to-remove-input-on-socket-windo.patch
|
||||
sha256sums = 51bfde603207878ba74aa79e003c23307d46ff310a11d04c3f0386cae4ca4132
|
||||
sha256sums = SKIP
|
||||
sha256sums = 512e3116ae9eea5b9d36092cd05074da86d37c911144f3d66df95da0d2d60353
|
||||
sha256sums = a3eda616996980f6f27c58c6b0d9c0d51094e7ad9c52f809a2a7f8eac9a2fbd9
|
||||
sha256sums = 612dcb05347295893771396c8cfb993ec66871f04b9b6b93e188369cb12bdf2c
|
||||
sha256sums = fcfec78b92f027e73958cc3e4b740d38db719b8185c79b040571a297d42056b1
|
||||
sha256sums = 9c51c48b3b7c6e5851630eb74289ab7897abca9226a89075a8b225fda2bda255
|
||||
b2sums = dbc32a609c1ee2f59ce777f2af4a541b376d5e53bded7d4b6ddfa0a913db503fc429fa0f9b8c8068b9e00382383e669ea6cbf553caa2348666cdc33bee8ad4ad
|
||||
b2sums = SKIP
|
||||
b2sums = bcd22b41f9ed65db461bab3460954b15345c3f72fb4da99cae702627d69bef25c8689464cb3ac37ef23b38ea90b18cf2486a947aa9f8dae4f69915367ee3db16
|
||||
b2sums = f8e7d2e5e7717b8610d53393dab97e0af181d8eed3d95988357347f57864e88f5339ce67f22ccef86d30d19c8a03b02e5938bc23c23db37f41e67482a133c3b4
|
||||
b2sums = d13b586f9be8e4088f8cefa3c63e4e1143f8b7206a8c05fc4646dbdf2e931260da531ad2d2393c47e85e7a6f64dd76b36ea9884ce16246246bf116c657f90163
|
||||
b2sums = f054d5dd341c45ed2accf06f3755096fb1e96aca04106fcda725115eee8e7c8dfc5b27e4ecd93df020524988a9559a25a052b2fa16d7ec48c178a4329ab7932a
|
||||
b2sums = be45ea9d9c793ed9ba7f7cdbdaefc13868619db0502d73ba1ed3a3f2dd8b40d72c42facbce9598245fc802ad042e785a4515b6ea04015104eec88a0035cf8129
|
||||
|
||||
pkgname = gnome-shell-performance
|
||||
groups = gnome
|
||||
|
|
30
PKGBUILD
30
PKGBUILD
|
@ -30,7 +30,7 @@ else
|
|||
pkgname=(gnome-shell-performance gnome-shell-performance-docs)
|
||||
fi
|
||||
pkgver=46.2
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
epoch=1
|
||||
pkgdesc="Next generation desktop shell | Attempts to improve performances with non-upstreamed merge-requests and frequent stable branch resync"
|
||||
url="https://wiki.gnome.org/Projects/GnomeShell"
|
||||
|
@ -79,9 +79,26 @@ _commit=568152c22247efbb66cd13c15a638bf2d36bfadb # tags/46.2^0
|
|||
source=(
|
||||
"git+https://gitlab.gnome.org/GNOME/gnome-shell.git#commit=$_commit"
|
||||
"git+https://gitlab.gnome.org/GNOME/libgnome-volume-control.git"
|
||||
"build-Add-explicit-dependency-on-Xfixes.patch"
|
||||
"shell-tray-icon-Trigger-a-relayout-when-the-underneath-xe.patch"
|
||||
"shell-tray-icon-Use-available-space-when-that-s-defined.patch"
|
||||
"tray-na-xembed-Destroy-socket-window-when-ending-the-embe.patch"
|
||||
"tray-na-xembed-Use-XShape-to-remove-input-on-socket-windo.patch"
|
||||
)
|
||||
sha256sums=('51bfde603207878ba74aa79e003c23307d46ff310a11d04c3f0386cae4ca4132'
|
||||
'SKIP'
|
||||
'512e3116ae9eea5b9d36092cd05074da86d37c911144f3d66df95da0d2d60353'
|
||||
'a3eda616996980f6f27c58c6b0d9c0d51094e7ad9c52f809a2a7f8eac9a2fbd9'
|
||||
'612dcb05347295893771396c8cfb993ec66871f04b9b6b93e188369cb12bdf2c'
|
||||
'fcfec78b92f027e73958cc3e4b740d38db719b8185c79b040571a297d42056b1'
|
||||
'9c51c48b3b7c6e5851630eb74289ab7897abca9226a89075a8b225fda2bda255')
|
||||
b2sums=('dbc32a609c1ee2f59ce777f2af4a541b376d5e53bded7d4b6ddfa0a913db503fc429fa0f9b8c8068b9e00382383e669ea6cbf553caa2348666cdc33bee8ad4ad'
|
||||
'SKIP')
|
||||
'SKIP'
|
||||
'bcd22b41f9ed65db461bab3460954b15345c3f72fb4da99cae702627d69bef25c8689464cb3ac37ef23b38ea90b18cf2486a947aa9f8dae4f69915367ee3db16'
|
||||
'f8e7d2e5e7717b8610d53393dab97e0af181d8eed3d95988357347f57864e88f5339ce67f22ccef86d30d19c8a03b02e5938bc23c23db37f41e67482a133c3b4'
|
||||
'd13b586f9be8e4088f8cefa3c63e4e1143f8b7206a8c05fc4646dbdf2e931260da531ad2d2393c47e85e7a6f64dd76b36ea9884ce16246246bf116c657f90163'
|
||||
'f054d5dd341c45ed2accf06f3755096fb1e96aca04106fcda725115eee8e7c8dfc5b27e4ecd93df020524988a9559a25a052b2fa16d7ec48c178a4329ab7932a'
|
||||
'be45ea9d9c793ed9ba7f7cdbdaefc13868619db0502d73ba1ed3a3f2dd8b40d72c42facbce9598245fc802ad042e785a4515b6ea04015104eec88a0035cf8129')
|
||||
|
||||
pkgver() {
|
||||
cd $_pkgname
|
||||
|
@ -124,6 +141,15 @@ prepare() {
|
|||
git reset --hard
|
||||
git cherry-pick --abort || true
|
||||
|
||||
# https://github.com/ubuntu/gnome-shell-extension-appindicator/issues/439
|
||||
# https://bugs.launchpad.net/ubuntu/+source/gnome-shell-extension-appindicator/+bug/2012388
|
||||
msg2 "Patching with the shell tray icon patches..."
|
||||
patch -Np1 -i ../build-Add-explicit-dependency-on-Xfixes.patch
|
||||
patch -Np1 -i ../shell-tray-icon-Trigger-a-relayout-when-the-underneath-xe.patch
|
||||
patch -Np1 -i ../shell-tray-icon-Use-available-space-when-that-s-defined.patch
|
||||
patch -Np1 -i ../tray-na-xembed-Destroy-socket-window-when-ending-the-embe.patch
|
||||
patch -Np1 -i ../tray-na-xembed-Use-XShape-to-remove-input-on-socket-windo.patch
|
||||
|
||||
# git remote add verde https://gitlab.gnome.org/verdre/gnome-shell.git || true
|
||||
# git fetch verde
|
||||
# git remote add 3v1n0 https://gitlab.gnome.org/3v1n0/gnome-shell || true
|
||||
|
|
40
build-Add-explicit-dependency-on-Xfixes.patch
Normal file
40
build-Add-explicit-dependency-on-Xfixes.patch
Normal file
|
@ -0,0 +1,40 @@
|
|||
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
|
||||
Date: Wed, 1 May 2024 22:33:43 +0200
|
||||
Subject: build: Add explicit dependency on Xfixes
|
||||
|
||||
We use the xfixes extensions in tray icons but we rely on the dependency
|
||||
brought to us from other libraries as mutter but let's make it explicit
|
||||
|
||||
(cherry picked from commit f0c5033b3ccd02a081dd18ac21d0b673474fe14f)
|
||||
|
||||
Origin: https://gitlab.gnome.org/3v1n0/gnome-shell/-/commits/tray-offscreen-xwindows
|
||||
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2012388
|
||||
---
|
||||
meson.build | 1 +
|
||||
src/tray/meson.build | 2 +-
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 30864ce..ac166d5 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -91,6 +91,7 @@ polkit_dep = dependency('polkit-agent-1', version: polkit_req)
|
||||
startup_dep = dependency('libstartup-notification-1.0', version: startup_req)
|
||||
ibus_dep = dependency('ibus-1.0', version: ibus_req)
|
||||
x11_dep = dependency('x11')
|
||||
+xfixes_dep = dependency('xfixes')
|
||||
schemas_dep = dependency('gsettings-desktop-schemas', version: schemas_req)
|
||||
gnome_desktop_dep = dependency('gnome-desktop-4', version: gnome_desktop_req)
|
||||
|
||||
diff --git a/src/tray/meson.build b/src/tray/meson.build
|
||||
index 1a86bcb..2fc73f3 100644
|
||||
--- a/src/tray/meson.build
|
||||
+++ b/src/tray/meson.build
|
||||
@@ -9,6 +9,6 @@ tray_sources = [
|
||||
|
||||
libtray = static_library('tray', tray_sources,
|
||||
c_args: ['-DG_LOG_DOMAIN="notification_area"'],
|
||||
- dependencies: [mutter_dep, mtk_dep],
|
||||
+ dependencies: [mutter_dep, mtk_dep, xfixes_dep],
|
||||
include_directories: conf_inc
|
||||
)
|
|
@ -0,0 +1,85 @@
|
|||
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
|
||||
Date: Wed, 1 May 2024 04:20:42 +0200
|
||||
Subject: shell-tray-icon: Trigger a relayout when the underneath xembeded
|
||||
size changes
|
||||
|
||||
(cherry picked from commit 8ebb71d9fdb8990e4e9731cc7662dbf704ce42a8)
|
||||
|
||||
Origin: https://gitlab.gnome.org/3v1n0/gnome-shell/-/commits/tray-offscreen-xwindows
|
||||
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2012388
|
||||
---
|
||||
src/shell-tray-icon.c | 4 ++++
|
||||
src/tray/na-xembed.c | 18 ++++++++++++++++++
|
||||
src/tray/na-xembed.h | 1 +
|
||||
3 files changed, 23 insertions(+)
|
||||
|
||||
diff --git a/src/shell-tray-icon.c b/src/shell-tray-icon.c
|
||||
index e1ff1cd..ddf40dd 100644
|
||||
--- a/src/shell-tray-icon.c
|
||||
+++ b/src/shell-tray-icon.c
|
||||
@@ -265,6 +265,10 @@ shell_tray_icon_set_child (ShellTrayIcon *tray_icon,
|
||||
"window-created",
|
||||
G_CALLBACK (shell_tray_icon_window_created_cb),
|
||||
tray_icon);
|
||||
+
|
||||
+ g_signal_connect_object (tray_child, "reconfigured",
|
||||
+ G_CALLBACK (clutter_actor_queue_relayout),
|
||||
+ tray_icon, G_CONNECT_SWAPPED);
|
||||
}
|
||||
|
||||
/*
|
||||
diff --git a/src/tray/na-xembed.c b/src/tray/na-xembed.c
|
||||
index 447c1cb..873d193 100644
|
||||
--- a/src/tray/na-xembed.c
|
||||
+++ b/src/tray/na-xembed.c
|
||||
@@ -91,6 +91,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (NaXembed, na_xembed, G_TYPE_OBJECT)
|
||||
enum {
|
||||
PLUG_ADDED,
|
||||
PLUG_REMOVED,
|
||||
+ RECONFIGURED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
@@ -548,6 +549,15 @@ xembed_filter_func (MetaX11Display *x11_display,
|
||||
}
|
||||
break;
|
||||
}
|
||||
+ case ConfigureNotify:
|
||||
+ {
|
||||
+ XConfigureEvent *xce = &xevent->xconfigure;
|
||||
+
|
||||
+ if (xce->window == priv->socket_window)
|
||||
+ g_signal_emit (xembed, signals[RECONFIGURED], 0);
|
||||
+
|
||||
+ break;
|
||||
+ }
|
||||
case DestroyNotify:
|
||||
{
|
||||
XDestroyWindowEvent *xdwe = &xevent->xdestroywindow;
|
||||
@@ -742,6 +752,14 @@ na_xembed_class_init (NaXembedClass *klass)
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
+ signals[RECONFIGURED] =
|
||||
+ g_signal_new ("reconfigured",
|
||||
+ G_OBJECT_CLASS_TYPE (klass),
|
||||
+ G_SIGNAL_RUN_LAST,
|
||||
+ G_STRUCT_OFFSET (NaXembedClass, reconfigured),
|
||||
+ NULL, NULL, NULL,
|
||||
+ G_TYPE_NONE, 0);
|
||||
+
|
||||
props[PROP_X11_DISPLAY] =
|
||||
g_param_spec_object ("x11-display",
|
||||
"x11-display",
|
||||
diff --git a/src/tray/na-xembed.h b/src/tray/na-xembed.h
|
||||
index 751da97..a5a4fae 100644
|
||||
--- a/src/tray/na-xembed.h
|
||||
+++ b/src/tray/na-xembed.h
|
||||
@@ -36,6 +36,7 @@ struct _NaXembedClass
|
||||
|
||||
void (* plug_added) (NaXembed *xembed);
|
||||
void (* plug_removed) (NaXembed *xembed);
|
||||
+ void (* reconfigured) (NaXembed *xembed);
|
||||
};
|
||||
|
||||
MetaX11Display * na_xembed_get_x11_display (NaXembed *xembed);
|
113
shell-tray-icon-Use-available-space-when-that-s-defined.patch
Normal file
113
shell-tray-icon-Use-available-space-when-that-s-defined.patch
Normal file
|
@ -0,0 +1,113 @@
|
|||
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
|
||||
Date: Wed, 1 May 2024 04:18:50 +0200
|
||||
Subject: shell-tray-icon: Use available space when that's defined
|
||||
|
||||
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7613
|
||||
(cherry picked from commit b10bfe1f9ce2b7794103f54bcf249f935678b5f7)
|
||||
|
||||
Origin: https://gitlab.gnome.org/3v1n0/gnome-shell/-/commits/tray-offscreen-xwindows
|
||||
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2012388
|
||||
---
|
||||
src/shell-tray-icon.c | 4 ++++
|
||||
src/tray/na-xembed.c | 29 +++++++++++++++++++++++++++++
|
||||
src/tray/na-xembed.h | 4 ++++
|
||||
3 files changed, 37 insertions(+)
|
||||
|
||||
diff --git a/src/shell-tray-icon.c b/src/shell-tray-icon.c
|
||||
index 3eee5f5..e1ff1cd 100644
|
||||
--- a/src/shell-tray-icon.c
|
||||
+++ b/src/shell-tray-icon.c
|
||||
@@ -185,6 +185,10 @@ shell_tray_icon_allocate (ClutterActor *actor,
|
||||
|
||||
CLUTTER_ACTOR_CLASS (shell_tray_icon_parent_class)->allocate (actor, box);
|
||||
|
||||
+ na_xembed_set_available_size (NA_XEMBED (tray_icon->tray_child),
|
||||
+ roundf (clutter_actor_box_get_width (box)),
|
||||
+ roundf (clutter_actor_box_get_height (box)));
|
||||
+
|
||||
/* Find the actor's new coordinates in terms of the stage.
|
||||
*/
|
||||
clutter_actor_get_transformed_position (actor, &wx, &wy);
|
||||
diff --git a/src/tray/na-xembed.c b/src/tray/na-xembed.c
|
||||
index 69690f1..447c1cb 100644
|
||||
--- a/src/tray/na-xembed.c
|
||||
+++ b/src/tray/na-xembed.c
|
||||
@@ -43,6 +43,8 @@ struct _NaXembedPrivate
|
||||
int request_height;
|
||||
int current_width;
|
||||
int current_height;
|
||||
+ int available_width;
|
||||
+ int available_height;
|
||||
int resize_count;
|
||||
int xembed_version;
|
||||
|
||||
@@ -141,6 +143,8 @@ na_xembed_end_embedding (NaXembed *xembed)
|
||||
priv->current_width = 0;
|
||||
priv->current_height = 0;
|
||||
priv->resize_count = 0;
|
||||
+ priv->available_width = -1;
|
||||
+ priv->available_height = -1;
|
||||
g_clear_handle_id (&priv->resize_id, g_source_remove);
|
||||
}
|
||||
|
||||
@@ -186,6 +190,11 @@ na_xembed_synchronize_size (NaXembed *xembed)
|
||||
width = priv->request_width;
|
||||
height = priv->request_height;
|
||||
|
||||
+ if (priv->available_width >= 0)
|
||||
+ width = priv->available_width;
|
||||
+ if (priv->available_height >= 0)
|
||||
+ height = priv->available_height;
|
||||
+
|
||||
XMoveResizeWindow (xdisplay,
|
||||
priv->socket_window,
|
||||
x, y,
|
||||
@@ -747,6 +756,10 @@ na_xembed_class_init (NaXembedClass *klass)
|
||||
static void
|
||||
na_xembed_init (NaXembed *xembed)
|
||||
{
|
||||
+ NaXembedPrivate *priv = na_xembed_get_instance_private (xembed);
|
||||
+
|
||||
+ priv->available_width = -1;
|
||||
+ priv->available_height = -1;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -811,6 +824,22 @@ na_xembed_get_size (NaXembed *xembed,
|
||||
*height = priv->request_height;
|
||||
}
|
||||
|
||||
+void
|
||||
+na_xembed_set_available_size (NaXembed *xembed,
|
||||
+ int width,
|
||||
+ int height)
|
||||
+{
|
||||
+ NaXembedPrivate *priv = na_xembed_get_instance_private (xembed);
|
||||
+
|
||||
+ if (priv->available_width == width && priv->available_height == height)
|
||||
+ return;
|
||||
+
|
||||
+ priv->available_width = width;
|
||||
+ priv->available_height = height;
|
||||
+
|
||||
+ na_xembed_resize (xembed);
|
||||
+}
|
||||
+
|
||||
void
|
||||
na_xembed_get_root_position (NaXembed *xembed,
|
||||
int *x,
|
||||
diff --git a/src/tray/na-xembed.h b/src/tray/na-xembed.h
|
||||
index ea8f9f4..751da97 100644
|
||||
--- a/src/tray/na-xembed.h
|
||||
+++ b/src/tray/na-xembed.h
|
||||
@@ -59,6 +59,10 @@ void na_xembed_get_size (NaXembed *xembed,
|
||||
int *width,
|
||||
int *height);
|
||||
|
||||
+void na_xembed_set_available_size (NaXembed *xembed,
|
||||
+ int width,
|
||||
+ int height);
|
||||
+
|
||||
void na_xembed_set_background_color (NaXembed *xembed,
|
||||
const ClutterColor *color);
|
||||
|
109
tray-na-xembed-Destroy-socket-window-when-ending-the-embe.patch
Normal file
109
tray-na-xembed-Destroy-socket-window-when-ending-the-embe.patch
Normal file
|
@ -0,0 +1,109 @@
|
|||
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
|
||||
Date: Wed, 1 May 2024 05:56:48 +0200
|
||||
Subject: tray/na-xembed: Destroy socket window when ending the embedding
|
||||
|
||||
Currently when embedding a tray icon is ended we are leaving the X11
|
||||
socket window around as we don't really destroy it, while we're just
|
||||
listening for its child destruction.
|
||||
|
||||
So, when embedding is ending we need to make sure that:
|
||||
- If the plug window is still alive, move it back to its old parent
|
||||
(normally that's the root window, but we query for it, to be sure)
|
||||
- If the plug window has been already destroyed or reparented (by us or
|
||||
by something else), we've to just destroy the socket window
|
||||
|
||||
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7614
|
||||
(cherry picked from commit 50a6e1e3ceb18e52f87534507ccd49884d7f53eb)
|
||||
|
||||
Origin: https://gitlab.gnome.org/3v1n0/gnome-shell/-/commits/tray-offscreen-xwindows
|
||||
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2012388
|
||||
---
|
||||
src/tray/na-xembed.c | 35 ++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 34 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/tray/na-xembed.c b/src/tray/na-xembed.c
|
||||
index 873d193..1d179af 100644
|
||||
--- a/src/tray/na-xembed.c
|
||||
+++ b/src/tray/na-xembed.c
|
||||
@@ -36,6 +36,7 @@ struct _NaXembedPrivate
|
||||
MetaX11Display *x11_display;
|
||||
Window socket_window;
|
||||
Window plug_window;
|
||||
+ Window old_parent;
|
||||
|
||||
int root_x;
|
||||
int root_y;
|
||||
@@ -140,7 +141,22 @@ na_xembed_end_embedding (NaXembed *xembed)
|
||||
{
|
||||
NaXembedPrivate *priv = na_xembed_get_instance_private (xembed);
|
||||
|
||||
+ if (priv->socket_window)
|
||||
+ {
|
||||
+ Display *xdisplay = meta_x11_display_get_xdisplay (priv->x11_display);
|
||||
+
|
||||
+ if (priv->plug_window && priv->old_parent)
|
||||
+ XReparentWindow (xdisplay,
|
||||
+ priv->plug_window,
|
||||
+ priv->old_parent,
|
||||
+ 0, 0);
|
||||
+
|
||||
+ XDestroyWindow (xdisplay, priv->socket_window);
|
||||
+ priv->socket_window = None;
|
||||
+ }
|
||||
+
|
||||
priv->plug_window = None;
|
||||
+ priv->old_parent = None;
|
||||
priv->current_width = 0;
|
||||
priv->current_height = 0;
|
||||
priv->resize_count = 0;
|
||||
@@ -415,6 +431,18 @@ na_xembed_add_window (NaXembed *xembed,
|
||||
&socket_attrs);
|
||||
|
||||
XUnmapWindow (xdisplay, priv->plug_window); /* Shouldn't actually be necessary for XEMBED, but just in case */
|
||||
+
|
||||
+ if (!priv->old_parent)
|
||||
+ {
|
||||
+ g_autofree Window *children = NULL;
|
||||
+ unsigned int n_children;
|
||||
+ Window root;
|
||||
+
|
||||
+ if (!XQueryTree (xdisplay, priv->plug_window, &root, &priv->old_parent,
|
||||
+ &children, &n_children))
|
||||
+ priv->old_parent = meta_x11_display_get_xroot (priv->x11_display);
|
||||
+ }
|
||||
+
|
||||
XReparentWindow (xdisplay,
|
||||
priv->plug_window,
|
||||
priv->socket_window,
|
||||
@@ -565,10 +593,14 @@ xembed_filter_func (MetaX11Display *x11_display,
|
||||
/* Note that we get destroy notifies both from SubstructureNotify on
|
||||
* our window and StructureNotify on socket->plug_window
|
||||
*/
|
||||
+ if (priv->socket_window && xdwe->window == priv->socket_window)
|
||||
+ priv->socket_window = None;
|
||||
+
|
||||
if (priv->plug_window && (xdwe->window == priv->plug_window))
|
||||
{
|
||||
g_object_ref (xembed);
|
||||
g_signal_emit (xembed, signals[PLUG_REMOVED], 0);
|
||||
+ priv->plug_window = None;
|
||||
na_xembed_end_embedding (xembed);
|
||||
g_object_unref (xembed);
|
||||
}
|
||||
@@ -633,6 +665,7 @@ xembed_filter_func (MetaX11Display *x11_display,
|
||||
{
|
||||
g_object_ref (xembed);
|
||||
g_signal_emit (xembed, signals[PLUG_REMOVED], 0);
|
||||
+ priv->old_parent = None;
|
||||
na_xembed_end_embedding (xembed);
|
||||
g_object_unref (xembed);
|
||||
}
|
||||
@@ -698,7 +731,7 @@ na_xembed_finalize (GObject *object)
|
||||
if (priv->x11_display && priv->event_func_id)
|
||||
meta_x11_display_remove_event_func (priv->x11_display, priv->event_func_id);
|
||||
|
||||
- if (priv->plug_window)
|
||||
+ if (priv->plug_window || priv->socket_window)
|
||||
na_xembed_end_embedding (xembed);
|
||||
|
||||
G_OBJECT_CLASS (na_xembed_parent_class)->finalize (object);
|
|
@ -0,0 +1,92 @@
|
|||
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
|
||||
Date: Wed, 1 May 2024 22:34:58 +0200
|
||||
Subject: tray/na-xembed: Use XShape to remove input on socket window
|
||||
|
||||
We don't want this window to take any input as, a part from blocking the
|
||||
events on the shell representation itself, they may potentially make the
|
||||
plugged window to do anything with the event is processing (such as
|
||||
showing tooltips). And we don't want this since we only want to send to
|
||||
those windows only the synthetic events that we explicitly control.
|
||||
|
||||
This was already the case before of commit ab60902058 but a similar
|
||||
approach was not replicated, leading to input events being fully
|
||||
processed from tray icons plugs.
|
||||
|
||||
It requires adding an explicit build dependency on Xext, but this is
|
||||
something that mutter already depends on so not really a new dependency
|
||||
|
||||
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7613
|
||||
(cherry picked from commit 075f9d72459d08a711feca3dc3c51a14c5f73bdc)
|
||||
|
||||
Origin: https://gitlab.gnome.org/3v1n0/gnome-shell/-/commits/tray-offscreen-xwindows
|
||||
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2012388
|
||||
---
|
||||
meson.build | 1 +
|
||||
src/tray/meson.build | 2 +-
|
||||
src/tray/na-xembed.c | 15 +++++++++++++++
|
||||
3 files changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index ac166d5..f85e358 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -91,6 +91,7 @@ polkit_dep = dependency('polkit-agent-1', version: polkit_req)
|
||||
startup_dep = dependency('libstartup-notification-1.0', version: startup_req)
|
||||
ibus_dep = dependency('ibus-1.0', version: ibus_req)
|
||||
x11_dep = dependency('x11')
|
||||
+xext_dep = dependency('xext')
|
||||
xfixes_dep = dependency('xfixes')
|
||||
schemas_dep = dependency('gsettings-desktop-schemas', version: schemas_req)
|
||||
gnome_desktop_dep = dependency('gnome-desktop-4', version: gnome_desktop_req)
|
||||
diff --git a/src/tray/meson.build b/src/tray/meson.build
|
||||
index 2fc73f3..c91e940 100644
|
||||
--- a/src/tray/meson.build
|
||||
+++ b/src/tray/meson.build
|
||||
@@ -9,6 +9,6 @@ tray_sources = [
|
||||
|
||||
libtray = static_library('tray', tray_sources,
|
||||
c_args: ['-DG_LOG_DOMAIN="notification_area"'],
|
||||
- dependencies: [mutter_dep, mtk_dep, xfixes_dep],
|
||||
+ dependencies: [mutter_dep, mtk_dep, xfixes_dep, xext_dep],
|
||||
include_directories: conf_inc
|
||||
)
|
||||
diff --git a/src/tray/na-xembed.c b/src/tray/na-xembed.c
|
||||
index 59b1071..69690f1 100644
|
||||
--- a/src/tray/na-xembed.c
|
||||
+++ b/src/tray/na-xembed.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "na-xembed.h"
|
||||
|
||||
#include <mtk/mtk-x11.h>
|
||||
+#include <X11/extensions/shape.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
@@ -362,6 +363,7 @@ na_xembed_add_window (NaXembed *xembed,
|
||||
{
|
||||
XSetWindowAttributes socket_attrs;
|
||||
XWindowAttributes plug_attrs;
|
||||
+ int shape_major, shape_minor;
|
||||
int result;
|
||||
|
||||
result = XGetWindowAttributes (xdisplay, priv->plug_window, &plug_attrs);
|
||||
@@ -407,6 +409,19 @@ na_xembed_add_window (NaXembed *xembed,
|
||||
priv->plug_window,
|
||||
priv->socket_window,
|
||||
0, 0);
|
||||
+
|
||||
+ /* Set an empty input shape on the window so that the socket does not
|
||||
+ * get any input. Without this we the tray may still get events and for
|
||||
+ * example show tooltips on hover which we don't want.
|
||||
+ * This is the quickest way to achieve this, without having to deal these
|
||||
+ * windows with specific code in mutter.
|
||||
+ */
|
||||
+ if (XShapeQueryExtension (xdisplay, &shape_major, &shape_minor))
|
||||
+ {
|
||||
+ XShapeSelectInput (xdisplay, priv->socket_window, NoEventMask);
|
||||
+ XShapeCombineRectangles (xdisplay, priv->socket_window, ShapeInput,
|
||||
+ 0, 0, NULL, 0, ShapeSet, 0);
|
||||
+ }
|
||||
}
|
||||
|
||||
priv->have_size = FALSE;
|
Loading…
Reference in a new issue