From cdcd3ca359920d875480c6021d2fcb6b2ed65258 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 7 Nov 2014 14:33:53 +0000 Subject: [PATCH] Hide GdkWindow libgtk_only API in the private vtable These are the last two global GDK symbols that have a libgtk_only suffix. https://bugzilla.gnome.org/show_bug.cgi?id=739781 --- gdk/gdk-private.c | 2 ++ gdk/gdk-private.h | 5 +++++ gdk/gdkwindow.c | 20 ++++++++++++++++++-- gdk/gdkwindow.h | 4 ++-- gdk/x11/gdkdisplay-x11.c | 5 +++-- gdk/x11/gdkwindow-x11.c | 3 ++- gtk/gtkwindow.c | 8 ++++++-- 7 files changed, 38 insertions(+), 9 deletions(-) diff --git a/gdk/gdk-private.c b/gdk/gdk-private.c index f95b0b8cec..bbb89a7017 100644 --- a/gdk/gdk-private.c +++ b/gdk/gdk-private.c @@ -11,6 +11,8 @@ gdk__private__ (void) gdk_pre_parse, gdk_gl_get_flags, gdk_gl_set_flags, + gdk_window_freeze_toplevel_updates, + gdk_window_thaw_toplevel_updates, }; return &table; diff --git a/gdk/gdk-private.h b/gdk/gdk-private.h index 83de62c72f..290160d156 100644 --- a/gdk/gdk-private.h +++ b/gdk/gdk-private.h @@ -20,6 +20,9 @@ void gdk_pre_parse (void); GdkGLFlags gdk_gl_get_flags (void); void gdk_gl_set_flags (GdkGLFlags flags); +void gdk_window_freeze_toplevel_updates (GdkWindow *window); +void gdk_window_thaw_toplevel_updates (GdkWindow *window); + typedef struct { /* add all private functions here, initialize them in gdk-private.c */ gboolean (* gdk_device_grab_info) (GdkDisplay *display, @@ -33,6 +36,8 @@ typedef struct { void (* gdk_pre_parse) (void); GdkGLFlags (* gdk_gl_get_flags) (void); void (* gdk_gl_set_flags) (GdkGLFlags flags); + void (* gdk_window_freeze_toplevel_updates) (GdkWindow *window); + void (* gdk_window_thaw_toplevel_updates) (GdkWindow *window); } GdkPrivateVTable; GDK_AVAILABLE_IN_ALL diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 08bcae4f79..be4f75ca35 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -4380,9 +4380,17 @@ gdk_window_thaw_updates (GdkWindow *window) * * This function is not part of the GDK public API and is only * for use by GTK+. - **/ + * + * Deprecated: 3.16: This symbol was never meant to be used outside of GTK+ + */ void gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window) +{ + gdk_window_freeze_toplevel_updates (window); +} + +void +gdk_window_freeze_toplevel_updates (GdkWindow *window) { g_return_if_fail (GDK_IS_WINDOW (window)); g_return_if_fail (window->window_type != GDK_WINDOW_CHILD); @@ -4400,9 +4408,17 @@ gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window) * * This function is not part of the GDK public API and is only * for use by GTK+. - **/ + * + * Deprecated: 3.16: This symbol was never meant to be used outside of GTK+ + */ void gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window) +{ + gdk_window_thaw_toplevel_updates (window); +} + +void +gdk_window_thaw_toplevel_updates (GdkWindow *window) { g_return_if_fail (GDK_IS_WINDOW (window)); g_return_if_fail (window->window_type != GDK_WINDOW_CHILD); diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index 6ae0afb86e..74e23d2369 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -1037,9 +1037,9 @@ void gdk_window_freeze_updates (GdkWindow *window); GDK_AVAILABLE_IN_ALL void gdk_window_thaw_updates (GdkWindow *window); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_3_16 void gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_3_16 void gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window); GDK_AVAILABLE_IN_ALL diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 220a85b009..4799bc6b5a 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -38,6 +38,7 @@ #include "gdkprivate-x11.h" #include "gdkscreen-x11.h" #include "gdkglcontext-x11.h" +#include "gdk-private.h" #include #include @@ -704,7 +705,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, } if (toplevel) - gdk_window_freeze_toplevel_updates_libgtk_only (window); + gdk_window_freeze_toplevel_updates (window); _gdk_x11_window_grab_check_unmap (window, xevent->xany.serial); } @@ -728,7 +729,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, 0); if (toplevel) - gdk_window_thaw_toplevel_updates_libgtk_only (window); + gdk_window_thaw_toplevel_updates (window); } break; diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 2302ba65e1..c2d7cf7387 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -38,6 +38,7 @@ #include "gdkdisplay-x11.h" #include "gdkglcontext-x11.h" #include "gdkprivate-x11.h" +#include "gdk-private.h" #include #include @@ -1129,7 +1130,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, connect_frame_clock (window); if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD) - gdk_window_freeze_toplevel_updates_libgtk_only (window); + gdk_window_freeze_toplevel_updates (window); } static GdkEventMask diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index d57b3a438f..0d0fb88897 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -63,6 +63,8 @@ #include "inspector/init.h" #include "inspector/window.h" +#include "gdk/gdk-private.h" + #ifdef GDK_WINDOWING_X11 #include "x11/gdkx.h" #endif @@ -7396,7 +7398,8 @@ gtk_window_configure_event (GtkWidget *widget, if (priv->configure_request_count > 0) { priv->configure_request_count -= 1; - gdk_window_thaw_toplevel_updates_libgtk_only (gtk_widget_get_window (widget)); + + GDK_PRIVATE_CALL (gdk_window_thaw_toplevel_updates) (gtk_widget_get_window (widget)); } /* @@ -9281,7 +9284,8 @@ gtk_window_move_resize (GtkWindow *window) { /* Increment the number of have-not-yet-received-notify requests */ priv->configure_request_count += 1; - gdk_window_freeze_toplevel_updates_libgtk_only (gdk_window); + + GDK_PRIVATE_CALL (gdk_window_freeze_toplevel_updates) (gdk_window); /* for GTK_RESIZE_QUEUE toplevels, we are now awaiting a new * configure event in response to our resizing request.