Browse Source

Merge pull request #23571 from marcelofg55/expose_mwtf

Expose OS::move_window_to_foreground
Rémi Verschelde 6 years ago
parent
commit
8ca90d718e
3 changed files with 14 additions and 0 deletions
  1. 6 0
      core/bind/core_bind.cpp
  2. 1 0
      core/bind/core_bind.h
  3. 7 0
      doc/classes/OS.xml

+ 6 - 0
core/bind/core_bind.cpp

@@ -1020,6 +1020,11 @@ void _OS::center_window() {
 	OS::get_singleton()->center_window();
 	OS::get_singleton()->center_window();
 }
 }
 
 
+void _OS::move_window_to_foreground() {
+
+	OS::get_singleton()->move_window_to_foreground();
+}
+
 bool _OS::is_debug_build() const {
 bool _OS::is_debug_build() const {
 
 
 #ifdef DEBUG_ENABLED
 #ifdef DEBUG_ENABLED
@@ -1121,6 +1126,7 @@ void _OS::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("request_attention"), &_OS::request_attention);
 	ClassDB::bind_method(D_METHOD("request_attention"), &_OS::request_attention);
 	ClassDB::bind_method(D_METHOD("get_real_window_size"), &_OS::get_real_window_size);
 	ClassDB::bind_method(D_METHOD("get_real_window_size"), &_OS::get_real_window_size);
 	ClassDB::bind_method(D_METHOD("center_window"), &_OS::center_window);
 	ClassDB::bind_method(D_METHOD("center_window"), &_OS::center_window);
+	ClassDB::bind_method(D_METHOD("move_window_to_foreground"), &_OS::move_window_to_foreground);
 
 
 	ClassDB::bind_method(D_METHOD("set_borderless_window", "borderless"), &_OS::set_borderless_window);
 	ClassDB::bind_method(D_METHOD("set_borderless_window", "borderless"), &_OS::set_borderless_window);
 	ClassDB::bind_method(D_METHOD("get_borderless_window"), &_OS::get_borderless_window);
 	ClassDB::bind_method(D_METHOD("get_borderless_window"), &_OS::get_borderless_window);

+ 1 - 0
core/bind/core_bind.h

@@ -185,6 +185,7 @@ public:
 	virtual bool is_window_always_on_top() const;
 	virtual bool is_window_always_on_top() const;
 	virtual void request_attention();
 	virtual void request_attention();
 	virtual void center_window();
 	virtual void center_window();
+	virtual void move_window_to_foreground();
 
 
 	virtual void set_borderless_window(bool p_borderless);
 	virtual void set_borderless_window(bool p_borderless);
 	virtual bool get_borderless_window() const;
 	virtual bool get_borderless_window() const;

+ 7 - 0
doc/classes/OS.xml

@@ -556,6 +556,13 @@
 				Note that this method can also be used to kill processes that were not spawned by the game.
 				Note that this method can also be used to kill processes that were not spawned by the game.
 			</description>
 			</description>
 		</method>
 		</method>
+		<method name="move_window_to_foreground">
+			<return type="void">
+			</return>
+			<description>
+				Moves the window to the front.
+			</description>
+		</method>
 		<method name="native_video_is_playing">
 		<method name="native_video_is_playing">
 			<return type="bool">
 			<return type="bool">
 			</return>
 			</return>