1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

LibGUI: Implement enter/leave events (with WindowServer support.)

Windows now learn when the mouse cursor leaves or enters them.
Use this to implement GWidget::{enter,leave}_event() and use that
to implement the CoolBar button effect. :^)
This commit is contained in:
Andreas Kling 2019-02-20 10:12:19 +01:00
parent af7eb5c89c
commit bf30502560
14 changed files with 103 additions and 5 deletions

View file

@ -94,6 +94,12 @@ void WSWindow::on_message(WSMessage& message)
server_message.mouse.button = to_api(static_cast<WSMouseEvent&>(message).button());
server_message.mouse.buttons = static_cast<WSMouseEvent&>(message).buttons();
break;
case WSMessage::WindowEntered:
server_message.type = WSAPI_ServerMessage::Type::WindowEntered;
break;
case WSMessage::WindowLeft:
server_message.type = WSAPI_ServerMessage::Type::WindowLeft;
break;
case WSMessage::KeyDown:
server_message.type = WSAPI_ServerMessage::Type::KeyDown;
server_message.key.character = static_cast<WSKeyEvent&>(message).character();