• Benjamin Otte's avatar
    gdk: Allow display subclasses to override the type used for windows · af7afbbe
    Benjamin Otte authored
    We want to have different window types for different displays, so we can
    write code like this:
    
      #if GDK_WINDOWING_X11
        if (GDK_IS_X11_WINDOW (window))
          {
            /* do x11 stuff */
          }
        else
      #endif
      #if GDK_WINDOWING_WAYLAND
        if (GDK_IS_WAYLAND_WINDOW (window))
          {
            /* do wayland stuff */
          }
        else
      #endif
          {
            /* do stuff for unsupported system */
        }
    
    This requires different GdkWindow types and we currently don't have
    that, as only the GdkWindowImpl differs. With this method, every backend
    defines a custom type that's just a simple subclass of GdkWindow. This
    way GdkWindow behaves like all the other types (visuals, screens,
    displays) and we can write code like the above.
    af7afbbe
gdkdisplay.c 77.6 KB