[dia] [restructuring] inline CANVAS_EVENT_MASK ...



commit c6f76bd55a09efc8c35d6493a9399c2a7471801c
Author: Hans Breuer <hans breuer org>
Date:   Sun Aug 5 19:53:12 2012 +0200

    [restructuring] inline CANVAS_EVENT_MASK ...
    
    ... it was used in one place only. Also another
    overlooked gtk_widget_set_can_focus (()

 app/disp_callbacks.h |    7 -------
 app/interface.c      |   11 ++++++++++-
 2 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/app/disp_callbacks.h b/app/disp_callbacks.h
index 4da0c99..84c5a25 100644
--- a/app/disp_callbacks.h
+++ b/app/disp_callbacks.h
@@ -20,13 +20,6 @@
 
 #include "display.h"
 
-#define CANVAS_EVENT_MASK   \
-         GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | \
-	 GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | \
-	 GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK | \
-	 GDK_ENTER_NOTIFY_MASK | GDK_KEY_PRESS_MASK |  \
-	 GDK_KEY_RELEASE_MASK
-
 gint ddisplay_focus_in_event (GtkWidget *widget, GdkEventFocus *event,
 			      gpointer data);
 gint ddisplay_focus_out_event (GtkWidget *widget, GdkEventFocus *event,
diff --git a/app/interface.c b/app/interface.c
index 1e6d70a..ceecfad 100644
--- a/app/interface.c
+++ b/app/interface.c
@@ -353,8 +353,17 @@ create_canvas (DDisplay *ddisp)
   /* Dia's canvas does it's double buffering alone so switch off GTK's */
   gtk_widget_set_double_buffered (canvas, FALSE);
 
-  gtk_widget_set_events (canvas, CANVAS_EVENT_MASK);
+  gtk_widget_set_events (canvas,
+			 GDK_EXPOSURE_MASK | 
+			 GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
+			 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | 
+			 GDK_STRUCTURE_MASK | GDK_ENTER_NOTIFY_MASK |
+			 GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
+#if GTK_CHECK_VERSION(2,18,0)
+  gtk_widget_set_can_focus (canvas, TRUE);
+#else
   GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS);
+#endif
   g_signal_connect (G_OBJECT (canvas), "event",
                     G_CALLBACK(ddisplay_canvas_events),
                     ddisp);



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