[gtk/gtk-3-24: 1/2] gdk: Make gdk_window_move_to_rect public
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 1/2] gdk: Make gdk_window_move_to_rect public
- Date: Tue, 5 Jun 2018 16:59:23 +0000 (UTC)
commit 9b3c745fc458b3524be300c4e0c5ccb19628b13b
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue Jun 5 15:01:52 2018 +0200
gdk: Make gdk_window_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.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/997
gdk/gdk-private.c | 1 -
gdk/gdk-private.h | 16 ----------------
gdk/gdkwindow.c | 3 +--
gdk/gdkwindow.h | 9 +++++++++
gtk/gtkmenu.c | 14 +++++++-------
5 files changed, 17 insertions(+), 26 deletions(-)
---
diff --git a/gdk/gdk-private.c b/gdk/gdk-private.c
index 37a4ee60c3..98a0b15b0d 100644
--- a/gdk/gdk-private.c
+++ b/gdk/gdk-private.c
@@ -17,7 +17,6 @@ gdk__private__ (void)
gdk_display_set_rendering_mode,
gdk_display_get_debug_updates,
gdk_display_set_debug_updates,
- gdk_window_move_to_rect
};
return &table;
diff --git a/gdk/gdk-private.h b/gdk/gdk-private.h
index e292429fd4..5d35eb54d8 100644
--- a/gdk/gdk-private.h
+++ b/gdk/gdk-private.h
@@ -31,14 +31,6 @@ gboolean gdk_display_get_debug_updates (GdkDisplay *display);
void gdk_display_set_debug_updates (GdkDisplay *display,
gboolean debug_updates);
-void gdk_window_move_to_rect (GdkWindow *window,
- const GdkRectangle *rect,
- GdkGravity rect_anchor,
- GdkGravity window_anchor,
- GdkAnchorHints anchor_hints,
- gint rect_anchor_dx,
- gint rect_anchor_dy);
-
typedef struct {
/* add all private functions here, initialize them in gdk-private.c */
gboolean (* gdk_device_grab_info) (GdkDisplay *display,
@@ -64,14 +56,6 @@ typedef struct {
gboolean (* gdk_display_get_debug_updates) (GdkDisplay *display);
void (* gdk_display_set_debug_updates) (GdkDisplay *display,
gboolean debug_updates);
-
- void (* gdk_window_move_to_rect) (GdkWindow *window,
- const GdkRectangle *rect,
- GdkGravity rect_anchor,
- GdkGravity window_anchor,
- GdkAnchorHints anchor_hints,
- gint rect_anchor_dx,
- gint rect_anchor_dy);
} GdkPrivateVTable;
GDK_AVAILABLE_IN_ALL
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 5ac1a69b4c..6b231f067e 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -6233,8 +6233,7 @@ gdk_window_move_resize (GdkWindow *window,
* Connect to the #GdkWindow::moved-to-rect signal to find out how it was
* actually positioned.
*
- * Since: 3.22
- * Stability: Private
+ * Since: 3.24
*/
void
gdk_window_move_to_rect (GdkWindow *window,
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 3614a76b9f..b1efbb984e 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -550,6 +550,15 @@ void gdk_window_move_resize (GdkWindow *window,
gint y,
gint width,
gint height);
+
+GDK_AVAILABLE_IN_3_24
+void gdk_window_move_to_rect (GdkWindow *window,
+ const GdkRectangle *rect,
+ GdkGravity rect_anchor,
+ GdkGravity window_anchor,
+ GdkAnchorHints anchor_hints,
+ gint rect_anchor_dx,
+ gint rect_anchor_dy);
GDK_AVAILABLE_IN_ALL
void gdk_window_reparent (GdkWindow *window,
GdkWindow *new_parent,
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 1006da0d2f..8ab4634878 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -5274,13 +5274,13 @@ gtk_menu_position (GtkMenu *menu,
g_signal_connect (toplevel, "moved-to-rect", G_CALLBACK (moved_to_rect_cb),
menu);
- GDK_PRIVATE_CALL (gdk_window_move_to_rect) (toplevel,
- &rect,
- rect_anchor,
- menu_anchor,
- anchor_hints,
- rect_anchor_dx,
- rect_anchor_dy);
+ gdk_window_move_to_rect (toplevel,
+ &rect,
+ rect_anchor,
+ menu_anchor,
+ anchor_hints,
+ rect_anchor_dx,
+ rect_anchor_dy);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]