Set up window focus correctly when using an existing X11 window.
Thanks to Joseph Toppi for the fix! --HG-- extra : rebase_source : be4596056669a0a9c7580355084b7f9eca345d78
This commit is contained in:
parent
20181eb52a
commit
bc4b0f28f1
1 changed files with 15 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue