[gtk/wip/matthiasc/popup5: 34/124] Drop child surfaces



commit 59456b300e6bda4480f57c8fb35abd480c8bb101
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 22 14:24:39 2019 -0400

    Drop child surfaces
    
    Drop gdk_surface_child_new and the child surface type,
    since we no longer use them. Deprecate surface apis
    that only make sense with child surfaces.

 docs/reference/gdk/gdk4-sections.txt |   5 -
 gdk/broadway/gdksurface-broadway.c   |   3 +-
 gdk/gdkdevice.c                      |   4 +-
 gdk/gdkevents.h                      |   1 -
 gdk/gdksurface.c                     | 172 +----------------------------------
 gdk/gdksurface.h                     |  17 ----
 gdk/quartz/gdkevents-quartz.c        |   2 +-
 gdk/quartz/gdksurface-quartz.c       |  25 +----
 gdk/wayland/gdksurface-wayland.c     |   4 +-
 gdk/win32/gdksurface-win32.c         |   6 --
 gdk/x11/gdkdisplay-x11.c             |  11 +--
 gdk/x11/gdksurface-x11.c             |  11 ---
 gtk/gtkgesture.c                     |  15 +--
 13 files changed, 15 insertions(+), 261 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index 32a212e44e..98b19230e8 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -214,7 +214,6 @@ gdk_surface_move
 gdk_surface_resize
 gdk_surface_move_resize
 gdk_surface_move_to_rect
-gdk_surface_has_native
 gdk_surface_raise
 gdk_surface_lower
 gdk_surface_restack
@@ -269,10 +268,6 @@ gdk_surface_get_root_coords
 gdk_surface_get_device_position
 GdkModifierType
 GdkModifierIntent
-gdk_surface_get_parent
-gdk_surface_get_toplevel
-gdk_surface_get_children
-gdk_surface_peek_children
 gdk_surface_set_icon_name
 gdk_surface_set_transient_for
 gdk_surface_set_startup_id
diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c
index 06b862c143..4e054144b9 100644
--- a/gdk/broadway/gdksurface-broadway.c
+++ b/gdk/broadway/gdksurface-broadway.c
@@ -46,8 +46,7 @@
 /* Forward declarations */
 static void        gdk_surface_impl_broadway_finalize   (GObject            *object);
 
