mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +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:
committed by
Andreas Kling
parent
6eaa6826fa
commit
3837de0573
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user