<html>
<head>
<base href="https://bugzilla.gnome.org/" />
</head>
<body><span class="vcard"><a href="page.cgi?id=describeuser.html&login=jadahl%40gmail.com" title="Jonas Ådahl <jadahl@gmail.com>"> <span class="fn">Jonas Ådahl</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - wayland: new window momentarily displays on wrong monitor"
href="https://bugzilla.gnome.org/show_bug.cgi?id=782183">bug 782183</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #351955 status</td>
<td>none
</td>
<td>reviewed
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - wayland: new window momentarily displays on wrong monitor"
href="https://bugzilla.gnome.org/show_bug.cgi?id=782183#c10">Comment # 10</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - wayland: new window momentarily displays on wrong monitor"
href="https://bugzilla.gnome.org/show_bug.cgi?id=782183">bug 782183</a>
from <span class="vcard"><a href="page.cgi?id=describeuser.html&login=jadahl%40gmail.com" title="Jonas Ådahl <jadahl@gmail.com>"> <span class="fn">Jonas Ådahl</span></a>
</span></b>
<pre>Review of <span class=""><a href="attachment.cgi?id=351955&action=diff" name="attach_351955" title="[PATCH] wayland: place window if maximized before placement">attachment 351955</a> <a href="attachment.cgi?id=351955&action=edit" title="[PATCH] wayland: place window if maximized before placement">[details]</a></span> <a href='review?bug=782183&attachment=351955'>[review]</a>:
::: src/wayland/meta-wayland-xdg-shell.c
@@ +352,3 @@
+ * this has no effect...
+ */
+ meta_window_force_placement (surface->window);
I think I understand why this helps, but my understanding doesn't seem to be
what is described in the commit message...
1) a side effect of calling this is that window->placed is set to TRUE, which
in turn avoids the defer-maximize-to-post-placement. For example, the issue is
also fixed either by commenting out that early-out in meta_window_maximize() or
changing the above line here to "window->placed = TRUE;".
2) this means the call below will actually do the move_resize call which will
constrain etc resulting in meta_wayland_xdg_toplevel_send_configure() being
called with the maximize dimensions.
3) this means that the meta_wayland_xdg_toplevel_send_configure(0,0) call in
xdg_toplevel_role_commit() won't be called.
As far as I can tell, the incorrect call send_configure(0,0) was the issue
here, as it meant the client first sent a non-maximized window geometry, which
was used when showing and initial placing. After placing, the correct configure
was sent, and then when the client had redrawn, the actual maximized surface
content was provided.
So... our window management code is quite frustrating, and this fix has an
after taste of work-around. I wonder if we can't fix this some better way.
First thing I can think of is to move part of the maximize code behind a
MetaWindowClass vfunc, as there are multiple things in meta_window_maximize()
that is X11 only (such as unshading, and this defer-maximize thing).
Another idea, is to get rid of that deferred-maximize thing all together. It
seems to originate from 2003 with no explanation as to why, and I don't know
how to trigger it either. When checking how it works with the panel-gtk test
case under X11, window-props.c handles initial maximization in a different way.
Given that meta_window_maximize() seems to be called mostly by interactive
window management operations, the two places I think needs consideration are:
meta_window_apply_session_info() (should probably set the defer-maximize
variables, as done in window-props.c), and meta_window_x11_client_message().</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>