<html>
<head>
<base href="https://bugzilla.gnome.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Wayland: gtkcombox menu misplaced in master"
href="https://bugzilla.gnome.org/show_bug.cgi?id=766722#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Wayland: gtkcombox menu misplaced in master"
href="https://bugzilla.gnome.org/show_bug.cgi?id=766722">bug 766722</a>
from <span class="vcard"><a href="page.cgi?id=describeuser.html&login=ofourdan%40redhat.com" title="Olivier Fourdan <ofourdan@redhat.com>"> <span class="fn">Olivier Fourdan</span></a>
</span></b>
<pre>Ok, here's the idea, when we deal with a backend that doesn't have global
coordinates, all coordinates are relative to the toplevel, which breaks the
monitor detection. Basically (0,0) is the toplevel top left corner and not the
screen top left corner.
So the idea is to translate the coordinates to the relevant monitor, by finding
the monitor based on the window (thanks to <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Wayland: gdk_screen_get_monitor_at_window() unreliable under Wayland"
href="show_bug.cgi?id=766566">bug 766566</a>) and add the monitor
location to the given (relative) coordinates, to fix the computation to
constrain menus within the current monitor, then translate it back to local
coordinates once the computation is done.
For this, we'd need to:
1. Add an API to tell whether or not the current display (and backend) supports
global coordinates.,so we do not need to check which backend is actually in use
- I think it could even be a worthy addition anyway.
2. Add a private helper function to gtkprivate to do the coordinates
translation back and forth when the backend doesn't support global coordinates.
3. Use that in various menu positioning and sizing routines.
>From my initial testing here, that seems to work well enough, it fixes this bug
and <a class="bz_bug_link
bz_status_NEW "
title="NEW - Certain menus display at wrong position in configured multi-monitor setups under Wayland"
href="show_bug.cgi?id=764310">bug 764310</a> as well.
That could be a good addition while we wait for the fixes for <a class="bz_bug_link
bz_status_NEW "
title="NEW - GTK should let GDK position menus"
href="show_bug.cgi?id=756579">bug 756579</a> to
land, and we could even consider this as a fix for gtk+-3.20 where xdg-shell v6
is unlikely to be backported, who knows.
Patch series to follow.</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>