From 59f44c184d56faf1fe98089414f72e5d979c5f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Sat, 31 Aug 2013 00:08:27 -0700 Subject: [PATCH] xwm: Detect legacy fullscreen modes --- src/xwayland/window-manager.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c index 93a912b0..8b2d7801 100644 --- a/src/xwayland/window-manager.c +++ b/src/xwayland/window-manager.c @@ -1898,12 +1898,36 @@ static const struct weston_shell_client shell_client = { send_configure }; +static int +legacy_fullscreen(struct weston_wm *wm, + struct weston_wm_window *window, + struct weston_output **output_ret) +{ + struct weston_compositor *compositor = wm->server->compositor; + struct weston_output *output; + + /* Heuristics for detecting legacy fullscreen windows... */ + + wl_list_for_each(output, &compositor->output_list, link) { + if (output->x == window->x && + output->y == window->y && + output->width == window->width && + output->height == window->height && + window->override_redirect) { + *output_ret = output; + return 1; + } + } + + return 0; +} static void xserver_map_shell_surface(struct weston_wm *wm, struct weston_wm_window *window) { struct weston_shell_interface *shell_interface = &wm->server->compositor->shell_interface; + struct weston_output *output; if (!shell_interface->create_shell_surface) return; @@ -1923,6 +1947,11 @@ xserver_map_shell_surface(struct weston_wm *wm, } else if (!window->override_redirect) { shell_interface->set_toplevel(window->shsurf); return; + } else if (legacy_fullscreen(wm, window, &output)) { + window->fullscreen = 1; + shell_interface->set_fullscreen(window->shsurf, + WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, + 0, output); } else { shell_interface->set_xwayland(window->shsurf, window->x,