mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:12:45 +00:00 
			
		
		
		
	WSEventLoop: Remove inheritance from CEventLoop
The only reason for the inheritance was to add FDs to the select set. Since CNotifier is available (and now also quite useful), we can make use of it instead, and remove the inheritance.
This commit is contained in:
		
							parent
							
								
									6eaa6826fa
								
							
						
					
					
						commit
						3837de0573
					
				
					 6 changed files with 30 additions and 45 deletions
				
			
		|  | @ -71,19 +71,19 @@ void WSScreen::on_receive_mouse_data(int dx, int dy, int dz, unsigned buttons) | |||
|         if (!(changed_buttons & (unsigned)button)) | ||||
|             return; | ||||
|         auto message = make<WSMouseEvent>(buttons & (unsigned)button ? WSEvent::MouseDown : WSEvent::MouseUp, m_cursor_location, buttons, button, m_modifiers); | ||||
|         WSEventLoop::the().post_event(WSWindowManager::the(), move(message)); | ||||
|         CEventLoop::current().post_event(WSWindowManager::the(), move(message)); | ||||
|     }; | ||||
|     post_mousedown_or_mouseup_if_needed(MouseButton::Left); | ||||
|     post_mousedown_or_mouseup_if_needed(MouseButton::Right); | ||||
|     post_mousedown_or_mouseup_if_needed(MouseButton::Middle); | ||||
|     if (m_cursor_location != prev_location) { | ||||
|         auto message = make<WSMouseEvent>(WSEvent::MouseMove, m_cursor_location, buttons, MouseButton::None, m_modifiers); | ||||
|         WSEventLoop::the().post_event(WSWindowManager::the(), move(message)); | ||||
|         CEventLoop::current().post_event(WSWindowManager::the(), move(message)); | ||||
|     } | ||||
| 
 | ||||
|     if (dz) { | ||||
|         auto message = make<WSMouseEvent>(WSEvent::MouseWheel, m_cursor_location, buttons, MouseButton::None, m_modifiers, dz); | ||||
|         WSEventLoop::the().post_event(WSWindowManager::the(), move(message)); | ||||
|         CEventLoop::current().post_event(WSWindowManager::the(), move(message)); | ||||
|     } | ||||
| 
 | ||||
|     if (m_cursor_location != prev_location) | ||||
|  | @ -94,7 +94,7 @@ void WSScreen::on_receive_keyboard_data(KeyEvent kernel_event) | |||
| { | ||||
|     m_modifiers = kernel_event.modifiers(); | ||||
|     auto message = make<WSKeyEvent>(kernel_event.is_press() ? WSEvent::KeyDown : WSEvent::KeyUp, kernel_event.key, kernel_event.character, kernel_event.modifiers()); | ||||
|     WSEventLoop::the().post_event(WSWindowManager::the(), move(message)); | ||||
|     CEventLoop::current().post_event(WSWindowManager::the(), move(message)); | ||||
| } | ||||
| 
 | ||||
| void WSScreen::set_y_offset(int offset) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Robin Burchell
						Robin Burchell