mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 02:08:12 +03:00
WindowServer: Don't crash if unable to open input peripherals
Seems a bit extreme, other operating systems don't have their graphical environment crash if there is no keyboard or no mouse.
This commit is contained in:
parent
4d755725bf
commit
491a67ddc4
Notes:
sideshowbarker
2024-07-18 22:53:25 +09:00
Author: https://github.com/boricj Commit: https://github.com/SerenityOS/serenity/commit/491a67ddc49 Pull-request: https://github.com/SerenityOS/serenity/pull/5095
@ -66,14 +66,19 @@ EventLoop::EventLoop()
|
||||
IPC::new_client_connection<ClientConnection>(client_socket.release_nonnull(), client_id);
|
||||
};
|
||||
|
||||
ASSERT(m_keyboard_fd >= 0);
|
||||
ASSERT(m_mouse_fd >= 0);
|
||||
if (m_keyboard_fd >= 0) {
|
||||
m_keyboard_notifier = Core::Notifier::construct(m_keyboard_fd, Core::Notifier::Read);
|
||||
m_keyboard_notifier->on_ready_to_read = [this] { drain_keyboard(); };
|
||||
} else {
|
||||
dbgln("Couldn't open /dev/keyboard");
|
||||
}
|
||||
|
||||
m_keyboard_notifier = Core::Notifier::construct(m_keyboard_fd, Core::Notifier::Read);
|
||||
m_keyboard_notifier->on_ready_to_read = [this] { drain_keyboard(); };
|
||||
|
||||
m_mouse_notifier = Core::Notifier::construct(m_mouse_fd, Core::Notifier::Read);
|
||||
m_mouse_notifier->on_ready_to_read = [this] { drain_mouse(); };
|
||||
if (m_mouse_fd >= 0) {
|
||||
m_mouse_notifier = Core::Notifier::construct(m_mouse_fd, Core::Notifier::Read);
|
||||
m_mouse_notifier->on_ready_to_read = [this] { drain_mouse(); };
|
||||
} else {
|
||||
dbgln("Couldn't open /dev/mouse");
|
||||
}
|
||||
}
|
||||
|
||||
EventLoop::~EventLoop()
|
||||
|
Loading…
Reference in New Issue
Block a user