compositor: Use raw Xlib to resize the compositor window
If we get two configure events on the root window in close sequence, then we could get the sequence: ConfigureNotify on the root window w1xh1 Processed by Mutter clutter_actor_set_size(stage, w1, h1) <relayout happens, stage window resized by clutter> ConfigureNotify on the root window, w2xh2 Processed by Mutter clutter_actor_set_size(stage, w2, h2) ConfigureNotify on the stage window, w1, h1) Processed by Clutter clutter_actor_set_size(stage, w1, h1) <relayout happens, stage window resized by clutter> Leaving the stage at the wrong size. To avoid fighting with Clutter, switch to resizing the stage with XResizeWindow(), similar to how a toplevel window is handled by a window manager.
This commit is contained in:
parent
264c555af0
commit
ac7ec585c8
@ -518,11 +518,12 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
||||
info->stage = clutter_stage_new ();
|
||||
|
||||
meta_screen_get_size (screen, &width, &height);
|
||||
clutter_actor_set_size (info->stage, width, height);
|
||||
clutter_actor_realize (info->stage);
|
||||
|
||||
xwin = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
|
||||
|
||||
XResizeWindow (xdisplay, xwin, width, height);
|
||||
|
||||
event_mask = FocusChangeMask |
|
||||
ExposureMask |
|
||||
EnterWindowMask | LeaveWindowMask |
|
||||
@ -1140,12 +1141,18 @@ meta_compositor_sync_screen_size (MetaCompositor *compositor,
|
||||
guint width,
|
||||
guint height)
|
||||
{
|
||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||
MetaDisplay *display = meta_screen_get_display (screen);
|
||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||
Display *xdisplay;
|
||||
Window xwin;
|
||||
|
||||
DEBUG_TRACE ("meta_compositor_sync_screen_size\n");
|
||||
g_return_if_fail (info);
|
||||
|
||||
clutter_actor_set_size (info->stage, width, height);
|
||||
xdisplay = meta_display_get_xdisplay (display);
|
||||
xwin = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
|
||||
|
||||
XResizeWindow (xdisplay, xwin, width, height);
|
||||
|
||||
meta_background_actor_screen_size_changed (screen);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user