src/video/x11/SDL_x11window.c
changeset 6024 38e2f4644548
parent 6023 6279958d571d
child 6045 b8e995dab018
--- a/src/video/x11/SDL_x11window.c	Sat Oct 22 02:13:35 2011 -0400
+++ b/src/video/x11/SDL_x11window.c	Sat Oct 22 02:14:57 2011 -0400
@@ -191,6 +191,21 @@
         }
     }
 
+    {
+        Window FocalWindow;
+        int RevertTo=0;
+        XGetInputFocus(data->videodata->display, &FocalWindow, &RevertTo);
+        if (FocalWindow==w)
+        {
+            window->flags |= SDL_WINDOW_INPUT_FOCUS;
+            SDL_SetKeyboardFocus(data->window);
+        }
+
+        if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
+            /* Tell x11 to clip mouse */
+        }
+    }
+
     /* FIXME: How can I tell?
        {
        DWORD style = GetWindowLong(hwnd, GWL_STYLE);