window/x11: Freeze commits on resize

Make sure we freeze commits before resizing the window as this will
clear the frame to black.

Set the "thaw on paint" flag so that the post paint for window actor X11
can then thaw the freeze initiated prior to the resize and keep the
freeze/thaw balanced.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/942
This commit is contained in:
Olivier Fourdan 2019-12-02 14:01:30 +01:00
parent 10796e6726
commit 4ae9953607
2 changed files with 20 additions and 0 deletions

View File

@ -40,6 +40,7 @@
#include "meta/meta-x11-errors.h"
#include "meta/window.h"
#include "x11/meta-x11-display-private.h"
#include "x11/window-x11.h"
enum
{
@ -1213,6 +1214,7 @@ static void
meta_window_actor_x11_post_paint (MetaWindowActor *actor)
{
MetaWindowActorX11 *actor_x11 = META_WINDOW_ACTOR_X11 (actor);
MetaWindow *window;
actor_x11->repaint_scheduled = FALSE;
@ -1238,6 +1240,14 @@ meta_window_actor_x11_post_paint (MetaWindowActor *actor)
actor_x11->needs_frame_drawn = FALSE;
}
/* This is for Xwayland, and a no-op on plain Xorg */
window = meta_window_actor_get_meta_window (actor);
if (meta_window_x11_should_thaw_after_paint (window))
{
meta_window_x11_thaw_commits (window);
meta_window_x11_set_thaw_after_paint (window, FALSE);
}
}
static gboolean

View File

@ -1448,6 +1448,16 @@ meta_window_x11_move_resize_internal (MetaWindow *window,
(window->size_hints.flags & USPosition)))
need_configure_notify = TRUE;
/* If resizing, freeze commits - This is for Xwayland, and a no-op on Xorg */
if (need_resize_client || need_resize_frame)
{
if (!meta_window_x11_should_thaw_after_paint (window))
{
meta_window_x11_set_thaw_after_paint (window, TRUE);
meta_window_x11_freeze_commits (window);
}
}
/* The rest of this function syncs our new size/pos with X as
* efficiently as possible
*/