Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
05a0a68c
Unverified
Commit
05a0a68c
authored
Jun 21, 2019
by
Rémi Verschelde
Committed by
GitHub
Jun 21, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24448 from lukad/toggle-system-console
Add option to toggle console window
parents
10cf5ac0
ad504b92
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
0 deletions
+34
-0
os.h
core/os/os.h
+2
-0
editor_node.cpp
editor/editor_node.cpp
+10
-0
editor_node.h
editor/editor_node.h
+1
-0
editor_settings.cpp
editor/editor_settings.cpp
+1
-0
main.cpp
main/main.cpp
+5
-0
os_windows.cpp
platform/windows/os_windows.cpp
+12
-0
os_windows.h
platform/windows/os_windows.h
+3
-0
No files found.
core/os/os.h
View file @
05a0a68c
...
...
@@ -222,6 +222,8 @@ public:
virtual
bool
is_window_maximized
()
const
{
return
true
;
}
virtual
void
set_window_always_on_top
(
bool
p_enabled
)
{}
virtual
bool
is_window_always_on_top
()
const
{
return
false
;
}
virtual
void
set_console_visible
(
bool
p_enabled
)
{}
virtual
bool
is_console_visible
()
const
{
return
false
;
}
virtual
void
request_attention
()
{}
virtual
void
center_window
();
...
...
editor/editor_node.cpp
View file @
05a0a68c
...
...
@@ -2475,6 +2475,13 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
OS
::
get_singleton
()
->
set_window_fullscreen
(
!
OS
::
get_singleton
()
->
is_window_fullscreen
());
}
break
;
case
SETTINGS_TOGGLE_CONSOLE
:
{
bool
was_visible
=
OS
::
get_singleton
()
->
is_console_visible
();
OS
::
get_singleton
()
->
set_console_visible
(
!
was_visible
);
EditorSettings
::
get_singleton
()
->
set_setting
(
"interface/editor/hide_console_window"
,
!
was_visible
);
}
break
;
case
SETTINGS_PICK_MAIN_SCENE
:
{
file
->
set_mode
(
EditorFileDialog
::
MODE_OPEN_FILE
);
...
...
@@ -5874,6 +5881,9 @@ EditorNode::EditorNode() {
#else
p
->
add_shortcut
(
ED_SHORTCUT
(
"editor/fullscreen_mode"
,
TTR
(
"Toggle Fullscreen"
),
KEY_MASK_SHIFT
|
KEY_F11
),
SETTINGS_TOGGLE_FULLSCREEN
);
#endif
#ifdef WINDOWS_ENABLED
p
->
add_item
(
TTR
(
"Toggle System Console"
),
SETTINGS_TOGGLE_CONSOLE
);
#endif
p
->
add_separator
();
if
(
OS
::
get_singleton
()
->
get_data_path
()
==
OS
::
get_singleton
()
->
get_config_path
())
{
...
...
editor/editor_node.h
View file @
05a0a68c
...
...
@@ -193,6 +193,7 @@ private:
SETTINGS_MANAGE_EXPORT_TEMPLATES
,
SETTINGS_MANAGE_FEATURE_PROFILES
,
SETTINGS_PICK_MAIN_SCENE
,
SETTINGS_TOGGLE_CONSOLE
,
SETTINGS_TOGGLE_FULLSCREEN
,
SETTINGS_HELP
,
SCENE_TAB_CLOSE
,
...
...
editor/editor_settings.cpp
View file @
05a0a68c
...
...
@@ -345,6 +345,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set
(
"interface/editor/unfocused_low_processor_mode_sleep_usec"
,
50000
);
// 20 FPS
hints
[
"interface/editor/unfocused_low_processor_mode_sleep_usec"
]
=
PropertyInfo
(
Variant
::
REAL
,
"interface/editor/unfocused_low_processor_mode_sleep_usec"
,
PROPERTY_HINT_RANGE
,
"1,100000,1"
,
PROPERTY_USAGE_DEFAULT
);
_initial_set
(
"interface/editor/separate_distraction_mode"
,
false
);
_initial_set
(
"interface/editor/hide_console_window"
,
false
);
_initial_set
(
"interface/editor/save_each_scene_on_quit"
,
true
);
// Regression
_initial_set
(
"interface/editor/quit_confirmation"
,
true
);
...
...
main/main.cpp
View file @
05a0a68c
...
...
@@ -1797,6 +1797,7 @@ bool Main::start() {
pmanager
->
add_child
(
progress_dialog
);
sml
->
get_root
()
->
add_child
(
pmanager
);
OS
::
get_singleton
()
->
set_context
(
OS
::
CONTEXT_PROJECTMAN
);
project_manager
=
true
;
}
if
(
project_manager
||
editor
)
{
...
...
@@ -1806,6 +1807,10 @@ bool Main::start() {
StreamPeerSSL
::
load_certs_from_file
(
certs
);
else
StreamPeerSSL
::
load_certs_from_memory
(
StreamPeerSSL
::
get_project_cert_array
());
// Hide console window if requested (Windows-only)
bool
hide_console
=
EditorSettings
::
get_singleton
()
->
get_setting
(
"interface/editor/hide_console_window"
);
OS
::
get_singleton
()
->
set_console_visible
(
!
hide_console
);
}
#endif
}
...
...
platform/windows/os_windows.cpp
View file @
05a0a68c
...
...
@@ -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
;
...
...
platform/windows/os_windows.h
View file @
05a0a68c
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment