mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:55:08 +00:00
LibGUI+WindowServer: Add a GResizeCorner widget.
This widget is automatically included in GStatusBar, but can be added in any other place, too. When clicked (with the left button), it initiates a window resize (using a WM request.) In this patch I also fixed up some issues with override cursors being cleared after the WindowServer finishes a drag or resize.
This commit is contained in:
parent
34c5db61aa
commit
ea9a39a9f2
19 changed files with 189 additions and 26 deletions
|
@ -24,6 +24,7 @@
|
|||
//#define COALESCING_DEBUG
|
||||
|
||||
int GEventLoop::s_event_fd = -1;
|
||||
int GEventLoop::s_my_client_id = -1;
|
||||
pid_t GEventLoop::s_server_pid = -1;
|
||||
|
||||
void GEventLoop::connect_to_server()
|
||||
|
@ -59,8 +60,7 @@ void GEventLoop::connect_to_server()
|
|||
request.type = WSAPI_ClientMessage::Type::Greeting;
|
||||
request.greeting.client_pid = getpid();
|
||||
auto response = sync_request(request, WSAPI_ServerMessage::Type::Greeting);
|
||||
s_server_pid = response.greeting.server_pid;
|
||||
GDesktop::the().did_receive_screen_rect(Badge<GEventLoop>(), response.greeting.screen_rect);
|
||||
handle_greeting(response);
|
||||
}
|
||||
|
||||
GEventLoop::GEventLoop()
|
||||
|
@ -235,8 +235,7 @@ void GEventLoop::process_unprocessed_bundles()
|
|||
for (auto& bundle : unprocessed_bundles) {
|
||||
auto& event = bundle.message;
|
||||
if (event.type == WSAPI_ServerMessage::Type::Greeting) {
|
||||
s_server_pid = event.greeting.server_pid;
|
||||
GDesktop::the().did_receive_screen_rect(Badge<GEventLoop>(), event.greeting.screen_rect);
|
||||
handle_greeting(event);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -402,3 +401,10 @@ WSAPI_ServerMessage GEventLoop::sync_request(const WSAPI_ClientMessage& request,
|
|||
ASSERT(success);
|
||||
return response;
|
||||
}
|
||||
|
||||
void GEventLoop::handle_greeting(WSAPI_ServerMessage& message)
|
||||
{
|
||||
s_server_pid = message.greeting.server_pid;
|
||||
s_my_client_id = message.greeting.your_client_id;
|
||||
GDesktop::the().did_receive_screen_rect(Badge<GEventLoop>(), message.greeting.screen_rect);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue