diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index a4f02a058..92ec4995c 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -569,6 +569,29 @@ xwl_window_set_fullscreen(struct xwl_window *xwl_window) return TRUE; } +void +xwl_window_rootful_update_fullscreen(struct xwl_window *xwl_window, + struct xwl_output *xwl_output) +{ + struct xwl_screen *xwl_screen = xwl_window->xwl_screen; + + if (!xwl_screen->fullscreen) + return; + + if (xwl_window->window != xwl_screen->screen->root) + return; + + if (xwl_window->wl_output_fullscreen != xwl_output->output) + return; + + /* The size and position of the output may have changed, clear our + * output to make sure the next call to xwl_window_set_fullscreen() + * recomputes the size and updates the viewport as needed. + */ + xwl_window->wl_output_fullscreen = NULL; + xwl_window_set_fullscreen(xwl_window); +} + void xwl_window_rootful_update_title(struct xwl_window *xwl_window) { diff --git a/hw/xwayland/xwayland-window.h b/hw/xwayland/xwayland-window.h index 45ae16da0..7fbb2a623 100644 --- a/hw/xwayland/xwayland-window.h +++ b/hw/xwayland/xwayland-window.h @@ -135,7 +135,8 @@ Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window); Bool xwl_window_is_toplevel(WindowPtr window); void xwl_window_check_resolution_change_emulation(struct xwl_window *xwl_window); void xwl_window_rootful_update_title(struct xwl_window *xwl_window); - +void xwl_window_rootful_update_fullscreen(struct xwl_window *xwl_window, + struct xwl_output *xwl_output); void xwl_window_set_window_pixmap(WindowPtr window, PixmapPtr pixmap); Bool xwl_realize_window(WindowPtr window);