Compare commits
1 Commits
main
...
57cc217a11
| Author | SHA1 | Date | |
|---|---|---|---|
| 57cc217a11 |
@@ -1,20 +1,20 @@
|
|||||||
From e71364497354b511159bf3d883b0e6168f430187 Mon Sep 17 00:00:00 2001
|
From c9dd87198ce5262e6ddf6bf3b0c18eb84784d35e Mon Sep 17 00:00:00 2001
|
||||||
From: Oskari Alaranta <oskari.alaranta@bananymous.com>
|
From: Oskari Alaranta <oskari.alaranta@bananymous.com>
|
||||||
Date: Tue, 7 Jul 2026 05:04:45 +0300
|
Date: Wed, 15 Apr 2026 17:52:54 +0300
|
||||||
Subject: [PATCH] linux-window-server-sdl2
|
Subject: [PATCH] linux-window-server-sdl2
|
||||||
|
|
||||||
---
|
---
|
||||||
userspace/libraries/LibGUI/Widget/Widget.cpp | 2 +-
|
userspace/libraries/LibGUI/Widget/Widget.cpp | 2 +-
|
||||||
userspace/libraries/LibGUI/Window.cpp | 11 +-
|
userspace/libraries/LibGUI/Window.cpp | 9 +-
|
||||||
userspace/programs/ProgramLauncher/main.cpp | 2 +-
|
userspace/programs/ProgramLauncher/main.cpp | 2 +-
|
||||||
userspace/programs/Terminal/Terminal.cpp | 10 +-
|
userspace/programs/Terminal/Terminal.cpp | 4 +-
|
||||||
.../programs/WindowServer/CMakeLists.txt | 3 +
|
.../programs/WindowServer/CMakeLists.txt | 3 +
|
||||||
.../programs/WindowServer/Framebuffer.cpp | 52 +--
|
.../programs/WindowServer/Framebuffer.cpp | 52 +--
|
||||||
userspace/programs/WindowServer/Window.cpp | 29 +-
|
userspace/programs/WindowServer/Window.cpp | 29 +-
|
||||||
.../programs/WindowServer/WindowServer.cpp | 47 ++-
|
.../programs/WindowServer/WindowServer.cpp | 47 ++-
|
||||||
.../programs/WindowServer/WindowServer.h | 1 +
|
.../programs/WindowServer/WindowServer.h | 1 +
|
||||||
userspace/programs/WindowServer/main.cpp | 357 ++++++++++++------
|
userspace/programs/WindowServer/main.cpp | 357 ++++++++++++------
|
||||||
10 files changed, 345 insertions(+), 169 deletions(-)
|
10 files changed, 340 insertions(+), 166 deletions(-)
|
||||||
|
|
||||||
diff --git a/userspace/libraries/LibGUI/Widget/Widget.cpp b/userspace/libraries/LibGUI/Widget/Widget.cpp
|
diff --git a/userspace/libraries/LibGUI/Widget/Widget.cpp b/userspace/libraries/LibGUI/Widget/Widget.cpp
|
||||||
index d6489d87..c532fb04 100644
|
index d6489d87..c532fb04 100644
|
||||||
@@ -30,7 +30,7 @@ index d6489d87..c532fb04 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/userspace/libraries/LibGUI/Window.cpp b/userspace/libraries/LibGUI/Window.cpp
|
diff --git a/userspace/libraries/LibGUI/Window.cpp b/userspace/libraries/LibGUI/Window.cpp
|
||||||
index 607421eb..d8aeee7e 100644
|
index b4172f70..3a0e9cca 100644
|
||||||
--- a/userspace/libraries/LibGUI/Window.cpp
|
--- a/userspace/libraries/LibGUI/Window.cpp
|
||||||
+++ b/userspace/libraries/LibGUI/Window.cpp
|
+++ b/userspace/libraries/LibGUI/Window.cpp
|
||||||
@@ -4,9 +4,8 @@
|
@@ -4,9 +4,8 @@
|
||||||
@@ -44,7 +44,7 @@ index 607421eb..d8aeee7e 100644
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -311,23 +310,23 @@ namespace LibGUI
|
@@ -271,7 +270,7 @@ namespace LibGUI
|
||||||
|
|
||||||
void Window::cleanup()
|
void Window::cleanup()
|
||||||
{
|
{
|
||||||
@@ -53,25 +53,24 @@ index 607421eb..d8aeee7e 100644
|
|||||||
close(m_server_fd);
|
close(m_server_fd);
|
||||||
close(m_epoll_fd);
|
close(m_epoll_fd);
|
||||||
}
|
}
|
||||||
|
@@ -279,7 +278,7 @@ namespace LibGUI
|
||||||
BAN::ErrorOr<bool> Window::handle_resize_event(const EventPacket::ResizeWindowEvent& event)
|
BAN::ErrorOr<void> Window::handle_resize_event(const EventPacket::ResizeWindowEvent& event)
|
||||||
{
|
{
|
||||||
- void* framebuffer_addr = smo_map(event.smo_key);
|
|
||||||
+ void* framebuffer_addr = shmat(event.smo_key, nullptr, 0);
|
|
||||||
if (framebuffer_addr == nullptr)
|
|
||||||
{
|
|
||||||
- if (errno == ENOENT)
|
|
||||||
+ if (errno == EINVAL)
|
|
||||||
return false;
|
|
||||||
return BAN::Error::from_errno(errno);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_framebuffer_smo)
|
if (m_framebuffer_smo)
|
||||||
- munmap(m_framebuffer_smo, m_width * m_height * 4);
|
- munmap(m_framebuffer_smo, m_width * m_height * 4);
|
||||||
+ shmdt(m_framebuffer_smo);
|
+ shmdt(m_framebuffer_smo);
|
||||||
m_framebuffer_smo = nullptr;
|
m_framebuffer_smo = nullptr;
|
||||||
|
|
||||||
TRY(m_texture.resize(event.width, event.height));
|
TRY(m_texture.resize(event.width, event.height));
|
||||||
|
@@ -287,7 +286,7 @@ namespace LibGUI
|
||||||
|
if (m_root_widget)
|
||||||
|
TRY(m_root_widget->set_fixed_geometry({ 0, 0, event.width, event.height }));
|
||||||
|
|
||||||
|
- void* framebuffer_addr = smo_map(event.smo_key);
|
||||||
|
+ void* framebuffer_addr = shmat(event.smo_key, nullptr, 0);
|
||||||
|
if (framebuffer_addr == nullptr)
|
||||||
|
return BAN::Error::from_errno(errno);
|
||||||
|
|
||||||
diff --git a/userspace/programs/ProgramLauncher/main.cpp b/userspace/programs/ProgramLauncher/main.cpp
|
diff --git a/userspace/programs/ProgramLauncher/main.cpp b/userspace/programs/ProgramLauncher/main.cpp
|
||||||
index c833c582..0e1cc460 100644
|
index c833c582..0e1cc460 100644
|
||||||
--- a/userspace/programs/ProgramLauncher/main.cpp
|
--- a/userspace/programs/ProgramLauncher/main.cpp
|
||||||
@@ -86,18 +85,10 @@ index c833c582..0e1cc460 100644
|
|||||||
const auto full_program_list = get_program_list();
|
const auto full_program_list = get_program_list();
|
||||||
|
|
||||||
diff --git a/userspace/programs/Terminal/Terminal.cpp b/userspace/programs/Terminal/Terminal.cpp
|
diff --git a/userspace/programs/Terminal/Terminal.cpp b/userspace/programs/Terminal/Terminal.cpp
|
||||||
index c470438d..709db432 100644
|
index e1bd317d..8a6b5bd0 100644
|
||||||
--- a/userspace/programs/Terminal/Terminal.cpp
|
--- a/userspace/programs/Terminal/Terminal.cpp
|
||||||
+++ b/userspace/programs/Terminal/Terminal.cpp
|
+++ b/userspace/programs/Terminal/Terminal.cpp
|
||||||
@@ -9,6 +9,7 @@
|
@@ -92,7 +92,7 @@ void Terminal::start_shell()
|
||||||
#include <fcntl.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
+#include <sys/ioctl.h>
|
|
||||||
#include <sys/select.h>
|
|
||||||
#include <termios.h>
|
|
||||||
#include <time.h>
|
|
||||||
@@ -92,7 +93,7 @@ void Terminal::start_shell()
|
|
||||||
close(pts_slave);
|
close(pts_slave);
|
||||||
close(pts_master);
|
close(pts_master);
|
||||||
|
|
||||||
@@ -106,7 +97,7 @@ index c470438d..709db432 100644
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +128,7 @@ void Terminal::run()
|
@@ -127,7 +127,7 @@ void Terminal::run()
|
||||||
m_window->texture().set_bg_color(m_bg_color);
|
m_window->texture().set_bg_color(m_bg_color);
|
||||||
m_window->invalidate();
|
m_window->invalidate();
|
||||||
|
|
||||||
@@ -115,25 +106,6 @@ index c470438d..709db432 100644
|
|||||||
|
|
||||||
m_window->set_min_size(m_font.width() * 8, m_font.height() * 2);
|
m_window->set_min_size(m_font.width() * 8, m_font.height() * 2);
|
||||||
|
|
||||||
@@ -147,7 +148,8 @@ void Terminal::run()
|
|
||||||
.ws_xpixel = static_cast<unsigned short>(m_window->width()),
|
|
||||||
.ws_ypixel = static_cast<unsigned short>(m_window->height()),
|
|
||||||
};
|
|
||||||
- if (tcsetwinsize(m_shell_info.pts_master, &winsize) == -1)
|
|
||||||
+
|
|
||||||
+ if (ioctl(m_shell_info.pts_master, TIOCSWINSZ, &winsize) == -1)
|
|
||||||
perror("tcsetwinsize");
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -212,7 +214,7 @@ void Terminal::run()
|
|
||||||
.ws_xpixel = static_cast<unsigned short>(m_window->width()),
|
|
||||||
.ws_ypixel = static_cast<unsigned short>(m_window->height()),
|
|
||||||
};
|
|
||||||
- if (tcsetwinsize(m_shell_info.pts_master, &winsize) == -1)
|
|
||||||
+ if (ioctl(m_shell_info.pts_master, TIOCSWINSZ, &winsize) == -1)
|
|
||||||
perror("tcsetwinsize");
|
|
||||||
});
|
|
||||||
|
|
||||||
diff --git a/userspace/programs/WindowServer/CMakeLists.txt b/userspace/programs/WindowServer/CMakeLists.txt
|
diff --git a/userspace/programs/WindowServer/CMakeLists.txt b/userspace/programs/WindowServer/CMakeLists.txt
|
||||||
index 8fdf79f9..fcaf441d 100644
|
index 8fdf79f9..fcaf441d 100644
|
||||||
--- a/userspace/programs/WindowServer/CMakeLists.txt
|
--- a/userspace/programs/WindowServer/CMakeLists.txt
|
||||||
@@ -227,7 +199,7 @@ index 0e727e8f..119f1451 100644
|
|||||||
return framebuffer;
|
return framebuffer;
|
||||||
}
|
}
|
||||||
diff --git a/userspace/programs/WindowServer/Window.cpp b/userspace/programs/WindowServer/Window.cpp
|
diff --git a/userspace/programs/WindowServer/Window.cpp b/userspace/programs/WindowServer/Window.cpp
|
||||||
index 78de89c9..c5405695 100644
|
index 1e66f522..9759eec9 100644
|
||||||
--- a/userspace/programs/WindowServer/Window.cpp
|
--- a/userspace/programs/WindowServer/Window.cpp
|
||||||
+++ b/userspace/programs/WindowServer/Window.cpp
|
+++ b/userspace/programs/WindowServer/Window.cpp
|
||||||
@@ -5,15 +5,14 @@
|
@@ -5,15 +5,14 @@
|
||||||
@@ -249,7 +221,7 @@ index 78de89c9..c5405695 100644
|
|||||||
|
|
||||||
LibGUI::EventPacket::DestroyWindowEvent packet;
|
LibGUI::EventPacket::DestroyWindowEvent packet;
|
||||||
|
|
||||||
@@ -45,16 +44,16 @@ BAN::ErrorOr<void> Window::resize(uint32_t width, uint32_t height)
|
@@ -47,16 +46,16 @@ BAN::ErrorOr<void> Window::resize(uint32_t width, uint32_t height)
|
||||||
{
|
{
|
||||||
const size_t fb_bytes = width * height * 4;
|
const size_t fb_bytes = width * height * 4;
|
||||||
|
|
||||||
@@ -272,7 +244,7 @@ index 78de89c9..c5405695 100644
|
|||||||
|
|
||||||
{
|
{
|
||||||
const auto old_area = m_client_area;
|
const auto old_area = m_client_area;
|
||||||
@@ -68,16 +67,14 @@ BAN::ErrorOr<void> Window::resize(uint32_t width, uint32_t height)
|
@@ -70,16 +69,14 @@ BAN::ErrorOr<void> Window::resize(uint32_t width, uint32_t height)
|
||||||
return title_bar_ret.release_error();
|
return title_bar_ret.release_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,7 +266,7 @@ index 78de89c9..c5405695 100644
|
|||||||
m_client_area.max_x = m_client_area.min_x + width;
|
m_client_area.max_x = m_client_area.min_x + width;
|
||||||
m_client_area.max_y = m_client_area.min_y + height;
|
m_client_area.max_y = m_client_area.min_y + height;
|
||||||
diff --git a/userspace/programs/WindowServer/WindowServer.cpp b/userspace/programs/WindowServer/WindowServer.cpp
|
diff --git a/userspace/programs/WindowServer/WindowServer.cpp b/userspace/programs/WindowServer/WindowServer.cpp
|
||||||
index e6b01476..a14074c3 100644
|
index 2c67d6c0..600704fd 100644
|
||||||
--- a/userspace/programs/WindowServer/WindowServer.cpp
|
--- a/userspace/programs/WindowServer/WindowServer.cpp
|
||||||
+++ b/userspace/programs/WindowServer/WindowServer.cpp
|
+++ b/userspace/programs/WindowServer/WindowServer.cpp
|
||||||
@@ -8,19 +8,20 @@
|
@@ -8,19 +8,20 @@
|
||||||
@@ -323,16 +295,16 @@ index e6b01476..a14074c3 100644
|
|||||||
{
|
{
|
||||||
MUST(m_background_image.resize(m_framebuffer.width * m_framebuffer.height, 0xFF101010));
|
MUST(m_background_image.resize(m_framebuffer.width * m_framebuffer.height, 0xFF101010));
|
||||||
|
|
||||||
@@ -512,7 +513,7 @@ static void update_volume(const char* new_volume)
|
@@ -440,7 +441,7 @@ static void update_volume(const char* new_volume)
|
||||||
|
|
||||||
void WindowServer::on_key_event(LibInput::KeyEvent event)
|
void WindowServer::on_key_event(LibInput::KeyEvent event)
|
||||||
{
|
{
|
||||||
- if (event.key == LibInput::Key::LeftSuper)
|
- if (event.key == LibInput::Key::Super)
|
||||||
+ if (event.key == LibInput::Key::RightCtrl)
|
+ if (event.key == LibInput::Key::RightCtrl)
|
||||||
m_is_mod_key_held = event.pressed();
|
m_is_mod_key_held = event.pressed();
|
||||||
|
|
||||||
if (event.pressed() && event.key == LibInput::Key::VolumeDown)
|
if (event.pressed() && event.key == LibInput::Key::VolumeDown)
|
||||||
@@ -533,7 +534,7 @@ void WindowServer::on_key_event(LibInput::KeyEvent event)
|
@@ -461,7 +462,7 @@ void WindowServer::on_key_event(LibInput::KeyEvent event)
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
if (pid == 0)
|
if (pid == 0)
|
||||||
{
|
{
|
||||||
@@ -341,7 +313,7 @@ index e6b01476..a14074c3 100644
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (pid == -1)
|
if (pid == -1)
|
||||||
@@ -547,7 +548,7 @@ void WindowServer::on_key_event(LibInput::KeyEvent event)
|
@@ -475,7 +476,7 @@ void WindowServer::on_key_event(LibInput::KeyEvent event)
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
if (pid == 0)
|
if (pid == 0)
|
||||||
{
|
{
|
||||||
@@ -350,7 +322,7 @@ index e6b01476..a14074c3 100644
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (pid == -1)
|
if (pid == -1)
|
||||||
@@ -1664,16 +1665,34 @@ void WindowServer::sync()
|
@@ -1599,16 +1600,34 @@ void WindowServer::sync()
|
||||||
|
|
||||||
for (size_t i = 0; i < m_damaged_area_count; i++)
|
for (size_t i = 0; i < m_damaged_area_count; i++)
|
||||||
{
|
{
|
||||||
@@ -392,10 +364,10 @@ index e6b01476..a14074c3 100644
|
|||||||
|
|
||||||
Rectangle WindowServer::cursor_area() const
|
Rectangle WindowServer::cursor_area() const
|
||||||
diff --git a/userspace/programs/WindowServer/WindowServer.h b/userspace/programs/WindowServer/WindowServer.h
|
diff --git a/userspace/programs/WindowServer/WindowServer.h b/userspace/programs/WindowServer/WindowServer.h
|
||||||
index 9e2dc70e..40813f2e 100644
|
index 94fbc774..bcd7a6b9 100644
|
||||||
--- a/userspace/programs/WindowServer/WindowServer.h
|
--- a/userspace/programs/WindowServer/WindowServer.h
|
||||||
+++ b/userspace/programs/WindowServer/WindowServer.h
|
+++ b/userspace/programs/WindowServer/WindowServer.h
|
||||||
@@ -65,6 +65,7 @@ public:
|
@@ -62,6 +62,7 @@ public:
|
||||||
|
|
||||||
bool is_damaged() const { return m_damaged_area_count > 0 || m_is_bouncing_window; }
|
bool is_damaged() const { return m_damaged_area_count > 0 || m_is_bouncing_window; }
|
||||||
bool is_stopped() const { return m_is_stopped; }
|
bool is_stopped() const { return m_is_stopped; }
|
||||||
@@ -404,7 +376,7 @@ index 9e2dc70e..40813f2e 100644
|
|||||||
private:
|
private:
|
||||||
void on_mouse_move_impl(int32_t new_x, int32_t new_y);
|
void on_mouse_move_impl(int32_t new_x, int32_t new_y);
|
||||||
diff --git a/userspace/programs/WindowServer/main.cpp b/userspace/programs/WindowServer/main.cpp
|
diff --git a/userspace/programs/WindowServer/main.cpp b/userspace/programs/WindowServer/main.cpp
|
||||||
index 61d10e97..e77e5d97 100644
|
index 46f2ba6d..520c8e7d 100644
|
||||||
--- a/userspace/programs/WindowServer/main.cpp
|
--- a/userspace/programs/WindowServer/main.cpp
|
||||||
+++ b/userspace/programs/WindowServer/main.cpp
|
+++ b/userspace/programs/WindowServer/main.cpp
|
||||||
@@ -10,7 +10,6 @@
|
@@ -10,7 +10,6 @@
|
||||||
@@ -546,7 +518,7 @@ index 61d10e97..e77e5d97 100644
|
|||||||
if (epoll_events == -1 && errno != EINTR)
|
if (epoll_events == -1 && errno != EINTR)
|
||||||
{
|
{
|
||||||
dwarnln("epoll_pwait2: {}", strerror(errno));
|
dwarnln("epoll_pwait2: {}", strerror(errno));
|
||||||
@@ -334,48 +289,6 @@ int main()
|
@@ -333,48 +288,6 @@ int main()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -595,7 +567,7 @@ index 61d10e97..e77e5d97 100644
|
|||||||
const int client_fd = events[i].data.fd;
|
const int client_fd = events[i].data.fd;
|
||||||
if (events[i].events & (EPOLLHUP | EPOLLERR))
|
if (events[i].events & (EPOLLHUP | EPOLLERR))
|
||||||
{
|
{
|
||||||
@@ -507,3 +420,237 @@ int main()
|
@@ -500,3 +413,237 @@ int main()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -834,5 +806,5 @@ index 61d10e97..e77e5d97 100644
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
--
|
--
|
||||||
2.54.0
|
2.53.0
|
||||||
|
|
||||||
|
|||||||
2
banan-os
2
banan-os
Submodule banan-os updated: e713644973...1bf5e6a051
@@ -311,7 +311,7 @@ static void invalidate_window_recursive(Object::Window& dst_window, int32_t dst_
|
|||||||
|
|
||||||
for (int32_t y = 0; y < h; y++)
|
for (int32_t y = 0; y < h; y++)
|
||||||
{
|
{
|
||||||
uint32_t* dst_u32 = &dst_window.double_buffer[(dst_y + y) * dst_window.width + dst_x];
|
uint32_t* dst_u32 = &dst_window.double_buffer[(dst_y + y) * dst_window.width + dst_x];
|
||||||
const uint32_t* src_u32 = &src_window. pixels[(src_y + y) * src_window.width + src_x];
|
const uint32_t* src_u32 = &src_window. pixels[(src_y + y) * src_window.width + src_x];
|
||||||
for (int32_t x = 0; x < w; x++)
|
for (int32_t x = 0; x < w; x++)
|
||||||
{
|
{
|
||||||
@@ -750,7 +750,7 @@ void update_cursor(WINDOW wid, int32_t x, int32_t y)
|
|||||||
if (wid == None)
|
if (wid == None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const CURSOR cid = [](WINDOW wid) -> CURSOR {
|
const CURSOR cid = [&wid]() -> CURSOR {
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
const auto& window = g_objects[wid]->object.get<Object::Window>();
|
const auto& window = g_objects[wid]->object.get<Object::Window>();
|
||||||
@@ -758,7 +758,7 @@ void update_cursor(WINDOW wid, int32_t x, int32_t y)
|
|||||||
return window.cursor;
|
return window.cursor;
|
||||||
wid = window.parent;
|
wid = window.parent;
|
||||||
}
|
}
|
||||||
}(wid);
|
}();
|
||||||
|
|
||||||
static CURSOR active_cid = None;
|
static CURSOR active_cid = None;
|
||||||
if (cid == active_cid)
|
if (cid == active_cid)
|
||||||
@@ -856,8 +856,8 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
|
|
||||||
dprintln("CreateWindow");
|
dprintln("CreateWindow");
|
||||||
dprintln(" depth: {}", request.depth);
|
dprintln(" depth: {}", request.depth);
|
||||||
dprintln(" wid: {h}", request.wid);
|
dprintln(" wid: {}", request.wid);
|
||||||
dprintln(" parent: {h}", request.parent);
|
dprintln(" parent: {}", request.parent);
|
||||||
dprintln(" x: {}", request.x);
|
dprintln(" x: {}", request.x);
|
||||||
dprintln(" y: {}", request.y);
|
dprintln(" y: {}", request.y);
|
||||||
dprintln(" width: {}", request.width);
|
dprintln(" width: {}", request.width);
|
||||||
@@ -983,7 +983,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xChangeWindowAttributesReq>(packet).value();
|
auto request = decode<xChangeWindowAttributesReq>(packet).value();
|
||||||
|
|
||||||
dprintln("ChangeWindowAttributes");
|
dprintln("ChangeWindowAttributes");
|
||||||
dprintln(" window: {h}", request.window);
|
dprintln(" window: {}", request.window);
|
||||||
dprintln(" valueMask: {8h}", request.valueMask);
|
dprintln(" valueMask: {8h}", request.valueMask);
|
||||||
|
|
||||||
auto& window = TRY_REF(get_window(client_info, request.window, opcode));
|
auto& window = TRY_REF(get_window(client_info, request.window, opcode));
|
||||||
@@ -1042,7 +1042,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("GetWindowAttributes");
|
dprintln("GetWindowAttributes");
|
||||||
dprintln(" window: {h}", wid);
|
dprintln(" window: {}", wid);
|
||||||
|
|
||||||
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
||||||
|
|
||||||
@@ -1079,7 +1079,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("DestroyWinow");
|
dprintln("DestroyWinow");
|
||||||
dprintln(" window: {h}", wid);
|
dprintln(" window: {}", wid);
|
||||||
|
|
||||||
(void)TRY_REF(get_window(client_info, wid, opcode));
|
(void)TRY_REF(get_window(client_info, wid, opcode));
|
||||||
TRY(destroy_window(client_info, wid));
|
TRY(destroy_window(client_info, wid));
|
||||||
@@ -1091,8 +1091,8 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xReparentWindowReq>(packet).value();
|
auto request = decode<xReparentWindowReq>(packet).value();
|
||||||
|
|
||||||
dprintln("ReparentWinow");
|
dprintln("ReparentWinow");
|
||||||
dprintln(" window: {h}", request.window);
|
dprintln(" window: {}", request.window);
|
||||||
dprintln(" parent: {h}", request.parent);
|
dprintln(" parent: {}", request.parent);
|
||||||
dprintln(" x: {}", request.x);
|
dprintln(" x: {}", request.x);
|
||||||
dprintln(" y: {}", request.y);
|
dprintln(" y: {}", request.y);
|
||||||
|
|
||||||
@@ -1162,7 +1162,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("MapWindow");
|
dprintln("MapWindow");
|
||||||
dprintln(" window: {h}", wid);
|
dprintln(" window: {}", wid);
|
||||||
|
|
||||||
(void)TRY_REF(get_window(client_info, wid, opcode));
|
(void)TRY_REF(get_window(client_info, wid, opcode));
|
||||||
TRY(map_window(client_info, wid));
|
TRY(map_window(client_info, wid));
|
||||||
@@ -1174,7 +1174,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("MapSubwindows");
|
dprintln("MapSubwindows");
|
||||||
dprintln(" window: {h}", wid);
|
dprintln(" window: {}", wid);
|
||||||
|
|
||||||
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
||||||
for (auto child_wid : window.children)
|
for (auto child_wid : window.children)
|
||||||
@@ -1187,7 +1187,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("UnmapWindow");
|
dprintln("UnmapWindow");
|
||||||
dprintln(" window: {h}", wid);
|
dprintln(" window: {}", wid);
|
||||||
|
|
||||||
(void)TRY_REF(get_window(client_info, wid, opcode));
|
(void)TRY_REF(get_window(client_info, wid, opcode));
|
||||||
TRY(unmap_window(client_info, wid));
|
TRY(unmap_window(client_info, wid));
|
||||||
@@ -1199,7 +1199,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("UnmapSubwindows");
|
dprintln("UnmapSubwindows");
|
||||||
dprintln(" window: {h}", wid);
|
dprintln(" window: {}", wid);
|
||||||
|
|
||||||
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
||||||
for (auto child_wid : window.children)
|
for (auto child_wid : window.children)
|
||||||
@@ -1212,7 +1212,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xConfigureWindowReq>(packet).value();
|
auto request = decode<xConfigureWindowReq>(packet).value();
|
||||||
|
|
||||||
dprintln("ConfigureWindow");
|
dprintln("ConfigureWindow");
|
||||||
dprintln(" window: {h}", request.window);
|
dprintln(" window: {}", request.window);
|
||||||
dprintln(" mask: {4h}", request.mask);
|
dprintln(" mask: {4h}", request.mask);
|
||||||
|
|
||||||
auto& window = TRY_REF(get_window(client_info, request.window, opcode));
|
auto& window = TRY_REF(get_window(client_info, request.window, opcode));
|
||||||
@@ -1304,7 +1304,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 drawable_id = packet.as_span<const uint32_t>()[1];
|
const CARD32 drawable_id = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("GetGeometry");
|
dprintln("GetGeometry");
|
||||||
dprintln(" drawable: {h}", drawable_id);
|
dprintln(" drawable: {}", drawable_id);
|
||||||
|
|
||||||
auto it = g_objects.find(drawable_id);
|
auto it = g_objects.find(drawable_id);
|
||||||
if (it == g_objects.end() || (it->value->type != Object::Type::Window && it->value->type != Object::Type::Pixmap))
|
if (it == g_objects.end() || (it->value->type != Object::Type::Window && it->value->type != Object::Type::Pixmap))
|
||||||
@@ -1371,7 +1371,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const auto wid = packet.as_span<const CARD32>()[1];
|
const auto wid = packet.as_span<const CARD32>()[1];
|
||||||
|
|
||||||
dprintln("QueryTree");
|
dprintln("QueryTree");
|
||||||
dprintln(" window: {h}", wid);
|
dprintln(" window: {}", wid);
|
||||||
|
|
||||||
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
||||||
|
|
||||||
@@ -1455,7 +1455,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
|
|
||||||
dprintln("ChangeProperty");
|
dprintln("ChangeProperty");
|
||||||
dprintln(" mode: {}", request.mode);
|
dprintln(" mode: {}", request.mode);
|
||||||
dprintln(" window: {h}", request.window);
|
dprintln(" window: {}", request.window);
|
||||||
dprintln(" property: {}", g_atoms_id_to_name[request.property]);
|
dprintln(" property: {}", g_atoms_id_to_name[request.property]);
|
||||||
dprintln(" type: {}", g_atoms_id_to_name[request.type]);
|
dprintln(" type: {}", g_atoms_id_to_name[request.type]);
|
||||||
dprintln(" format: {}", request.format);
|
dprintln(" format: {}", request.format);
|
||||||
@@ -1520,7 +1520,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xDeletePropertyReq>(packet).value();
|
auto request = decode<xDeletePropertyReq>(packet).value();
|
||||||
|
|
||||||
dprintln("DeleteProperty");
|
dprintln("DeleteProperty");
|
||||||
dprintln(" window: {h}", request.window);
|
dprintln(" window: {}", request.window);
|
||||||
dprintln(" property: {}", g_atoms_id_to_name[request.property]);
|
dprintln(" property: {}", g_atoms_id_to_name[request.property]);
|
||||||
|
|
||||||
auto& window = TRY_REF(get_window(client_info, request.window, opcode));
|
auto& window = TRY_REF(get_window(client_info, request.window, opcode));
|
||||||
@@ -1550,7 +1550,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
|
|
||||||
dprintln("GetProperty");
|
dprintln("GetProperty");
|
||||||
dprintln(" c_delete: {}", request.c_delete);
|
dprintln(" c_delete: {}", request.c_delete);
|
||||||
dprintln(" window: {h}", request.window);
|
dprintln(" window: {}", request.window);
|
||||||
dprintln(" property: {}", g_atoms_id_to_name[request.property]);
|
dprintln(" property: {}", g_atoms_id_to_name[request.property]);
|
||||||
dprintln(" type: {}", request.type);
|
dprintln(" type: {}", request.type);
|
||||||
dprintln(" longOffset: {}", request.longOffset);
|
dprintln(" longOffset: {}", request.longOffset);
|
||||||
@@ -1633,7 +1633,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("ListProperties");
|
dprintln("ListProperties");
|
||||||
dprintln(" window: {h}", wid);
|
dprintln(" window: {}", wid);
|
||||||
|
|
||||||
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
||||||
|
|
||||||
@@ -1657,7 +1657,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xSetSelectionOwnerReq>(packet).value();
|
auto request = decode<xSetSelectionOwnerReq>(packet).value();
|
||||||
|
|
||||||
dprintln("SetSelectionOwner");
|
dprintln("SetSelectionOwner");
|
||||||
dprintln(" window: {h}", request.window);
|
dprintln(" window: {}", request.window);
|
||||||
dprintln(" selection: {}", g_atoms_id_to_name[request.selection]);
|
dprintln(" selection: {}", g_atoms_id_to_name[request.selection]);
|
||||||
dprintln(" time: {}", request.time);
|
dprintln(" time: {}", request.time);
|
||||||
|
|
||||||
@@ -1713,7 +1713,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xConvertSelectionReq>(packet).value();
|
auto request = decode<xConvertSelectionReq>(packet).value();
|
||||||
|
|
||||||
dprintln("ConvertSelection");
|
dprintln("ConvertSelection");
|
||||||
dprintln(" requestor: {h}", request.requestor);
|
dprintln(" requestor: {}", request.requestor);
|
||||||
dprintln(" selection: {}", get_atom_name_safe(request.selection));
|
dprintln(" selection: {}", get_atom_name_safe(request.selection));
|
||||||
dprintln(" target: {}", get_atom_name_safe(request.target));
|
dprintln(" target: {}", get_atom_name_safe(request.target));
|
||||||
dprintln(" property: {}", get_atom_name_safe(request.property));
|
dprintln(" property: {}", get_atom_name_safe(request.property));
|
||||||
@@ -1800,8 +1800,8 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
|
|
||||||
dprintln("GrabPointer");
|
dprintln("GrabPointer");
|
||||||
dprintln(" ownerEvents: {}", request.ownerEvents);
|
dprintln(" ownerEvents: {}", request.ownerEvents);
|
||||||
dprintln(" grabWindow: {h}", request.grabWindow);
|
dprintln(" grabWindow: {}", request.grabWindow);
|
||||||
dprintln(" eventMask: {h}", request.eventMask);
|
dprintln(" eventMask: {}", request.eventMask);
|
||||||
dprintln(" pointerMode: {}", request.pointerMode);
|
dprintln(" pointerMode: {}", request.pointerMode);
|
||||||
dprintln(" keyboardMode: {}", request.keyboardMode);
|
dprintln(" keyboardMode: {}", request.keyboardMode);
|
||||||
dprintln(" confineTo: {}", request.confineTo);
|
dprintln(" confineTo: {}", request.confineTo);
|
||||||
@@ -1867,7 +1867,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
|
|
||||||
dprintln("GrabKeyboard");
|
dprintln("GrabKeyboard");
|
||||||
dprintln(" ownerEvents: {}", request.ownerEvents);
|
dprintln(" ownerEvents: {}", request.ownerEvents);
|
||||||
dprintln(" grabWindow: {h}", request.grabWindow);
|
dprintln(" grabWindow: {}", request.grabWindow);
|
||||||
dprintln(" pointerMode: {}", request.pointerMode);
|
dprintln(" pointerMode: {}", request.pointerMode);
|
||||||
dprintln(" keyboardMode: {}", request.keyboardMode);
|
dprintln(" keyboardMode: {}", request.keyboardMode);
|
||||||
dprintln(" time: {}", request.time);
|
dprintln(" time: {}", request.time);
|
||||||
@@ -1942,7 +1942,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
const CARD32 wid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("QueryPointer");
|
dprintln("QueryPointer");
|
||||||
dprintln(" window: {h}", wid);
|
dprintln(" window: {}", wid);
|
||||||
|
|
||||||
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
const auto& window = TRY_REF(get_window(client_info, wid, opcode));
|
||||||
|
|
||||||
@@ -1989,8 +1989,8 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xTranslateCoordsReq>(packet).value();
|
auto request = decode<xTranslateCoordsReq>(packet).value();
|
||||||
|
|
||||||
dprintln("TranslateCoords");
|
dprintln("TranslateCoords");
|
||||||
dprintln(" src_wid: {h}", request.srcWid);
|
dprintln(" src_wid: {}", request.srcWid);
|
||||||
dprintln(" dst_wid: {h}", request.dstWid);
|
dprintln(" dst_wid: {}", request.dstWid);
|
||||||
dprintln(" src_x: {}", request.srcX);
|
dprintln(" src_x: {}", request.srcX);
|
||||||
dprintln(" src_y: {}", request.srcY);
|
dprintln(" src_y: {}", request.srcY);
|
||||||
|
|
||||||
@@ -2018,12 +2018,12 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xWarpPointerReq>(packet).value();
|
auto request = decode<xWarpPointerReq>(packet).value();
|
||||||
|
|
||||||
dprintln("WarpPointer");
|
dprintln("WarpPointer");
|
||||||
dprintln(" src_wid: {h}", request.srcWid);
|
dprintln(" src_wid: {}", request.srcWid);
|
||||||
dprintln(" src_x: {}", request.srcX);
|
dprintln(" src_x: {}", request.srcX);
|
||||||
dprintln(" src_y: {}", request.srcY);
|
dprintln(" src_y: {}", request.srcY);
|
||||||
dprintln(" src_w: {}", request.srcWidth);
|
dprintln(" src_w: {}", request.srcWidth);
|
||||||
dprintln(" src_h: {}", request.srcHeight);
|
dprintln(" src_h: {}", request.srcHeight);
|
||||||
dprintln(" dst_wid: {h}", request.dstWid);
|
dprintln(" dst_wid: {}", request.dstWid);
|
||||||
dprintln(" dst_x: {}", request.dstX);
|
dprintln(" dst_x: {}", request.dstX);
|
||||||
dprintln(" dst_y: {}", request.dstY);
|
dprintln(" dst_y: {}", request.dstY);
|
||||||
|
|
||||||
@@ -2093,8 +2093,8 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
|
|
||||||
dprintln("CreatePixmap");
|
dprintln("CreatePixmap");
|
||||||
dprintln(" depth: {}", request.depth);
|
dprintln(" depth: {}", request.depth);
|
||||||
dprintln(" pid: {h}", request.pid);
|
dprintln(" pid: {}", request.pid);
|
||||||
dprintln(" drawable: {h}", request.drawable);
|
dprintln(" drawable: {}", request.drawable);
|
||||||
dprintln(" width: {}", request.width);
|
dprintln(" width: {}", request.width);
|
||||||
dprintln(" height: {}", request.height);
|
dprintln(" height: {}", request.height);
|
||||||
|
|
||||||
@@ -2128,7 +2128,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 pid = packet.as_span<const uint32_t>()[1];
|
const CARD32 pid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("FreePixmap");
|
dprintln("FreePixmap");
|
||||||
dprintln(" pixmap: {h}", pid);
|
dprintln(" pixmap: {}", pid);
|
||||||
|
|
||||||
(void)TRY_REF(get_pixmap(client_info, pid, opcode));
|
(void)TRY_REF(get_pixmap(client_info, pid, opcode));
|
||||||
client_info.objects.remove(pid);
|
client_info.objects.remove(pid);
|
||||||
@@ -2141,7 +2141,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xCreateGCReq>(packet).value();
|
auto request = decode<xCreateGCReq>(packet).value();
|
||||||
|
|
||||||
dprintln("CreateGC");
|
dprintln("CreateGC");
|
||||||
dprintln(" drawable {h}", request.drawable);
|
dprintln(" drawable {}", request.drawable);
|
||||||
dprintln(" gc {}", request.gc);
|
dprintln(" gc {}", request.gc);
|
||||||
dprintln(" mask {8h}", request.mask);
|
dprintln(" mask {8h}", request.mask);
|
||||||
|
|
||||||
@@ -2223,7 +2223,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xChangeGCReq>(packet).value();
|
auto request = decode<xChangeGCReq>(packet).value();
|
||||||
|
|
||||||
dprintln("ChangeGC");
|
dprintln("ChangeGC");
|
||||||
dprintln(" gc: {h}", request.gc);
|
dprintln(" gc: {}", request.gc);
|
||||||
dprintln(" mask: {8h}", request.mask);
|
dprintln(" mask: {8h}", request.mask);
|
||||||
|
|
||||||
auto& object = *g_objects[request.gc];
|
auto& object = *g_objects[request.gc];
|
||||||
@@ -2287,7 +2287,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xSetClipRectanglesReq>(packet).value();
|
auto request = decode<xSetClipRectanglesReq>(packet).value();
|
||||||
|
|
||||||
dprintln("SetClipRectangles");
|
dprintln("SetClipRectangles");
|
||||||
dprintln(" gc: {h}", request.gc);
|
dprintln(" gc: {}", request.gc);
|
||||||
dprintln(" ordering: {}", request.ordering);
|
dprintln(" ordering: {}", request.ordering);
|
||||||
dprintln(" xOrigin: {}", request.xOrigin);
|
dprintln(" xOrigin: {}", request.xOrigin);
|
||||||
dprintln(" yOrigin: {}", request.yOrigin);
|
dprintln(" yOrigin: {}", request.yOrigin);
|
||||||
@@ -2315,7 +2315,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const CARD32 gc = packet.as_span<const uint32_t>()[1];
|
const CARD32 gc = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("FreeGC");
|
dprintln("FreeGC");
|
||||||
dprintln(" gc: {h}", gc);
|
dprintln(" gc: {}", gc);
|
||||||
|
|
||||||
(void)TRY_REF(get_gc(client_info, gc, opcode));
|
(void)TRY_REF(get_gc(client_info, gc, opcode));
|
||||||
client_info.objects.remove(gc);
|
client_info.objects.remove(gc);
|
||||||
@@ -2329,7 +2329,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
|
|
||||||
dprintln("ClearArea");
|
dprintln("ClearArea");
|
||||||
dprintln(" exposures: {}", request.exposures);
|
dprintln(" exposures: {}", request.exposures);
|
||||||
dprintln(" window: {h}", request.window);
|
dprintln(" window: {}", request.window);
|
||||||
dprintln(" x: {}", request.x);
|
dprintln(" x: {}", request.x);
|
||||||
dprintln(" y: {}", request.y);
|
dprintln(" y: {}", request.y);
|
||||||
dprintln(" width: {}", request.width);
|
dprintln(" width: {}", request.width);
|
||||||
@@ -2363,9 +2363,9 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xCopyAreaReq>(packet).value();
|
auto request = decode<xCopyAreaReq>(packet).value();
|
||||||
|
|
||||||
dprintln("CopyArea");
|
dprintln("CopyArea");
|
||||||
dprintln(" srcDrawable: {h}", request.srcDrawable);
|
dprintln(" srcDrawable: {}", request.srcDrawable);
|
||||||
dprintln(" dstDrawable: {h}", request.dstDrawable);
|
dprintln(" dstDrawable: {}", request.dstDrawable);
|
||||||
dprintln(" gc: {h}", request.gc);
|
dprintln(" gc: {}", request.gc);
|
||||||
dprintln(" srcX: {}", request.srcX);
|
dprintln(" srcX: {}", request.srcX);
|
||||||
dprintln(" srcY: {}", request.srcY);
|
dprintln(" srcY: {}", request.srcY);
|
||||||
dprintln(" dstX: {}", request.dstX);
|
dprintln(" dstX: {}", request.dstX);
|
||||||
@@ -2458,8 +2458,8 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xPutImageReq>(packet).value();
|
auto request = decode<xPutImageReq>(packet).value();
|
||||||
|
|
||||||
dprintln("PutImage");
|
dprintln("PutImage");
|
||||||
dprintln(" drawable: {h}", request.drawable);
|
dprintln(" drawable: {}", request.drawable);
|
||||||
dprintln(" gc: {h}", request.gc);
|
dprintln(" gc: {}", request.gc);
|
||||||
dprintln(" format: {}", request.format);
|
dprintln(" format: {}", request.format);
|
||||||
dprintln(" depth: {}", request.depth);
|
dprintln(" depth: {}", request.depth);
|
||||||
dprintln(" dstX: {}", request.dstX);
|
dprintln(" dstX: {}", request.dstX);
|
||||||
@@ -2507,7 +2507,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xGetImageReq>(packet).value();
|
auto request = decode<xGetImageReq>(packet).value();
|
||||||
|
|
||||||
dprintln("GetImage");
|
dprintln("GetImage");
|
||||||
dprintln(" drawable: {h}", request.drawable);
|
dprintln(" drawable: {}", request.drawable);
|
||||||
dprintln(" format: {}", request.format);
|
dprintln(" format: {}", request.format);
|
||||||
dprintln(" x: {}", request.x);
|
dprintln(" x: {}", request.x);
|
||||||
dprintln(" y: {}", request.y);
|
dprintln(" y: {}", request.y);
|
||||||
@@ -2678,7 +2678,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
auto request = decode<xCreateCursorReq>(packet).value();
|
auto request = decode<xCreateCursorReq>(packet).value();
|
||||||
|
|
||||||
dprintln("CreateCursor");
|
dprintln("CreateCursor");
|
||||||
dprintln(" cid: {h}", request.cid);
|
dprintln(" cid: {}", request.cid);
|
||||||
dprintln(" source: {}", request.source);
|
dprintln(" source: {}", request.source);
|
||||||
dprintln(" mask: {}", request.mask);
|
dprintln(" mask: {}", request.mask);
|
||||||
dprintln(" foreRed: {}", request.foreRed);
|
dprintln(" foreRed: {}", request.foreRed);
|
||||||
@@ -2749,7 +2749,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
const auto cid = packet.as_span<const uint32_t>()[1];
|
const auto cid = packet.as_span<const uint32_t>()[1];
|
||||||
|
|
||||||
dprintln("FreeCursor");
|
dprintln("FreeCursor");
|
||||||
dprintln(" cid: {h}", cid);
|
dprintln(" cid: {}", cid);
|
||||||
|
|
||||||
client_info.objects.remove(cid);
|
client_info.objects.remove(cid);
|
||||||
g_objects.remove(cid);
|
g_objects.remove(cid);
|
||||||
@@ -2762,7 +2762,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
|
|||||||
|
|
||||||
dprintln("QueryBestSize");
|
dprintln("QueryBestSize");
|
||||||
dprintln(" class: {}", request.c_class);
|
dprintln(" class: {}", request.c_class);
|
||||||
dprintln(" drawable: {h}", request.drawable);
|
dprintln(" drawable: {}", request.drawable);
|
||||||
dprintln(" width: {}", request.width);
|
dprintln(" width: {}", request.width);
|
||||||
dprintln(" height: {}", request.height);
|
dprintln(" height: {}", request.height);
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ struct BananCursor final : public PlatformCursor
|
|||||||
int32_t origin_y;
|
int32_t origin_y;
|
||||||
};
|
};
|
||||||
|
|
||||||
static BAN::UniqPtr<LibGUI::Window> s_dummy_window;
|
|
||||||
|
|
||||||
static BAN::ErrorOr<void> bananos_initialize_keymap();
|
static BAN::ErrorOr<void> bananos_initialize_keymap();
|
||||||
|
|
||||||
static bool bananos_initialize()
|
static bool bananos_initialize()
|
||||||
@@ -42,9 +40,7 @@ static bool bananos_initialize()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_dummy_window = dummy_or_error.release_value();
|
register_display(0, 0, dummy_or_error.value()->width(), dummy_or_error.value()->height());
|
||||||
|
|
||||||
register_display(0, 0, s_dummy_window->width(), s_dummy_window->height());
|
|
||||||
|
|
||||||
if (auto ret = bananos_initialize_keymap(); ret.is_error())
|
if (auto ret = bananos_initialize_keymap(); ret.is_error())
|
||||||
{
|
{
|
||||||
@@ -76,9 +72,6 @@ static BAN::ErrorOr<BAN::UniqPtr<PlatformWindow>> bananos_create_window(WindowTy
|
|||||||
auto gui_window = TRY(LibGUI::Window::create(width, height, ""_sv, attributes));
|
auto gui_window = TRY(LibGUI::Window::create(width, height, ""_sv, attributes));
|
||||||
auto* winp = gui_window.ptr();
|
auto* winp = gui_window.ptr();
|
||||||
|
|
||||||
if (x != 0 || y != 0)
|
|
||||||
gui_window->set_position(x, y);
|
|
||||||
|
|
||||||
gui_window->set_close_window_event_callback([wid] {
|
gui_window->set_close_window_event_callback([wid] {
|
||||||
on_window_close_event(wid);
|
on_window_close_event(wid);
|
||||||
});
|
});
|
||||||
@@ -91,9 +84,6 @@ static BAN::ErrorOr<BAN::UniqPtr<PlatformWindow>> bananos_create_window(WindowTy
|
|||||||
gui_window->set_window_fullscreen_event_callback([wid](auto event) {
|
gui_window->set_window_fullscreen_event_callback([wid](auto event) {
|
||||||
on_window_fullscreen_event(wid, event.fullscreen);
|
on_window_fullscreen_event(wid, event.fullscreen);
|
||||||
});
|
});
|
||||||
gui_window->set_window_move_event_callback([wid](auto event) {
|
|
||||||
on_window_move_event(wid, event.x, event.y);
|
|
||||||
});
|
|
||||||
gui_window->set_mouse_move_event_callback([wid](auto event) {
|
gui_window->set_mouse_move_event_callback([wid](auto event) {
|
||||||
on_mouse_move_event(wid, event.x, event.y);
|
on_mouse_move_event(wid, event.x, event.y);
|
||||||
});
|
});
|
||||||
@@ -140,12 +130,6 @@ static void bananos_request_resize(PlatformWindow* window, uint32_t width, uint3
|
|||||||
banan_window.window->request_resize(width, height);
|
banan_window.window->request_resize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bananos_request_reposition(PlatformWindow* window, int32_t x, int32_t y)
|
|
||||||
{
|
|
||||||
auto& banan_window = *static_cast<BananWindow*>(window);
|
|
||||||
banan_window.window->set_position(x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bananos_invalidate(PlatformWindow* window, const void* src_pixels, uint32_t src_pitch, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
|
static void bananos_invalidate(PlatformWindow* window, const void* src_pixels, uint32_t src_pitch, uint32_t x, uint32_t y, uint32_t width, uint32_t height)
|
||||||
{
|
{
|
||||||
auto& banan_window = *static_cast<BananWindow*>(window);
|
auto& banan_window = *static_cast<BananWindow*>(window);
|
||||||
@@ -176,26 +160,6 @@ static void bananos_request_fullscreen(PlatformWindow* window, bool fullscreen)
|
|||||||
banan_window.window->set_fullscreen(fullscreen);
|
banan_window.window->set_fullscreen(fullscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bananos_query_ponter(int32_t* x, int32_t* y)
|
|
||||||
{
|
|
||||||
s_dummy_window->query_cursor_position();
|
|
||||||
|
|
||||||
bool queried { false };
|
|
||||||
s_dummy_window->set_query_pointer_event_callback([&](auto event) {
|
|
||||||
*x = event.x;
|
|
||||||
*y = event.y;
|
|
||||||
queried = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
while (!queried)
|
|
||||||
{
|
|
||||||
s_dummy_window->wait_events();
|
|
||||||
s_dummy_window->poll_events();
|
|
||||||
}
|
|
||||||
|
|
||||||
s_dummy_window->set_query_pointer_event_callback({});
|
|
||||||
}
|
|
||||||
|
|
||||||
static BAN::ErrorOr<BAN::UniqPtr<PlatformCursor>> bananos_create_bitmap_cursor(const uint32_t* pixels, uint32_t width, uint32_t height, int32_t origin_x, int32_t origin_y)
|
static BAN::ErrorOr<BAN::UniqPtr<PlatformCursor>> bananos_create_bitmap_cursor(const uint32_t* pixels, uint32_t width, uint32_t height, int32_t origin_x, int32_t origin_y)
|
||||||
{
|
{
|
||||||
auto cursor = TRY(BAN::UniqPtr<BananCursor>::create());
|
auto cursor = TRY(BAN::UniqPtr<BananCursor>::create());
|
||||||
@@ -233,10 +197,10 @@ PlatformOps g_platform_ops = {
|
|||||||
.begin_frame = nullptr,
|
.begin_frame = nullptr,
|
||||||
.end_frame = bananos_end_frame,
|
.end_frame = bananos_end_frame,
|
||||||
.request_resize = bananos_request_resize,
|
.request_resize = bananos_request_resize,
|
||||||
.request_reposition = bananos_request_reposition,
|
.request_reposition = nullptr,
|
||||||
.request_fullscreen = bananos_request_fullscreen,
|
.request_fullscreen = bananos_request_fullscreen,
|
||||||
.warp_pointer = nullptr,
|
.warp_pointer = nullptr,
|
||||||
.query_pointer = bananos_query_ponter,
|
.query_pointer = nullptr,
|
||||||
.set_pointer_grab = nullptr,
|
.set_pointer_grab = nullptr,
|
||||||
.create_system_cursor = nullptr,
|
.create_system_cursor = nullptr,
|
||||||
.create_bitmap_cursor = bananos_create_bitmap_cursor,
|
.create_bitmap_cursor = bananos_create_bitmap_cursor,
|
||||||
@@ -344,10 +308,9 @@ static uint32_t bananos_keyevent_to_x_keysym(LibInput::KeyEvent event)
|
|||||||
case Key::CapsLock: return XK_Caps_Lock;
|
case Key::CapsLock: return XK_Caps_Lock;
|
||||||
case Key::LeftShift: return XK_Shift_L;
|
case Key::LeftShift: return XK_Shift_L;
|
||||||
case Key::LeftCtrl: return XK_Control_L;
|
case Key::LeftCtrl: return XK_Control_L;
|
||||||
case Key::LeftSuper: return XK_Super_L;
|
case Key::Super: return XK_Super_L;
|
||||||
case Key::LeftAlt: return XK_Alt_L;
|
case Key::LeftAlt: return XK_Alt_L;
|
||||||
case Key::RightAlt: return XK_Alt_R;
|
case Key::RightAlt: return XK_Alt_R;
|
||||||
case Key::RightSuper: return XK_Super_R;
|
|
||||||
case Key::RightCtrl: return XK_Control_R;
|
case Key::RightCtrl: return XK_Control_R;
|
||||||
case Key::RightShift: return XK_Shift_R;
|
case Key::RightShift: return XK_Shift_R;
|
||||||
case Key::ArrowUp: return XK_Up;
|
case Key::ArrowUp: return XK_Up;
|
||||||
@@ -380,11 +343,10 @@ static uint32_t bananos_keyevent_to_x_keysym(LibInput::KeyEvent event)
|
|||||||
case Key::MediaStop: return XF86XK_AudioStop;
|
case Key::MediaStop: return XF86XK_AudioStop;
|
||||||
case Key::MediaPrevious: return XF86XK_AudioPrev;
|
case Key::MediaPrevious: return XF86XK_AudioPrev;
|
||||||
case Key::MediaNext: return XF86XK_AudioNext;
|
case Key::MediaNext: return XF86XK_AudioNext;
|
||||||
case Key::Application: return XF86XK_ApplicationRight;
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
static_assert(static_cast<size_t>(Key::Count) == 147, "update keymap");
|
static_assert(static_cast<size_t>(Key::Count) == 145, "update keymap");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user