[mutter/wip/carlosg/x11-services-initialization-fix: 1/2] core: Ensure stack tracker gets synchronized once
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/x11-services-initialization-fix: 1/2] core: Ensure stack tracker gets synchronized once
- Date: Wed, 11 Sep 2019 16:02:14 +0000 (UTC)
commit e68d4b4f09b66673da9dc8303aa0a0920333052e
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Sep 11 17:56:47 2019 +0200
core: Ensure stack tracker gets synchronized once
For "reasons", we may need to emit ::x11-display-opened twice, one
at the right time so MetaStackTracker captures xserver state at a
time we don't have in flight requests for our own windows, another
at a time the upper layers might be aware of it.
Protect the stack tracker against such double initialization if it
ever happened.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/792
src/core/stack-tracker.c | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c
index 5a2956c00..eb89848c9 100644
--- a/src/core/stack-tracker.c
+++ b/src/core/stack-tracker.c
@@ -169,6 +169,8 @@ struct _MetaStackTracker
* stack up with our best guess before a frame is drawn.
*/
guint sync_stack_later;
+
+ gboolean synchronized_with_xserver;
};
static void
@@ -492,6 +494,10 @@ query_xserver_stack (MetaDisplay *display,
guint n_children;
guint i, old_len;
+ if (tracker->synchronized_with_xserver)
+ return;
+
+ tracker->synchronized_with_xserver = TRUE;
tracker->xserver_serial = XNextRequest (x11_display->xdisplay);
XQueryTree (x11_display->xdisplay,
@@ -542,6 +548,8 @@ drop_x11_windows (MetaDisplay *display,
l = next;
}
+
+ tracker->synchronized_with_xserver = FALSE;
}
MetaStackTracker *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]