summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/os_windows.cpp12
-rw-r--r--platform/windows/os_windows.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 6e6df08f02..5876a385c6 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1979,6 +1979,17 @@ bool OS_Windows::is_window_always_on_top() const {
return video_mode.always_on_top;
}
+void OS_Windows::set_console_visible(bool p_enabled) {
+ if (console_visible == p_enabled)
+ return;
+ ShowWindow(GetConsoleWindow(), p_enabled ? SW_SHOW : SW_HIDE);
+ console_visible = p_enabled;
+}
+
+bool OS_Windows::is_console_visible() const {
+ return console_visible;
+}
+
bool OS_Windows::get_window_per_pixel_transparency_enabled() const {
if (!is_layered_allowed()) return false;
@@ -3231,6 +3242,7 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) {
control_mem = false;
meta_mem = false;
minimized = false;
+ console_visible = IsWindowVisible(GetConsoleWindow());
hInstance = _hInstance;
pressrc = 0;
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 4660c16b97..fc8ad1b188 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -210,6 +210,7 @@ protected:
bool maximized;
bool minimized;
bool borderless;
+ bool console_visible;
public:
LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -256,6 +257,8 @@ public:
virtual bool is_window_maximized() const;
virtual void set_window_always_on_top(bool p_enabled);
virtual bool is_window_always_on_top() const;
+ virtual void set_console_visible(bool p_enabled);
+ virtual bool is_console_visible() const;
virtual void request_attention();
virtual void set_borderless_window(bool p_borderless);