[gtk/present-toplevel-2: 52/178] popover: Use GdkPopup



commit a0b89b008aab1227ea780e37336f7e793c993bff
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 29 09:44:05 2020 -0500

    popover: Use GdkPopup

 gtk/gtkpopover.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 404bdc9b1d..b3e3e79b3b 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -351,28 +351,28 @@ update_popover_layout (GtkPopover     *popover,
   GdkRectangle final_rect;
   gboolean flipped_x;
   gboolean flipped_y;
+  GdkPopup *popup = GDK_POPUP (priv->surface);
 
   g_clear_pointer (&priv->layout, gdk_popup_layout_unref);
   priv->layout = layout;
 
   final_rect = (GdkRectangle) {
+    .x = gdk_popup_get_position_x (GDK_POPUP (priv->surface)),
+    .y = gdk_popup_get_position_y (GDK_POPUP (priv->surface)),
     .width = gdk_surface_get_width (priv->surface),
     .height = gdk_surface_get_height (priv->surface),
   };
-  gdk_surface_get_position (priv->surface,
-                            &final_rect.x,
-                            &final_rect.y);
 
   flipped_x =
     did_flip_horizontally (gdk_popup_layout_get_rect_anchor (layout),
-                           gdk_surface_get_popup_rect_anchor (priv->surface)) &&
+                           gdk_popup_get_rect_anchor (popup)) &&
     did_flip_horizontally (gdk_popup_layout_get_surface_anchor (layout),
-                           gdk_surface_get_popup_surface_anchor (priv->surface));
+                           gdk_popup_get_surface_anchor (popup));
   flipped_y =
     did_flip_vertically (gdk_popup_layout_get_rect_anchor (layout),
-                         gdk_surface_get_popup_rect_anchor (priv->surface)) &&
+                         gdk_popup_get_rect_anchor (popup)) &&
     did_flip_vertically (gdk_popup_layout_get_surface_anchor (layout),
-                         gdk_surface_get_popup_surface_anchor (priv->surface));
+                         gdk_popup_get_surface_anchor (popup));
 
   gtk_widget_allocate (GTK_WIDGET (popover),
                        gdk_surface_get_width (priv->surface),
@@ -544,7 +544,7 @@ present_popup (GtkPopover *popover)
 
   layout = create_popup_layout (popover);
   gtk_widget_get_preferred_size (GTK_WIDGET (popover), NULL, &req);
-  if (gdk_surface_present_popup (priv->surface,
+  if (gdk_popup_present (GDK_POPUP (priv->surface),
                                  MAX (req.width, 1),
                                  MAX (req.height, 1),
                                  layout))


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