<div dir="ltr"><div>Ooops, mixed the two commits together. Sorry, will fix it.<br><br></div>Marek<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 1 September 2014 17:13, Marek Chalupa <span dir="ltr"><<a href="mailto:mchqwerty@gmail.com" target="_blank">mchqwerty@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Set the right position of maximized window. Up until now we ignored<br>
output's "position" and were using only the working area<br>
of output which is in output-relative coordinates. This led to<br>
showing the maximized window always on the first output.<br>
<br>
This, along with the previous patch, fixes<br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=82967" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=82967</a><br>
<br>
Signed-off-by: Marek Chalupa <<a href="mailto:mchqwerty@gmail.com">mchqwerty@gmail.com</a>><br>
---<br>
 desktop-shell/shell.c | 23 ++++-------------------<br>
 1 file changed, 4 insertions(+), 19 deletions(-)<br>
<br>
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c<br>
index 11c893a..9c0e721 100644<br>
--- a/desktop-shell/shell.c<br>
+++ b/desktop-shell/shell.c<br>
@@ -2389,22 +2389,6 @@ shell_surface_set_parent(struct shell_surface *shsurf,<br>
 }<br>
<br>
 static void<br>
-shell_surface_set_output(struct shell_surface *shsurf,<br>
-                         struct weston_output *output)<br>
-{<br>
-       struct weston_surface *es = shsurf->surface;<br>
-<br>
-       /* get the default output, if the client set it as NULL<br>
-          check whether the ouput is available */<br>
-       if (output)<br>
-               shsurf->output = output;<br>
-       else if (es->output)<br>
-               shsurf->output = es->output;<br>
-       else<br>
-               shsurf->output = get_default_output(es->compositor);<br>
-}<br>
-<br>
-static void<br>
 surface_clear_next_states(struct shell_surface *shsurf)<br>
 {<br>
        shsurf->next_state.maximized = false;<br>
@@ -5130,15 +5114,16 @@ set_maximized_position(struct desktop_shell *shell,<br>
 {<br>
        int32_t surf_x, surf_y;<br>
        pixman_rectangle32_t area;<br>
+       pixman_box32_t *e;<br>
<br>
-       /* use surface configure to set the geometry */<br>
        get_output_work_area(shell, shsurf->output, &area);<br>
        surface_subsurfaces_boundingbox(shsurf->surface,<br>
                                        &surf_x, &surf_y, NULL, NULL);<br>
+       e = pixman_region32_extents(&shsurf->output->region);<br>
<br>
        weston_view_set_position(shsurf->view,<br>
-                                area.x - surf_x,<br>
-                                area.y - surf_y);<br>
+                                e->x1 + area.x - surf_x,<br>
+                                e->y1 + area.y - surf_y);<br>
 }<br>
<br>
 static void<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.3<br>
<br>
</font></span></blockquote></div><br></div>