winex11.drv: Add checking to managed mode before using GetTickCount in XSetInputFocus...
authorIlya Shpigor <shpigor@etersoft.ru>
Fri, 19 Jun 2009 09:49:51 +0000 (13:49 +0400)
committerVitaly Lipatov <lav@etersoft.ru>
Wed, 15 Jul 2009 16:30:48 +0000 (20:30 +0400)
dlls/winex11.drv/window.c

index d569a0f99967f2baf90a19448c249e1609faec03..79e091abcdd3a8068ddb7b511f41a011d5ccf146 100644 (file)
@@ -2281,8 +2281,12 @@ void CDECL X11DRV_SetFocus( HWND hwnd )
 
         /* we must not use CurrentTime (ICCCM), so try to use GetTickCount instead */
         /* FIXME: this is not entirely correct */
-        XSetInputFocus( display, data->whole_window, RevertToParent,
-                        GetTickCount() - EVENT_x11_time_to_win32_time(0));
+        if (data->managed)
+            XSetInputFocus( display, data->whole_window, RevertToParent,
+                            GetTickCount() - EVENT_x11_time_to_win32_time(0));
+        else
+            XSetInputFocus( display, data->whole_window, RevertToParent,
+                            GetMessageTime() - EVENT_x11_time_to_win32_time(0));
     }
     wine_tsx11_unlock();
 }