[metacity] double check whether the user time window was previously used
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] double check whether the user time window was previously used
- Date: Sun, 26 Feb 2017 22:22:51 +0000 (UTC)
commit 595e970855323730fab3d304be7e8adc3b05c062
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Nov 11 20:29:59 2016 +0100
double check whether the user time window was previously used
Some applications like Wine may choose to juggle the same user time
window across different toplevels, in that case we receive warnings
when trying to register the window a second time, leading to wrong
accounting.
If the window was already used as the user time window for another
toplevel, unset it from the previous MetaWindow owner, and unregister
so the registration with the new MetaWindow is successful.
https://bugzilla.gnome.org/show_bug.cgi?id=774330
src/core/window-props.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window-props.c b/src/core/window-props.c
index 5b64d12..35a8dfd 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -430,6 +430,8 @@ reload_net_wm_user_time_window (MetaWindow *window,
{
if (value->type != META_PROP_VALUE_INVALID)
{
+ MetaWindow *prev_owner;
+
/* Unregister old NET_WM_USER_TIME_WINDOW */
if (window->user_time_window != None)
{
@@ -442,6 +444,15 @@ reload_net_wm_user_time_window (MetaWindow *window,
NoEventMask);
}
+ /* Ensure the new user time window is not used on another MetaWindow,
+ * and unset its user time window if that is the case.
+ */
+ prev_owner = meta_display_lookup_x_window (window->display, value->v.xwindow);
+ if (prev_owner && prev_owner->user_time_window == value->v.xwindow)
+ {
+ meta_display_unregister_x_window (window->display, value->v.xwindow);
+ prev_owner->user_time_window = None;
+ }
/* Obtain the new NET_WM_USER_TIME_WINDOW and register it */
window->user_time_window = value->v.xwindow;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]