ensure focus remains on main window when creating child windows #54

Merged
MartinFouilleul merged 1 commits from fix_initial_window_focus into main 2023-08-22 20:10:58 +00:00
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);
} }