<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On 20 February 2018 at 18:41, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When xdg_output support was added to Xwayland, need_rotate parameter was<br>
added to output_get_new_size where true gave you the old pre-xdg_output<br>
behavior and false gave the new behavior.  Unfortunately, the two places<br>
where this is called, need_rotate was set backwards.  This caused input<br>
get clampped to the wrong dimensions.  Also, the logic for deciding<br>
whether or not to flip was wrong because, if need_rotate was false, it<br>
would always flip which is not what you want.<br>
<br>
v2 (Daniel Stone):<br>
 - Fix output_get_new_size so that it doesn't flip the dimensions when<br>
   need_rotate is false.<br>
<br>
Signed-off-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
Reviewed-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br>
Cc: Olivier Fourdan <<a href="mailto:ofourdan@redhat.com">ofourdan@redhat.com</a>><br>
---<br>
 hw/xwayland/xwayland-output.c | 6 +++---<br>
 1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/hw/xwayland/xwayland-output.<wbr>c b/hw/xwayland/xwayland-output.<wbr>c<br>
index c593896..48faeb1 100644<br>
--- a/hw/xwayland/xwayland-output.<wbr>c<br>
+++ b/hw/xwayland/xwayland-output.<wbr>c<br>
@@ -126,7 +126,7 @@ output_get_new_size(struct xwl_output *xwl_output,<br>
 {<br>
     int output_width, output_height;<br>
<br>
-    if (need_rotate && (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180))) {<br>
+    if (!need_rotate || (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180))) {<br>
         output_width = xwl_output->width;<br>
         output_height = xwl_output->height;<br>
     } else {<br>
@@ -220,7 +220,7 @@ apply_output_change(struct xwl_output *xwl_output)<br>
     xwl_output->xdg_output_done = FALSE;<br>
<br>
     /* xdg-output sends output size in compositor space. so already rotated */<br>
-    need_rotate = (xwl_output->xdg_output != NULL);<br>
+    need_rotate = (xwl_output->xdg_output == NULL);<br>
<br>
     randr_mode = xwayland_cvt(xwl_output-><wbr>width, xwl_output->height,<br>
                               xwl_output->refresh / 1000.0, 0, 0);<br>
@@ -390,7 +390,7 @@ xwl_output_remove(struct xwl_output *xwl_output)<br>
     struct xwl_output *it;<br>
     struct xwl_screen *xwl_screen = xwl_output->xwl_screen;<br>
     int width = 0, height = 0;<br>
-    Bool need_rotate = (xwl_output->xdg_output != NULL);<br>
+    Bool need_rotate = (xwl_output->xdg_output == NULL);<br>
<br>
     RRCrtcDestroy(xwl_output-><wbr>randr_crtc);<br>
     RROutputDestroy(xwl_output-><wbr>randr_output);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.0.400.gff86faf<br>
<br>
______________________________<wbr>_________________<br>
<a href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a>: X.Org development<br>
Archives: <a href="http://lists.x.org/archives/xorg-devel" rel="noreferrer" target="_blank">http://lists.x.org/archives/<wbr>xorg-devel</a><br>
Info: <a href="https://lists.x.org/mailman/listinfo/xorg-devel" rel="noreferrer" target="_blank">https://lists.x.org/mailman/<wbr>listinfo/xorg-devel<br></a></font></span></blockquote><div><br></div><div>Hehe, yes, I was typing my reply pointing toward <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">output_get_new_size() as well but you were faster!</span></div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">So v2 is:</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Reviewed-by: Olivier Fourdan <<a href="mailto:ofourdan@redhat.com">ofourdan@redhat.com</a>></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div>Thanks!</div><div>Olivier</div></div></div></div>