Skip to content

Commit

Permalink
Add ability to make window unminimizable
Browse files Browse the repository at this point in the history
As an bonus, make the editor subwindows to behave the same as single_window_mode (only hide minimize button).
  • Loading branch information
programneer committed Jul 4, 2024
1 parent 6a13fdc commit 12e59e8
Show file tree
Hide file tree
Showing 18 changed files with 107 additions and 15 deletions.
1 change: 1 addition & 0 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,7 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "display/window/size/initial_screen", PROPERTY_HINT_RANGE, "0,64,1,or_greater"), 0);

GLOBAL_DEF_BASIC("display/window/size/resizable", true);
GLOBAL_DEF_BASIC("display/window/size/minimizable", true);
GLOBAL_DEF_BASIC("display/window/size/borderless", false);
GLOBAL_DEF("display/window/size/always_on_top", false);
GLOBAL_DEF("display/window/size/transparent", false);
Expand Down
5 changes: 4 additions & 1 deletion doc/classes/DisplayServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,10 @@
<constant name="WINDOW_FLAG_MOUSE_PASSTHROUGH" value="7" enum="WindowFlags">
All mouse events are passed to the underlying window of the same application.
</constant>
<constant name="WINDOW_FLAG_MAX" value="8" enum="WindowFlags">
<constant name="WINDOW_FLAG_MINIMIZE_DISABLED" value="8" enum="WindowFlags">
The window can't be minimized by clicking its minimize button as it will hides anyway. It's still possible to minimize the window using [constant WINDOW_MODE_MINIMIZED]. This flag is ignored for full screen windows.
</constant>
<constant name="WINDOW_FLAG_MAX" value="9" enum="WindowFlags">
Max value of the [enum WindowFlags].
</constant>
<constant name="WINDOW_EVENT_MOUSE_ENTER" value="0" enum="WindowEvent">
Expand Down
1 change: 1 addition & 0 deletions doc/classes/Popup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<member name="borderless" type="bool" setter="set_flag" getter="get_flag" overrides="Window" default="true" />
<member name="popup_window" type="bool" setter="set_flag" getter="get_flag" overrides="Window" default="true" />
<member name="transient" type="bool" setter="set_transient" getter="is_transient" overrides="Window" default="true" />
<member name="unminimizable" type="bool" setter="set_flag" getter="get_flag" overrides="Window" default="true" />
<member name="unresizable" type="bool" setter="set_flag" getter="get_flag" overrides="Window" default="true" />
<member name="visible" type="bool" setter="set_visible" getter="is_visible" overrides="Window" default="false" />
<member name="wrap_controls" type="bool" setter="set_wrap_controls" getter="is_wrapping_controls" overrides="Window" default="true" />
Expand Down
6 changes: 6 additions & 0 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,12 @@
Main window initial screen, this setting is used only if [member display/window/size/initial_position_type] is set to "Other Screen Center" ([code]2[/code]).
[b]Note:[/b] This setting only affects the exported project, or when the project is run from the command line. In the editor, the value of [member EditorSettings.run/window_placement/screen] is used instead.
</member>
<member name="display/window/size/minimizable" type="bool" setter="" getter="" default="true">
If [code]true[/code], allows the window to be minimizable by default.
[b]Note:[/b] This property is only read when the project starts. To change whether the window is minimizable at runtime, set [member Window.unminimizable] instead on the root Window, which can be retrieved using [code]get_viewport().get_window()[/code]. [member Window.unminimizable] takes the opposite value of this setting.
[b]Note:[/b] Certain window managers can be configured to ignore the non-minimizable status of a window. Do not rely on this setting as a guarantee that the window will [i]never[/i] be minimizable.
[b]Note:[/b] This setting is implemented only on Windows, macOS, and Linux/X11.
</member>
<member name="display/window/size/mode" type="int" setter="" getter="" default="0">
Main window mode. See [enum DisplayServer.WindowMode] for possible values and how each mode behaves.
</member>
Expand Down
10 changes: 8 additions & 2 deletions doc/classes/Window.xml
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,9 @@
<member name="unfocusable" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], the [Window] can't be focused nor interacted with. It can still be visible.
</member>
<member name="unminimizable" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], the window can't be minimized. Minimize button is disabled.
</member>
<member name="unresizable" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], the window can't be resized. Minimize and maximize buttons are disabled.
</member>
Expand Down Expand Up @@ -790,7 +793,7 @@
Windowed mode, i.e. [Window] doesn't occupy the whole screen (unless set to the size of the screen).
</constant>
<constant name="MODE_MINIMIZED" value="1" enum="Mode">
Minimized window mode, i.e. [Window] is not visible and available on window manager's window list. Normally happens when the minimize button is pressed.
Minimized window mode, i.e. [Window] is not visible and available on window manager's window list. Normally happens when the minimize button is pressed, unless [member unminimizable] is enabled.
</constant>
<constant name="MODE_MAXIMIZED" value="2" enum="Mode">
Maximized window mode, i.e. [Window] will occupy whole screen area except task bar and still display its borders. Normally happens when the maximize button is pressed.
Expand Down Expand Up @@ -839,7 +842,10 @@
All mouse events are passed to the underlying window of the same application.
[b]Note:[/b] This flag has no effect in embedded windows.
</constant>
<constant name="FLAG_MAX" value="8" enum="Flags">
<constant name="FLAG_MINIMIZE_DISABLED" value="8" enum="Flags">
The window can't be minimized by clicking its minimize button as it will hides anyway. It's still possible to minimize the window using [constant MODE_MINIMIZED]. This flag is ignored for full screen windows. Set with [member unminimizable].
</constant>
<constant name="FLAG_MAX" value="9" enum="Flags">
Max value of the [enum Flags].
</constant>
<constant name="CONTENT_SCALE_MODE_DISABLED" value="0" enum="ContentScaleMode">
Expand Down
3 changes: 3 additions & 0 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2237,6 +2237,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (!bool(GLOBAL_GET("display/window/size/resizable"))) {
window_flags |= DisplayServer::WINDOW_FLAG_RESIZE_DISABLED_BIT;
}
if (!bool(GLOBAL_GET("display/window/size/minimizable"))) {
window_flags |= DisplayServer::WINDOW_FLAG_MINIMIZE_DISABLED_BIT;
}
if (bool(GLOBAL_GET("display/window/size/borderless"))) {
window_flags |= DisplayServer::WINDOW_FLAG_BORDERLESS_BIT;
}
Expand Down
15 changes: 15 additions & 0 deletions platform/linuxbsd/x11/display_server_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2816,6 +2816,18 @@ void DisplayServerX11::window_set_flag(WindowFlags p_flag, bool p_enabled, Windo

XFlush(x11_display);
} break;
case WINDOW_FLAG_MINIMIZE_DISABLED: {
wd.minimize_disabled = p_enabled;

XWMHints *xwmh = XAllocWMHints();
if (wd.minimize_disabled) {
xwmh->flags |= 1; // PUnminimizable? That doesn't seem to be existed.
}
XSetWMHints(x11_display, wd.x11_window, xwmh);

XFree(xwmh);
XFlush(x11_display);
} break;
case WINDOW_FLAG_BORDERLESS: {
Hints hints;
Atom property;
Expand Down Expand Up @@ -2892,6 +2904,9 @@ bool DisplayServerX11::window_get_flag(WindowFlags p_flag, WindowID p_window) co
case WINDOW_FLAG_RESIZE_DISABLED: {
return wd.resize_disabled;
} break;
case WINDOW_FLAG_MINIMIZE_DISABLED: {
return wd.minimize_disabled;
} break;
case WINDOW_FLAG_BORDERLESS: {
bool borderless = wd.borderless;
Atom prop = XInternAtom(x11_display, "_MOTIF_WM_HINTS", True);
Expand Down
1 change: 1 addition & 0 deletions platform/linuxbsd/x11/display_server_x11.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class DisplayServerX11 : public DisplayServer {
bool on_top = false;
bool borderless = false;
bool resize_disabled = false;
bool minimize_disabled = false;
Vector2i last_position_before_fs;
bool focused = true;
bool minimized = false;
Expand Down
1 change: 1 addition & 0 deletions platform/macos/display_server_macos.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class DisplayServerMacOS : public DisplayServer {
bool on_top = false;
bool borderless = false;
bool resize_disabled = false;
bool minimize_disabled = false;
bool no_focus = false;
bool is_popup = false;
bool mpass = false;
Expand Down
26 changes: 24 additions & 2 deletions platform/macos/display_server_macos.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2229,6 +2229,9 @@
if (wd.resize_disabled) { // Restore resize disabled.
[wd.window_object setStyleMask:[wd.window_object styleMask] & ~NSWindowStyleMaskResizable];
}
if (!wd.minimize_disabled) { // Restore minimizable.
[wd.window_object setStyleMask:[wd.window_object styleMask] & NSWindowStyleMaskMiniaturizable];
}
if (wd.min_size != Size2i()) {
Size2i size = wd.min_size / screen_get_max_scale();
[wd.window_object setContentMinSize:NSMakeSize(size.x, size.y)];
Expand Down Expand Up @@ -2265,6 +2268,9 @@
if (wd.resize_disabled) { // Fullscreen window should be resizable to work.
[wd.window_object setStyleMask:[wd.window_object styleMask] | NSWindowStyleMaskResizable];
}
if (!wd.minimize_disabled) { // Fullscreen window shouldn't be minimizable.
[wd.window_object setStyleMask:[wd.window_object styleMask] | ~NSWindowStyleMaskMiniaturizable];
}
[wd.window_object setContentMinSize:NSMakeSize(0, 0)];
[wd.window_object setContentMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)];
[wd.window_object toggleFullScreen:nil];
Expand Down Expand Up @@ -2415,6 +2421,19 @@
[[wd.window_object standardWindowButton:NSWindowZoomButton] setEnabled:YES];
}
} break;
case WINDOW_FLAG_MINIMIZE_DISABLED: {
wd.minimize_disabled = p_enabled;
if (wd.fullscreen) { // Fullscreen window shouldn't be minimizable, style will be applied on exiting fullscreen.
return;
}
if (p_enabled) {
[wd.window_object setStyleMask:[wd.window_object styleMask] & ~NSWindowStyleMaskMiniaturizable];
[[wd.window_object standardWindowButton:NSWindowMiniaturizeButton] setEnabled:NO];
} else {
[wd.window_object setStyleMask:[wd.window_object styleMask] | NSWindowStyleMaskMiniaturizable];
[[wd.window_object standardWindowButton:NSWindowMiniaturizeButton] setEnabled:YES];
}
} break;
case WINDOW_FLAG_EXTEND_TO_TITLE: {
NSRect rect = [wd.window_object frame];
wd.extend_to_title = p_enabled;
Expand Down Expand Up @@ -2454,7 +2473,7 @@
wd.layered_window = false;
set_window_per_pixel_transparency_enabled(false, p_window);
}
[wd.window_object setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | (wd.extend_to_title ? NSWindowStyleMaskFullSizeContentView : 0) | (wd.resize_disabled ? 0 : NSWindowStyleMaskResizable)];
[wd.window_object setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | (wd.minimize_disabled ? 0 : NSWindowStyleMaskMiniaturizable) | (wd.extend_to_title ? NSWindowStyleMaskFullSizeContentView : 0) | (wd.resize_disabled ? 0 : NSWindowStyleMaskResizable)];
// Force update of the window styles.
NSRect frameRect = [wd.window_object frame];
[wd.window_object setFrame:NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width + 1, frameRect.size.height) display:NO];
Expand Down Expand Up @@ -2489,7 +2508,7 @@
if (p_enabled) {
[wd.window_object setStyleMask:NSWindowStyleMaskBorderless]; // Force borderless.
} else if (!wd.borderless) {
[wd.window_object setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | (wd.extend_to_title ? NSWindowStyleMaskFullSizeContentView : 0) | (wd.resize_disabled ? 0 : NSWindowStyleMaskResizable)];
[wd.window_object setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | (wd.minimize_disabled ? 0 : NSWindowStyleMaskMiniaturizable) | (wd.extend_to_title ? NSWindowStyleMaskFullSizeContentView : 0) | (wd.resize_disabled ? 0 : NSWindowStyleMaskResizable)];
}
wd.layered_window = p_enabled;
set_window_per_pixel_transparency_enabled(p_enabled, p_window);
Expand Down Expand Up @@ -2530,6 +2549,9 @@
case WINDOW_FLAG_RESIZE_DISABLED: {
return wd.resize_disabled;
} break;
case WINDOW_FLAG_MINIMIZE_DISABLED: {
return wd.minimize_disabled;
} break;
case WINDOW_FLAG_EXTEND_TO_TITLE: {
return [wd.window_object styleMask] & NSWindowStyleMaskFullSizeContentView;
} break;
Expand Down
4 changes: 2 additions & 2 deletions platform/macos/godot_window_delegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ - (void)windowWillEnterFullScreen:(NSNotification *)notification {

// Temporary disable borderless and transparent state.
if ([wd.window_object styleMask] == NSWindowStyleMaskBorderless) {
[wd.window_object setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable];
[wd.window_object setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | (wd.minimize_disabled ? 0 : NSWindowStyleMaskMiniaturizable) | NSWindowStyleMaskResizable];
}
if (wd.layered_window) {
ds->set_window_per_pixel_transparency_enabled(false, window_id);
Expand Down Expand Up @@ -187,7 +187,7 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification {
if (wd.borderless || wd.layered_window) {
[wd.window_object setStyleMask:NSWindowStyleMaskBorderless];
} else {
[wd.window_object setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | (wd.extend_to_title ? NSWindowStyleMaskFullSizeContentView : 0) | (wd.resize_disabled ? 0 : NSWindowStyleMaskResizable)];
[wd.window_object setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | (wd.minimize_disabled ? 0 : NSWindowStyleMaskMiniaturizable) | (wd.extend_to_title ? NSWindowStyleMaskFullSizeContentView : 0) | (wd.resize_disabled ? 0 : NSWindowStyleMaskResizable)];
}
if (wd.layered_window) {
ds->set_window_per_pixel_transparency_enabled(true, window_id);
Expand Down
28 changes: 21 additions & 7 deletions platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,9 @@ DisplayServer::WindowID DisplayServerWindows::create_sub_window(WindowMode p_mod
if (p_flags & WINDOW_FLAG_RESIZE_DISABLED_BIT) {
wd.resizable = false;
}
if (p_flags & WINDOW_FLAG_MINIMIZE_DISABLED_BIT) {
wd.minimizable = false;
}
if (p_flags & WINDOW_FLAG_BORDERLESS_BIT) {
wd.borderless = true;
}
Expand Down Expand Up @@ -1895,7 +1898,7 @@ Size2i DisplayServerWindows::window_get_size_with_decorations(WindowID p_window)
return Size2();
}

void DisplayServerWindows::_get_window_style(bool p_main_window, bool p_fullscreen, bool p_multiwindow_fs, bool p_borderless, bool p_resizable, bool p_maximized, bool p_maximized_fs, bool p_no_activate_focus, DWORD &r_style, DWORD &r_style_ex) {
void DisplayServerWindows::_get_window_style(bool p_main_window, bool p_fullscreen, bool p_multiwindow_fs, bool p_borderless, bool p_resizable, bool p_minimizable, bool p_maximized, bool p_maximized_fs, bool p_no_activate_focus, DWORD &r_style, DWORD &r_style_ex) {
// Windows docs for window styles:
// https://docs.microsoft.com/en-us/windows/win32/winmsg/window-styles
// https://docs.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles
Expand Down Expand Up @@ -1924,13 +1927,17 @@ void DisplayServerWindows::_get_window_style(bool p_main_window, bool p_fullscre
}
} else {
if (p_resizable) {
r_style |= WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MAXIMIZEBOX;

if (p_maximized) {
r_style = WS_OVERLAPPEDWINDOW | WS_MAXIMIZE;
} else {
r_style = WS_OVERLAPPEDWINDOW;
r_style |= WS_MAXIMIZE;
}
} else {
r_style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
r_style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU;
}

if (p_minimizable) {
r_style |= WS_MINIMIZEBOX;
}
}

Expand All @@ -1955,7 +1962,7 @@ void DisplayServerWindows::_update_window_style(WindowID p_window, bool p_repain
DWORD style = 0;
DWORD style_ex = 0;

_get_window_style(p_window == MAIN_WINDOW_ID, wd.fullscreen, wd.multiwindow_fs, wd.borderless, wd.resizable, wd.maximized, wd.maximized_fs, wd.no_focus || wd.is_popup, style, style_ex);
_get_window_style(p_window == MAIN_WINDOW_ID, wd.fullscreen, wd.multiwindow_fs, wd.borderless, wd.resizable, wd.minimizable, wd.maximized, wd.maximized_fs, wd.no_focus || wd.is_popup, style, style_ex);

SetWindowLongPtr(wd.hWnd, GWL_STYLE, style);
SetWindowLongPtr(wd.hWnd, GWL_EXSTYLE, style_ex);
Expand Down Expand Up @@ -2105,6 +2112,10 @@ void DisplayServerWindows::window_set_flag(WindowFlags p_flag, bool p_enabled, W
wd.resizable = !p_enabled;
_update_window_style(p_window);
} break;
case WINDOW_FLAG_MINIMIZE_DISABLED: {
wd.minimizable = !p_enabled;
_update_window_style(p_window);
} break;
case WINDOW_FLAG_BORDERLESS: {
wd.borderless = p_enabled;
_update_window_style(p_window);
Expand Down Expand Up @@ -2169,6 +2180,9 @@ bool DisplayServerWindows::window_get_flag(WindowFlags p_flag, WindowID p_window
case WINDOW_FLAG_RESIZE_DISABLED: {
return !wd.resizable;
} break;
case WINDOW_FLAG_MINIMIZE_DISABLED: {
return !wd.minimizable;
} break;
case WINDOW_FLAG_BORDERLESS: {
return wd.borderless;
} break;
Expand Down Expand Up @@ -5163,7 +5177,7 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode,
DWORD dwExStyle;
DWORD dwStyle;

_get_window_style(window_id_counter == MAIN_WINDOW_ID, (p_mode == WINDOW_MODE_FULLSCREEN || p_mode == WINDOW_MODE_EXCLUSIVE_FULLSCREEN), p_mode != WINDOW_MODE_EXCLUSIVE_FULLSCREEN, p_flags & WINDOW_FLAG_BORDERLESS_BIT, !(p_flags & WINDOW_FLAG_RESIZE_DISABLED_BIT), p_mode == WINDOW_MODE_MAXIMIZED, false, (p_flags & WINDOW_FLAG_NO_FOCUS_BIT) | (p_flags & WINDOW_FLAG_POPUP), dwStyle, dwExStyle);
_get_window_style(window_id_counter == MAIN_WINDOW_ID, (p_mode == WINDOW_MODE_FULLSCREEN || p_mode == WINDOW_MODE_EXCLUSIVE_FULLSCREEN), p_mode != WINDOW_MODE_EXCLUSIVE_FULLSCREEN, p_flags & WINDOW_FLAG_BORDERLESS_BIT, !(p_flags & WINDOW_FLAG_RESIZE_DISABLED_BIT), !(p_flags & WINDOW_FLAG_MINIMIZE_DISABLED_BIT), p_mode == WINDOW_MODE_MAXIMIZED, false, (p_flags & WINDOW_FLAG_NO_FOCUS_BIT) | (p_flags & WINDOW_FLAG_POPUP), dwStyle, dwExStyle);

RECT WindowRect;

Expand Down
3 changes: 2 additions & 1 deletion platform/windows/display_server_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ class DisplayServerWindows : public DisplayServer {
bool multiwindow_fs = false;
bool borderless = false;
bool resizable = true;
bool minimizable = true;
bool window_focused = false;
int activate_state = 0;
bool was_maximized = false;
Expand Down Expand Up @@ -475,7 +476,7 @@ class DisplayServerWindows : public DisplayServer {
HashMap<IndicatorID, IndicatorData> indicators;

void _send_window_event(const WindowData &wd, WindowEvent p_event);
void _get_window_style(bool p_main_window, bool p_fullscreen, bool p_multiwindow_fs, bool p_borderless, bool p_resizable, bool p_maximized, bool p_maximized_fs, bool p_no_activate_focus, DWORD &r_style, DWORD &r_style_ex);
void _get_window_style(bool p_main_window, bool p_fullscreen, bool p_multiwindow_fs, bool p_borderless, bool p_resizable, bool p_minimizable, bool p_maximized, bool p_maximized_fs, bool p_no_activate_focus, DWORD &r_style, DWORD &r_style_ex);

MouseMode mouse_mode;
int restore_mouse_trails = 0;
Expand Down
1 change: 1 addition & 0 deletions scene/gui/popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ Popup::Popup() {
set_transient(true);
set_flag(FLAG_BORDERLESS, true);
set_flag(FLAG_RESIZE_DISABLED, true);
set_flag(FLAG_MINIMIZE_DISABLED, true);
set_flag(FLAG_POPUP, true);
}

Expand Down
13 changes: 13 additions & 0 deletions scene/main/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,17 @@ void Window::_make_window() {
DisplayServer::get_singleton()->window_set_title(tr_title, window_id);
DisplayServer::get_singleton()->window_attach_instance_id(get_instance_id(), window_id);

#ifdef TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint() || Engine::get_singleton()->is_project_manager_hint()) {
#ifdef LINUXBSD_ENABLED
if (DisplayServer::get_singleton()->get_name() == "Wayland") {
return;
}
#endif
DisplayServer::get_singleton()->window_set_flag(DisplayServer::WINDOW_FLAG_MINIMIZE_DISABLED, true, window_id);
}
#endif

if (is_in_edited_scene_root()) {
DisplayServer::get_singleton()->window_set_exclusive(window_id, false);
} else {
Expand Down Expand Up @@ -3000,6 +3011,7 @@ void Window::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "transient_to_focused"), "set_transient_to_focused", "is_transient_to_focused");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "exclusive"), "set_exclusive", "is_exclusive");
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "unresizable"), "set_flag", "get_flag", FLAG_RESIZE_DISABLED);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "unminimizable"), "set_flag", "get_flag", FLAG_MINIMIZE_DISABLED);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "borderless"), "set_flag", "get_flag", FLAG_BORDERLESS);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "always_on_top"), "set_flag", "get_flag", FLAG_ALWAYS_ON_TOP);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "transparent"), "set_flag", "get_flag", FLAG_TRANSPARENT);
Expand Down Expand Up @@ -3060,6 +3072,7 @@ void Window::_bind_methods() {
BIND_ENUM_CONSTANT(FLAG_POPUP);
BIND_ENUM_CONSTANT(FLAG_EXTEND_TO_TITLE);
BIND_ENUM_CONSTANT(FLAG_MOUSE_PASSTHROUGH);
BIND_ENUM_CONSTANT(FLAG_MINIMIZE_DISABLED);
BIND_ENUM_CONSTANT(FLAG_MAX);

BIND_ENUM_CONSTANT(CONTENT_SCALE_MODE_DISABLED);
Expand Down
Loading

0 comments on commit 12e59e8

Please sign in to comment.