[gtksourceview/wip/chergert/gsv-gtk4] completion: use GdkPopupLayout API



commit 7e9ce49c82b3e288ea191200bb3e4d0e73ab043d
Author: Christian Hergert <chergert redhat com>
Date:   Fri Mar 6 15:53:57 2020 -0800

    completion: use GdkPopupLayout API

 gtksourceview/gtksourcecompletion.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 00d7918e..ba1fc952 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -738,6 +738,7 @@ update_info_position (GtkSourceCompletion *completion)
 {
        GdkSurface *main_surface;
        GdkSurface *info_surface;
+       GdkPopupLayout *layout;
        GdkRectangle geom;
 
        if (!GTK_IS_NATIVE (completion->main_window) ||
@@ -758,12 +759,10 @@ update_info_position (GtkSourceCompletion *completion)
        geom.width = gdk_surface_get_width (main_surface);
        geom.height = gdk_surface_get_height (main_surface);
 
-       gdk_surface_move_to_rect (info_surface,
-                                 &geom,
-                                 GDK_GRAVITY_NORTH_EAST,
-                                 GDK_GRAVITY_NORTH_WEST,
-                                 GDK_ANCHOR_FLIP_X,
-                                 0, 0);
+       layout = gdk_popup_layout_new (&geom, GDK_GRAVITY_NORTH_EAST, GDK_GRAVITY_NORTH_WEST);
+       gdk_popup_layout_set_anchor_hints (layout, GDK_ANCHOR_FLIP_X);
+       gdk_surface_present_popup (info_surface, geom.width, geom.height, layout);
+       gdk_popup_layout_unref (layout);
 }
 
 static GtkSourceCompletionProvider *


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