mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:02:45 +00:00 
			
		
		
		
	LibGUI+WindowServer: Create and broadcast an event when a window moves
LibWeb's Window object will need to know the OS-level position and size of the GUI::Window for e.g. screenX, screenY, outerWidth, outerHeight. It will also need to know about changes to that data.
This commit is contained in:
		
							parent
							
								
									6b41da0b9e
								
							
						
					
					
						commit
						f7e747b68e
					
				
					 7 changed files with 47 additions and 0 deletions
				
			
		|  | @ -408,6 +408,7 @@ void Window::set_maximized(bool maximized) | |||
|         set_rect(m_floating_rect); | ||||
|     m_frame.did_set_maximized({}, maximized); | ||||
|     Core::EventLoop::current().post_event(*this, make<ResizeEvent>(m_rect)); | ||||
|     Core::EventLoop::current().post_event(*this, make<MoveEvent>(m_rect)); | ||||
|     set_default_positioned(false); | ||||
| 
 | ||||
|     WindowManager::the().notify_minimization_state_changed(*this); | ||||
|  | @ -486,6 +487,9 @@ void Window::event(Core::Event& event) | |||
|     case Event::WindowResized: | ||||
|         m_client->async_window_resized(m_window_id, static_cast<ResizeEvent const&>(event).rect()); | ||||
|         break; | ||||
|     case Event::WindowMoved: | ||||
|         m_client->async_window_moved(m_window_id, static_cast<MoveEvent const&>(event).rect()); | ||||
|         break; | ||||
|     default: | ||||
|         break; | ||||
|     } | ||||
|  | @ -826,6 +830,7 @@ void Window::set_fullscreen(bool fullscreen) | |||
|     } | ||||
| 
 | ||||
|     Core::EventLoop::current().post_event(*this, make<ResizeEvent>(new_window_rect)); | ||||
|     Core::EventLoop::current().post_event(*this, make<MoveEvent>(new_window_rect)); | ||||
|     set_rect(new_window_rect); | ||||
| } | ||||
| 
 | ||||
|  | @ -896,6 +901,7 @@ bool Window::set_untiled() | |||
|     set_rect(m_floating_rect); | ||||
| 
 | ||||
|     Core::EventLoop::current().post_event(*this, make<ResizeEvent>(m_rect)); | ||||
|     Core::EventLoop::current().post_event(*this, make<MoveEvent>(m_rect)); | ||||
| 
 | ||||
|     return true; | ||||
| } | ||||
|  | @ -917,6 +923,7 @@ void Window::set_tiled(WindowTileType tile_type) | |||
| 
 | ||||
|     set_rect(WindowManager::the().tiled_window_rect(*this, tile_type)); | ||||
|     Core::EventLoop::current().post_event(*this, make<ResizeEvent>(m_rect)); | ||||
|     Core::EventLoop::current().post_event(*this, make<MoveEvent>(m_rect)); | ||||
| } | ||||
| 
 | ||||
| void Window::detach_client(Badge<ConnectionFromClient>) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy Flynn
						Timothy Flynn