<html>
<head>
<base href="https://bugzilla.gnome.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - wayland: use a subsurface for GDK_WINDOW_TEMP if attached to a toplevel"
href="https://bugzilla.gnome.org/show_bug.cgi?id=759738">759738</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>wayland: use a subsurface for GDK_WINDOW_TEMP if attached to a toplevel
</td>
</tr>
<tr>
<th>Classification</th>
<td>Platform
</td>
</tr>
<tr>
<th>Product</th>
<td>gtk+
</td>
</tr>
<tr>
<th>Version</th>
<td>3.19.x
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>Normal
</td>
</tr>
<tr>
<th>Component</th>
<td>Backend: Wayland
</td>
</tr>
<tr>
<th>Assignee</th>
<td>gtk-bugs@gtk.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ofourdan@redhat.com
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>gtk-bugs@gtk.org
</td>
</tr>
<tr>
<th>CC</th>
<td>rob@robster.org.uk, wayland-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>GNOME version</th>
<td>---
</td>
</tr></table>
<p>
<div>
<pre>On X11, some application (e.g. gucharmap) use GTK_WINDOW_POPUP to display some
additional information (like the zoom window, see <a class="bz_bug_link
bz_status_NEW "
title="NEW - wayland: zoom window not working on Wayland"
href="show_bug.cgi?id=759229">bug 759229</a> for example).
On Wayland, this will be translated by default as a regular surface which will
take receive focus and cannot be placed programatically by the application.
Best way to get on Wayland a behaviour similar to overide redirect on X11 is to
use subsurface, but gtk+ doesn't make it particularly easy to achieve this
(there is no gtk+ API to request a subsurface because this is a Wayalnd concept
and threrefore belongs to the gdk backend).
Currently, easiest way is to set the window type to "tooltip" as this will be
translated by default as a subsurface on Wayland (if the parent is set), but
that's a hack and it's a clear misuse of the intended type.
Another possibility is to subclass gtkwindow to override the realize method and
set the gdk window type to GDK_WINDOW_SUBSURFACE, but that means that the
application needs to test the underlying windowing system (there is no
GDK_WINDOW_SUBSURFACE outside of Wayland) and it also adds a lot of complexity
for a simple and quite common use case.
Ideally, the gdk wayland backend should use a subsurface when possible, ie with
GDK_WINDOW_TEMP with a parent (transient_for) set and not when an xdg-popup is
to be used (e.g. menus).
That would make the fix for Wayland a one liner in the applications, just have
to set the transient_for to the toplevel and gdk would automatically prefer a
subsurface that can be positioned at will by the application, just like on X11.
Patch 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>