2019-09-12 09:26:25 +00:00
|
|
|
From 850ef518795dcc20d3b9a4f661f70ff8d0ddacb2 Mon Sep 17 00:00:00 2001
|
2019-09-11 14:47:10 +00:00
|
|
|
From: Carlos Garnacho <carlosg@gnome.org>
|
2019-09-12 09:26:25 +00:00
|
|
|
Date: Wed, 11 Sep 2019 22:26:49 +0200
|
|
|
|
Subject: [PATCH] core: Split x11-display initialization in 2 signals
|
2019-09-11 14:47:10 +00:00
|
|
|
|
2019-09-12 09:26:25 +00:00
|
|
|
We have a "setup" phase, used internally to initialize early the x11
|
|
|
|
side of things like the stack tracker, and an "opened" phase where
|
|
|
|
other upper parts may hook up to. This latter phase is delayed during
|
|
|
|
initialization so the upper parts have a change to connect to on
|
|
|
|
plugin creation.
|
2019-09-11 14:47:10 +00:00
|
|
|
|
|
|
|
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/771
|
|
|
|
---
|
2019-09-12 09:26:25 +00:00
|
|
|
src/core/display.c | 13 ++++++++++++-
|
|
|
|
src/core/stack-tracker.c | 2 +-
|
|
|
|
2 files changed, 13 insertions(+), 2 deletions(-)
|
2019-09-11 14:47:10 +00:00
|
|
|
|
|
|
|
diff --git a/src/core/display.c b/src/core/display.c
|
2019-09-12 09:26:25 +00:00
|
|
|
index e803f5557..2ddcbbc1f 100644
|
2019-09-11 14:47:10 +00:00
|
|
|
--- a/src/core/display.c
|
|
|
|
+++ b/src/core/display.c
|
2019-09-12 09:26:25 +00:00
|
|
|
@@ -126,6 +126,7 @@ G_DEFINE_TYPE(MetaDisplay, meta_display, G_TYPE_OBJECT);
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
CURSOR_UPDATED,
|
|
|
|
+ X11_DISPLAY_SETUP,
|
|
|
|
X11_DISPLAY_OPENED,
|
|
|
|
X11_DISPLAY_CLOSING,
|
|
|
|
OVERLAY_KEY,
|
|
|
|
@@ -232,6 +233,14 @@ meta_display_class_init (MetaDisplayClass *klass)
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
|
|
|
+ display_signals[X11_DISPLAY_SETUP] =
|
|
|
|
+ g_signal_new ("x11-display-setup",
|
|
|
|
+ G_TYPE_FROM_CLASS (klass),
|
|
|
|
+ G_SIGNAL_RUN_LAST,
|
|
|
|
+ 0,
|
|
|
|
+ NULL, NULL, NULL,
|
|
|
|
+ G_TYPE_NONE, 0);
|
|
|
|
+
|
|
|
|
display_signals[X11_DISPLAY_OPENED] =
|
|
|
|
g_signal_new ("x11-display-opened",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
@@ -657,12 +666,13 @@ meta_display_init_x11 (MetaDisplay *display,
|
2019-09-11 14:47:10 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
display->x11_display = x11_display;
|
|
|
|
- g_signal_emit (display, display_signals[X11_DISPLAY_OPENED], 0);
|
2019-09-12 09:26:25 +00:00
|
|
|
+ g_signal_emit (display, display_signals[X11_DISPLAY_SETUP], 0);
|
2019-09-11 14:47:10 +00:00
|
|
|
|
|
|
|
meta_x11_display_create_guard_window (x11_display);
|
|
|
|
|
|
|
|
if (!display->display_opening)
|
|
|
|
{
|
|
|
|
+ g_signal_emit (display, display_signals[X11_DISPLAY_OPENED], 0);
|
|
|
|
meta_display_manage_all_xwindows (display);
|
|
|
|
meta_compositor_redirect_x11_windows (display->compositor);
|
|
|
|
}
|
2019-09-12 09:26:25 +00:00
|
|
|
@@ -803,6 +813,7 @@ meta_display_open (void)
|
2019-09-11 14:47:10 +00:00
|
|
|
|
|
|
|
if (display->x11_display)
|
|
|
|
{
|
|
|
|
+ g_signal_emit (display, display_signals[X11_DISPLAY_OPENED], 0);
|
|
|
|
meta_x11_display_restore_active_workspace (display->x11_display);
|
|
|
|
meta_x11_display_create_guard_window (display->x11_display);
|
|
|
|
}
|
2019-09-12 09:26:25 +00:00
|
|
|
diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c
|
|
|
|
index 5a2956c00..a37760ec2 100644
|
|
|
|
--- a/src/core/stack-tracker.c
|
|
|
|
+++ b/src/core/stack-tracker.c
|
|
|
|
@@ -556,7 +556,7 @@ meta_stack_tracker_new (MetaDisplay *display)
|
|
|
|
tracker->unverified_predictions = g_queue_new ();
|
|
|
|
|
|
|
|
g_signal_connect (display,
|
|
|
|
- "x11-display-opened",
|
|
|
|
+ "x11-display-setup",
|
|
|
|
G_CALLBACK (query_xserver_stack),
|
|
|
|
tracker);
|
|
|
|
g_signal_connect (display,
|
2019-09-11 14:47:10 +00:00
|
|
|
--
|
|
|
|
2.22.0
|
|
|
|
|