2019-01-20 06:49:48 +03:00
|
|
|
#include "GEventLoop.h"
|
|
|
|
#include "GEvent.h"
|
2019-01-20 07:48:43 +03:00
|
|
|
#include "GWindow.h"
|
2019-06-07 12:46:02 +03:00
|
|
|
#include <LibC/errno.h>
|
2019-01-20 07:48:43 +03:00
|
|
|
#include <LibC/fcntl.h>
|
2019-06-07 12:46:02 +03:00
|
|
|
#include <LibC/stdio.h>
|
|
|
|
#include <LibC/stdlib.h>
|
2019-01-20 07:48:43 +03:00
|
|
|
#include <LibC/string.h>
|
|
|
|
#include <LibC/sys/select.h>
|
2019-02-14 19:18:35 +03:00
|
|
|
#include <LibC/sys/socket.h>
|
2019-03-27 03:31:53 +03:00
|
|
|
#include <LibC/sys/time.h>
|
2019-06-07 12:46:02 +03:00
|
|
|
#include <LibC/time.h>
|
|
|
|
#include <LibC/unistd.h>
|
|
|
|
#include <LibCore/CNotifier.h>
|
|
|
|
#include <LibCore/CObject.h>
|
|
|
|
#include <LibGUI/GAction.h>
|
|
|
|
#include <LibGUI/GApplication.h>
|
|
|
|
#include <LibGUI/GDesktop.h>
|
|
|
|
#include <LibGUI/GMenu.h>
|
|
|
|
#include <LibGUI/GWidget.h>
|
2019-05-10 04:19:25 +03:00
|
|
|
#include <sys/uio.h>
|
2018-10-10 16:12:38 +03:00
|
|
|
|
2019-01-20 09:03:38 +03:00
|
|
|
//#define GEVENTLOOP_DEBUG
|
2019-04-10 16:39:28 +03:00
|
|
|
//#define COALESCING_DEBUG
|
2019-01-20 09:03:38 +03:00
|
|
|
|
2019-07-17 21:57:27 +03:00
|
|
|
GWindowServerConnection& GWindowServerConnection::the()
|
|
|
|
{
|
|
|
|
static GWindowServerConnection* s_connection = nullptr;
|
|
|
|
if (!s_connection) {
|
|
|
|
s_connection = new GWindowServerConnection();
|
|
|
|
s_connection->handshake();
|
|
|
|
}
|
|
|
|
return *s_connection;
|
|
|
|
}
|
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handshake()
|
2018-10-10 16:12:38 +03:00
|
|
|
{
|
2019-03-19 02:01:02 +03:00
|
|
|
WSAPI_ClientMessage request;
|
|
|
|
request.type = WSAPI_ClientMessage::Type::Greeting;
|
|
|
|
request.greeting.client_pid = getpid();
|
|
|
|
auto response = sync_request(request, WSAPI_ServerMessage::Type::Greeting);
|
2019-05-03 02:38:24 +03:00
|
|
|
handle_greeting(response);
|
2019-03-09 19:34:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
GEventLoop::GEventLoop()
|
|
|
|
{
|
2019-07-17 21:57:27 +03:00
|
|
|
// ensure the WS connection is up, as our users might be expecting it to be
|
|
|
|
// valid very early (via e.g. GDesktop) :)
|
|
|
|
GWindowServerConnection::the();
|
2018-10-10 16:12:38 +03:00
|
|
|
}
|
|
|
|
|
2019-01-20 06:49:48 +03:00
|
|
|
GEventLoop::~GEventLoop()
|
2018-10-10 16:12:38 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handle_paint_event(const WSAPI_ServerMessage& event, GWindow& window, const ByteBuffer& extra_data)
|
2019-01-20 07:48:43 +03:00
|
|
|
{
|
2019-01-26 23:44:13 +03:00
|
|
|
#ifdef GEVENTLOOP_DEBUG
|
2019-07-17 19:28:30 +03:00
|
|
|
dbgprintf("WID=%x Paint\n", event.window_id);
|
2019-01-26 23:44:13 +03:00
|
|
|
#endif
|
2019-04-20 18:37:28 +03:00
|
|
|
Vector<Rect, 32> rects;
|
2019-04-22 02:15:47 +03:00
|
|
|
for (int i = 0; i < min(WSAPI_ServerMessage::max_inline_rect_count, event.rect_count); ++i)
|
2019-04-20 18:37:28 +03:00
|
|
|
rects.append(event.rects[i]);
|
2019-04-22 02:15:47 +03:00
|
|
|
if (event.extra_size) {
|
|
|
|
auto* extra_rects = reinterpret_cast<const WSAPI_Rect*>(extra_data.data());
|
|
|
|
for (int i = 0; i < event.rect_count - WSAPI_ServerMessage::max_inline_rect_count; ++i)
|
|
|
|
rects.append(extra_rects[i]);
|
|
|
|
}
|
2019-07-17 19:28:30 +03:00
|
|
|
CEventLoop::current().post_event(window, make<GMultiPaintEvent>(rects, event.paint.window_size));
|
2019-01-20 07:48:43 +03:00
|
|
|
}
|
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handle_resize_event(const WSAPI_ServerMessage& event, GWindow& window)
|
2019-02-20 17:34:55 +03:00
|
|
|
{
|
2019-07-17 19:28:30 +03:00
|
|
|
CEventLoop::current().post_event(window, make<GResizeEvent>(event.window.old_rect.size, event.window.rect.size));
|
2019-02-20 17:34:55 +03:00
|
|
|
}
|
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handle_window_activation_event(const WSAPI_ServerMessage& event, GWindow& window)
|
2019-01-26 23:58:43 +03:00
|
|
|
{
|
|
|
|
#ifdef GEVENTLOOP_DEBUG
|
|
|
|
dbgprintf("WID=%x WindowActivation\n", event.window_id);
|
|
|
|
#endif
|
2019-07-17 19:28:30 +03:00
|
|
|
CEventLoop::current().post_event(window, make<GEvent>(event.type == WSAPI_ServerMessage::Type::WindowActivated ? GEvent::WindowBecameActive : GEvent::WindowBecameInactive));
|
2019-01-26 23:58:43 +03:00
|
|
|
}
|
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handle_window_close_request_event(const WSAPI_ServerMessage&, GWindow& window)
|
2019-02-05 12:31:37 +03:00
|
|
|
{
|
2019-07-17 19:28:30 +03:00
|
|
|
CEventLoop::current().post_event(window, make<GEvent>(GEvent::WindowCloseRequest));
|
2019-02-05 12:31:37 +03:00
|
|
|
}
|
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handle_window_entered_or_left_event(const WSAPI_ServerMessage& message, GWindow& window)
|
2019-02-20 12:12:19 +03:00
|
|
|
{
|
2019-07-17 19:28:30 +03:00
|
|
|
CEventLoop::current().post_event(window, make<GEvent>(message.type == WSAPI_ServerMessage::Type::WindowEntered ? GEvent::WindowEntered : GEvent::WindowLeft));
|
2019-02-20 12:12:19 +03:00
|
|
|
}
|
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handle_key_event(const WSAPI_ServerMessage& event, GWindow& window)
|
2019-01-26 08:39:13 +03:00
|
|
|
{
|
2019-01-26 23:44:13 +03:00
|
|
|
#ifdef GEVENTLOOP_DEBUG
|
|
|
|
dbgprintf("WID=%x KeyEvent character=0x%b\n", event.window_id, event.key.character);
|
|
|
|
#endif
|
2019-03-03 14:32:15 +03:00
|
|
|
auto key_event = make<GKeyEvent>(event.type == WSAPI_ServerMessage::Type::KeyDown ? GEvent::KeyDown : GEvent::KeyUp, event.key.key, event.key.modifiers);
|
|
|
|
if (event.key.character != '\0')
|
|
|
|
key_event->m_text = String(&event.key.character, 1);
|
2019-03-02 12:04:49 +03:00
|
|
|
|
2019-03-08 03:59:07 +03:00
|
|
|
if (event.type == WSAPI_ServerMessage::Type::KeyDown) {
|
2019-04-20 22:56:56 +03:00
|
|
|
if (auto* focused_widget = window.focused_widget()) {
|
|
|
|
if (auto* action = focused_widget->action_for_key_event(*key_event)) {
|
|
|
|
if (action->is_enabled()) {
|
|
|
|
action->activate();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-08 03:59:07 +03:00
|
|
|
if (auto* action = GApplication::the().action_for_key_event(*key_event)) {
|
2019-04-12 03:53:27 +03:00
|
|
|
if (action->is_enabled()) {
|
|
|
|
action->activate();
|
|
|
|
return;
|
|
|
|
}
|
2019-03-08 03:59:07 +03:00
|
|
|
}
|
2019-03-02 12:04:49 +03:00
|
|
|
}
|
2019-07-17 19:28:30 +03:00
|
|
|
CEventLoop::current().post_event(window, move(key_event));
|
2019-01-26 08:39:13 +03:00
|
|
|
}
|
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handle_mouse_event(const WSAPI_ServerMessage& event, GWindow& window)
|
2019-01-20 07:48:43 +03:00
|
|
|
{
|
2019-01-26 23:44:13 +03:00
|
|
|
#ifdef GEVENTLOOP_DEBUG
|
2019-05-13 20:52:57 +03:00
|
|
|
dbgprintf("WID=%x MouseEvent %d,%d,%d\n", event.window_id, event.mouse.position.x, event.mouse.position.y, event.mouse.wheel_delta);
|
2019-01-26 23:44:13 +03:00
|
|
|
#endif
|
2019-01-20 07:48:43 +03:00
|
|
|
GMouseEvent::Type type;
|
|
|
|
switch (event.type) {
|
2019-06-07 12:46:02 +03:00
|
|
|
case WSAPI_ServerMessage::Type::MouseMove:
|
|
|
|
type = GEvent::MouseMove;
|
|
|
|
break;
|
|
|
|
case WSAPI_ServerMessage::Type::MouseUp:
|
|
|
|
type = GEvent::MouseUp;
|
|
|
|
break;
|
|
|
|
case WSAPI_ServerMessage::Type::MouseDown:
|
|
|
|
type = GEvent::MouseDown;
|
|
|
|
break;
|
|
|
|
case WSAPI_ServerMessage::Type::MouseDoubleClick:
|
|
|
|
type = GEvent::MouseDoubleClick;
|
|
|
|
break;
|
|
|
|
case WSAPI_ServerMessage::Type::MouseWheel:
|
|
|
|
type = GEvent::MouseWheel;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
break;
|
2019-01-20 07:48:43 +03:00
|
|
|
}
|
|
|
|
GMouseButton button { GMouseButton::None };
|
|
|
|
switch (event.mouse.button) {
|
2019-06-07 12:46:02 +03:00
|
|
|
case WSAPI_MouseButton::NoButton:
|
|
|
|
button = GMouseButton::None;
|
|
|
|
break;
|
|
|
|
case WSAPI_MouseButton::Left:
|
|
|
|
button = GMouseButton::Left;
|
|
|
|
break;
|
|
|
|
case WSAPI_MouseButton::Right:
|
|
|
|
button = GMouseButton::Right;
|
|
|
|
break;
|
|
|
|
case WSAPI_MouseButton::Middle:
|
|
|
|
button = GMouseButton::Middle;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
break;
|
2019-01-20 07:48:43 +03:00
|
|
|
}
|
2019-07-17 19:28:30 +03:00
|
|
|
CEventLoop::current().post_event(window, make<GMouseEvent>(type, event.mouse.position, event.mouse.buttons, button, event.mouse.modifiers, event.mouse.wheel_delta));
|
2019-01-11 01:19:29 +03:00
|
|
|
}
|
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handle_menu_event(const WSAPI_ServerMessage& event)
|
2019-02-12 12:08:35 +03:00
|
|
|
{
|
2019-02-15 11:17:18 +03:00
|
|
|
if (event.type == WSAPI_ServerMessage::Type::MenuItemActivated) {
|
2019-02-12 12:08:35 +03:00
|
|
|
auto* menu = GMenu::from_menu_id(event.menu.menu_id);
|
|
|
|
if (!menu) {
|
|
|
|
dbgprintf("GEventLoop received event for invalid window ID %d\n", event.window_id);
|
|
|
|
return;
|
|
|
|
}
|
2019-02-12 16:09:48 +03:00
|
|
|
if (auto* action = menu->action_at(event.menu.identifier))
|
|
|
|
action->activate();
|
2019-02-12 12:08:35 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
}
|
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handle_wm_event(const WSAPI_ServerMessage& event, GWindow& window)
|
2019-04-04 02:44:35 +03:00
|
|
|
{
|
2019-04-04 17:23:23 +03:00
|
|
|
#ifdef GEVENTLOOP_DEBUG
|
|
|
|
dbgprintf("GEventLoop: handle_wm_event: %d\n", (int)event.type);
|
|
|
|
#endif
|
2019-04-04 02:44:35 +03:00
|
|
|
if (event.type == WSAPI_ServerMessage::WM_WindowStateChanged)
|
2019-07-17 19:28:30 +03:00
|
|
|
CEventLoop::current().post_event(window, make<GWMWindowStateChangedEvent>(event.wm.client_id, event.wm.window_id, String(event.text, event.text_length), event.wm.rect, event.wm.is_active, (GWindowType)event.wm.window_type, event.wm.is_minimized));
|
|
|
|
else if (event.type == WSAPI_ServerMessage::WM_WindowRectChanged)
|
|
|
|
CEventLoop::current().post_event(window, make<GWMWindowRectChangedEvent>(event.wm.client_id, event.wm.window_id, event.wm.rect));
|
2019-07-28 11:18:49 +03:00
|
|
|
else if (event.type == WSAPI_ServerMessage::WM_WindowIconBitmapChanged)
|
|
|
|
CEventLoop::current().post_event(window, make<GWMWindowIconBitmapChangedEvent>(event.wm.client_id, event.wm.window_id, event.wm.icon_buffer_id, event.wm.icon_size));
|
2019-07-17 19:28:30 +03:00
|
|
|
else if (event.type == WSAPI_ServerMessage::WM_WindowRemoved)
|
|
|
|
CEventLoop::current().post_event(window, make<GWMWindowRemovedEvent>(event.wm.client_id, event.wm.window_id));
|
|
|
|
else
|
|
|
|
ASSERT_NOT_REACHED();
|
2019-04-04 02:44:35 +03:00
|
|
|
}
|
|
|
|
|
2019-07-17 20:46:06 +03:00
|
|
|
void GWindowServerConnection::postprocess_bundles(Vector<IncomingMessageBundle>& bundles)
|
2019-02-20 23:59:13 +03:00
|
|
|
{
|
2019-04-10 16:39:28 +03:00
|
|
|
int coalesced_paints = 0;
|
|
|
|
int coalesced_resizes = 0;
|
2019-07-17 19:28:30 +03:00
|
|
|
auto unprocessed_bundles = move(bundles);
|
2019-04-10 16:39:28 +03:00
|
|
|
|
|
|
|
HashMap<int, Size> latest_size_for_window_id;
|
2019-04-22 02:15:47 +03:00
|
|
|
for (auto& bundle : unprocessed_bundles) {
|
|
|
|
auto& event = bundle.message;
|
2019-04-10 16:39:28 +03:00
|
|
|
if (event.type == WSAPI_ServerMessage::Type::WindowResized) {
|
|
|
|
latest_size_for_window_id.set(event.window_id, event.window.rect.size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int paint_count = 0;
|
|
|
|
HashMap<int, Size> latest_paint_size_for_window_id;
|
2019-04-22 02:15:47 +03:00
|
|
|
for (auto& bundle : unprocessed_bundles) {
|
|
|
|
auto& event = bundle.message;
|
2019-04-10 16:39:28 +03:00
|
|
|
if (event.type == WSAPI_ServerMessage::Type::Paint) {
|
|
|
|
++paint_count;
|
|
|
|
#ifdef COALESCING_DEBUG
|
2019-07-17 19:28:30 +03:00
|
|
|
dbgprintf(" (window: %s)\n", Size(event.paint.window_size).to_string().characters());
|
2019-04-10 16:39:28 +03:00
|
|
|
#endif
|
|
|
|
latest_paint_size_for_window_id.set(event.window_id, event.paint.window_size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef COALESCING_DEBUG
|
|
|
|
dbgprintf("paint_count: %d\n", paint_count);
|
|
|
|
#endif
|
|
|
|
|
2019-04-22 02:15:47 +03:00
|
|
|
for (auto& bundle : unprocessed_bundles) {
|
|
|
|
auto& event = bundle.message;
|
2019-02-20 23:59:13 +03:00
|
|
|
if (event.type == WSAPI_ServerMessage::Type::Greeting) {
|
2019-07-17 19:28:30 +03:00
|
|
|
// Shouldn't get a second greeting
|
|
|
|
dbg() << "Got second Greeting!?";
|
|
|
|
ASSERT_NOT_REACHED();
|
2019-04-03 18:22:14 +03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (event.type == WSAPI_ServerMessage::Type::ScreenRectChanged) {
|
2019-05-31 16:44:04 +03:00
|
|
|
GDesktop::the().did_receive_screen_rect({}, event.screen.rect);
|
2019-02-20 23:59:13 +03:00
|
|
|
continue;
|
|
|
|
}
|
2019-02-14 11:32:34 +03:00
|
|
|
|
2019-02-15 11:17:18 +03:00
|
|
|
if (event.type == WSAPI_ServerMessage::Error) {
|
2019-02-14 11:32:34 +03:00
|
|
|
dbgprintf("GEventLoop got error message from server\n");
|
|
|
|
dbgprintf(" - error message: %s\n", String(event.text, event.text_length).characters());
|
2019-07-17 19:28:30 +03:00
|
|
|
CEventLoop::current().quit(1);
|
2019-02-14 11:32:34 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-02-12 12:08:35 +03:00
|
|
|
switch (event.type) {
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ServerMessage::MenuItemActivated:
|
2019-02-12 12:08:35 +03:00
|
|
|
handle_menu_event(event);
|
|
|
|
continue;
|
2019-02-13 19:54:30 +03:00
|
|
|
default:
|
|
|
|
break;
|
2019-02-12 12:08:35 +03:00
|
|
|
}
|
|
|
|
|
2019-01-20 07:48:43 +03:00
|
|
|
auto* window = GWindow::from_window_id(event.window_id);
|
|
|
|
if (!window) {
|
|
|
|
dbgprintf("GEventLoop received event for invalid window ID %d\n", event.window_id);
|
2019-01-20 09:03:38 +03:00
|
|
|
continue;
|
2019-01-20 07:48:43 +03:00
|
|
|
}
|
|
|
|
switch (event.type) {
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ServerMessage::Type::Paint:
|
2019-07-24 11:25:43 +03:00
|
|
|
if (Size(event.paint.window_size) != latest_paint_size_for_window_id.get(event.window_id).value_or({})) {
|
2019-04-10 16:39:28 +03:00
|
|
|
++coalesced_paints;
|
|
|
|
break;
|
|
|
|
}
|
2019-04-22 02:15:47 +03:00
|
|
|
handle_paint_event(event, *window, bundle.extra_data);
|
2019-01-20 07:48:43 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ServerMessage::Type::MouseDown:
|
2019-05-15 23:17:09 +03:00
|
|
|
case WSAPI_ServerMessage::Type::MouseDoubleClick:
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ServerMessage::Type::MouseUp:
|
|
|
|
case WSAPI_ServerMessage::Type::MouseMove:
|
2019-05-13 20:52:57 +03:00
|
|
|
case WSAPI_ServerMessage::Type::MouseWheel:
|
2019-01-20 07:48:43 +03:00
|
|
|
handle_mouse_event(event, *window);
|
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ServerMessage::Type::WindowActivated:
|
|
|
|
case WSAPI_ServerMessage::Type::WindowDeactivated:
|
2019-01-26 23:58:43 +03:00
|
|
|
handle_window_activation_event(event, *window);
|
2019-01-20 07:48:43 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ServerMessage::Type::WindowCloseRequest:
|
2019-02-05 12:31:37 +03:00
|
|
|
handle_window_close_request_event(event, *window);
|
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ServerMessage::Type::KeyDown:
|
|
|
|
case WSAPI_ServerMessage::Type::KeyUp:
|
2019-01-26 08:39:13 +03:00
|
|
|
handle_key_event(event, *window);
|
|
|
|
break;
|
2019-02-20 12:12:19 +03:00
|
|
|
case WSAPI_ServerMessage::Type::WindowEntered:
|
|
|
|
case WSAPI_ServerMessage::Type::WindowLeft:
|
|
|
|
handle_window_entered_or_left_event(event, *window);
|
|
|
|
break;
|
2019-02-20 17:34:55 +03:00
|
|
|
case WSAPI_ServerMessage::Type::WindowResized:
|
2019-07-24 11:25:43 +03:00
|
|
|
if (Size(event.window.rect.size) != latest_size_for_window_id.get(event.window_id).value_or({})) {
|
2019-04-10 16:39:28 +03:00
|
|
|
++coalesced_resizes;
|
|
|
|
break;
|
|
|
|
}
|
2019-02-20 17:34:55 +03:00
|
|
|
handle_resize_event(event, *window);
|
|
|
|
break;
|
2019-02-12 12:08:35 +03:00
|
|
|
default:
|
2019-07-28 11:18:49 +03:00
|
|
|
if (event.type > WSAPI_ServerMessage::__Begin_WM_Events__ && event.type < WSAPI_ServerMessage::Type::__End_WM_Events__)
|
|
|
|
handle_wm_event(event, *window);
|
2019-02-12 12:08:35 +03:00
|
|
|
break;
|
2019-01-20 07:48:43 +03:00
|
|
|
}
|
|
|
|
}
|
2019-02-20 23:59:13 +03:00
|
|
|
|
2019-04-10 16:39:28 +03:00
|
|
|
#ifdef COALESCING_DEBUG
|
|
|
|
if (coalesced_paints)
|
|
|
|
dbgprintf("Coalesced %d paints\n", coalesced_paints);
|
|
|
|
if (coalesced_resizes)
|
|
|
|
dbgprintf("Coalesced %d resizes\n", coalesced_resizes);
|
|
|
|
#endif
|
2018-10-10 16:12:38 +03:00
|
|
|
}
|
2019-02-01 05:50:06 +03:00
|
|
|
|
2019-07-17 19:28:30 +03:00
|
|
|
void GWindowServerConnection::handle_greeting(WSAPI_ServerMessage& message)
|
2019-05-03 02:38:24 +03:00
|
|
|
{
|
2019-07-17 19:28:30 +03:00
|
|
|
set_server_pid(message.greeting.server_pid);
|
|
|
|
set_my_client_id(message.greeting.your_client_id);
|
2019-05-31 16:44:04 +03:00
|
|
|
GDesktop::the().did_receive_screen_rect({}, message.greeting.screen_rect);
|
2019-05-03 02:38:24 +03:00
|
|
|
}
|