Child windows shouldn't take focus if the parent window is in relative mouse mode
Fixes https://github.com/libsdl-org/SDL/issues/11807 on Windows
This commit is contained in:
parent
3bea84531d
commit
81e57147f8
1 changed files with 10 additions and 0 deletions
|
@ -1119,6 +1119,16 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
|
||||||
if (SDL_WINDOW_IS_POPUP(data->window)) {
|
if (SDL_WINDOW_IS_POPUP(data->window)) {
|
||||||
return MA_NOACTIVATE;
|
return MA_NOACTIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check parents to see if they are in relative mouse mode and focused
|
||||||
|
SDL_Window *parent = data->window->parent;
|
||||||
|
while (parent) {
|
||||||
|
if ((parent->flags & SDL_WINDOW_INPUT_FOCUS) &&
|
||||||
|
(parent->flags & SDL_WINDOW_MOUSE_RELATIVE_MODE)) {
|
||||||
|
return MA_NOACTIVATE;
|
||||||
|
}
|
||||||
|
parent = parent->parent;
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue