Author: amunjal
Date: Tue Mar  8 17:27:48 2016
New Revision: 39481

URL: http://svn.gna.org/viewcvs/gnustep?rev=39481&view=rev
Log:
fix for issue #8544

Modified:
    libs/back/branches/gnustep_testplant_branch/Headers/win32/WIN32Server.h
    libs/back/branches/gnustep_testplant_branch/Source/win32/WIN32Server.m

Modified: 
libs/back/branches/gnustep_testplant_branch/Headers/win32/WIN32Server.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/back/branches/gnustep_testplant_branch/Headers/win32/WIN32Server.h?rev=39481&r1=39480&r2=39481&view=diff
==============================================================================
--- libs/back/branches/gnustep_testplant_branch/Headers/win32/WIN32Server.h     
(original)
+++ libs/back/branches/gnustep_testplant_branch/Headers/win32/WIN32Server.h     
Tue Mar  8 17:27:48 2016
@@ -96,6 +96,7 @@
   HICON  currentAppIcon;
   NSMutableArray *monitorInfo;
   NSMutableDictionary *systemCursors;
+  NSMutableArray *listOfCursorsFailed;
 }
 
 - (BOOL) handlesWindowDecorations;

Modified: libs/back/branches/gnustep_testplant_branch/Source/win32/WIN32Server.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/back/branches/gnustep_testplant_branch/Source/win32/WIN32Server.m?rev=39481&r1=39480&r2=39481&view=diff
==============================================================================
--- libs/back/branches/gnustep_testplant_branch/Source/win32/WIN32Server.m      
(original)
+++ libs/back/branches/gnustep_testplant_branch/Source/win32/WIN32Server.m      
Tue Mar  8 17:27:48 2016
@@ -676,6 +676,7 @@
 
       systemCursors = RETAIN([NSMutableDictionary dictionary]);
       monitorInfo   = RETAIN([NSMutableArray array]);
+         listOfCursorsFailed = RETAIN([NSMutableArray array]);
 
       [self _resetMonitors];
       [self setupRunLoopInputSourcesForMode: NSDefaultRunLoopMode]; 
@@ -744,6 +745,7 @@
     }
   }
   RELEASE(systemCursors);
+  RELEASE(listOfCursorsFailed);
   [super dealloc];
 }
 
@@ -2782,12 +2784,29 @@
          CURSORINFO cursorInfo;
          cursorInfo.cbSize = sizeof(CURSORINFO); 
          if (!GetCursorInfo(&cursorInfo)) {
-               NSLog(@"GetCursorInfo failed with %d", GetLastError());
-        return NSZeroPoint;
+         
+               if ([NSCursor currentCursor]) {
+                       BOOL cursorFound = FALSE;
+                       NSImage *cursorImage = [[NSCursor currentCursor] image];
+                       
+                       // has the cursor already failed?
+                       for (NSImage *item in listOfCursorsFailed) {
+                               if (cursorImage == item) {
+                                       cursorFound = TRUE;
+                                       break;
+                               }
+                       }
+                       
+                       // log this cursor fail entry to avoid multiple logs
+                       if (!cursorFound) {
+                               [listOfCursorsFailed addObject:cursorImage];
+                               NSLog(@"GetCursorInfo failed with %d", 
GetLastError());
+                       }
+               }
+               return NSZeroPoint;
       }
          p = cursorInfo.ptScreenPos;
     }
-
   return MSScreenPointToGS(p.x, p.y);
 }
 


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to