[gtk+/wip/carlosg/event-delivery: 55/105] gtkcolorplane: Remove event window



commit 020ca69758d2005e4f7f04cc4a12a3e37bb80dfa
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Apr 2 15:29:33 2017 +0200

    gtkcolorplane: Remove event window
    
    It is not necessary anymore to receive events.

 gtk/gtkcolorplane.c |   45 ---------------------------------------------
 1 files changed, 0 insertions(+), 45 deletions(-)
---
diff --git a/gtk/gtkcolorplane.c b/gtk/gtkcolorplane.c
index 8e3f453..9c4e68a 100644
--- a/gtk/gtkcolorplane.c
+++ b/gtk/gtkcolorplane.c
@@ -33,7 +33,6 @@ struct _GtkColorPlanePrivate
   GtkAdjustment *s_adj;
   GtkAdjustment *v_adj;
 
-  GdkWindow *input_window;
   cairo_surface_t *surface;
 
   GtkGesture *drag_gesture;
@@ -187,30 +186,14 @@ plane_size_allocate (GtkWidget     *widget,
 
   GTK_WIDGET_CLASS (gtk_color_plane_parent_class)->size_allocate (widget, allocation);
 
-  if (gtk_widget_get_realized (widget))
-    gdk_window_move_resize (plane->priv->input_window,
-                            allocation->x, allocation->y,
-                            allocation->width, allocation->height);
-
   create_surface (plane);
 }
 
 static void
 plane_realize (GtkWidget *widget)
 {
-  GtkColorPlane *plane = GTK_COLOR_PLANE (widget);
-  GtkColorPlanePrivate *priv = gtk_color_plane_get_instance_private (plane);
-  GtkAllocation allocation;
-
   GTK_WIDGET_CLASS (gtk_color_plane_parent_class)->realize (widget);
 
-  gtk_widget_get_allocation (widget, &allocation);
-
-  priv->input_window = gdk_window_new_input (gtk_widget_get_window (widget),
-                                             GDK_ALL_EVENTS_MASK,
-                                             &allocation);
-  gtk_widget_register_window (widget, priv->input_window);
-
   create_surface (GTK_COLOR_PLANE (widget));
 }
 
@@ -222,36 +205,10 @@ plane_unrealize (GtkWidget *widget)
 
   g_clear_pointer (&priv->surface, cairo_surface_destroy);
 
-  gtk_widget_unregister_window (widget, priv->input_window);
-  gdk_window_destroy (priv->input_window);
-  priv->input_window = NULL;
-
   GTK_WIDGET_CLASS (gtk_color_plane_parent_class)->unrealize (widget);
 }
 
 static void
-plane_map (GtkWidget *widget)
-{
-  GtkColorPlane *plane = GTK_COLOR_PLANE (widget);
-  GtkColorPlanePrivate *priv = gtk_color_plane_get_instance_private (plane);
-
-  gdk_window_show (priv->input_window);
-
-  GTK_WIDGET_CLASS (gtk_color_plane_parent_class)->map (widget);
-}
-
-static void
-plane_unmap (GtkWidget *widget)
-{
-  GtkColorPlane *plane = GTK_COLOR_PLANE (widget);
-  GtkColorPlanePrivate *priv = gtk_color_plane_get_instance_private (plane);
-
-  GTK_WIDGET_CLASS (gtk_color_plane_parent_class)->unmap (widget);
-
-  gdk_window_hide (priv->input_window);
-}
-
-static void
 set_cross_cursor (GtkWidget *widget,
                   gboolean   enabled)
 {
@@ -559,8 +516,6 @@ gtk_color_plane_class_init (GtkColorPlaneClass *class)
   widget_class->size_allocate = plane_size_allocate;
   widget_class->realize = plane_realize;
   widget_class->unrealize = plane_unrealize;
-  widget_class->map = plane_map;
-  widget_class->unmap = plane_unmap;
   widget_class->key_press_event = plane_key_press;
 
   g_object_class_install_property (object_class,


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