gdk: Make gdk_surface_move_to_rect public
authorJonas Ådahl <jadahl@gmail.com>
Tue, 5 Jun 2018 15:46:34 +0000 (17:46 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Tue, 5 Jun 2018 15:53:05 +0000 (17:53 +0200)
This is the API used by GtkMenu to properly position menus on the screen
without requiring GTK to query the menu window's position or the work
area of where the window is positioned. It makes it possible to position
popup windows properly when using Wayland.

Make this API available to external users so custom popup windows can be
positioned properly as well.

Related: https://gitlab.gnome.org/GNOME/gtk/issues/997

gdk/gdk-private.h
gdk/gdksurface.c
gdk/gdksurface.h

index 0618f8187f636e6c4ba66c8dec1f57d628084767..2d96acc2da71e9807865138874f3a7d2f27f71ce 100644 (file)
@@ -20,14 +20,6 @@ void            gdk_surface_thaw_toplevel_updates        (GdkSurface *surface);
 
 gboolean        gdk_surface_supports_edge_constraints    (GdkSurface *surface);
 
-void            gdk_surface_move_to_rect        (GdkSurface          *surface,
-                                                 const GdkRectangle *rect,
-                                                 GdkGravity          rect_anchor,
-                                                 GdkGravity          surface_anchor,
-                                                 GdkAnchorHints      anchor_hints,
-                                                 gint                rect_anchor_dx,
-                                                 gint                rect_anchor_dy);
-
 GObject *       gdk_event_get_user_data         (const GdkEvent *event);
 
 guint32         gdk_display_get_last_seen_time  (GdkDisplay *display);
index aac5af5ea42e6c1e71d2bd5f3872220f658b5416..323e5069f9735550d92108545159121fc1d3ff77 100644 (file)
@@ -3055,8 +3055,6 @@ gdk_surface_move_resize (GdkSurface *surface,
  *
  * Connect to the #GdkSurface::moved-to-rect signal to find out how it was
  * actually positioned.
- *
- * Stability: Private
  */
 void
 gdk_surface_move_to_rect (GdkSurface          *surface,
index ddae4f21289fcac5d33e8621fafb36d278915c23..5158e1176187ff6504d5854b779f698daf13e1df 100644 (file)
@@ -486,6 +486,15 @@ void          gdk_surface_move_resize           (GdkSurface     *surface,
                                                  gint           width,
                                                  gint           height);
 GDK_AVAILABLE_IN_ALL
+void          gdk_surface_move_to_rect          (GdkSurface         *surface,
+                                                 const GdkRectangle *rect,
+                                                 GdkGravity          rect_anchor,
+                                                 GdkGravity          surface_anchor,
+                                                 GdkAnchorHints      anchor_hints,
+                                                 gint                rect_anchor_dx,
+                                                 gint                rect_anchor_dy);
+
+GDK_AVAILABLE_IN_ALL
 void          gdk_surface_raise                 (GdkSurface     *surface);
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_lower                 (GdkSurface     *surface);