[mutter/wip/carlosg/xwayland-on-demand: 24/32] core: Add explicit init/shutdown_x11() MetaDisplay calls
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/xwayland-on-demand: 24/32] core: Add explicit init/shutdown_x11() MetaDisplay calls
- Date: Mon, 7 Jan 2019 12:50:26 +0000 (UTC)
commit 2375dc0de83febf9ad70b70a305f36b3cacdc5fc
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Dec 10 13:40:54 2018 +0100
core: Add explicit init/shutdown_x11() MetaDisplay calls
src/core/display-private.h | 4 ++++
src/core/display.c | 43 +++++++++++++++++++++++++++++++++----------
2 files changed, 37 insertions(+), 10 deletions(-)
---
diff --git a/src/core/display-private.h b/src/core/display-private.h
index db6381549..8b158d440 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -422,4 +422,8 @@ void meta_display_queue_check_fullscreen (MetaDisplay *display);
MetaWindow *meta_display_get_pointer_window (MetaDisplay *display,
MetaWindow *not_this_one);
+gboolean meta_display_init_x11 (MetaDisplay *display,
+ GError **error);
+void meta_display_shutdown_x11 (MetaDisplay *display);
+
#endif
diff --git a/src/core/display.c b/src/core/display.c
index 7c14a066c..0412a9841 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -629,6 +629,36 @@ on_ui_scaling_factor_changed (MetaSettings *settings,
meta_display_reload_cursor (display);
}
+gboolean
+meta_display_init_x11 (MetaDisplay *display,
+ GError **error)
+{
+ MetaX11Display *x11_display;
+
+ g_assert (display->x11_display == NULL);
+
+ x11_display = meta_x11_display_new (display, error);
+ if (!x11_display)
+ return FALSE;
+
+ display->x11_display = x11_display;
+ g_signal_emit (display, display_signals[X11_DISPLAY_OPENED], 0);
+ meta_x11_display_create_guard_window (x11_display);
+ meta_display_manage_all_windows (display);
+ return TRUE;
+}
+
+void
+meta_display_shutdown_x11 (MetaDisplay *display)
+{
+ if (!display->x11_display)
+ return;
+
+ g_signal_emit (display, display_signals[X11_DISPLAY_CLOSING], 0);
+ g_object_run_dispose (G_OBJECT (display->x11_display));
+ g_clear_object (&display->x11_display);
+}
+
/**
* meta_display_open:
*
@@ -728,10 +758,8 @@ meta_display_open (void)
if (meta_should_autostart_x11_display ())
{
- x11_display = meta_x11_display_new (display, &error);
- g_assert (x11_display != NULL); /* Required, for now */
- display->x11_display = x11_display;
- g_signal_emit (display, display_signals[X11_DISPLAY_OPENED], 0);
+ if (!meta_display_init_x11 (display, &error))
+ g_error ("Failed to start Xwayland: %s", error->message);
timestamp = display->x11_display->timestamp;
}
@@ -948,12 +976,7 @@ meta_display_close (MetaDisplay *display,
if (display->compositor)
meta_compositor_destroy (display->compositor);
- if (display->x11_display)
- {
- g_signal_emit (display, display_signals[X11_DISPLAY_CLOSING], 0);
- g_object_run_dispose (G_OBJECT (display->x11_display));
- g_clear_object (&display->x11_display);
- }
+ meta_display_shutdown_x11 (display);
meta_display_shutdown_keys (display);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]