[goocanvas] gtk4: Don't use removed gtk_widget_set/get_events().



commit 15c44e827bbe450fb1788d241d7d114e2e39da5d
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon May 29 18:30:58 2017 +0200

    gtk4: Don't use removed gtk_widget_set/get_events().

 demo/demo-grabs.c    |   34 ----------------------------------
 demo/mv-demo-grabs.c |   35 -----------------------------------
 src/goocanvas.c      |    3 +--
 3 files changed, 1 insertions(+), 71 deletions(-)
---
diff --git a/demo/demo-grabs.c b/demo/demo-grabs.c
index d62e374..939b059 100644
--- a/demo/demo-grabs.c
+++ b/demo/demo-grabs.c
@@ -233,17 +233,6 @@ create_fixed (GtkGrid *grid, gint row, gchar *text, gchar *id)
 
   fixed = gtk_fixed_new ();
   gtk_widget_set_has_window (fixed, TRUE);
-  gtk_widget_set_events (fixed,
-                        GDK_EXPOSURE_MASK
-                        | GDK_BUTTON_PRESS_MASK
-                        | GDK_BUTTON_RELEASE_MASK
-                        | GDK_POINTER_MOTION_MASK
-                        | GDK_POINTER_MOTION_HINT_MASK
-                        | GDK_KEY_PRESS_MASK
-                        | GDK_KEY_RELEASE_MASK
-                        | GDK_ENTER_NOTIFY_MASK
-                        | GDK_LEAVE_NOTIFY_MASK
-                        | GDK_FOCUS_CHANGE_MASK);
   gtk_widget_set_size_request (fixed, 200, 100);
   gtk_grid_attach (GTK_GRID (grid), fixed, 1, row, 1, 1);
   g_object_set (fixed, "expand", FALSE, NULL);
@@ -266,17 +255,6 @@ create_fixed (GtkGrid *grid, gint row, gchar *text, gchar *id)
 
 
   drawing_area = gtk_drawing_area_new ();
-  gtk_widget_set_events (drawing_area,
-                        GDK_EXPOSURE_MASK
-                        | GDK_BUTTON_PRESS_MASK
-                        | GDK_BUTTON_RELEASE_MASK
-                        | GDK_POINTER_MOTION_MASK
-                        | GDK_POINTER_MOTION_HINT_MASK
-                        | GDK_KEY_PRESS_MASK
-                        | GDK_KEY_RELEASE_MASK
-                        | GDK_ENTER_NOTIFY_MASK
-                        | GDK_LEAVE_NOTIFY_MASK
-                        | GDK_FOCUS_CHANGE_MASK);
 
   gtk_widget_set_size_request (drawing_area, 60, 60);
   gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 20, 20);
@@ -299,18 +277,6 @@ create_fixed (GtkGrid *grid, gint row, gchar *text, gchar *id)
 
 
   drawing_area = gtk_drawing_area_new ();
-  gtk_widget_set_events (drawing_area,
-                        GDK_EXPOSURE_MASK
-                        | GDK_BUTTON_PRESS_MASK
-                        | GDK_BUTTON_RELEASE_MASK
-                        | GDK_POINTER_MOTION_MASK
-                        | GDK_POINTER_MOTION_HINT_MASK
-                        | GDK_KEY_PRESS_MASK
-                        | GDK_KEY_RELEASE_MASK
-                        | GDK_ENTER_NOTIFY_MASK
-                        | GDK_LEAVE_NOTIFY_MASK
-                        | GDK_FOCUS_CHANGE_MASK);
-
   gtk_widget_set_size_request (drawing_area, 60, 60);
   gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 120, 20);
   gtk_widget_show (drawing_area);
diff --git a/demo/mv-demo-grabs.c b/demo/mv-demo-grabs.c
index 4a39953..10a787b 100644
--- a/demo/mv-demo-grabs.c
+++ b/demo/mv-demo-grabs.c
@@ -238,17 +238,6 @@ create_fixed (GtkGrid *grid, gint row, gchar *text, gchar *id)
 
   fixed = gtk_fixed_new ();
   gtk_widget_set_has_window (fixed, TRUE);
-  gtk_widget_set_events (fixed,
-                        GDK_EXPOSURE_MASK
-                        | GDK_BUTTON_PRESS_MASK
-                        | GDK_BUTTON_RELEASE_MASK
-                        | GDK_POINTER_MOTION_MASK
-                        | GDK_POINTER_MOTION_HINT_MASK
-                        | GDK_KEY_PRESS_MASK
-                        | GDK_KEY_RELEASE_MASK
-                        | GDK_ENTER_NOTIFY_MASK
-                        | GDK_LEAVE_NOTIFY_MASK
-                        | GDK_FOCUS_CHANGE_MASK);
   gtk_widget_set_size_request (fixed, 200, 100);
   gtk_grid_attach (GTK_GRID (grid), fixed, 1, row, 1, 1);
   gtk_widget_show (fixed);
@@ -270,18 +259,6 @@ create_fixed (GtkGrid *grid, gint row, gchar *text, gchar *id)
 
 
   drawing_area = gtk_drawing_area_new ();
-  gtk_widget_set_events (drawing_area,
-                        GDK_EXPOSURE_MASK
-                        | GDK_BUTTON_PRESS_MASK
-                        | GDK_BUTTON_RELEASE_MASK
-                        | GDK_POINTER_MOTION_MASK
-                        | GDK_POINTER_MOTION_HINT_MASK
-                        | GDK_KEY_PRESS_MASK
-                        | GDK_KEY_RELEASE_MASK
-                        | GDK_ENTER_NOTIFY_MASK
-                        | GDK_LEAVE_NOTIFY_MASK
-                        | GDK_FOCUS_CHANGE_MASK);
-                        
   gtk_widget_set_size_request (drawing_area, 60, 60);
   gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 20, 20);
   gtk_widget_show (drawing_area);
@@ -303,18 +280,6 @@ create_fixed (GtkGrid *grid, gint row, gchar *text, gchar *id)
 
 
   drawing_area = gtk_drawing_area_new ();
-  gtk_widget_set_events (drawing_area,
-                        GDK_EXPOSURE_MASK
-                        | GDK_BUTTON_PRESS_MASK
-                        | GDK_BUTTON_RELEASE_MASK
-                        | GDK_POINTER_MOTION_MASK
-                        | GDK_POINTER_MOTION_HINT_MASK
-                        | GDK_KEY_PRESS_MASK
-                        | GDK_KEY_RELEASE_MASK
-                        | GDK_ENTER_NOTIFY_MASK
-                        | GDK_LEAVE_NOTIFY_MASK
-                        | GDK_FOCUS_CHANGE_MASK);
-                        
   gtk_widget_set_size_request (drawing_area, 60, 60);
   gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 120, 20);
   gtk_widget_show (drawing_area);
diff --git a/src/goocanvas.c b/src/goocanvas.c
index f7a5b46..5c25fb0 100644
--- a/src/goocanvas.c
+++ b/src/goocanvas.c
@@ -1530,8 +1530,7 @@ goo_canvas_realize (GtkWidget *widget)
                         | GDK_KEY_RELEASE_MASK
                         | GDK_ENTER_NOTIFY_MASK
                         | GDK_LEAVE_NOTIFY_MASK
-                        | GDK_FOCUS_CHANGE_MASK
-                         | gtk_widget_get_events (widget);
+                        | GDK_FOCUS_CHANGE_MASK;
 
   priv->window_x = priv->static_window_x = allocation.x;
   priv->window_y = priv->static_window_y = allocation.y;


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