[gtk+] gdkwindow: Remove event_mask arguments from constructors



commit ed1b6a9bed6e2cbf3b2c9767e8b4143af13d9cbe
Author: Benjamin Otte <otte redhat com>
Date:   Mon Nov 13 18:00:31 2017 +0100

    gdkwindow: Remove event_mask arguments from constructors

 gdk/gdkinternals.h                |    1 -
 gdk/gdkwindow.c                   |   12 +-----------
 gdk/gdkwindow.h                   |    3 ---
 gdk/wayland/gdkdevice-wayland.c   |    2 +-
 gdk/wayland/gdkdnd-wayland.c      |    2 +-
 gdk/wayland/gdkwaylandwindow.h    |    1 -
 gdk/wayland/gdkwindow-wayland.c   |    3 ---
 gdk/x11/gdkdnd-x11.c              |    2 +-
 gtk/gtkpopover.c                  |    2 --
 gtk/gtktreeview.c                 |    4 ----
 gtk/gtkwindow.c                   |    3 ---
 gtk/inspector/general.c           |    4 ++--
 tests/rendernode.c                |    2 +-
 testsuite/gsk/test-render-nodes.c |    2 +-
 testsuite/gtk/notify.c            |    1 -
 15 files changed, 8 insertions(+), 36 deletions(-)
