mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibGUI+WindowServer: Replace WindowInput{Enter,Leave} Events
with WindowInput{Preempted,Restored} Events and allow Widgets to save the state of their focus preemption. As of now, only Popups will preempt input and trigger these events.
This commit is contained in:
parent
901878bad9
commit
5d567565a4
Notes:
sideshowbarker
2024-07-17 04:19:05 +09:00
Author: https://github.com/thankyouverycool
Commit: 5d567565a4
Pull-request: https://github.com/SerenityOS/serenity/pull/16098
11 changed files with 50 additions and 45 deletions
|
@ -120,16 +120,16 @@ void ConnectionToWindowServer::window_deactivated(i32 window_id)
|
|||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowBecameInactive));
|
||||
}
|
||||
|
||||
void ConnectionToWindowServer::window_input_entered(i32 window_id)
|
||||
void ConnectionToWindowServer::window_input_preempted(i32 window_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowInputEntered));
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowInputPreempted));
|
||||
}
|
||||
|
||||
void ConnectionToWindowServer::window_input_left(i32 window_id)
|
||||
void ConnectionToWindowServer::window_input_restored(i32 window_id)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(window_id))
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowInputLeft));
|
||||
Core::EventLoop::current().post_event(*window, make<Event>(Event::WindowInputRestored));
|
||||
}
|
||||
|
||||
void ConnectionToWindowServer::window_close_request(i32 window_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue