[gnome-shell/wip/wayland: 2506/2508] wayland: Create a dummy stage window when running as a display server
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/wayland: 2506/2508] wayland: Create a dummy stage window when running as a display server
- Date: Wed, 19 Jun 2013 14:09:35 +0000 (UTC)
commit e3be2237b88871d122b0c668ebdda4db105edf11
Author: Neil Roberts <neil linux intel com>
Date: Wed Jun 19 13:49:31 2013 +0100
wayland: Create a dummy stage window when running as a display server
When Mutter is running as a display server then Clutter won't be using
the X11 backend so there won't be a window for the stage. The shell
global keeps track of this stage window to be used in various places.
This patch adds a dummy window that is never mapped to use instead of
the stage window so that the various places that are using it might be
able to continue working without generating X errors.
src/shell-global.c | 31 ++++++++++++++++++++++++++++---
1 files changed, 28 insertions(+), 3 deletions(-)
---
diff --git a/src/shell-global.c b/src/shell-global.c
index 4a82b95..1e0ea9c 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -930,9 +930,34 @@ _shell_global_set_plugin (ShellGlobal *global,
meta_screen_get_screen_number (global->meta_screen));
global->stage = CLUTTER_STAGE (meta_get_stage_for_screen (global->meta_screen));
- global->stage_xwindow = clutter_x11_get_stage_window (global->stage);
- global->stage_gdk_window = gdk_x11_window_foreign_new_for_display (global->gdk_display,
- global->stage_xwindow);
+ if (meta_is_display_server ())
+ {
+ /* When Mutter is acting as its own display server then the
+ stage does not have a window. Instead we'll just create a
+ dummy window that might make some things blunder along but
+ will probably just leave most things broken. It might be
+ possible to fix this to make the fake window be the same size
+ as the stage window would be and make it more useful. */
+
+ GdkWindowAttr attributes;
+
+ attributes.wclass = GDK_INPUT_OUTPUT;
+ attributes.width = 100;
+ attributes.height = 100;
+ attributes.window_type = GDK_WINDOW_TOPLEVEL;
+
+ global->stage_gdk_window = gdk_window_new (NULL,
+ &attributes,
+ 0 /* attributes_mask */);
+ global->stage_xwindow = gdk_x11_window_get_xid (global->stage_gdk_window);
+ }
+ else
+ {
+ global->stage_xwindow = clutter_x11_get_stage_window (global->stage);
+ global->stage_gdk_window =
+ gdk_x11_window_foreign_new_for_display (global->gdk_display,
+ global->stage_xwindow);
+ }
g_signal_connect (global->stage, "notify::width",
G_CALLBACK (global_stage_notify_width), global);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]