diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-07-15 15:12:14 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-07-15 15:29:58 -0400 |
commit | d148f26658bd6af8066c8269585c02959943c69b (patch) | |
tree | 8020ecb9a714f8926e7b94a747e7094a1e3a3e9f /gdk | |
parent | 7ca6440f4d1c6a0921cfd310e1993d0a7c8e082d (diff) | |
download | gtk+-d148f26658bd6af8066c8269585c02959943c69b.tar.gz |
Drop gdk_surface_withdraw
'withdrawn' is an X11-centric concept, and the function
can just as well be replaced by gdk_surface_hide.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdksurface.c | 32 | ||||
-rw-r--r-- | gdk/gdksurface.h | 2 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11.c | 36 |
3 files changed, 18 insertions, 52 deletions
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index db80d00eb6..00c5ac4c09 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -2607,38 +2607,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS gdk_surface_invalidate_in_parent (surface); } -/** - * gdk_surface_withdraw: - * @surface: a toplevel #GdkSurface - * - * Withdraws a surface (unmaps it and asks the surface manager to forget about it). - * This function is not really useful as gdk_surface_hide() automatically - * withdraws toplevel surfaces before hiding them. - **/ -void -gdk_surface_withdraw (GdkSurface *surface) -{ - GdkSurfaceImplClass *impl_class; - GdkGLContext *current_context; - - g_return_if_fail (GDK_IS_SURFACE (surface)); - - if (surface->destroyed) - return; - - if (gdk_surface_has_impl (surface)) - { - impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl); - impl_class->withdraw (surface); - - current_context = gdk_gl_context_get_current (); - if (current_context != NULL && gdk_gl_context_get_surface (current_context) == surface) - gdk_gl_context_clear_current (); - - recompute_visible_regions (surface, FALSE); - } -} - static void gdk_surface_move_resize_toplevel (GdkSurface *surface, gboolean with_move, diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h index a1b800b8f4..b9d88690b5 100644 --- a/gdk/gdksurface.h +++ b/gdk/gdksurface.h @@ -460,8 +460,6 @@ void gdk_surface_show (GdkSurface *surface); GDK_AVAILABLE_IN_ALL void gdk_surface_hide (GdkSurface *surface); GDK_AVAILABLE_IN_ALL -void gdk_surface_withdraw (GdkSurface *surface); -GDK_AVAILABLE_IN_ALL void gdk_surface_show_unraised (GdkSurface *surface); GDK_AVAILABLE_IN_ALL void gdk_surface_move (GdkSurface *surface, diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index f04f74d486..29b6dae9f7 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -1285,6 +1285,23 @@ gdk_surface_x11_show (GdkSurface *surface, gboolean already_mapped) } static void +gdk_surface_x11_withdraw (GdkSurface *surface) +{ + if (!surface->destroyed) + { + if (GDK_SURFACE_IS_MAPPED (surface)) + gdk_synthesize_surface_state (surface, + 0, + GDK_SURFACE_STATE_WITHDRAWN); + + g_assert (!GDK_SURFACE_IS_MAPPED (surface)); + + XWithdrawWindow (GDK_SURFACE_XDISPLAY (surface), + GDK_SURFACE_XID (surface), 0); + } +} + +static void gdk_surface_x11_hide (GdkSurface *surface) { /* We'll get the unmap notify eventually, and handle it then, @@ -1299,7 +1316,7 @@ gdk_surface_x11_hide (GdkSurface *surface) { case GDK_SURFACE_TOPLEVEL: case GDK_SURFACE_TEMP: /* ? */ - gdk_surface_withdraw (surface); + gdk_surface_x11_withdraw (surface); return; case GDK_SURFACE_CHILD: @@ -1313,23 +1330,6 @@ gdk_surface_x11_hide (GdkSurface *surface) GDK_SURFACE_XID (surface)); } -static void -gdk_surface_x11_withdraw (GdkSurface *surface) -{ - if (!surface->destroyed) - { - if (GDK_SURFACE_IS_MAPPED (surface)) - gdk_synthesize_surface_state (surface, - 0, - GDK_SURFACE_STATE_WITHDRAWN); - - g_assert (!GDK_SURFACE_IS_MAPPED (surface)); - - XWithdrawWindow (GDK_SURFACE_XDISPLAY (surface), - GDK_SURFACE_XID (surface), 0); - } -} - static inline void surface_x11_move (GdkSurface *surface, gint x, |