Core: add --no-window-frame command line option

Add a command line option to load Blender without a window frame.

Currently this is only used on Wayland, enabled for WITH_UI_TESTS since
attempting to load LIBDECOR caused the tests to crash on start on Fedora.
For tests there is no need to use LIBDECOR, so disable the window frame.
This can also be used by users who don't want to use the X11 fallback if
LIBDECOR can't be found.

Ref !147716
This commit is contained in:
Campbell Barton
2025-10-13 09:47:07 +00:00
parent d79a23e6b9
commit 3349b97987
12 changed files with 97 additions and 6 deletions

View File

@@ -702,6 +702,7 @@ static void print_help(bArgs *ba, bool all)
BLI_args_print_arg_doc(ba, "--window-geometry");
BLI_args_print_arg_doc(ba, "--start-console");
BLI_args_print_arg_doc(ba, "--no-native-pixels");
BLI_args_print_arg_doc(ba, "--no-window-frame");
BLI_args_print_arg_doc(ba, "--no-window-focus");
PRINT("\n");
@@ -1889,6 +1890,15 @@ static int arg_handle_window_maximized(int /*argc*/, const char ** /*argv*/, voi
return 0;
}
static const char arg_handle_no_window_frame_doc[] =
"\n\t"
"Disable all window decorations (Wayland only).";
static int arg_handle_no_window_frame(int /*argc*/, const char ** /*argv*/, void * /*data*/)
{
WM_init_window_frame_set(false);
return 0;
}
static const char arg_handle_no_window_focus_doc[] =
"\n\t"
"Open behind other windows and without taking focus.";
@@ -3087,6 +3097,7 @@ void main_args_setup(bContext *C, bArgs *ba, bool all)
BLI_args_add(ba, "-w", "--window-border", CB(arg_handle_window_border), nullptr);
BLI_args_add(ba, "-W", "--window-fullscreen", CB(arg_handle_window_fullscreen), nullptr);
BLI_args_add(ba, "-M", "--window-maximized", CB(arg_handle_window_maximized), nullptr);
BLI_args_add(ba, nullptr, "--no-window-frame", CB(arg_handle_no_window_frame), nullptr);
BLI_args_add(ba, nullptr, "--no-window-focus", CB(arg_handle_no_window_focus), nullptr);
BLI_args_add(ba, "-con", "--start-console", CB(arg_handle_start_with_console), nullptr);
BLI_args_add(ba, "-r", "--register", CB(arg_handle_register_extension), nullptr);