Skip to content
  • Luca Bacci's avatar
    GdkWindow: check for same impl class in set_transient_for () · 0c72ce94
    Luca Bacci authored
    Checking for offscreen windows with gdk_window_is_offscreen ()
    is not enough in this case. What we want here is that the impl
    classes match, as backends are meant to know only about their
    windows. Instead gdk_window_is_offscreen () checks whether the
    GdkWindow.window_type field is GDK_WINDOW_OFFSCREEN.
    
    In the case of child windows in offscreen windows, the window
    type is GDK_WINDOW_CHILD, even though their impl is still
    GdkOffscreenWindow.
    
    So actually check whether GDK_WINDOW_IMPL_GET_CLASS (window)
    matches GDK_WINDOW_IMPL_GET_CLASS (parent).
    
    We may also consider getting the toplevels from child windows,
    as transient-for relationships are really about toplevels, but
    child windows doesn't seem to cause problems in practice.
    0c72ce94