[gtk/wip/matthiasc/popup5: 73/109] surface: Store popup parent



commit 057ec70339280db6798ee228e42089f3cf6615ad
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Apr 22 14:21:17 2019 +0000

    surface: Store popup parent
    
    Store popup parents separately from transient-for
    parents, since these are separate concepts with
    different behaviors. And we need the parent in
    the frontend, so we can use it in the fallback
    move-to-rect implementation.

 gdk/broadway/gdksurface-broadway.c | 1 +
 gdk/gdksurfaceprivate.h            | 3 ++-
 gdk/wayland/gdksurface-wayland.c   | 1 +
 gdk/x11/gdksurface-x11.c           | 1 +
 4 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c
index 53d74a461e..c4740d3fa6 100644
--- a/gdk/broadway/gdksurface-broadway.c
+++ b/gdk/broadway/gdksurface-broadway.c
@@ -205,6 +205,7 @@ _gdk_broadway_display_create_surface (GdkDisplay     *display,
   g_object_unref (frame_clock);
 
   surface->surface_type = surface_type;
+  surface->parent = parent;
   surface->x = x;
   surface->y = y;
   surface->width = width;
diff --git a/gdk/gdksurfaceprivate.h b/gdk/gdksurfaceprivate.h
index f2855ae996..25319c6b38 100644
--- a/gdk/gdksurfaceprivate.h
+++ b/gdk/gdksurfaceprivate.h
@@ -32,7 +32,8 @@ struct _GdkSurface
 
   GdkDisplay *display;
 
-  GdkSurface *transient_for;
+  GdkSurface *transient_for; /* for toplevels */
+  GdkSurface *parent;        /* for popups */
 
   gpointer widget;
 
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 11ab88fcc0..1ba42c8450 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -531,6 +531,7 @@ _gdk_wayland_display_create_surface (GdkDisplay     *display,
     }
 
   surface->surface_type = surface_type;
+  surface->parent = parent;
   surface->x = x;
   surface->y = y;
   surface->width = width;
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index f5f8886544..0643948ec2 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -811,6 +811,7 @@ _gdk_x11_display_create_surface (GdkDisplay     *display,
   g_object_unref (frame_clock);
 
   surface->surface_type = surface_type;
+  surface->parent = parent;
   surface->x = x;
   surface->y = y;
   surface->width = width;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]