diff --git a/LibGUI/Window.cpp b/LibGUI/Window.cpp index 7305a617a5..4fdef8bd16 100644 --- a/LibGUI/Window.cpp +++ b/LibGUI/Window.cpp @@ -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); diff --git a/LibGUI/include/LibGUI/Window.h b/LibGUI/include/LibGUI/Window.h index c88a4e2ebb..826b9d6ba5 100644 --- a/LibGUI/include/LibGUI/Window.h +++ b/LibGUI/include/LibGUI/Window.h @@ -133,6 +133,8 @@ namespace LibGUI void set_mouse_move_event_callback(BAN::Function callback) { m_mouse_move_event_callback = callback; } void set_mouse_scroll_event_callback(BAN::Function 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)