Commit 35f55f91 authored by Roman Gilg's avatar Roman Gilg
Browse files

xwayland: Set rotated mode with xdg-output

When receiving an output update for the mode size we need to rotate the stored
width and height values if and only if we have an xdg-output for this output
since in this case the stored values describe the output's size in logical
space, i.e. rotated.

The prior code did not rotate though when an xdg-output was available since in
this case the need_rotate variable was set to False what caused in the check
afterwards the first branch to execute.

In order to remove the double negation this variable implied it gets replaced
with a simple check on the xdg-output directly.
Signed-off-by: Roman Gilg's avatarRoman Gilg <>
parent f9e1c8a9
Pipeline #188461 passed with stages
in 3 minutes and 45 seconds
......@@ -503,17 +503,16 @@ apply_output_change(struct xwl_output *xwl_output)
int mode_width, mode_height, count;
int width = 0, height = 0, has_this_output = 0;
RRModePtr *randr_modes;
Bool need_rotate;
/* Clear out the "done" received flags */
xwl_output->wl_output_done = FALSE;
xwl_output->xdg_output_done = FALSE;
/* xdg-output sends output size in compositor space. so already rotated */
need_rotate = (xwl_output->xdg_output == NULL);
/* We need to rotate back the logical size for the mode */
if (!need_rotate || xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) {
/* When we have received an xdg-output for the mode size we might need to
* rotate back the stored logical size it provided.
if (xwl_output->xdg_output == NULL
|| xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) {
mode_width = xwl_output->width;
mode_height = xwl_output->height;
} else {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment