Delay creation of overlay window until we are ready to show the stage.

The overlay window was created before the plugins are loaded. Because the
  composite extension immediately maps the window, we ended blanking the screen
  while plugins, etc., were loading. This commit reorganizes the code so that
  the overlay window is only created just before we are ready to show the
  stage.

  The significant impact of this change is that plugins cannot manipulate the
  overlay window during their initial loading, i.e., they cannot call the
  input-region API (the plugin should hook into the "show" signal if it needs
  to do anything of this sort).

  The commit also removes the XClearArea() call on the overlay window that
  seems to have served no real purpose.
This commit is contained in:
Tomas Frydrych 2009-03-30 16:56:52 +01:00
parent 540fc4b76b
commit 3b864f8af5

View File

@ -1863,15 +1863,12 @@ clutter_cmp_manage_screen (MetaCompositor *compositor,
meta_screen_set_compositor_data (screen, info);
info->output = get_output_window (screen);
info->output = None;
info->windows = NULL;
info->windows_by_xid = g_hash_table_new (g_direct_hash, g_direct_equal);
info->focus_window = meta_display_get_focus_window (display);
XClearArea (xdisplay, info->output, 0, 0, 0, 0, TRUE);
meta_screen_set_cm_selection (screen);
info->stage = clutter_stage_get_default ();
@ -1881,8 +1878,6 @@ clutter_cmp_manage_screen (MetaCompositor *compositor,
xwin = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
XReparentWindow (xdisplay, xwin, info->output, 0, 0);
event_mask = FocusChangeMask |
ExposureMask |
PointerMotionMask |
@ -1910,17 +1905,23 @@ clutter_cmp_manage_screen (MetaCompositor *compositor,
clutter_actor_hide (info->hidden_group);
/*
* Must do this *before* creating the plugin manager, in case any of the
* plugins need to adjust the screen shape regions.
*/
show_overlay_window (xdisplay, xwin, info->output);
info->plugin_mgr =
mutter_plugin_manager_new (screen);
clutter_actor_show (info->stage);
/*
* Delay the creation of the overlay window as long as we can, to avoid
* blanking out the screen. This means that during the plugin loading, the
* overlay window is not accessible, and so the plugins cannot do stuff
* like changing input shape; if that is required, the plugin should hook into
* "show" signal on stage, and do its stuff there.
*/
info->output = get_output_window (screen);
XReparentWindow (xdisplay, xwin, info->output, 0, 0);
show_overlay_window (xdisplay, xwin, info->output);
clutter_actor_show (info->overlay_group);
clutter_actor_show (info->stage);
#endif
}