Merge lp:~jpakkane/libgrip/unsubscribe-fix into lp:libgrip

Proposed by Jussi Pakkanen
Status: Merged
Merged at revision: 59
Proposed branch: lp:~jpakkane/libgrip/unsubscribe-fix
Merge into: lp:libgrip
Diff against target: 33 lines (+10/-6)
1 file modified
src/gripgesturemanager.c (+10/-6)
To merge this branch: bzr merge lp:~jpakkane/libgrip/unsubscribe-fix
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Review via email: mp+73781@code.launchpad.net

Description of the change

When subscribing to new gestures, libgrip unsubscribes every device type but only resubscribes the specified gesture types.

This patch fixes the issue by only unsubscribing those gesture types that will get resubscribed.

To post a comment you must log in.
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Is the stray additional line supposed to be there? If it's a random cleanup that was just folded into the commit, then that's fine, but if it's accidental it should be fixed before merging.

I'm going to assume that it's intentional and give approval. It looks like a good fix for an obvious bug in hindsight :).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/gripgesturemanager.c'
2--- src/gripgesturemanager.c 2011-08-10 00:18:08 +0000
3+++ src/gripgesturemanager.c 2011-09-02 10:43:42 +0000
4@@ -1209,12 +1209,15 @@
5 }
6 else
7 {
8- geis_unsubscribe (registrations->touchscreen->instance,
9- (GeisGestureType*)registrations->touchscreen->gesture_list->pdata);
10- geis_unsubscribe (registrations->touchpad->instance,
11- (GeisGestureType*)registrations->touchpad->gesture_list->pdata);
12- geis_unsubscribe (registrations->independent->instance,
13- (GeisGestureType*)registrations->independent->gesture_list->pdata);
14+ if (device_type & GRIP_DEVICE_TOUCHSCREEN)
15+ geis_unsubscribe (registrations->touchscreen->instance,
16+ (GeisGestureType*)registrations->touchscreen->gesture_list->pdata);
17+ if (device_type & GRIP_DEVICE_TOUCHPAD)
18+ geis_unsubscribe (registrations->touchpad->instance,
19+ (GeisGestureType*)registrations->touchpad->gesture_list->pdata);
20+ if (device_type & GRIP_DEVICE_INDEPENDENT)
21+ geis_unsubscribe (registrations->independent->instance,
22+ (GeisGestureType*)registrations->independent->gesture_list->pdata);
23 }
24
25 if (device_type & GRIP_DEVICE_TOUCHSCREEN)
26@@ -1226,6 +1229,7 @@
27 bind_registration(manager,
28 registrations->touchpad, widget, gesture_type, GRIP_DEVICE_TOUCHPAD, touch_points,
29 callback, user_data, destroy);
30+
31 if (device_type & GRIP_DEVICE_INDEPENDENT)
32 bind_registration(manager,
33 registrations->independent, widget, gesture_type, GRIP_DEVICE_INDEPENDENT, touch_points,

Subscribers

People subscribed via source and target branches