xwayland: xwl_window_should_enable_viewport: Add extra test

Games based on the allegro gaming library or on ClanLib-1.0 do not size
their window to match the fullscreen resolution, instead they use a
window covering the entire screen, drawing only the fullscreen resolution
part of it.

This commit adds a check for these games, so that we correctly apply a
viewport to them making fullscreen work properly for these games under
Xwayland.

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Hans de Goede 2019-08-26 12:26:34 +02:00
parent 38de626081
commit 0c305dbff8
1 changed files with 17 additions and 0 deletions

View File

@ -679,6 +679,23 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
}
}
/* 2. Test if the window uses override-redirect + vidmode
* and matches (fully covers) the entire screen.
* This path gets hit by: allegro4, ClanLib-1.0.
*/
xwl_output = xwl_screen_get_first_output(xwl_screen);
emulated_mode = xwl_output_get_emulated_mode_for_client(xwl_output, owner);
if (xwl_output && xwl_window->window->overrideRedirect &&
emulated_mode && emulated_mode->from_vidmode &&
xwl_window->x == 0 && xwl_window->y == 0 &&
xwl_window->width == xwl_screen->width &&
xwl_window->height == xwl_screen->height) {
*emulated_mode_ret = emulated_mode;
*xwl_output_ret = xwl_output;
return TRUE;
}
return FALSE;
}