diff --git a/ChangeLog b/ChangeLog index 0cfa57a..c1e4d1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2013-10-03 Frank Le Grand + + * Source/win32/WIN32Server.m + * Source/win32/WIN32Server.h + * Source/win32/win32_general.m: Fixed processing of + WM_SETCURSOR: We now mark the event has handled in our + NSCursor stack is not empty, indicating that we're in a cursor + rectangle and we don't want Windows to set the cursor. + 2013-08-18 Frank Le Grand * Source/win32/WIN32Server.m : We're now processing the Windows diff --git a/Headers/win32/WIN32Server.h b/Headers/win32/WIN32Server.h index dcae8bd..fd38693 100644 --- a/Headers/win32/WIN32Server.h +++ b/Headers/win32/WIN32Server.h @@ -186,6 +186,7 @@ typedef struct w32serverFlags - (void) decodeWM_SYSCOMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_COMMANDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; - (void) decodeWM_THEMECHANGEDParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; +- (void) decodeWM_SETCURSORParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd; @end diff --git a/Source/win32/WIN32Server.m b/Source/win32/WIN32Server.m index 5c312ea..4961e7e 100644 --- a/Source/win32/WIN32Server.m +++ b/Source/win32/WIN32Server.m @@ -1587,17 +1587,8 @@ LRESULT CALLBACK windowEnumCallback(HWND hwnd, LPARAM lParam) [self decodeWM_KILLFOCUSParams: wParam : lParam : hwnd]; break; case WM_SETCURSOR: - // This was a fix where our cursor was reset to the default arrow - // after the first mouse move after we had set it to something - // else according to a view's cursorRects. - // Unfortunately this is not enough, as it now makes the default - // cursor show when we expect a resizing cursor on a Window's - // edges (among other issues). - // if (g_cursorId) - // { - // SetCursor((HCURSOR)g_cursorId); - // flags._eventHandled = YES; - // } + if (wParam == (int)hwnd) + [self decodeWM_SETCURSORParams: wParam : lParam : hwnd]; break; case WM_QUERYOPEN: [self decodeWM_QUERYOPENParams: wParam : lParam : hwnd]; diff --git a/Source/win32/w32_general.m b/Source/win32/w32_general.m index 98b88b4..f70a34a 100644 --- a/Source/win32/w32_general.m +++ b/Source/win32/w32_general.m @@ -33,6 +33,13 @@ #include "win32/WIN32Geometry.h" #include +@interface NSCursor (NSCursor_w32_General) + ++ (NSMutableArray *) stack; + +@end + + @implementation WIN32Server (w32_General) - (void) decodeWM_CLOSEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd @@ -141,4 +148,17 @@ // Reactivate the theme when the host system changes it's theme... [[GSTheme theme] activate]; } + +- (void) decodeWM_SETCURSORParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd +{ + // Are we in a cursor rectangle? + if ([[NSCursor stack] count] > 0) + { + // if so, we've already taken care of setting our cursor, otherwise + // if we don't mark the event as handled, we'll let Windows handle it, + // e.g. to show the resizing cursors around a windows. + flags._eventHandled = YES; + } +} + @end