GNOME Bugzilla – Bug 414029
Hyperlinks cannot be dragged with mouse
Last modified: 2009-10-04 00:48:03 UTC
Hyperlinks should be activated on button release, not on button press. This makes dragging hyperlinked text impossible.
This is an exact dupe of bug #157241. Does anyone know if GtkTextView still has no URL support? I don't want to mark it as a dupe if it can actually be fixed now.
Setting the default assignee and QA Contact to "tomboy-maint@gnome.bugs".
Created attachment 121295 [details] [review] Activate links on button release I changed the event from ButtonPress to ButtonRelease. It seems to work except for a problem with evolution links: when I activate an email link, the message opens but the cursor keeps selecting text although no button is pressed. I guess that happens because the event handler returns true now for the release event and the event is not propagated further. Can we safely return false from this method all the time?
Created attachment 134103 [details] [review] Allow dragging of hyperlinks with the mouse I tried to finish this. The patch changes the event type from ButtonPress to ButtonRelease, all links in Tomboy are now opened when the mouse button is released. To solve the selection problem, the handler now always returns false. Another effect of changing the event type was that links could no longer be activated with the middle button because the current selection was inserted into the link. That is why the ButtonPress event is still handled for such cases. Please test this patch extensively.
Confirming, let's look at this for 0.15.1.
I just found a problem with my patch: when middle-click-pasting a link to a note, the link is opened immediatley.
Do we have to do something like saving and checking against the last link that received a ButtonPress with button 1? Or is it simpler than that...do we just need to check for the right button on ButtonRelease?
bug #469088 seems to be a duplicate of this one.
*** Bug 469088 has been marked as a duplicate of this bug. ***
Okay, let's just make sure we cover all links and not just web/file links in this bug.
Created attachment 134553 [details] [review] Fix middle-click pasting of links Now links are only activated if there was a preceding ButtonPress event. Both patches have to be applied when testing this.
This seems to work really well for me. The only thing I noticed is that when I drag a bugzilla link, I lose the icon. I've pushed these two commits...let's fix the bugzilla thing and whatever else comes up.
Same with evolution mail icons. I think this is a general problem with links that include icons, there is also a bug report about copy/paste: bug #500927.
Okay, please confirm and update bug #500927. Closing this bug as fixed. Thanks!