xwayland: Recycle window buffers when setting pixmap
Right now, we would recycle the window buffers whenever the window the window is resized. This, however, is not sufficient to guarantee that the buffers are up to date, since changing the window border width for example would not trigger a `WindowResize` (the border being outside the window). Make sure we recycle the buffers on `SetWindowPixmap` to ensure that the buffers will be recycled whenever the pixmap size is changed. Related: https://gitlab.freedesktop.org/xorg/xserver/issues/951 Suggested-by: Michel Dänzer <mdaenzer@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
parent
71c3a97142
commit
1cb886bc2a
|
@ -1025,7 +1025,10 @@ xwl_set_window_pixmap(WindowPtr window,
|
|||
{
|
||||
ScreenPtr screen = window->drawable.pScreen;
|
||||
struct xwl_screen *xwl_screen;
|
||||
struct xwl_window *xwl_window;
|
||||
PixmapPtr old_pixmap;
|
||||
|
||||
old_pixmap = (*screen->GetWindowPixmap) (window);
|
||||
xwl_screen = xwl_screen_get(screen);
|
||||
|
||||
screen->SetWindowPixmap = xwl_screen->SetWindowPixmap;
|
||||
|
@ -1037,6 +1040,14 @@ xwl_set_window_pixmap(WindowPtr window,
|
|||
return;
|
||||
|
||||
ensure_surface_for_window(window);
|
||||
|
||||
if (old_pixmap->drawable.width == pixmap->drawable.width &&
|
||||
old_pixmap->drawable.height == pixmap->drawable.height)
|
||||
return;
|
||||
|
||||
xwl_window = xwl_window_get(window);
|
||||
if (xwl_window)
|
||||
xwl_window_buffers_recycle(xwl_window);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1058,7 +1069,6 @@ xwl_resize_window(WindowPtr window,
|
|||
screen->ResizeWindow = xwl_resize_window;
|
||||
|
||||
if (xwl_window) {
|
||||
xwl_window_buffers_recycle(xwl_window);
|
||||
xwl_window->x = x;
|
||||
xwl_window->y = y;
|
||||
xwl_window->width = width;
|
||||
|
|
Loading…
Reference in New Issue