[Wayland-bugs] [Bug 759738] New: wayland: use a subsurface for GDK_WINDOW_TEMP if attached to a toplevel

gtk+ (GNOME Bugzilla) bugzilla at gnome.org
Mon Dec 21 05:35:13 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=759738

            Bug ID: 759738
           Summary: wayland: use a subsurface for GDK_WINDOW_TEMP if
                    attached to a toplevel
    Classification: Platform
           Product: gtk+
           Version: 3.19.x
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: Backend: Wayland
          Assignee: gtk-bugs at gtk.org
          Reporter: ofourdan at redhat.com
        QA Contact: gtk-bugs at gtk.org
                CC: rob at robster.org.uk, wayland-bugs at lists.freedesktop.org
     GNOME version: ---

On X11, some application (e.g. gucharmap) use GTK_WINDOW_POPUP to display some
additional information (like the zoom window, see bug 759229 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-bugs/attachments/20151221/eedb4808/attachment.html>


More information about the wayland-bugs mailing list