-#define SURFACE_IS_TOPLEVEL(surface) \
-  (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD)
+#define SURFACE_IS_TOPLEVEL(surface)  TRUE
 
 struct _GdkBroadwaySurface {
   GdkSurface parent;
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 18640a7f74..f5dfc56cb8 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -1258,9 +1258,9 @@ gdk_device_grab (GdkDevice        *device,
   g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_GRAB_FAILED);
   g_return_val_if_fail (gdk_surface_get_display (surface) == gdk_device_get_display (device), 
GDK_GRAB_FAILED);
 
-  native = gdk_surface_get_toplevel (surface);
+  native = surface;
 
-  if (native == NULL || GDK_SURFACE_DESTROYED (native))
+  if (GDK_SURFACE_DESTROYED (native))
     return GDK_GRAB_NOT_VIEWABLE;
 
   res = GDK_DEVICE_GET_CLASS (device)->grab (device,
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index 73aef44431..a954f5daba 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -141,7 +141,6 @@ typedef union  _GdkEvent        GdkEvent;
  * @GDK_LEAVE_NOTIFY: the pointer has left the surface.
  * @GDK_FOCUS_CHANGE: the keyboard focus has entered or left the surface.
  * @GDK_CONFIGURE: the size, position or stacking order of the surface has changed.
- *   Note that GTK+ discards these events for %GDK_SURFACE_CHILD surfaces.
  * @GDK_PROXIMITY_IN: an input device has moved into contact with a sensing
  *   surface (e.g. a touchscreen or graphics tablet).
  * @GDK_PROXIMITY_OUT: an input device has moved out of contact with a sensing
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index a319bf0a78..18cb731762 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -220,7 +220,7 @@ gdk_surface_init (GdkSurface *surface)
 {
   /* 0-initialization is good for all other fields. */
 
-  surface->surface_type = GDK_SURFACE_CHILD;
+  surface->surface_type = GDK_SURFACE_TOPLEVEL;
 
   surface->state = GDK_SURFACE_STATE_WITHDRAWN;
   surface->fullscreen_mode = GDK_FULLSCREEN_ON_CURRENT_MONITOR;
@@ -702,16 +702,7 @@ gdk_surface_new (GdkDisplay    *display,
   surface->alpha = 255;
 
   if (attributes->wclass == GDK_INPUT_ONLY)
-    {
-      /* Backwards compatiblity - we've always ignored
-       * attributes->surface_type for input-only surfaces
-       * before
-       */
-      if (parent == NULL)
-        surface->surface_type = GDK_SURFACE_TEMP;
-      else
-        surface->surface_type = GDK_SURFACE_CHILD;
-    }
+    surface->surface_type = GDK_SURFACE_TEMP;
   else
     surface->surface_type = attributes->surface_type;
 
@@ -723,8 +714,6 @@ gdk_surface_new (GdkDisplay    *display,
       if (parent != NULL)
         g_warning (G_STRLOC "Toplevel surfaces must be created without a parent");
       break;
-    case GDK_SURFACE_CHILD:
-      break;
     default:
       g_warning (G_STRLOC "cannot make surfaces of type %d", surface->surface_type);
       return NULL;
@@ -894,33 +883,6 @@ gdk_surface_new_temp (GdkDisplay *display)
   return gdk_surface_new (display, NULL, &attr);
 }
 
-/**
- * gdk_surface_new_child: (constructor)
- * @parent: the parent surface
- * @position: placement of the surface inside @parent
- *
- * Creates a new client-side child surface.
- *
- * Returns: (transfer full): the new #GdkSurface
- **/
-GdkSurface *
-gdk_surface_new_child (GdkSurface          *parent,
-                       const GdkRectangle *position)
-{
-  GdkSurfaceAttr attr;
-
-  g_return_val_if_fail (GDK_IS_SURFACE (parent), NULL);
-
-  attr.wclass = GDK_INPUT_OUTPUT;
-  attr.x = position->x;
-  attr.y = position->y;
-  attr.width = position->width;
-  attr.height = position->height;
-  attr.surface_type = GDK_SURFACE_CHILD;
-
-  return gdk_surface_new (gdk_surface_get_display (parent), parent, &attr);
-}
-
 static void
 update_pointer_info_foreach (GdkDisplay           *display,
                              GdkDevice            *device,
@@ -988,7 +950,6 @@ _gdk_surface_destroy_hierarchy (GdkSurface *surface,
       break;
 
     case GDK_SURFACE_TOPLEVEL:
-    case GDK_SURFACE_CHILD:
     case GDK_SURFACE_TEMP:
       if (surface->parent)
         {
@@ -1152,22 +1113,6 @@ gdk_surface_is_destroyed (GdkSurface *surface)
   return GDK_SURFACE_DESTROYED (surface);
 }
 
-/**
- * gdk_surface_has_native:
- * @surface: a #GdkSurface
- *
- * Checks whether the surface has a native surface or not.
- *
- * Returns: %TRUE if the @surface has a native surface, %FALSE otherwise.
- */
-gboolean
-gdk_surface_has_native (GdkSurface *surface)
-{
-  g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
-
-  return surface->parent == NULL || surface->parent->impl != surface->impl;
-}
-
 /**
  * gdk_surface_get_position:
  * @surface: a #GdkSurface
@@ -1196,101 +1141,6 @@ gdk_surface_get_position (GdkSurface *surface,
     *y = surface->y;
 }
 
-/**
- * gdk_surface_get_parent:
- * @surface: a #GdkSurface
- *
- * Obtains the parent of @surface, as known to GDK. Does not query the
- * X server; thus this returns the parent as passed to gdk_surface_new(),
- * not the actual parent. This should never matter unless you’re using
- * Xlib calls mixed with GDK calls on the X11 platform. It may also
- * matter for toplevel windows, because the window manager may choose
- * to reparent them.
- *
- * Returns: (transfer none): parent of @surface
- **/
-GdkSurface*
-gdk_surface_get_parent (GdkSurface *surface)
-{
-  g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
-
-  return surface->parent;
-}
-
-/**
- * gdk_surface_get_toplevel:
- * @surface: a #GdkSurface
- *
- * Gets the toplevel surface that’s an ancestor of @surface.
- *
- * Any surface type but %GDK_SURFACE_CHILD is considered a
- * toplevel surface, as is a %GDK_SURFACE_CHILD surface that
- * has a root surface as parent.
- *
- * Returns: (transfer none): the toplevel surface containing @surface
- **/
-GdkSurface *
-gdk_surface_get_toplevel (GdkSurface *surface)
-{
-  g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
-
-  while (surface->surface_type == GDK_SURFACE_CHILD)
-    {
-      if (gdk_surface_is_toplevel (surface))
-        break;
-      surface = surface->parent;
-    }
-
-  return surface;
-}
-
-/**
- * gdk_surface_get_children:
- * @surface: a #GdkSurface
- *
- * Gets the list of children of @surface known to GDK.
- * This function only returns children created via GDK,
- * so for example it’s useless when used with the root window;
- * it only returns surfaces an application created itself.
- *
- * The returned list must be freed, but the elements in the
- * list need not be.
- *
- * Returns: (transfer container) (element-type GdkSurface):
- *     list of child surfaces inside @surface
- **/
-GList*
-gdk_surface_get_children (GdkSurface *surface)
-{
-  g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
-
-  if (GDK_SURFACE_DESTROYED (surface))
-    return NULL;
-
-  return g_list_copy (surface->children);
-}
-
-/**
- * gdk_surface_peek_children:
- * @surface: a #GdkSurface
- *
- * Like gdk_surface_get_children(), but does not copy the list of
- * children, so the list does not need to be freed.
- *
- * Returns: (transfer none) (element-type GdkSurface):
- *     a reference to the list of child surfaces in @surface
- **/
-GList *
-gdk_surface_peek_children (GdkSurface *surface)
-{
-  g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
-
-  if (GDK_SURFACE_DESTROYED (surface))
-    return NULL;
-
-  return surface->children;
-}
-
 /**
  * gdk_surface_is_visible:
  * @surface: a #GdkSurface
@@ -1621,11 +1471,7 @@ gdk_surface_remove_update_surface (GdkSurface *surface)
 static gboolean
 gdk_surface_is_toplevel_frozen (GdkSurface *surface)
 {
-  GdkSurface *toplevel;
-
-  toplevel = gdk_surface_get_toplevel (surface);
-
-  return toplevel->update_and_descendants_freeze_count > 0;
+  return surface->update_and_descendants_freeze_count > 0;
 }
 
 static void
@@ -1942,7 +1788,6 @@ void
 gdk_surface_freeze_toplevel_updates (GdkSurface *surface)
 {
   g_return_if_fail (GDK_IS_SURFACE (surface));
-  g_return_if_fail (surface->surface_type != GDK_SURFACE_CHILD);
 
   surface->update_and_descendants_freeze_count++;
   _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (surface));
@@ -1952,7 +1797,6 @@ void
 gdk_surface_thaw_toplevel_updates (GdkSurface *surface)
 {
   g_return_if_fail (GDK_IS_SURFACE (surface));
-  g_return_if_fail (surface->surface_type != GDK_SURFACE_CHILD);
   g_return_if_fail (surface->update_and_descendants_freeze_count > 0);
 
   surface->update_and_descendants_freeze_count--;
@@ -3914,8 +3758,7 @@ gdk_surface_print (GdkSurface *surface,
 #endif
     }
 
-  if (surface->surface_type != GDK_SURFACE_CHILD)
-    g_print (" %s", surface_types[surface->surface_type]);
+  g_print (" %s", surface_types[surface->surface_type]);
 
   if (surface->input_only)
     g_print (" input-only");
@@ -5053,13 +4896,9 @@ gdk_surface_set_frame_clock (GdkSurface     *surface,
 GdkFrameClock*
 gdk_surface_get_frame_clock (GdkSurface *surface)
 {
-  GdkSurface *toplevel;
-
   g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
 
-  toplevel = gdk_surface_get_toplevel (surface);
-
-  return toplevel->frame_clock;
+  return surface->frame_clock;
 }
 
 /**
@@ -5297,7 +5136,6 @@ gdk_surface_set_state (GdkSurface      *surface,
     case GDK_SURFACE_TEMP: /* ? */
       g_object_notify_by_pspec (G_OBJECT (surface), properties[PROP_STATE]);
       break;
-    case GDK_SURFACE_CHILD:
     default:
       break;
     }
diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h
index f3169b5931..39ed4a9855 100644
--- a/gdk/gdksurface.h
+++ b/gdk/gdksurface.h
@@ -42,7 +42,6 @@ typedef struct _GdkGeometry          GdkGeometry;
 /**
  * GdkSurfaceType:
  * @GDK_SURFACE_TOPLEVEL: toplevel window (used to implement #GtkWindow)
- * @GDK_SURFACE_CHILD: child surface (used to implement e.g. #GtkEntry)
  * @GDK_SURFACE_TEMP: override redirect temporary surface (used to implement #GtkMenu)
  *
  * Describes the kind of surface.
@@ -50,7 +49,6 @@ typedef struct _GdkGeometry          GdkGeometry;
 typedef enum
 {
   GDK_SURFACE_TOPLEVEL,
-  GDK_SURFACE_CHILD,
   GDK_SURFACE_TEMP
 } GdkSurfaceType;
 
@@ -444,9 +442,6 @@ GdkSurface *   gdk_surface_new_popup_full       (GdkDisplay    *display,
                                                  GdkSurface    *parent);
 GDK_AVAILABLE_IN_ALL
 GdkSurface *   gdk_surface_new_temp             (GdkDisplay    *display);
-GDK_AVAILABLE_IN_ALL
-GdkSurface *   gdk_surface_new_child            (GdkSurface     *parent,
-                                                 const GdkRectangle *position);
 
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_destroy               (GdkSurface     *surface);
@@ -544,8 +539,6 @@ GdkSurfaceState gdk_surface_get_state (GdkSurface *surface);
 
 /* GdkSurface */
 
-GDK_AVAILABLE_IN_ALL
-gboolean      gdk_surface_has_native         (GdkSurface       *surface);
 GDK_AVAILABLE_IN_ALL
 void              gdk_surface_set_type_hint (GdkSurface        *surface,
                                              GdkSurfaceTypeHint hint);
@@ -639,16 +632,6 @@ GdkSurface *   gdk_surface_get_device_position (GdkSurface      *surface,
                                                 double          *x,
                                                 double          *y,
                                                 GdkModifierType *mask);
-GDK_AVAILABLE_IN_ALL
-GdkSurface *   gdk_surface_get_parent      (GdkSurface       *surface);
-GDK_AVAILABLE_IN_ALL
-GdkSurface *   gdk_surface_get_toplevel    (GdkSurface       *surface);
-
-GDK_AVAILABLE_IN_ALL
-GList *       gdk_surface_get_children   (GdkSurface      *surface);
-GDK_AVAILABLE_IN_ALL
-GList *       gdk_surface_peek_children   (GdkSurface       *surface);
-
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_set_icon_list   (GdkSurface       *surface,
                                            GList           *surfaces);
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index 4bd50478eb..775e14ba90 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -39,7 +39,7 @@
 #define GRIP_HEIGHT 15
 #define GDK_LION_RESIZE 5
 
-#define SURFACE_IS_TOPLEVEL(window)      (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD)
+#define SURFACE_IS_TOPLEVEL(window)      TRUE
 
 /* This is the window corresponding to the key window */
 static GdkSurface   *current_keyboard_window;
diff --git a/gdk/quartz/gdksurface-quartz.c b/gdk/quartz/gdksurface-quartz.c
index 1a8e865e08..a3af7844fe 100644
--- a/gdk/quartz/gdksurface-quartz.c
+++ b/gdk/quartz/gdksurface-quartz.c
@@ -62,7 +62,7 @@ static FullscreenSavedGeometry *get_fullscreen_geometry (GdkSurface *window);
 static void update_toplevel_order (void);
 static void clear_toplevel_order  (void);
 
-#define SURFACE_IS_TOPLEVEL(window)      (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD)
+#define SURFACE_IS_TOPLEVEL(window)      TRUE
 
 /*
  * GdkQuartzSurface
@@ -827,29 +827,6 @@ _gdk_quartz_display_create_surface_impl (GdkDisplay    *display,
       }
       break;
 
-    case GDK_SURFACE_CHILD:
-      {
-       GdkSurfaceImplQuartz *parent_impl = GDK_SURFACE_IMPL_QUARTZ (window->parent->impl);
-
-       if (!window->input_only)
-         {
-           NSRect frame_rect = NSMakeRect (window->x + window->parent->abs_x,
-                                            window->y + window->parent->abs_y,
-                                            window->width,
-                                            window->height);
-       
-           impl->view = [[GdkQuartzView alloc] initWithFrame:frame_rect];
-           
-           [impl->view setGdkSurface:window];
-
-           /* GdkSurfaces should be hidden by default */
-           [impl->view setHidden:YES];
-           [parent_impl->view addSubview:impl->view];
-           [impl->view release];
-         }
-      }
-      break;
-
     default:
       g_assert_not_reached ();
     }
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 55211e8fcd..8f9ae820d1 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -49,8 +49,7 @@ enum {
 
 static guint signals[LAST_SIGNAL];
 
-#define SURFACE_IS_TOPLEVEL(surface) \
-  (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD)
+#define SURFACE_IS_TOPLEVEL(surface)  TRUE
 
 #define MAX_WL_BUFFER_SIZE (4083) /* 4096 minus header, string argument length and NUL byte */
 
@@ -585,7 +584,6 @@ _gdk_wayland_display_create_surface_impl (GdkDisplay     *display,
       gdk_surface_set_title (surface, get_default_title ());
       break;
 
-    case GDK_SURFACE_CHILD:
     default:
       break;
     }
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index 93deebb41c..0225484caa 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -499,7 +499,6 @@ RegisterGdkClass (GdkSurfaceType wtype, GdkSurfaceTypeHint wtype_hint)
         }
       break;
 
-    case GDK_SURFACE_CHILD:
     default:
       g_assert_not_reached ();
       break;
@@ -612,7 +611,6 @@ _gdk_win32_display_create_surface_impl (GdkDisplay    *display,
       break;
 
 
-    case GDK_SURFACE_CHILD:
     default:
       g_assert_not_reached ();
     }
@@ -1189,10 +1187,6 @@ gdk_win32_surface_move (GdkSurface *window,
   if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
     return;
 
-  /* Don't check GDK_SURFACE_TYPE (window) == GDK_SURFACE_CHILD.
-   * Foreign windows (another app's windows) might be children of our
-   * windows! Especially in the case of gtkplug/socket.
-   */
   if (GetAncestor (GDK_SURFACE_HWND (window), GA_PARENT) != GetDesktopWindow ())
     {
       _gdk_surface_move_resize_child (window, x, y, window->width, window->height);
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index dc0f017afd..178695686b 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -931,13 +931,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
                           xevent->xconfigure.border_width,
                           xevent->xconfigure.above,
                           xevent->xconfigure.override_redirect,
-                          !surface
-                          ? " (discarding)"
-                          : surface->surface_type == GDK_SURFACE_CHILD
-                          ? " (discarding child)"
-                          : xevent->xconfigure.event != xevent->xconfigure.window
-                          ? " (discarding substructure)"
-                          : ""));
+                          !surface ? " (discarding)" : ""));
       if (_gdk_x11_display_is_root_window (display, xevent->xconfigure.window))
         {
          _gdk_x11_screen_size_changed (x11_screen, xevent);
@@ -953,8 +947,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
 #endif
 
     if (!surface ||
-         xevent->xconfigure.event != xevent->xconfigure.window ||
-          GDK_SURFACE_TYPE (surface) == GDK_SURFACE_CHILD)
+         xevent->xconfigure.event != xevent->xconfigure.window)
        return_val = FALSE;
       else
        {
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 7e51686991..63ce6e9da7 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -870,7 +870,6 @@ _gdk_x11_display_create_surface_impl (GdkDisplay    *display,
         }
       break;
 
-    case GDK_SURFACE_CHILD:
     default:
       g_assert_not_reached ();
       break;
@@ -969,7 +968,6 @@ _gdk_x11_display_create_surface_impl (GdkDisplay    *display,
       setup_toplevel_window (surface, x11_screen);
       break;
 
-    case GDK_SURFACE_CHILD:
     default:
       break;
     }
@@ -1319,7 +1317,6 @@ gdk_surface_x11_hide (GdkSurface *surface)
       gdk_surface_x11_withdraw (surface);
       return;
       
-    case GDK_SURFACE_CHILD:
     default:
       break;
     }
