Merge lp:~brendan-donegan/checkbox/fix_get_pointer_error into lp:checkbox

Proposed by Brendan Donegan
Status: Merged
Merged at revision: 924
Proposed branch: lp:~brendan-donegan/checkbox/fix_get_pointer_error
Merge into: lp:checkbox
Diff against target: 12 lines (+1/-1)
1 file modified
checkbox_gtk/hyper_text_view.py (+1/-1)
To merge this branch: bzr merge lp:~brendan-donegan/checkbox/fix_get_pointer_error
Reviewer Review Type Date Requested Status
Marc Tardif (community) Approve
Review via email: mp+64378@code.launchpad.net

Description of the change

As the bug states, this change fixes what looks to be a minor problem where get_pointer is returning a tuple with too many values. Having thought about this a bit, this could actually be the root cause of a few other problems seen in Oneiric, since x and y are the values that are actually used and I think the old version may have been putting the wrong values in them.

To post a comment you must log in.
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

To aid the review process I should point out that I did check before making this change what the different elements of the tuple actually were by:

w, x, y, z = window.get_pointer()
print(w,x,y,z)

the result being: (None, 150, 280, <flags 0 of type ModifierType>)

So I'm quite sure that the 2nd and 3rd values are in fact the x and y co-ordinates.

Revision history for this message
Marc Tardif (cr3) wrote :

Looks good, thanks for the fix!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox_gtk/hyper_text_view.py'
2--- checkbox_gtk/hyper_text_view.py 2011-05-17 13:47:10 +0000
3+++ checkbox_gtk/hyper_text_view.py 2011-06-13 10:09:28 +0000
4@@ -75,7 +75,7 @@
5
6 def _motion(self, view, ev):
7 window = ev.window
8- x, y, _ = window.get_pointer()
9+ _, x, y, _ = window.get_pointer()
10 x, y = view.window_to_buffer_coords(Gtk.TextWindowType.TEXT, x, y)
11 tags = view.get_iter_at_location(x, y).get_tags()
12 for tag in tags:

Subscribers

People subscribed via source and target branches