mirror of
https://github.com/yawut/SDL.git
synced 2026-08-20 07:44:03 -05:00
Set up window focus correctly when using an existing X11 window.
Thanks to Joseph Toppi for the fix!
This commit is contained in:
@@ -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?
|
||||
{
|
||||
DWORD style = GetWindowLong(hwnd, GWL_STYLE);
|
||||
|
||||
Reference in New Issue
Block a user