From 2a63e062b0e71c291d57aa155d9462f68fed8535 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 10 Apr 2018 10:32:56 +0200 Subject: Tests: add --no-window-focus to open window without focus. This is useful to run OpenGL tests while continuing to do other tasks without windows constantly popping up in the foreground. --- source/creator/creator_args.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/creator/creator_args.c') diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index acb03efb895..f8fe57b05a2 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -514,6 +514,7 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo BLI_argsPrintArgDoc(ba, "--window-geometry"); BLI_argsPrintArgDoc(ba, "--start-console"); BLI_argsPrintArgDoc(ba, "--no-native-pixels"); + BLI_argsPrintArgDoc(ba, "--no-window-focus"); printf("\n"); @@ -1134,6 +1135,15 @@ static int arg_handle_without_borders(int UNUSED(argc), const char **UNUSED(argv return 0; } +static const char arg_handle_no_window_focus_doc[] = +"\n\tOpen behind other windows and without taking focus." +; +static int arg_handle_no_window_focus(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) +{ + WM_init_window_focus_set(false); + return 0; +} + extern bool wm_start_with_console; /* wm_init_exit.c */ static const char arg_handle_start_with_console_doc[] = @@ -2072,6 +2082,7 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) BLI_argsAdd(ba, 2, "-p", "--window-geometry", CB(arg_handle_window_geometry), NULL); BLI_argsAdd(ba, 2, "-w", "--window-border", CB(arg_handle_with_borders), NULL); BLI_argsAdd(ba, 2, "-W", "--window-fullscreen", CB(arg_handle_without_borders), NULL); + BLI_argsAdd(ba, 2, NULL, "--no-window-focus", CB(arg_handle_no_window_focus), NULL); BLI_argsAdd(ba, 2, "-con", "--start-console", CB(arg_handle_start_with_console), NULL); BLI_argsAdd(ba, 2, "-R", NULL, CB(arg_handle_register_extension), NULL); BLI_argsAdd(ba, 2, "-r", NULL, CB_EX(arg_handle_register_extension, silent), ba); -- cgit v1.2.3