egl/wayland: Don't invalidate buffers on no-op resize
authorDaniel Stone <daniels@collabora.com>
Tue, 3 Mar 2020 10:52:32 +0000 (10:52 +0000)
committerDaniel Stone <daniels@collabora.com>
Wed, 4 Mar 2020 11:38:11 +0000 (11:38 +0000)
commite5b01183a69d8492a66d0c172ac44b9d9ba5fd59
tree75c85a73056b170249e82c3d50853aaa3235aeaa
parent311c82e1923f63070b198881d90c1098f4ff7a08
egl/wayland: Don't invalidate buffers on no-op resize

The Wayland platform's resize_callback is invoked from libwayland-egl
when wl_egl_window_resize() is called. The resize call is the only place
for the application to insert dx/dy arguments to wl_surface_attach().

When modifying the cursor hotspot (as in wayland/wayland#148), we want
to set dx/dy, but leave the surface size the same. If we get
wl_egl_window_resize() with the same width and height argument as we
already have, we do not need to invalidate our existing drawable.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4030>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4030>
src/egl/drivers/dri2/platform_wayland.c