[gtk+/wip/paint-stack-2: 3/3] gdkwindow: Remove support for VISIBILITY_NOTIFY events on child windows



commit 97d158b7d017847d094b5abc84b3c41e9ddf607d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jun 23 13:13:45 2014 -0400

    gdkwindow: Remove support for VISIBILITY_NOTIFY events on child windows
    
    The code here is particularly complicated, and we already expect that
    VISIBILITY_NOTIFY doesn't work properly under composited environments
    anyway.
    
    We don't remove the X11 codepath for handling VisbilityNotify, even if
    we probably should.
    
    Let's see if any apps complain. I seriously hope not.

 gdk/gdkinternals.h |    3 -
 gdk/gdkwindow.c    |  115 ----------------------------------------------------
 2 files changed, 0 insertions(+), 118 deletions(-)
---
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index a2c4e53..c2a038b 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -232,9 +232,6 @@ struct _GdkWindow
   guint shaped : 1;
   guint support_multidevice : 1;
   guint synthesize_crossing_event_queued : 1;
-  guint effective_visibility : 2;
-  guint visibility : 2; /* The visibility wrt the toplevel (i.e. based on clip_region) */
-  guint native_visibility : 2; /* the native visibility of a impl windows */
   guint viewable : 1; /* mapped and all parents mapped */
   guint applied_shape : 1;
   guint in_update : 1;
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 2ca81b0..da04d4d 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -131,9 +131,6 @@
  * draws over the native child window.
  */
 
-/* This adds a local value to the GdkVisibilityState enum */
-#define GDK_VISIBILITY_NOT_VIEWABLE 3
-
 enum {
   PICK_EMBEDDED_CHILD, /* only called if children are embedded */
   TO_EMBEDDER,
@@ -239,11 +236,6 @@ gdk_window_init (GdkWindow *window)
   window->width = 1;
   window->height = 1;
   window->toplevel_window_type = -1;
-  /* starts hidden */
-  window->effective_visibility = GDK_VISIBILITY_NOT_VIEWABLE;
-  window->visibility = GDK_VISIBILITY_FULLY_OBSCURED;
-  /* Default to unobscured since some backends don't send visibility events */
-  window->native_visibility = GDK_VISIBILITY_UNOBSCURED;
 
   window->device_cursor = g_hash_table_new_full (NULL, NULL,
                                                  NULL, g_object_unref);
@@ -730,64 +722,6 @@ remove_child_area (GdkWindow *window,
     }
 }
 
-static GdkVisibilityState
-effective_visibility (GdkWindow *window)
-{
-  GdkVisibilityState native;
-
-  if (!gdk_window_is_viewable (window))
-    return GDK_VISIBILITY_NOT_VIEWABLE;
-
-  native = window->impl_window->native_visibility;
-
-  if (native == GDK_VISIBILITY_FULLY_OBSCURED ||
-      window->visibility == GDK_VISIBILITY_FULLY_OBSCURED)
-    return GDK_VISIBILITY_FULLY_OBSCURED;
-  else if (native == GDK_VISIBILITY_UNOBSCURED)
-    return window->visibility;
-  else /* native PARTIAL, private partial or unobscured  */
-    return GDK_VISIBILITY_PARTIAL;
-}
-
-static void
-gdk_window_update_visibility (GdkWindow *window)
-{
-  GdkVisibilityState new_visibility;
-  GdkEvent *event;
-
-  new_visibility = effective_visibility (window);
-
-  if (new_visibility != window->effective_visibility)
-    {
-      window->effective_visibility = new_visibility;
-
-      if (new_visibility != GDK_VISIBILITY_NOT_VIEWABLE &&
-         window->event_mask & GDK_VISIBILITY_NOTIFY_MASK)
-       {
-         event = _gdk_make_event (window, GDK_VISIBILITY_NOTIFY,
-                                  NULL, FALSE);
-         event->visibility.state = new_visibility;
-       }
-    }
-}
-
-static void
-gdk_window_update_visibility_recursively (GdkWindow *window,
-                                         GdkWindow *only_for_impl)
-{
-  GdkWindow *child;
-  GList *l;
-
-  gdk_window_update_visibility (window);
-  for (l = window->children; l != NULL; l = l->next)
-    {
-      child = l->data;
-      if ((only_for_impl == NULL) ||
-         (only_for_impl == child->impl_window))
-       gdk_window_update_visibility_recursively (child, only_for_impl);
-    }
-}
-
 static gboolean
 should_apply_clip_as_shape (GdkWindow *window)
 {
@@ -937,42 +871,6 @@ recompute_visible_regions_internal (GdkWindow *private,
       private->clip_region = new_clip;
     }
 
-  if (clip_region_changed)
-    {
-      GdkVisibilityState visibility;
-      gboolean fully_visible;
-
-      if (cairo_region_is_empty (private->clip_region))
-       visibility = GDK_VISIBILITY_FULLY_OBSCURED;
-      else
-        {
-          if (private->shape)
-            {
-             fully_visible = cairo_region_equal (private->clip_region,
-                                               private->shape);
-            }
-          else
-            {
-             r.x = 0;
-             r.y = 0;
-             r.width = private->width;
-             r.height = private->height;
-             fully_visible = region_rect_equal (private->clip_region, &r);
-           }
-
-         if (fully_visible)
-           visibility = GDK_VISIBILITY_UNOBSCURED;
-         else
-           visibility = GDK_VISIBILITY_PARTIAL;
-       }
-
-      if (private->visibility != visibility)
-       {
-         private->visibility = visibility;
-         gdk_window_update_visibility (private);
-       }
-    }
-
   /* Update all children, recursively (except for root, where children are not exact). */
   if ((abs_pos_changed || clip_region_changed || recalculate_children) &&
       private->window_type != GDK_WINDOW_ROOT)
@@ -4660,9 +4558,6 @@ gdk_window_show_internal (GdkWindow *window, gboolean raise)
     {
       recompute_visible_regions (window, FALSE);
 
-      /* If any decendants became visible we need to send visibility notify */
-      gdk_window_update_visibility_recursively (window, NULL);
-
       if (gdk_window_is_viewable (window))
        {
          _gdk_synthesize_crossing_events_for_geometry_change (window);
@@ -5040,9 +4935,6 @@ gdk_window_hide (GdkWindow *window)
 
   recompute_visible_regions (window, FALSE);
 
-  /* all decendants became non-visible, we need to send visibility notify */
-  gdk_window_update_visibility_recursively (window, NULL);
-
   if (was_mapped && !gdk_window_has_impl (window))
     {
       if (window->event_mask & GDK_STRUCTURE_MASK)
@@ -8944,13 +8836,6 @@ _gdk_windowing_got_event (GdkDisplay *display,
     }
 #endif
 
-  if (event->type == GDK_VISIBILITY_NOTIFY)
-    {
-      event_window->native_visibility = event->visibility.state;
-      gdk_window_update_visibility_recursively (event_window, event_window);
-      goto out;
-    }
-
   if (!(is_button_type (event->type) ||
         is_motion_type (event->type)) ||
       event_window->window_type == GDK_WINDOW_ROOT)


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