On Sun, Feb 07, 2010 at 08:55:25PM -0600, Chris Bagwell wrote: > Attached is small patch to fix zoom gesture crashes in xf86-input-wacom > driver. > > Chris
> From 2cf2225651a90b5c6478e45b5901013547741a9e Mon Sep 17 00:00:00 2001 > From: Chris Bagwell <[email protected]> > Date: Sun, 7 Feb 2010 20:49:55 -0600 > Subject: [PATCH] Fix zoom gesture crash. Make emitKeysym public. > > emitKeysym is used by multiple files so can't be static. Made > public and renamed to wcmEmitKeysym to better prevent symbol > name conflicts. This also fixes a crash with zoom gestures. > > Signed-off-by: Chris Bagwell <[email protected]> applied, thank you. Cheers, Peter > --- > src/wcmCommon.c | 13 +++++++------ > src/wcmTouchFilter.c | 14 +++++++------- > 2 files changed, 14 insertions(+), 13 deletions(-) > > diff --git a/src/wcmCommon.c b/src/wcmCommon.c > index b132954..f8cf87b 100644 > --- a/src/wcmCommon.c > +++ b/src/wcmCommon.c > @@ -25,6 +25,7 @@ > #include "Xwacom.h" > #include <xkbsrv.h> > > +void wcmEmitKeysym(DeviceIntPtr keydev, int keysym, int state); > void wcmInitialScreens(LocalDevicePtr local); > void wcmRotateTablet(LocalDevicePtr local, int value); > void wcmRotateCoordinates(LocalDevicePtr local, int* x, int* y); > @@ -303,7 +304,7 @@ static void wcmSendButtons(LocalDevicePtr local, int > buttons, int rx, int ry, > } > > > /***************************************************************************** > - * emitKeysym -- > + * wcmEmitKeysym -- > * Emit a keydown/keyup event > > ****************************************************************************/ > static int ODDKEYSYM [][2] = > @@ -332,7 +333,7 @@ static int ODDKEYSYM [][2] = > { 0, 0} > }; > > -static void emitKeysym (DeviceIntPtr keydev, int keysym, int state) > +void wcmEmitKeysym (DeviceIntPtr keydev, int keysym, int state) > { > int i, j, alt_keysym = 0; > > @@ -499,7 +500,7 @@ static void sendAButton(LocalDevicePtr local, int button, > int mask, > { > int key_sym = (action & AC_CODE); > int is_press = (action & > AC_KEYBTNPRESS); > - emitKeysym(local->dev, key_sym, > is_press); > + wcmEmitKeysym(local->dev, key_sym, > is_press); > } > break; > case AC_MODETOGGLE: > @@ -558,7 +559,7 @@ static void sendAButton(LocalDevicePtr local, int button, > int mask, > > if (countPresses(key_sym, > &priv->keys[button][i], > > ARRAY_SIZE(priv->keys[button]) - i)) > - emitKeysym(local->dev, key_sym, > 0); > + wcmEmitKeysym(local->dev, > key_sym, 0); > } > } > > @@ -684,8 +685,8 @@ static void sendWheelStripEvents(LocalDevicePtr local, > const WacomDeviceState* d > break; > > case AC_KEY: > - emitKeysym(local->dev, (fakeButton & AC_CODE), 1); > - emitKeysym(local->dev, (fakeButton & AC_CODE), 0); > + wcmEmitKeysym(local->dev, (fakeButton & AC_CODE), 1); > + wcmEmitKeysym(local->dev, (fakeButton & AC_CODE), 0); > break; > > default: > diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c > index b91b14a..9d4a4e8 100644 > --- a/src/wcmTouchFilter.c > +++ b/src/wcmTouchFilter.c > @@ -45,7 +45,7 @@ > void wcmFingerTapToClick(WacomCommonPtr common); > > extern void wcmRotateCoordinates(LocalDevicePtr local, int* x, int* y); > -extern void emitKeysym (DeviceIntPtr keydev, int keysym, int state); > +extern void wcmEmitKeysym(DeviceIntPtr keydev, int keysym, int state); > > static void wcmFingerScroll(WacomDevicePtr priv); > static void wcmFingerZoom(WacomDevicePtr priv); > @@ -401,19 +401,19 @@ static void wcmFingerZoom(WacomDevicePtr priv) > for (i=0; i<(int)(((double)abs(dist)/ > (double)WACOM_MOTION_IN_POINT) + 0.5); i++) > { > - emitKeysym (priv->local->dev, XK_Control_L, 1); > + wcmEmitKeysym (priv->local->dev, XK_Control_L, 1); > /* zooming in */ > if (dist > 0) > { > - emitKeysym (priv->local->dev, XK_plus, 1); > - emitKeysym (priv->local->dev, XK_plus, 0); > + wcmEmitKeysym (priv->local->dev, XK_plus, 1); > + wcmEmitKeysym (priv->local->dev, XK_plus, 0); > } > else /* zooming out */ > { > - emitKeysym (priv->local->dev, XK_minus, 1); > - emitKeysym (priv->local->dev, XK_minus, 0); > + wcmEmitKeysym (priv->local->dev, XK_minus, 1); > + wcmEmitKeysym (priv->local->dev, XK_minus, 0); > } > - emitKeysym (priv->local->dev, XK_Control_L, 0); > + wcmEmitKeysym (priv->local->dev, XK_Control_L, 0); > } > > /* reset initial states */ > -- > 1.6.6 > ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Linuxwacom-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
