diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2021-01-22 16:30:57 +0100 |
---|---|---|
committer | Robert Mader <robert.mader@posteo.de> | 2021-02-03 23:13:37 +0100 |
commit | 2d424a73936d48a129732fa8c888b214f241b5ac (patch) | |
tree | d2125f9127fbfd3b2c591c1d02242b7219280242 | |
parent | 2d47adc109376ebc81a8dd6d920ff970c4f17cb4 (diff) | |
download | mutter-2d424a73936d48a129732fa8c888b214f241b5ac.tar.gz |
window/x11: Check before freezing commits
Now that we have a window actor API that can hint whether or not the
window actor would support freezing commits, use it to avoid freezing
Xwayland commit on actors that will not be thawed after paint.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1615
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1678>
(cherry picked from commit a2e2cfe43714df656e451ef525b97c24fa786fed)
-rw-r--r-- | src/x11/window-x11.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index ea9e82c8f..980a1510a 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -35,6 +35,7 @@ #include "backends/meta-logical-monitor.h" #include "backends/x11/meta-backend-x11.h" +#include "compositor/meta-window-actor-private.h" #include "core/boxes-private.h" #include "core/frame.h" #include "core/meta-workspace-manager-private.h" @@ -1324,6 +1325,18 @@ meta_window_x11_current_workspace_changed (MetaWindow *window) meta_x11_error_trap_pop (x11_display); } +static gboolean +meta_window_x11_can_freeze_commits (MetaWindow *window) +{ + MetaWindowActor *window_actor; + + window_actor = meta_window_actor_from_window (window); + if (window_actor == NULL) + return FALSE; + + return meta_window_actor_can_freeze_commits (window_actor); +} + static void meta_window_x11_move_resize_internal (MetaWindow *window, MetaGravity gravity, @@ -1475,7 +1488,8 @@ meta_window_x11_move_resize_internal (MetaWindow *window, /* 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)) + if (meta_window_x11_can_freeze_commits (window) && + !meta_window_x11_should_thaw_after_paint (window)) { meta_window_x11_set_thaw_after_paint (window, TRUE); meta_window_x11_freeze_commits (window); |