LibGUI: Mark Window's server fd as CLOEXEC and expose it through API

This commit is contained in:
Bananymous 2024-06-03 18:01:34 +03:00
parent f2d6518311
commit 1066855532
2 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,9 @@ namespace LibGUI
if (server_fd == -1)
return BAN::Error::from_errno(errno);
if (fcntl(server_fd, F_SETFL, fcntl(server_fd, F_GETFL) | O_CLOEXEC) == -1)
return BAN::Error::from_errno(errno);
timespec start_time;
clock_gettime(CLOCK_MONOTONIC, &start_time);

View File

@ -133,6 +133,8 @@ namespace LibGUI
void set_mouse_move_event_callback(BAN::Function<void(EventPacket::MouseMoveEvent)> callback) { m_mouse_move_event_callback = callback; }
void set_mouse_scroll_event_callback(BAN::Function<void(EventPacket::MouseScrollEvent)> callback) { m_mouse_scroll_event_callback = callback; }
int server_fd() const { return m_server_fd; }
private:
Window(int server_fd, uint32_t* framebuffer, uint32_t width, uint32_t height)
: m_server_fd(server_fd)