Package: xsane / 0.998-6

fix_preview_mouse_events.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Description: Fix mouse events handling in preview window
 Event handling was using key values as masks on mouse events, leading
 to valid mouse events being discarded in some setups.
Bug-Debian: http://bugs.debian.org/583661
Author: Reinhard F´┐Żssmeier <info@ais-sanmarino.org>

Index: xsane-0.998/src/xsane-preview.c
===================================================================
--- xsane-0.998.orig/src/xsane-preview.c	2010-11-16 21:52:39.000000000 +0100
+++ xsane-0.998/src/xsane-preview.c	2011-02-04 19:51:41.789016002 +0100
@@ -80,7 +80,6 @@
 #include "xsane-preview.h"
 #include "xsane-preferences.h"
 #include "xsane-gamma.h"
-#include <gdk/gdkkeysyms.h>
 
 
 #ifndef PATH_MAX
@@ -3023,9 +3022,9 @@
     preview_display_color_components(p, event->motion.x, event->motion.y);
 
     switch (((GdkEventMotion *)event)->state &
-            GDK_Num_Lock & GDK_Caps_Lock & GDK_Shift_Lock & GDK_Scroll_Lock) /* mask all Locks */
+	    (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) /* only check for mouse buttons */
     {
-      case 256: /* left button */
+      case GDK_BUTTON1_MASK: /* left button */
 
         DBG(DBG_info2, "left button\n");
 
@@ -3292,8 +3291,8 @@
         }
        break;
 
-      case 512: /* middle button */
-      case 1024: /* right button */
+      case GDK_BUTTON2_MASK: /* middle button */
+      case GDK_BUTTON3_MASK: /* right button */
         DBG(DBG_info2, "middle or right button\n");
 
         if (p->selection_drag)