mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:12:45 +00:00 
			
		
		
		
	WindowServer: Bring window stack to front when clicking on frame
When clicking on a window's frame that is blocked by a modal window, we want to bring the entire window stack to the front regardless of where the user clicked in the frame (not just the icon).
This commit is contained in:
		
							parent
							
								
									f4a5c9b6c2
								
							
						
					
					
						commit
						ad48bd1aca
					
				
					 1 changed files with 30 additions and 27 deletions
				
			
		|  | @ -353,16 +353,18 @@ void WindowFrame::on_mouse_event(const MouseEvent& event) | ||||||
| { | { | ||||||
|     ASSERT(!m_window.is_fullscreen()); |     ASSERT(!m_window.is_fullscreen()); | ||||||
| 
 | 
 | ||||||
|     if (m_window.is_blocked_by_modal_window()) |  | ||||||
|         return; |  | ||||||
| 
 |  | ||||||
|     auto& wm = WindowManager::the(); |     auto& wm = WindowManager::the(); | ||||||
|     if (m_window.type() != WindowType::Normal && m_window.type() != WindowType::Notification) |     if (m_window.type() != WindowType::Normal && m_window.type() != WindowType::Notification) | ||||||
|         return; |         return; | ||||||
| 
 | 
 | ||||||
|     if (m_window.type() == WindowType::Normal && title_bar_icon_rect().contains(event.position())) { |     if (m_window.type() == WindowType::Normal) { | ||||||
|         if (event.type() == Event::MouseDown) |         if (event.type() == Event::MouseDown) | ||||||
|             wm.move_to_front_and_make_active(m_window); |             wm.move_to_front_and_make_active(m_window); | ||||||
|  | 
 | ||||||
|  |         if (m_window.is_blocked_by_modal_window()) | ||||||
|  |             return; | ||||||
|  | 
 | ||||||
|  |         if (title_bar_icon_rect().contains(event.position())) { | ||||||
|             if (event.type() == Event::MouseDown && (event.button() == MouseButton::Left || event.button() == MouseButton::Right)) { |             if (event.type() == Event::MouseDown && (event.button() == MouseButton::Left || event.button() == MouseButton::Right)) { | ||||||
|                 // Manually start a potential double click. Since we're opening
 |                 // Manually start a potential double click. Since we're opening
 | ||||||
|                 // a menu, we will only receive the MouseDown event, so we
 |                 // a menu, we will only receive the MouseDown event, so we
 | ||||||
|  | @ -391,6 +393,7 @@ void WindowFrame::on_mouse_event(const MouseEvent& event) | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     // This is slightly hackish, but expand the title bar rect by two pixels downwards,
 |     // This is slightly hackish, but expand the title bar rect by two pixels downwards,
 | ||||||
|     // so that mouse events between the title bar and window contents don't act like
 |     // so that mouse events between the title bar and window contents don't act like
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Tom
						Tom