mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 16:20:03 +01:00
xwayland/window: Queue damage after commits are allowed
Compositors may use XWAYLAND_ALLOW_COMMITS to communicate when Xwayland
may or may not commit new buffers to a wl_surface. If commits are
denied, then later allowed, we'll only get a buffer attached if there is
actual damage posted, which might be long after.
This fixes an issue where the window manager would reparent a window
while denying commits, then after reparenting, allow commits. The window
in question belonged to a game and took several seconds produce the next
frame, resulting in an empty window appearing as if it had just
disappeared.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
(cherry picked from commit 9a55c402aa)
This commit is contained in:
parent
3bf134075e
commit
f8d6ae3877
1 changed files with 12 additions and 0 deletions
|
|
@ -102,9 +102,21 @@ static void
|
||||||
xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow,
|
xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow,
|
||||||
const char *debug_msg)
|
const char *debug_msg)
|
||||||
{
|
{
|
||||||
|
struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
|
||||||
|
DamagePtr damage;
|
||||||
|
|
||||||
xwl_window->allow_commits = allow;
|
xwl_window->allow_commits = allow;
|
||||||
DebugF("XWAYLAND: win %d allow_commits = %d (%s)\n",
|
DebugF("XWAYLAND: win %d allow_commits = %d (%s)\n",
|
||||||
xwl_window->window->drawable.id, allow, debug_msg);
|
xwl_window->window->drawable.id, allow, debug_msg);
|
||||||
|
|
||||||
|
damage = window_get_damage(xwl_window->window);
|
||||||
|
if (allow &&
|
||||||
|
xorg_list_is_empty(&xwl_window->link_damage) &&
|
||||||
|
damage &&
|
||||||
|
RegionNotEmpty(DamageRegion(damage))) {
|
||||||
|
xorg_list_add(&xwl_window->link_damage,
|
||||||
|
&xwl_screen->damage_window_list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue