fix a problem in mouse event processing

fix a problem in mouse event processing that interferes with selecting
the scan rectangle in the preview window (#624190, patch by Reinhard
Fössmeier)
This commit is contained in:
Nils Philippsen 2011-06-01 15:00:11 +02:00
parent 51cea490c1
commit 2e5190ed84
2 changed files with 70 additions and 1 deletions

View File

@ -0,0 +1,60 @@
From 81782eb74370afd321dbd394ca1aa60c01bead7f Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Wed, 1 Jun 2011 14:30:14 +0200
Subject: [PATCH] patch: preview-selection
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Squashed commit of the following:
commit 3a238ff28cf8c57d11f41624cf340d2fdbe15c83
Author: Reinhard Fössmeier <info@ais-sanmarino.org>
Date: Wed May 12 20:23:18 2010 +0200
fixed a problem in mouse event processing
Fixed a problem in mouse event processing that interfered with selecting
the scan rectangle in the preview window.
---
src/xsane-preview.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/xsane-preview.c b/src/xsane-preview.c
index f089dd1..264c775 100644
--- a/src/xsane-preview.c
+++ b/src/xsane-preview.c
@@ -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 @@ static gint preview_motion_event_handler(GtkWidget *window, GdkEvent *event, gpo
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 @@ static gint preview_motion_event_handler(GtkWidget *window, GdkEvent *event, gpo
}
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)
--
1.7.5.2

View File

@ -14,7 +14,7 @@
Name: xsane
Summary: X Window System front-end for the SANE scanner interface
Version: 0.998
Release: 3%{?dist}
Release: 4%{?dist}
Source0: http://www.xsane.org/download/%{name}-%{version}.tar.gz
# distro-specific: use "xdg-open" instead of "netscape" to launch help browser
Patch0: xsane-0.995-xdg-open.patch
@ -37,6 +37,10 @@ Patch6: xsane-0.998-desktop-file.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=693224
# submitted to upstream (Oliver Rauch) via email, 2011-04-04
Patch7: xsane-0.998-xsane_update_param-crash.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=624190
# fix from: https://bugs.launchpad.net/ubuntu/+source/xsane/+bug/370818
# submitted to upstream (Oliver Rauch) via email, 2011-06-01
Patch8: xsane-0.998-preview-selection.patch
# autoconf-generated files
Patch100: xsane-0.998-1-autoconf.patch.bz2
License: GPLv2+
@ -95,6 +99,7 @@ done
%patch5 -p1 -b .ipv6
%patch6 -p1 -b .desktop-file
%patch7 -p1 -b .xsane_update_param-crash
%patch8 -p1 -b .preview-selection.patch
%patch100 -p1 -b .autoconf
@ -165,6 +170,10 @@ fi
%{_datadir}/sane/xsane
%changelog
* Wed Jun 01 2011 Nils Philippsen <nils@redhat.com> - 0.998-4
- fix a problem in mouse event processing that interferes with selecting the
scan rectangle in the preview window (#624190, patch by Reinhard Fössmeier)
* Mon Apr 04 2011 Nils Philippsen <nils@redhat.com> - 0.998-3
- don't dereference unset xsane.preview (#693224)