Merge lp:~cyphermox/pasaffe/bugfix into lp:~mdeslaur/pasaffe/trunk

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Merge reported by: Marc Deslauriers
Merged at revision: not available
Proposed branch: lp:~cyphermox/pasaffe/bugfix
Merge into: lp:~mdeslaur/pasaffe/trunk
Diff against target: 26 lines (+9/-6)
1 file modified
pasaffe/PasaffeWindow.py (+9/-6)
To merge this branch: bzr merge lp:~cyphermox/pasaffe/bugfix
Reviewer Review Type Date Requested Status
Marc Deslauriers Approve
Review via email: mp+309388@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Thanks for the patch, I fixed it in a slightly different way to be compatible with GTK < 3.20 also.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pasaffe/PasaffeWindow.py'
2--- pasaffe/PasaffeWindow.py 2016-06-12 19:43:54 +0000
3+++ pasaffe/PasaffeWindow.py 2016-10-26 20:20:16 +0000
4@@ -684,13 +684,16 @@
5 def textview_event_handler(self, textview, event):
6 loc_x, loc_y = textview.window_to_buffer_coords(
7 Gtk.TextWindowType.WIDGET, int(event.x), int(event.y))
8- itera = textview.get_iter_at_location(loc_x, loc_y)
9+ has_iter, itera = textview.get_iter_at_location(loc_x, loc_y)
10 cursor = Gdk.Cursor.new(Gdk.CursorType.XTERM)
11- for tag in itera.get_tags():
12- if tag.get_property('name') == 'url':
13- cursor = Gdk.Cursor.new(Gdk.CursorType.HAND2)
14- break
15- textview.get_window(Gtk.TextWindowType.TEXT).set_cursor(cursor)
16+ try:
17+ for tag in itera.get_tags():
18+ if tag.get_property('name') == 'url':
19+ cursor = Gdk.Cursor.new(Gdk.CursorType.HAND2)
20+ break
21+ textview.get_window(Gtk.TextWindowType.TEXT).set_cursor(cursor)
22+ except AttributeError:
23+ pass
24 return False
25
26 def open_url(self):

Subscribers

People subscribed via source and target branches