mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:22:46 +00:00 
			
		
		
		
	LibGUI+WindowServer: Add Window::set_always_on_top()
This commit is contained in:
		
							parent
							
								
									50e74de279
								
							
						
					
					
						commit
						63a18aa89e
					
				
					 5 changed files with 21 additions and 0 deletions
				
			
		|  | @ -1281,4 +1281,11 @@ void Window::flush_pending_paints_immediately() | ||||||
|     handle_multi_paint_event(paint_event); |     handle_multi_paint_event(paint_event); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void Window::set_always_on_top(bool always_on_top) | ||||||
|  | { | ||||||
|  |     if (!m_window_id) | ||||||
|  |         return; | ||||||
|  |     ConnectionToWindowServer::the().set_always_on_top(m_window_id, always_on_top); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -232,6 +232,8 @@ public: | ||||||
|     void set_blocks_emoji_input(bool b) { m_blocks_emoji_input = b; } |     void set_blocks_emoji_input(bool b) { m_blocks_emoji_input = b; } | ||||||
|     bool blocks_emoji_input() const { return m_blocks_emoji_input; } |     bool blocks_emoji_input() const { return m_blocks_emoji_input; } | ||||||
| 
 | 
 | ||||||
|  |     void set_always_on_top(bool always_on_top = true); | ||||||
|  | 
 | ||||||
| protected: | protected: | ||||||
|     Window(Core::Object* parent = nullptr); |     Window(Core::Object* parent = nullptr); | ||||||
|     virtual void wm_event(WMEvent&); |     virtual void wm_event(WMEvent&); | ||||||
|  |  | ||||||
|  | @ -1341,6 +1341,15 @@ void ConnectionFromClient::remove_window_stealing(i32 window_id) | ||||||
|     window->remove_all_stealing(); |     window->remove_all_stealing(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void ConnectionFromClient::set_always_on_top(i32 window_id, bool always_on_top) | ||||||
|  | { | ||||||
|  |     auto window = window_from_id(window_id); | ||||||
|  |     if (!window) | ||||||
|  |         did_misbehave("SetAlwaysOnTop: Bad window ID"); | ||||||
|  | 
 | ||||||
|  |     window->set_always_on_top(always_on_top); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void ConnectionFromClient::notify_about_theme_change() | void ConnectionFromClient::notify_about_theme_change() | ||||||
| { | { | ||||||
|     // Recalculate minimum size for each window, using the new theme metrics.
 |     // Recalculate minimum size for each window, using the new theme metrics.
 | ||||||
|  |  | ||||||
|  | @ -185,6 +185,7 @@ private: | ||||||
|     virtual void add_window_stealing_for_client(i32, i32) override; |     virtual void add_window_stealing_for_client(i32, i32) override; | ||||||
|     virtual void remove_window_stealing_for_client(i32, i32) override; |     virtual void remove_window_stealing_for_client(i32, i32) override; | ||||||
|     virtual void remove_window_stealing(i32) override; |     virtual void remove_window_stealing(i32) override; | ||||||
|  |     virtual void set_always_on_top(i32, bool) override; | ||||||
|     virtual Messages::WindowServer::GetColorUnderCursorResponse get_color_under_cursor() override; |     virtual Messages::WindowServer::GetColorUnderCursorResponse get_color_under_cursor() override; | ||||||
| 
 | 
 | ||||||
|     Window* window_from_id(i32 window_id); |     Window* window_from_id(i32 window_id); | ||||||
|  |  | ||||||
|  | @ -182,4 +182,6 @@ endpoint WindowServer | ||||||
|     add_window_stealing_for_client(i32 client_id, i32 window_id) => () |     add_window_stealing_for_client(i32 client_id, i32 window_id) => () | ||||||
|     remove_window_stealing_for_client(i32 client_id, i32 window_id) => () |     remove_window_stealing_for_client(i32 client_id, i32 window_id) => () | ||||||
|     remove_window_stealing(i32 window_id) => () |     remove_window_stealing(i32 window_id) => () | ||||||
|  | 
 | ||||||
|  |     set_always_on_top(i32 window_id, bool always_on_top) => () | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 demostanis
						demostanis