egl/wayland: Don't invalidate drawable on swap buffers
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Fri, 30 Nov 2012 15:41:02 +0000 (17:41 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 10 Jan 2013 21:33:50 +0000 (16:33 -0500)
commiteaf6884621661288624fc060974c3aa485771324
tree6b226ef2180c5afad061e1d1b987ec620bf0b47a
parent0ac90296a092f846647812318913b0e492775f31
egl/wayland: Don't invalidate drawable on swap buffers

We used to invalidate the drawable after a call to eglSwapBuffers(),
so that a wl_egl_window_resize() would take effect for the next frame.
However, that leads to calling dri2_get_buffers() when eglMakeCurrent()
is called with the current context and surface, and a later call to
wl_egl_window_resize() would not take effect until the next buffer
swap.

Instead, add a callback from wl_egl_window_resize() back to the wayland
egl platform, and invalidate the drawable only when it is resized.

This solves a bug on wayland clients when going back to windowed mode
from fullscreen when clicking a pop up menu, where the window size
after this would be the fullscreen size.

Note: this is a candidate for stable branches.
CC: wayland-devel@lists.freedesktop.org
src/egl/drivers/dri2/platform_wayland.c
src/egl/wayland/wayland-egl/wayland-egl-priv.h
src/egl/wayland/wayland-egl/wayland-egl.c