Author: espectador
Date: Wed Apr 1 07:52:29 2015
New Revision: 38444
URL: http://svn.gna.org/viewcvs/gnustep?rev=38444&view=rev
Log:
Improvements for last changes related with cursors on MS Windows.
Modified:
libs/back/trunk/ChangeLog
libs/back/trunk/Source/win32/WIN32Server.m
Modified: libs/back/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/back/trunk/ChangeLog?rev=38444&r1=38443&r2=38444&view=diff
==============================================================================
--- libs/back/trunk/ChangeLog (original)
+++ libs/back/trunk/ChangeLog Wed Apr 1 07:52:29 2015
@@ -1,3 +1,15 @@
+2015-03-31 Germán Arias <[email protected]>
+
+ * Source/win32/WIN32Server.m (-windowEventProc:, -process_mouse_event:):
+ Start tracking the mouse at the first mouse movement (as suggested in
+ a note at MSDN documentation) so the window receives the WM_MOUSELEAVE
+ message when the mouse leave the client area. I don't use the message
+ WM_NCMOUSEMOVE, as suggested by Fred, because when the user moves
+ fast the mouse this messages is not generated. But we receive the
+ WM_MOUSELEAVE message no matter if the mouse move fast or not. This
+ approach make unnecessary handle the message WM_NCMOUSEMOVE. I also
+ remove a redundant line in WM_MOUSELEAVE.
+
2015-03-23 Germán Arias <[email protected]>
* Source/win32/WIN32Server.m (-windowEventProc:, -process_mouse_event:):
Modified: libs/back/trunk/Source/win32/WIN32Server.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/back/trunk/Source/win32/WIN32Server.m?rev=38444&r1=38443&r2=38444&view=diff
==============================================================================
--- libs/back/trunk/Source/win32/WIN32Server.m (original)
+++ libs/back/trunk/Source/win32/WIN32Server.m Wed Apr 1 07:52:29 2015
@@ -1153,7 +1153,6 @@
* the cursor.
*/
NSEvent *e;
- [GSWindowWithNumber((int)hwnd) resetCursorRects];
e = [NSEvent otherEventWithType: NSAppKitDefined
location: NSMakePoint(-1,-1)
modifierFlags: 0
@@ -1344,11 +1343,7 @@
NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "NCHITTEST", hwnd);
break;
case WM_NCMOUSEMOVE: //MOUSE
- /* If the user move the mouse over a nonclient area, tell GNUstep
- * that should stop handle the cursor.
- */
NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "NCMOUSEMOVE", hwnd);
- should_handle_cursor = NO;
break;
case WM_NCLBUTTONDOWN: //MOUSE
NSDebugLLog(@"NSEvent", @"Got Message %s for %d", "NCLBUTTONDOWN",
hwnd);
@@ -2786,6 +2781,15 @@
*/
should_handle_cursor = YES;
update_cursor = YES;
+
+ /* We also starts tracking the mouse, so we receive the
+ * message WM_MOUSELEAVE when the mouse leaves the client area.
+ */
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.hwndTrack = hwnd;
+ TrackMouseEvent(&tme);
/* If there are a previous cursor available (maybe a cursor that
* represent a tool) set it as the cursor. If not, set an arrow
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs