2
0
Эх сурвалжийг харах

WindowModes: Add win-mode config variable

Mitchell Stokes 9 жил өмнө
parent
commit
8def7f458e

+ 5 - 0
panda/src/display/config_display.cxx

@@ -328,6 +328,11 @@ ConfigVariableBool undecorated
           "property.  When this is true, the default window is created "
           "without a title bar or resizable border."));
 
+ConfigVariableEnum<WindowProperties::WindowMode> win_mode
+("win-mode", WindowProperties::W_regular,
+ PRC_DESC("This specifies the default value of the 'window_mode' window "
+          "property."));
+
 ConfigVariableBool win_fixed_size
 ("win-fixed-size", false,
  PRC_DESC("This specifies the default value of the 'fixed_size' window "

+ 1 - 0
panda/src/display/config_display.h

@@ -74,6 +74,7 @@ extern EXPCL_PANDA_DISPLAY ConfigVariableInt win_size;
 extern EXPCL_PANDA_DISPLAY ConfigVariableInt win_origin;
 extern EXPCL_PANDA_DISPLAY ConfigVariableBool fullscreen;
 extern EXPCL_PANDA_DISPLAY ConfigVariableBool undecorated;
+extern EXPCL_PANDA_DISPLAY ConfigVariableEnum<WindowProperties::WindowMode> win_mode;
 extern EXPCL_PANDA_DISPLAY ConfigVariableBool win_fixed_size;
 extern EXPCL_PANDA_DISPLAY ConfigVariableBool cursor_hidden;
 extern EXPCL_PANDA_DISPLAY ConfigVariableFilename icon_filename;

+ 3 - 1
panda/src/display/windowProperties.cxx

@@ -81,7 +81,9 @@ get_config_properties() {
     props.set_parent_window(NativeWindowHandle::make_subprocess(subprocess_window));
   }
   props.set_mouse_mode(M_absolute);
-  props.set_window_mode(W_regular);
+  if (win_mode.has_value()) {
+    props.set_window_mode(win_mode);
+  }
 
   return props;
 }