Commit bc4b0f28 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Set up window focus correctly when using an existing X11 window.

Thanks to Joseph Toppi for the fix!

--HG--
extra : rebase_source : be4596056669a0a9c7580355084b7f9eca345d78
parent 20181eb5
...@@ -191,6 +191,21 @@ SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created) ...@@ -191,6 +191,21 @@ SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created)
} }
} }
{
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? /* FIXME: How can I tell?
{ {
DWORD style = GetWindowLong(hwnd, GWL_STYLE); DWORD style = GetWindowLong(hwnd, GWL_STYLE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment