2019-02-17 03:43:01 +03:00
|
|
|
#include <WindowServer/WSMessageLoop.h>
|
|
|
|
#include <WindowServer/WSMessage.h>
|
|
|
|
#include <WindowServer/WSMessageReceiver.h>
|
|
|
|
#include <WindowServer/WSWindowManager.h>
|
|
|
|
#include <WindowServer/WSScreen.h>
|
2019-02-14 10:22:47 +03:00
|
|
|
#include <WindowServer/WSClientConnection.h>
|
2019-02-15 11:14:21 +03:00
|
|
|
#include <WindowServer/WSAPITypes.h>
|
2019-02-17 03:43:01 +03:00
|
|
|
#include <Kernel/KeyCode.h>
|
|
|
|
#include <LibC/sys/socket.h>
|
|
|
|
#include <LibC/sys/select.h>
|
|
|
|
#include <LibC/unistd.h>
|
|
|
|
#include <LibC/time.h>
|
|
|
|
#include <LibC/fcntl.h>
|
|
|
|
#include <LibC/stdio.h>
|
|
|
|
#include <LibC/errno.h>
|
2019-01-16 18:03:50 +03:00
|
|
|
|
|
|
|
//#define WSEVENTLOOP_DEBUG
|
|
|
|
|
2019-01-26 07:28:02 +03:00
|
|
|
static WSMessageLoop* s_the;
|
2019-01-16 18:03:50 +03:00
|
|
|
|
2019-01-26 07:28:02 +03:00
|
|
|
WSMessageLoop::WSMessageLoop()
|
2019-01-16 18:03:50 +03:00
|
|
|
{
|
|
|
|
if (!s_the)
|
|
|
|
s_the = this;
|
|
|
|
}
|
|
|
|
|
2019-01-26 07:28:02 +03:00
|
|
|
WSMessageLoop::~WSMessageLoop()
|
2019-01-16 18:03:50 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-01-26 07:28:02 +03:00
|
|
|
WSMessageLoop& WSMessageLoop::the()
|
2019-01-16 18:03:50 +03:00
|
|
|
{
|
|
|
|
ASSERT(s_the);
|
|
|
|
return *s_the;
|
|
|
|
}
|
|
|
|
|
2019-01-26 07:28:02 +03:00
|
|
|
int WSMessageLoop::exec()
|
2019-01-16 18:03:50 +03:00
|
|
|
{
|
2019-02-17 02:13:47 +03:00
|
|
|
m_keyboard_fd = open("/dev/keyboard", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
|
|
|
m_mouse_fd = open("/dev/psaux", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
2019-01-16 19:20:58 +03:00
|
|
|
|
2019-02-17 02:13:47 +03:00
|
|
|
unlink("/wsportal");
|
2019-01-16 19:20:58 +03:00
|
|
|
|
2019-02-17 02:13:47 +03:00
|
|
|
m_server_fd = socket(AF_LOCAL, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0);
|
2019-02-14 19:18:35 +03:00
|
|
|
ASSERT(m_server_fd >= 0);
|
|
|
|
sockaddr_un address;
|
|
|
|
address.sun_family = AF_LOCAL;
|
|
|
|
strcpy(address.sun_path, "/wsportal");
|
2019-02-17 02:13:47 +03:00
|
|
|
int rc = bind(m_server_fd, (const sockaddr*)&address, sizeof(address));
|
2019-02-14 19:18:35 +03:00
|
|
|
ASSERT(rc == 0);
|
2019-02-17 02:13:47 +03:00
|
|
|
rc = listen(m_server_fd, 5);
|
2019-02-14 19:18:35 +03:00
|
|
|
ASSERT(rc == 0);
|
|
|
|
|
2019-01-16 19:20:58 +03:00
|
|
|
ASSERT(m_keyboard_fd >= 0);
|
|
|
|
ASSERT(m_mouse_fd >= 0);
|
|
|
|
|
2019-01-16 18:03:50 +03:00
|
|
|
m_running = true;
|
|
|
|
for (;;) {
|
2019-01-26 07:35:45 +03:00
|
|
|
wait_for_message();
|
2019-02-17 02:13:47 +03:00
|
|
|
Vector<QueuedMessage> messages = move(m_queued_messages);
|
2019-01-16 18:03:50 +03:00
|
|
|
|
2019-01-26 07:35:45 +03:00
|
|
|
for (auto& queued_message : messages) {
|
|
|
|
auto* receiver = queued_message.receiver;
|
|
|
|
auto& message = *queued_message.message;
|
2019-01-16 18:03:50 +03:00
|
|
|
#ifdef WSEVENTLOOP_DEBUG
|
2019-02-12 11:24:28 +03:00
|
|
|
dbgprintf("WSMessageLoop: receiver{%p} message %u\n", receiver, (unsigned)message.type());
|
2019-01-16 18:03:50 +03:00
|
|
|
#endif
|
|
|
|
if (!receiver) {
|
2019-01-26 07:35:45 +03:00
|
|
|
dbgprintf("WSMessage type %u with no receiver :(\n", message.type());
|
2019-01-16 18:03:50 +03:00
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
return 1;
|
|
|
|
} else {
|
2019-01-26 07:35:45 +03:00
|
|
|
receiver->on_message(message);
|
2019-01-16 18:03:50 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-11 15:05:51 +03:00
|
|
|
void WSMessageLoop::post_message(WSMessageReceiver* receiver, OwnPtr<WSMessage>&& message)
|
2019-01-16 18:03:50 +03:00
|
|
|
{
|
|
|
|
#ifdef WSEVENTLOOP_DEBUG
|
2019-02-12 11:24:28 +03:00
|
|
|
dbgprintf("WSMessageLoop::post_message: {%u} << receiver=%p, message=%p (type=%u)\n", m_queued_messages.size(), receiver, message.ptr(), message->type());
|
2019-01-16 18:03:50 +03:00
|
|
|
#endif
|
2019-01-26 07:35:45 +03:00
|
|
|
m_queued_messages.append({ receiver, move(message) });
|
2019-01-16 18:03:50 +03:00
|
|
|
}
|
|
|
|
|
2019-02-13 11:10:32 +03:00
|
|
|
void WSMessageLoop::Timer::reload()
|
|
|
|
{
|
|
|
|
struct timeval now;
|
2019-02-17 02:13:47 +03:00
|
|
|
gettimeofday(&now, nullptr);
|
2019-02-13 11:10:32 +03:00
|
|
|
next_fire_time = {
|
|
|
|
now.tv_sec + (interval / 1000),
|
|
|
|
now.tv_usec + (interval % 1000)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
int WSMessageLoop::start_timer(int interval, Function<void()>&& callback)
|
|
|
|
{
|
|
|
|
auto timer = make<Timer>();
|
|
|
|
int timer_id = m_next_timer_id++;
|
|
|
|
timer->timer_id = timer_id;
|
|
|
|
timer->callback = move(callback);
|
|
|
|
timer->interval = interval;
|
|
|
|
timer->reload();
|
|
|
|
m_timers.set(timer_id, move(timer));
|
|
|
|
return timer_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
int WSMessageLoop::stop_timer(int timer_id)
|
|
|
|
{
|
|
|
|
auto it = m_timers.find(timer_id);
|
|
|
|
if (it == m_timers.end())
|
|
|
|
return -1;
|
|
|
|
m_timers.remove(it);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-01-26 07:35:45 +03:00
|
|
|
void WSMessageLoop::wait_for_message()
|
2019-01-16 19:20:58 +03:00
|
|
|
{
|
|
|
|
fd_set rfds;
|
2019-02-17 02:13:47 +03:00
|
|
|
FD_ZERO(&rfds);
|
2019-02-14 19:18:35 +03:00
|
|
|
int max_fd = 0;
|
2019-02-17 02:13:47 +03:00
|
|
|
auto add_fd_to_set = [&max_fd] (int fd, auto& set) {
|
|
|
|
FD_SET(fd, &set);
|
2019-02-14 19:18:35 +03:00
|
|
|
if (fd > max_fd)
|
|
|
|
max_fd = fd;
|
|
|
|
};
|
|
|
|
|
2019-02-17 02:13:47 +03:00
|
|
|
add_fd_to_set(m_keyboard_fd, rfds);
|
|
|
|
add_fd_to_set(m_mouse_fd, rfds);
|
|
|
|
add_fd_to_set(m_server_fd, rfds);
|
2019-02-14 19:18:35 +03:00
|
|
|
|
|
|
|
WSClientConnection::for_each_client([&] (WSClientConnection& client) {
|
2019-02-17 02:13:47 +03:00
|
|
|
add_fd_to_set(client.fd(), rfds);
|
2019-02-14 19:18:35 +03:00
|
|
|
});
|
|
|
|
|
2019-01-18 07:26:45 +03:00
|
|
|
struct timeval timeout = { 0, 0 };
|
2019-02-13 11:10:32 +03:00
|
|
|
bool had_any_timer = false;
|
|
|
|
|
|
|
|
for (auto& it : m_timers) {
|
|
|
|
auto& timer = *it.value;
|
|
|
|
if (!had_any_timer) {
|
|
|
|
timeout = timer.next_fire_time;
|
2019-02-13 11:38:32 +03:00
|
|
|
had_any_timer = true;
|
2019-02-13 11:10:32 +03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (timer.next_fire_time.tv_sec > timeout.tv_sec || (timer.next_fire_time.tv_sec == timeout.tv_sec && timer.next_fire_time.tv_usec > timeout.tv_usec))
|
|
|
|
timeout = timer.next_fire_time;
|
|
|
|
}
|
|
|
|
|
2019-02-17 02:13:47 +03:00
|
|
|
int rc = select(max_fd + 1, &rfds, nullptr, nullptr, m_timers.is_empty() && m_queued_messages.is_empty() ? nullptr : &timeout);
|
2019-01-16 19:20:58 +03:00
|
|
|
if (rc < 0) {
|
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
}
|
|
|
|
|
2019-02-13 11:10:32 +03:00
|
|
|
struct timeval now;
|
2019-02-17 02:13:47 +03:00
|
|
|
gettimeofday(&now, nullptr);
|
2019-02-13 11:10:32 +03:00
|
|
|
for (auto& it : m_timers) {
|
|
|
|
auto& timer = *it.value;
|
|
|
|
if (now.tv_sec > timer.next_fire_time.tv_sec || (now.tv_sec == timer.next_fire_time.tv_sec && now.tv_usec > timer.next_fire_time.tv_usec)) {
|
|
|
|
timer.callback();
|
|
|
|
timer.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-17 02:13:47 +03:00
|
|
|
if (FD_ISSET(m_keyboard_fd, &rfds))
|
2019-01-16 19:20:58 +03:00
|
|
|
drain_keyboard();
|
2019-02-17 02:13:47 +03:00
|
|
|
if (FD_ISSET(m_mouse_fd, &rfds))
|
2019-01-16 19:20:58 +03:00
|
|
|
drain_mouse();
|
2019-02-17 02:13:47 +03:00
|
|
|
if (FD_ISSET(m_server_fd, &rfds)) {
|
2019-02-14 19:18:35 +03:00
|
|
|
sockaddr_un address;
|
|
|
|
socklen_t address_size = sizeof(address);
|
2019-02-17 02:13:47 +03:00
|
|
|
int client_fd = accept(m_server_fd, (sockaddr*)&address, &address_size);
|
|
|
|
dbgprintf("accept() returned fd=%d, address=%s\n", client_fd, address.sun_path);
|
|
|
|
ASSERT(client_fd >= 0);
|
2019-02-14 19:18:35 +03:00
|
|
|
new WSClientConnection(client_fd);
|
|
|
|
}
|
|
|
|
WSClientConnection::for_each_client([&] (WSClientConnection& client) {
|
2019-02-17 02:13:47 +03:00
|
|
|
if (!FD_ISSET(client.fd(), &rfds))
|
|
|
|
return;
|
|
|
|
unsigned messages_received = 0;
|
|
|
|
for (;;) {
|
|
|
|
WSAPI_ClientMessage message;
|
|
|
|
// FIXME: Don't go one message at a time, that's so much context switching, oof.
|
|
|
|
ssize_t nread = read(client.fd(), &message, sizeof(WSAPI_ClientMessage));
|
|
|
|
if (nread == 0) {
|
|
|
|
if (!messages_received)
|
|
|
|
notify_client_disconnected(client.client_id());
|
|
|
|
break;
|
2019-02-15 13:43:43 +03:00
|
|
|
}
|
2019-02-17 02:13:47 +03:00
|
|
|
if (nread < 0) {
|
|
|
|
perror("read");
|
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
}
|
|
|
|
on_receive_from_client(client.client_id(), message);
|
|
|
|
++messages_received;
|
2019-02-14 19:18:35 +03:00
|
|
|
}
|
|
|
|
});
|
2019-01-16 19:20:58 +03:00
|
|
|
}
|
|
|
|
|
2019-01-26 07:28:02 +03:00
|
|
|
void WSMessageLoop::drain_mouse()
|
2019-01-16 18:03:50 +03:00
|
|
|
{
|
|
|
|
auto& screen = WSScreen::the();
|
|
|
|
bool prev_left_button = screen.left_mouse_button_pressed();
|
|
|
|
bool prev_right_button = screen.right_mouse_button_pressed();
|
|
|
|
int dx = 0;
|
|
|
|
int dy = 0;
|
2019-02-17 02:13:47 +03:00
|
|
|
bool left_button = prev_left_button;
|
|
|
|
bool right_button = prev_right_button;
|
|
|
|
for (;;) {
|
2019-01-17 04:32:40 +03:00
|
|
|
byte data[3];
|
2019-02-17 02:13:47 +03:00
|
|
|
ssize_t nread = read(m_mouse_fd, data, sizeof(data));
|
|
|
|
if (nread == 0)
|
|
|
|
break;
|
2019-01-16 19:20:58 +03:00
|
|
|
ASSERT(nread == sizeof(data));
|
2019-01-16 18:03:50 +03:00
|
|
|
bool left_button = data[0] & 1;
|
|
|
|
bool right_button = data[0] & 2;
|
2019-02-07 10:07:37 +03:00
|
|
|
bool x_overflow = data[0] & 0x40;
|
|
|
|
bool y_overflow = data[0] & 0x80;
|
|
|
|
bool x_sign = data[0] & 0x10;
|
|
|
|
bool y_sign = data[0] & 0x20;
|
|
|
|
|
|
|
|
if (x_overflow || y_overflow)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
int x = data[1];
|
|
|
|
int y = data[2];
|
|
|
|
if (x && x_sign)
|
|
|
|
x -= 0x100;
|
|
|
|
if (y && y_sign)
|
|
|
|
y -= 0x100;
|
|
|
|
|
|
|
|
dx += x;
|
|
|
|
dy += -y;
|
2019-02-17 02:13:47 +03:00
|
|
|
if (left_button != prev_left_button || right_button != prev_right_button) {
|
2019-01-16 18:03:50 +03:00
|
|
|
prev_left_button = left_button;
|
|
|
|
prev_right_button = right_button;
|
|
|
|
screen.on_receive_mouse_data(dx, dy, left_button, right_button);
|
|
|
|
dx = 0;
|
|
|
|
dy = 0;
|
|
|
|
}
|
|
|
|
}
|
2019-02-17 02:13:47 +03:00
|
|
|
if (dx || dy) {
|
|
|
|
screen.on_receive_mouse_data(dx, dy, left_button, right_button);
|
|
|
|
}
|
2019-01-16 18:03:50 +03:00
|
|
|
}
|
2019-01-16 19:20:58 +03:00
|
|
|
|
2019-01-26 07:28:02 +03:00
|
|
|
void WSMessageLoop::drain_keyboard()
|
2019-01-16 19:20:58 +03:00
|
|
|
{
|
|
|
|
auto& screen = WSScreen::the();
|
2019-02-17 02:13:47 +03:00
|
|
|
for (;;) {
|
|
|
|
KeyEvent event;
|
|
|
|
ssize_t nread = read(m_keyboard_fd, (byte*)&event, sizeof(KeyEvent));
|
|
|
|
if (nread == 0)
|
|
|
|
break;
|
|
|
|
ASSERT(nread == sizeof(KeyEvent));
|
2019-01-21 09:05:31 +03:00
|
|
|
screen.on_receive_keyboard_data(event);
|
2019-01-16 19:20:58 +03:00
|
|
|
}
|
|
|
|
}
|
2019-02-13 19:54:30 +03:00
|
|
|
|
2019-02-17 02:13:47 +03:00
|
|
|
void WSMessageLoop::notify_client_disconnected(int client_id)
|
2019-02-14 03:21:32 +03:00
|
|
|
{
|
2019-02-14 10:22:47 +03:00
|
|
|
auto* client = WSClientConnection::from_client_id(client_id);
|
|
|
|
if (!client)
|
|
|
|
return;
|
|
|
|
post_message(client, make<WSClientDisconnectedNotification>(client_id));
|
2019-02-14 03:21:32 +03:00
|
|
|
}
|
|
|
|
|
2019-02-15 13:43:43 +03:00
|
|
|
void WSMessageLoop::on_receive_from_client(int client_id, const WSAPI_ClientMessage& message)
|
2019-02-13 19:54:30 +03:00
|
|
|
{
|
2019-02-17 02:13:47 +03:00
|
|
|
#if 0
|
2019-02-14 03:21:32 +03:00
|
|
|
// FIXME: This should not be necessary.. why is this necessary?
|
|
|
|
while (!running())
|
2019-02-17 02:13:47 +03:00
|
|
|
sched_yield();
|
|
|
|
#endif
|
2019-02-14 03:21:32 +03:00
|
|
|
|
2019-02-17 02:13:47 +03:00
|
|
|
WSClientConnection* client = WSClientConnection::from_client_id(client_id);
|
|
|
|
ASSERT(client);
|
2019-02-13 19:54:30 +03:00
|
|
|
switch (message.type) {
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::CreateMenubar:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPICreateMenubarRequest>(client_id));
|
2019-02-13 19:54:30 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::DestroyMenubar:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPIDestroyMenubarRequest>(client_id, message.menu.menubar_id));
|
2019-02-13 19:54:30 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::SetApplicationMenubar:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPISetApplicationMenubarRequest>(client_id, message.menu.menubar_id));
|
2019-02-13 20:48:22 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::AddMenuToMenubar:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPIAddMenuToMenubarRequest>(client_id, message.menu.menubar_id, message.menu.menu_id));
|
2019-02-13 20:48:22 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::CreateMenu:
|
2019-02-14 03:21:32 +03:00
|
|
|
ASSERT(message.text_length < sizeof(message.text));
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPICreateMenuRequest>(client_id, String(message.text, message.text_length)));
|
2019-02-13 20:48:22 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::DestroyMenu:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPIDestroyMenuRequest>(client_id, message.menu.menu_id));
|
2019-02-13 20:48:22 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::AddMenuItem:
|
2019-02-14 03:21:32 +03:00
|
|
|
ASSERT(message.text_length < sizeof(message.text));
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPIAddMenuItemRequest>(client_id, message.menu.menu_id, message.menu.identifier, String(message.text, message.text_length)));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::CreateWindow:
|
2019-02-14 03:21:32 +03:00
|
|
|
ASSERT(message.text_length < sizeof(message.text));
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPICreateWindowRequest>(client_id, message.window.rect, String(message.text, message.text_length)));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::DestroyWindow:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPIDestroyWindowRequest>(client_id, message.window_id));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::SetWindowTitle:
|
2019-02-14 03:21:32 +03:00
|
|
|
ASSERT(message.text_length < sizeof(message.text));
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPISetWindowTitleRequest>(client_id, message.window_id, String(message.text, message.text_length)));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::GetWindowTitle:
|
2019-02-14 03:21:32 +03:00
|
|
|
ASSERT(message.text_length < sizeof(message.text));
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPIGetWindowTitleRequest>(client_id, message.window_id));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::SetWindowRect:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPISetWindowRectRequest>(client_id, message.window_id, message.window.rect));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::GetWindowRect:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPIGetWindowRectRequest>(client_id, message.window_id));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::InvalidateRect:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPIInvalidateRectRequest>(client_id, message.window_id, message.window.rect));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::DidFinishPainting:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPIDidFinishPaintingNotification>(client_id, message.window_id, message.window.rect));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::GetWindowBackingStore:
|
2019-02-14 10:22:47 +03:00
|
|
|
post_message(client, make<WSAPIGetWindowBackingStoreRequest>(client_id, message.window_id));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-15 11:17:18 +03:00
|
|
|
case WSAPI_ClientMessage::Type::SetGlobalCursorTracking:
|
2019-02-14 10:43:29 +03:00
|
|
|
post_message(client, make<WSAPISetGlobalCursorTrackingRequest>(client_id, message.window_id, message.value));
|
2019-02-14 03:21:32 +03:00
|
|
|
break;
|
2019-02-13 19:54:30 +03:00
|
|
|
}
|
|
|
|
}
|