Improvements for last changes related with cursors on MS Windows.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38444 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
espectador 2015-04-01 05:52:29 +00:00
parent c01174c60b
commit 1a4b4de2db
2 changed files with 21 additions and 5 deletions

View file

@ -1,3 +1,15 @@
2015-03-31 Germán Arias <germanandre@gmx.es>
* 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 <germanandre@gmx.es>
* Source/win32/WIN32Server.m (-windowEventProc:, -process_mouse_event:):

View file

@ -1153,7 +1153,6 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
* the cursor.
*/
NSEvent *e;
[GSWindowWithNumber((int)hwnd) resetCursorRects];
e = [NSEvent otherEventWithType: NSAppKitDefined
location: NSMakePoint(-1,-1)
modifierFlags: 0
@ -1344,11 +1343,7 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam)
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 @@ process_mouse_event(WIN32Server *svr, HWND hwnd, WPARAM wParam, LPARAM lParam,
*/
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