---
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index f8393ee..315bae8 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -166,7 +166,6 @@ typedef enum
 
 struct _GdkWindowAttr
 {
-  gint event_mask;
   gint x, y;
   gint width;
   gint height;
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 2380aa6..efd979f 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -939,7 +939,7 @@ gdk_window_new (GdkDisplay    *display,
       return NULL;
     }
 
-  window->event_mask = attributes->event_mask | GDK_ALL_EVENTS_MASK;
+  window->event_mask = GDK_ALL_EVENTS_MASK;
 
   if (attributes->wclass == GDK_INPUT_OUTPUT)
     {
@@ -1003,7 +1003,6 @@ gdk_window_new (GdkDisplay    *display,
 /**
  * gdk_window_new_toplevel: (constructor)
  * @display: the display to create the window on
- * @event_mask: event mask (see gdk_window_set_events())
  * @width: width of new window
  * @height: height of new window
  *
@@ -1016,7 +1015,6 @@ gdk_window_new (GdkDisplay    *display,
  **/
 GdkWindow *
 gdk_window_new_toplevel (GdkDisplay *display,
-                         gint        event_mask,
                          gint        width,
                          gint        height)
 {
@@ -1024,7 +1022,6 @@ gdk_window_new_toplevel (GdkDisplay *display,
 
   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
 
-  attr.event_mask = event_mask;
   attr.wclass = GDK_INPUT_OUTPUT;
   attr.x = 0;
   attr.y = 0;
@@ -1038,7 +1035,6 @@ gdk_window_new_toplevel (GdkDisplay *display,
 /**
  * gdk_window_new_popup: (constructor)
  * @display: the display to create the window on
- * @event_mask: event mask (see gdk_window_set_events())
  * @position: position of the window on screen
  *
  * Creates a new toplevel popup window. The window will bypass window
@@ -1050,7 +1046,6 @@ gdk_window_new_toplevel (GdkDisplay *display,
  **/
 GdkWindow *
 gdk_window_new_popup (GdkDisplay         *display,
-                      gint                event_mask,
                       const GdkRectangle *position)
 {
   GdkWindowAttr attr;
@@ -1058,7 +1053,6 @@ gdk_window_new_popup (GdkDisplay         *display,
   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
   g_return_val_if_fail (position != NULL, NULL);
 
-  attr.event_mask = event_mask;
   attr.wclass = GDK_INPUT_OUTPUT;
   attr.x = position->x;
   attr.y = position->y;
@@ -1089,7 +1083,6 @@ gdk_window_new_temp (GdkDisplay *display)
 
   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
 
-  attr.event_mask = 0;
   attr.wclass = GDK_INPUT_ONLY;
   attr.x = -100;
   attr.y = -100;
@@ -1103,7 +1096,6 @@ gdk_window_new_temp (GdkDisplay *display)
 /**
  * gdk_window_new_child: (constructor)
  * @parent: the parent window
- * @event_mask: event mask (see gdk_window_set_events())
  * @position: placement of the window inside @parent
  *
  * Creates a new client-side child window.
@@ -1114,14 +1106,12 @@ gdk_window_new_temp (GdkDisplay *display)
  **/
 GdkWindow *
 gdk_window_new_child (GdkWindow          *parent,
-                      gint                event_mask,
                       const GdkRectangle *position)
 {
   GdkWindowAttr attr;
 
   g_return_val_if_fail (GDK_IS_WINDOW (parent), NULL);
 
-  attr.event_mask = event_mask;
   attr.wclass = GDK_INPUT_OUTPUT;
   attr.x = position->x;
   attr.y = position->y;
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 0769a6f..a9fbb67 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -401,18 +401,15 @@ GDK_AVAILABLE_IN_ALL
 GType         gdk_window_get_type              (void) G_GNUC_CONST;
 GDK_AVAILABLE_IN_3_90
 GdkWindow *   gdk_window_new_toplevel          (GdkDisplay    *display,
-                                                gint           event_mask,
                                                 int            width,
                                                 int            height);
 GDK_AVAILABLE_IN_3_90
 GdkWindow *   gdk_window_new_popup             (GdkDisplay    *display,
-                                                gint           event_mask,
                                                 const GdkRectangle *position);
 GDK_AVAILABLE_IN_3_90
 GdkWindow *   gdk_window_new_temp              (GdkDisplay    *display);
 GDK_AVAILABLE_IN_3_90
 GdkWindow *   gdk_window_new_child             (GdkWindow     *parent,
-                                                gint           event_mask,
                                                 const GdkRectangle *position);
 
 GDK_AVAILABLE_IN_ALL
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index d5ac46e..cf3ea74 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -4569,7 +4569,7 @@ static const struct wl_surface_listener pointer_surface_listener = {
 static GdkWindow *
 create_foreign_dnd_window (GdkDisplay *display)
 {
-  return gdk_window_new_popup (display, 0, &(GdkRectangle) { 0, 0, 1, 1 });
+  return gdk_window_new_popup (display, &(GdkRectangle) { 0, 0, 1, 1 });
 }
 
 static void
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index 16b8f82..8e9daa4 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -501,7 +501,7 @@ create_dnd_window (GdkDisplay *display)
 {
   GdkWindow *window;
 
-  window = gdk_window_new_popup (display, 0, &(GdkRectangle) { 0, 0, 100, 100 });
+  window = gdk_window_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
 
   gdk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DND);
   
diff --git a/gdk/wayland/gdkwaylandwindow.h b/gdk/wayland/gdkwaylandwindow.h
index 61c52da..f74d82f 100644
--- a/gdk/wayland/gdkwaylandwindow.h
+++ b/gdk/wayland/gdkwaylandwindow.h
@@ -47,7 +47,6 @@ GType                    gdk_wayland_window_get_type             (void);
 
 GDK_AVAILABLE_IN_3_90
 GdkWindow *              gdk_wayland_window_new_subsurface       (GdkDisplay            *display,
-                                                                  int                    event_mask,
                                                                   const GdkRectangle    *position);
 GDK_AVAILABLE_IN_ALL
 struct wl_surface       *gdk_wayland_window_get_wl_surface       (GdkWindow *window);
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 3231534..b07f0f8 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -3721,7 +3721,6 @@ _gdk_wayland_window_set_grab_seat (GdkWindow *window,
 /**
  * gdk_wayland_window_new_subsurface: (constructor)
  * @display: the display to create the window on
- * @event_mask: event mask (see gdk_window_set_events())
  * @position: position relative to the transient window
  *
  * Creates a new subsurface window.
@@ -3732,7 +3731,6 @@ _gdk_wayland_window_set_grab_seat (GdkWindow *window,
  **/
 GdkWindow *
 gdk_wayland_window_new_subsurface (GdkDisplay         *display,
-                                   int                 event_mask,
                                    const GdkRectangle *position)
 {
   GdkWindowAttr attr;
@@ -3740,7 +3738,6 @@ gdk_wayland_window_new_subsurface (GdkDisplay         *display,
   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
   g_return_val_if_fail (position != NULL, NULL);
 
-  attr.event_mask = event_mask;
   attr.wclass = GDK_INPUT_OUTPUT;
   attr.x = position->x;
   attr.y = position->y;
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index fc6ea69..dad2c23 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -1987,7 +1987,7 @@ create_drag_window (GdkDisplay *display)
 {
   GdkWindow *window;
 
-  window = gdk_window_new_popup (display, 0, &(GdkRectangle) { 0, 0, 100, 100 });
+  window = gdk_window_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
 
   gdk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DND);
   
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index fb47a7b..a49114c 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -487,7 +487,6 @@ gtk_popover_realize (GtkWidget *widget)
       g_assert (GTK_IS_WINDOW (toplevel));
 
       window = gdk_wayland_window_new_subsurface (gtk_widget_get_display (toplevel),
-                                                  GDK_ALL_EVENTS_MASK,
                                                   &allocation);
 
       gdk_window_set_transient_for (window,
@@ -497,7 +496,6 @@ gtk_popover_realize (GtkWidget *widget)
 #endif
     {
       window = gdk_window_new_child (gtk_widget_get_parent_window (widget),
-                                     GDK_ALL_EVENTS_MASK,
                                      &allocation);
     }
 
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 635ee91..e0d68b8 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -3656,7 +3656,6 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
          width = drag_allocation.width;
          height = drag_allocation.height;
          tree_view->priv->drag_highlight_window = gdk_window_new_child (gtk_widget_get_window (widget),
-                                                                         GDK_POINTER_MOTION_MASK,
                                                                          &(GdkRectangle){
                                                                            tree_view->priv->drag_column_x,
                                                                            0,
@@ -3706,7 +3705,6 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
            }
 
          tree_view->priv->drag_highlight_window = gdk_window_new_popup (gtk_widget_get_display (widget),
-                                                                         GDK_POINTER_MOTION_MASK,
                                                                          &(GdkRectangle) { x, y, width, 
height });
          gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
 
@@ -3777,7 +3775,6 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
            }
 
          tree_view->priv->drag_highlight_window = gdk_window_new_popup (gtk_widget_get_display (widget),
-                                                                         GDK_POINTER_MOTION_MASK,
                                                                          &(GdkRectangle) { x, y, width, 
height });
          gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
 
@@ -9630,7 +9627,6 @@ _gtk_tree_view_column_start_drag (GtkTreeView       *tree_view,
   button_allocation.y = 0;
 
   tree_view->priv->drag_window = gdk_window_new_child (gtk_widget_get_window (GTK_WIDGET (tree_view)),
-                                                       GDK_POINTER_MOTION_MASK,
                                                        &button_allocation);
   gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_window);
 
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index d012434..5b19d75 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6798,7 +6798,6 @@ gtk_window_realize (GtkWidget *widget)
         {
         case GTK_WINDOW_TOPLEVEL:
           gdk_window = gdk_window_new_toplevel (gtk_widget_get_display (widget),
-                                                GDK_ALL_EVENTS_MASK,
                                                 allocation.width,
                                                 allocation.height);
           break;
@@ -6808,14 +6807,12 @@ gtk_window_realize (GtkWidget *widget)
               GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (widget)))
             {
               gdk_window = gdk_wayland_window_new_subsurface (gtk_widget_get_display (widget),
-                                                              GDK_ALL_EVENTS_MASK,
                                                               &allocation);
             }
           else
 #endif
             {
               gdk_window = gdk_window_new_popup (gtk_widget_get_display (widget),
-                                                 GDK_ALL_EVENTS_MASK,
                                                  &allocation);
             }
           break;
diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c
index 54d2e57..cf97a6f 100644
--- a/gtk/inspector/general.c
+++ b/gtk/inspector/general.c
@@ -128,7 +128,7 @@ init_version (GtkInspectorGeneral *gen)
 #endif
     backend = "Unknown";
 
-  window = gdk_window_new_toplevel (display, 0, 10, 10);
+  window = gdk_window_new_toplevel (display, 10, 10);
   gsk_renderer = gsk_renderer_new_for_window (window);
   if (strcmp (G_OBJECT_TYPE_NAME (gsk_renderer), "GskVulkanRenderer") == 0)
     renderer = "Vulkan";
@@ -388,7 +388,7 @@ init_vulkan (GtkInspectorGeneral *gen)
   GdkVulkanContext *context;
   GdkDisplay *display = gdk_display_get_default ();
 
-  window = gdk_window_new_toplevel (display, 0, 10, 10);
+  window = gdk_window_new_toplevel (display, 10, 10);
   context = gdk_window_create_vulkan_context (window, NULL);
   gdk_window_destroy (window);
 
diff --git a/tests/rendernode.c b/tests/rendernode.c
index 3a6d1a4..b1e6467 100644
--- a/tests/rendernode.c
+++ b/tests/rendernode.c
@@ -117,7 +117,7 @@ main(int argc, char **argv)
       GdkWindow *window;
       GdkTexture *texture = NULL;
 
-      window = gdk_window_new_toplevel (gdk_display_get_default(), 0, 10 , 10);
+      window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10);
       renderer = gsk_renderer_new_for_window (window);
 
       for (run = 0; run < runs; run++)
diff --git a/testsuite/gsk/test-render-nodes.c b/testsuite/gsk/test-render-nodes.c
index 447b19a..0d3990c 100644
--- a/testsuite/gsk/test-render-nodes.c
+++ b/testsuite/gsk/test-render-nodes.c
@@ -549,7 +549,7 @@ load_node_file (GFile *file, gboolean generate)
       return;
     }
 
-  window = gdk_window_new_toplevel (gdk_display_get_default(), 0, 10 , 10);
+  window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10);
   renderer = gsk_renderer_new_for_window (window);
   texture = gsk_renderer_render_texture (renderer, node, NULL);
 
diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c
index 04b6739..2d5708d 100644
--- a/testsuite/gtk/notify.c
+++ b/testsuite/gtk/notify.c
@@ -403,7 +403,6 @@ test_type (gconstpointer data)
   else if (g_type_is_a (type, GDK_TYPE_WINDOW))
     {
       instance = g_object_ref (gdk_window_new_popup (gdk_display_get_default (),
-                                                     0,
                                                      &(GdkRectangle) { 0, 0, 100, 100 }));
     }
   else if (g_str_equal (g_type_name (type), "GdkX11Cursor"))


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