From: Jonas Ã…dahl Date: Tue, 5 Jun 2018 15:46:34 +0000 (+0200) Subject: gdk: Make gdk_surface_move_to_rect public X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~22^2~211^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c0e1044d5c11ec810b81bad91affb23576364ca8;p=gtk4.git gdk: Make gdk_surface_move_to_rect public 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 --- diff --git a/gdk/gdk-private.h b/gdk/gdk-private.h index 0618f8187f..2d96acc2da 100644 --- a/gdk/gdk-private.h +++ b/gdk/gdk-private.h @@ -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); diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index aac5af5ea4..323e5069f9 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -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, diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h index ddae4f2128..5158e11761 100644 --- a/gdk/gdksurface.h +++ b/gdk/gdksurface.h @@ -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);