ensure focus remains on main window when creating child windows

This commit is contained in:
Reuben Dunnington 2023-08-21 12:46:01 -07:00 committed by MartinFouilleul
parent c27e1c6b62
commit 7755827485
1 changed files with 4 additions and 0 deletions

View File

@ -1252,6 +1252,10 @@ void oc_surface_init_for_window(oc_surface_data* surface, oc_window_data* window
oc_log_error("couldn't enable blur behind\n"); oc_log_error("couldn't enable blur behind\n");
} }
//NOTE(reuben): Creating the child window takes focus away from the main window, but we want to keep
//the focus on the main window
SetFocus(window->win32.hWnd);
surface->layer.parent = window; surface->layer.parent = window;
oc_list_append(&window->win32.layers, &surface->layer.listElt); oc_list_append(&window->win32.layers, &surface->layer.listElt);
} }