[tomboy] [mac] Use hand cursor when hovering over links



commit 68c33b21a0054471166582616dc1e0189b2d981d
Author: Stefan Schweizer <steve schweizer gmail com>
Date:   Wed Oct 20 15:52:58 2010 +0200

    [mac] Use hand cursor when hovering over links
    
    MouseHandWatcher only changes the cursor to the hand cursor if Ctrl or
    Shift is not pressed when hovering a link. That did not work on mac
    because the modifiers obtained from GdkWindow had some modifiers set
    although none of them were actually held down. We now use the
    coordinates and modifiers from the event args.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=616317

 Tomboy/Watchers.cs |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/Tomboy/Watchers.cs b/Tomboy/Watchers.cs
index 87e040c..105205e 100644
--- a/Tomboy/Watchers.cs
+++ b/Tomboy/Watchers.cs
@@ -1010,13 +1010,6 @@ namespace Tomboy
 		[GLib.ConnectBefore]
 		void OnEditorMotion (object sender, Gtk.MotionNotifyEventArgs args)
 		{
-			int pointer_x, pointer_y;
-			Gdk.ModifierType pointer_mask;
-
-			Window.Editor.GdkWindow.GetPointer (out pointer_x,
-			                                    out pointer_y,
-			                                    out pointer_mask);
-
 			bool hovering = false;
 
 			// Figure out if we're on a link by getting the text
@@ -1025,8 +1018,8 @@ namespace Tomboy
 
 			int buffer_x, buffer_y;
 			Window.Editor.WindowToBufferCoords (Gtk.TextWindowType.Widget,
-			                                    pointer_x,
-			                                    pointer_y,
+			                                    (int)args.Event.X,
+			                                    (int)args.Event.Y,
 			                                    out buffer_x,
 			                                    out buffer_y);
 
@@ -1040,8 +1033,8 @@ namespace Tomboy
 			}
 
 			// Don't show hand if Shift or Control is pressed
-			bool avoid_hand = (pointer_mask & (Gdk.ModifierType.ShiftMask |
-			                                   Gdk.ModifierType.ControlMask)) != 0;
+			bool avoid_hand = (args.Event.State & (Gdk.ModifierType.ShiftMask |
+			                                       Gdk.ModifierType.ControlMask)) != 0;
 
 			if (hovering != hovering_on_link) {
 				hovering_on_link = hovering;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]