I noticed that in wayland , popovers are created as subsurfaces rather than new windows. (I discovered this while investigating https://github.com/swaywm/sway/issues/4924.) I’m not really sure why it is a subsurface instead of using xdg_popup, but anyway, I was looking through the code of gtk and gdk to figure out how this was happening, and am quite confused about it. It appears that GtkPopover sets the window type to GDK_WINDOW_CHILD. But in
should_map_as_subsurface we have the following code (https://github.com/swaywm/sway/issues/4924):
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_SUBSURFACE) return TRUE; if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TEMP) return FALSE;
but since the window type is GDK_WINDOW_CHILD, it seems like this should return false, but apparantly it doesn’t. What is going on?