@@ -1525,7 +1522,6 @@ gdk_x11_surface_move_to_current_desktop (GdkSurface *surface)
   GdkToplevelX11 *toplevel;
 
   g_return_if_fail (GDK_IS_SURFACE (surface));
-  g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
 
   toplevel = _gdk_x11_surface_get_toplevel (surface);
 
@@ -1881,8 +1877,6 @@ gdk_x11_surface_set_skip_taskbar_hint (GdkSurface *surface,
 {
   GdkToplevelX11 *toplevel;
   
-  g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
-  
   if (GDK_SURFACE_DESTROYED (surface) ||
       !SURFACE_IS_TOPLEVEL (surface))
     return;
@@ -1910,8 +1904,6 @@ gdk_x11_surface_set_skip_pager_hint (GdkSurface *surface,
 {
   GdkToplevelX11 *toplevel;
     
-  g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
-  
   if (GDK_SURFACE_DESTROYED (surface) ||
       !SURFACE_IS_TOPLEVEL (surface))
     return;
@@ -1939,8 +1931,6 @@ gdk_x11_surface_set_urgency_hint (GdkSurface *surface,
 {
   GdkToplevelX11 *toplevel;
     
-  g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
-  
   if (GDK_SURFACE_DESTROYED (surface) ||
       !SURFACE_IS_TOPLEVEL (surface))
     return;
@@ -3416,7 +3406,6 @@ gdk_x11_surface_set_group (GdkSurface *surface,
   GdkToplevelX11 *toplevel;
   
   g_return_if_fail (GDK_IS_SURFACE (surface));
-  g_return_if_fail (GDK_SURFACE_TYPE (surface) != GDK_SURFACE_CHILD);
   g_return_if_fail (leader == NULL || GDK_IS_SURFACE (leader));
 
   if (GDK_SURFACE_DESTROYED (surface) ||
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index e4e0791d59..6296ba3444 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -600,23 +600,12 @@ _gtk_gesture_cancel_all (GtkGesture *gesture)
 
 static gboolean
 gesture_within_surface (GtkGesture *gesture,
-                        GdkSurface  *parent)
+                        GdkSurface  *surface)
 {
-  GdkSurface *surface;
   GtkWidget *widget;
 
   widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
-  surface = gtk_widget_get_surface (widget);
-
-  while (surface)
-    {
-      if (surface == parent)
-        return TRUE;
-
-      surface = gdk_surface_get_parent (surface);
-    }
-
-  return FALSE;
+  return surface == gtk_widget_get_surface (widget);
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]