xwayland: Add xwl_present_unrealize_window
When a window is unrealized, a pending frame callback may never be
called, which could result in repeatedly freezing until the frame timer
fires after a second.
Fixes these symptoms when switching from fullscreen to windowed mode in
sauerbraten.
(cherry picked from commit 8c9538573c
)
This commit is contained in:
parent
98f41563e6
commit
4613595709
|
@ -524,6 +524,22 @@ xwl_present_flips_stop(WindowPtr window)
|
||||||
xwl_present_reset_timer(xwl_present_window);
|
xwl_present_reset_timer(xwl_present_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xwl_present_unrealize_window(WindowPtr window)
|
||||||
|
{
|
||||||
|
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window);
|
||||||
|
|
||||||
|
if (!xwl_present_window || !xwl_present_window->frame_callback)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* The pending frame callback may never be called, so drop it and shorten
|
||||||
|
* the frame timer interval.
|
||||||
|
*/
|
||||||
|
wl_callback_destroy(xwl_present_window->frame_callback);
|
||||||
|
xwl_present_window->frame_callback = NULL;
|
||||||
|
xwl_present_reset_timer(xwl_present_window);
|
||||||
|
}
|
||||||
|
|
||||||
static present_wnmd_info_rec xwl_present_info = {
|
static present_wnmd_info_rec xwl_present_info = {
|
||||||
.version = PRESENT_SCREEN_INFO_VERSION,
|
.version = PRESENT_SCREEN_INFO_VERSION,
|
||||||
.get_crtc = xwl_present_get_crtc,
|
.get_crtc = xwl_present_get_crtc,
|
||||||
|
|
|
@ -609,6 +609,11 @@ xwl_unrealize_window(WindowPtr window)
|
||||||
xwl_screen->UnrealizeWindow = screen->UnrealizeWindow;
|
xwl_screen->UnrealizeWindow = screen->UnrealizeWindow;
|
||||||
screen->UnrealizeWindow = xwl_unrealize_window;
|
screen->UnrealizeWindow = xwl_unrealize_window;
|
||||||
|
|
||||||
|
#ifdef GLAMOR_HAS_GBM
|
||||||
|
if (xwl_screen->present)
|
||||||
|
xwl_present_unrealize_window(window);
|
||||||
|
#endif
|
||||||
|
|
||||||
xwl_window = xwl_window_get(window);
|
xwl_window = xwl_window_get(window);
|
||||||
if (!xwl_window)
|
if (!xwl_window)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -454,6 +454,7 @@ void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen);
|
||||||
#ifdef GLAMOR_HAS_GBM
|
#ifdef GLAMOR_HAS_GBM
|
||||||
Bool xwl_present_init(ScreenPtr screen);
|
Bool xwl_present_init(ScreenPtr screen);
|
||||||
void xwl_present_cleanup(WindowPtr window);
|
void xwl_present_cleanup(WindowPtr window);
|
||||||
|
void xwl_present_unrealize_window(WindowPtr window);
|
||||||
#endif /* GLAMOR_HAS_GBM */
|
#endif /* GLAMOR_HAS_GBM */
|
||||||
|
|
||||||
#ifdef XV
|
#ifdef XV
|
||||||
|
|
Loading…
Reference in New Issue