diff options
author | Michel Dänzer <mdaenzer@redhat.com> | 2020-02-07 12:06:39 +0100 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2020-02-11 16:06:13 +0100 |
commit | f88d9b1f779835302e02e255fcd45989db7f488d (patch) | |
tree | 9ab01db9c9f28d9253113355de08d1b0243fcee3 /hw/xwayland | |
parent | 7b33c2d3f31fe03f88cc26f08590f2baf1a6ef36 (diff) |
xwayland: Split up xwl_screen_post_damage into two phases
The first phase sets the new surface properties for all damaged
windows, then the second phase commits all surface updates.
This is preparatory for the next change, there should be no observable
change in behaviour (other than the order of Wayland protocol
requests).
Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw/xwayland')
-rw-r--r-- | hw/xwayland/xwayland-screen.c | 14 | ||||
-rw-r--r-- | hw/xwayland/xwayland-window.c | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index b84252306..428f176d5 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -273,6 +273,9 @@ static void xwl_screen_post_damage(struct xwl_screen *xwl_screen) { struct xwl_window *xwl_window, *next_xwl_window; + struct xorg_list commit_window_list; + + xorg_list_init(&commit_window_list); xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, &xwl_screen->damage_window_list, link_damage) { @@ -290,6 +293,17 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen) #endif xwl_window_post_damage(xwl_window); + xorg_list_del(&xwl_window->link_damage); + xorg_list_append(&xwl_window->link_damage, &commit_window_list); + } + + if (xorg_list_is_empty(&commit_window_list)) + return; + + xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, + &commit_window_list, link_damage) { + wl_surface_commit(xwl_window->surface); + xorg_list_del(&xwl_window->link_damage); } } diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index a9128fb3d..dc12b8e21 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -808,10 +808,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) } xwl_window_create_frame_callback(xwl_window); - wl_surface_commit(xwl_window->surface); DamageEmpty(window_get_damage(xwl_window->window)); - - xorg_list_del(&xwl_window->link_damage); } Bool |