Skip to content
Snippets Groups Projects
Commit 28e5faab authored by Olivier Fourdan's avatar Olivier Fourdan :tools:
Browse files

xwayland: pass the emulated mode by reference


When using xrandr emulation, the emulated mode is passed as a pointer to
the XRandR mode from the xwl_output associated with the X11 client.

In preparation for fullscreen mode, we want to be able to reuse that
code but use a separate emulated mode.

Simply change the internal API to pass a reference to the emulated mode.

This introduces no functional change.

Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent f3e32cae
No related branches found
No related tags found
No related merge requests found
......@@ -270,7 +270,7 @@ window_get_client_toplevel(WindowPtr window)
static Bool
xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
struct xwl_output **xwl_output_ret,
struct xwl_emulated_mode **emulated_mode_ret)
struct xwl_emulated_mode *emulated_mode_ret)
{
struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
struct xwl_emulated_mode *emulated_mode;
......@@ -302,7 +302,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
drawable->width == emulated_mode->width &&
drawable->height == emulated_mode->height) {
*emulated_mode_ret = emulated_mode;
memcpy(emulated_mode_ret, emulated_mode, sizeof(struct xwl_emulated_mode));
*xwl_output_ret = xwl_output;
return TRUE;
}
......@@ -320,7 +320,7 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
drawable->width == xwl_screen->width &&
drawable->height == xwl_screen->height) {
*emulated_mode_ret = emulated_mode;
memcpy(emulated_mode_ret, emulated_mode, sizeof(struct xwl_emulated_mode));
*xwl_output_ret = xwl_output;
return TRUE;
}
......@@ -331,11 +331,11 @@ xwl_window_should_enable_viewport(struct xwl_window *xwl_window,
void
xwl_window_check_resolution_change_emulation(struct xwl_window *xwl_window)
{
struct xwl_emulated_mode *emulated_mode;
struct xwl_emulated_mode emulated_mode;
struct xwl_output *xwl_output;
if (xwl_window_should_enable_viewport(xwl_window, &xwl_output, &emulated_mode))
xwl_window_enable_viewport(xwl_window, xwl_output, emulated_mode);
xwl_window_enable_viewport(xwl_window, xwl_output, &emulated_mode);
else if (xwl_window_has_viewport_enabled(xwl_window))
xwl_window_disable_viewport(xwl_window);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment