From cf4b62cbd6b7fc4f1f5fbce324cea481862fcae2 Mon Sep 17 00:00:00 2001 From: Reuben Dunnington Date: Mon, 21 Aug 2023 12:46:01 -0700 Subject: [PATCH] ensure focus remains on main window when creating child windows --- src/app/win32_app.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/win32_app.c b/src/app/win32_app.c index df6c4ff..9492784 100644 --- a/src/app/win32_app.c +++ b/src/app/win32_app.c @@ -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"); } + //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; oc_list_append(&window->win32.layers, &surface->layer.listElt); } -- 2.25.1