winex11.drv: Do not call user32 functions if wine_tsx11_lock is called (eterbug ...
authorAlexander Morozov <amorozov@etersoft.ru>
Thu, 12 Aug 2010 11:50:34 +0000 (15:50 +0400)
committerAlexander Morozov <amorozov@etersoft.ru>
Thu, 12 Aug 2010 11:59:41 +0000 (15:59 +0400)
dlls/winex11.drv/mouse.c

index e59cb5895cbd8c738fb5fc92502fad7d3319d2c3..d7faad57fdd7c93ccd4cabf50a89613ccff445bb 100644 (file)
@@ -854,6 +854,9 @@ BOOL CDECL X11DRV_GetCursorPos(LPPOINT pos)
     Window root, child;
     int rootX, rootY, winX, winY;
     unsigned int xstate;
+    char class[80];
+    WINDOWINFO pwi;
+    HWND hwnd;
 
     wine_tsx11_lock();
     if ((GetTickCount() - last_time_modified > 100) &&
@@ -867,19 +870,18 @@ BOOL CDECL X11DRV_GetCursorPos(LPPOINT pos)
         cursor_pos.x = winX;
         cursor_pos.y = winY;
     }
+    *pos = cursor_pos;
+    wine_tsx11_unlock();
+
     /* EterBug 1695 */
-    WINDOWINFO pwi;
-    HWND hwnd = WindowFromPoint(cursor_pos);
+    hwnd = WindowFromPoint(*pos);
     GetWindowInfo(hwnd,&pwi);
-    char class[80];
     GetClassNameA(hwnd,class,sizeof class);
     if((GetActiveWindow()==0)&&(!(strcmp(class, "V8Dockbar"))||!(strcmp(class, "V8CommandBar"))))
     {
-        cursor_pos.y=0;
+        pos->y=0;
     }
 
-    *pos = cursor_pos;
-    wine_tsx11_unlock();
     return TRUE;
 }