summaryrefslogtreecommitdiff
path: root/Kernel/ProcessGUI.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-18 05:26:45 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-18 05:28:07 +0100
commitdff5051905e4b83f7f1c94453105bb51be743763 (patch)
treea9286377dee1444d580b47c85c32c8870657ef09 /Kernel/ProcessGUI.cpp
parenta01e119e05b535e17f8ad124b1ddf38afedd3a24 (diff)
downloadserenity-dff5051905e4b83f7f1c94453105bb51be743763.zip
Support polling with select() by using a zero timeout.
Use this in WindowServer to avoid getting blocked in select() when there are pending injected events.
Diffstat (limited to 'Kernel/ProcessGUI.cpp')
-rw-r--r--Kernel/ProcessGUI.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Kernel/ProcessGUI.cpp b/Kernel/ProcessGUI.cpp
index 417dac360e..d1e53d2baa 100644
--- a/Kernel/ProcessGUI.cpp
+++ b/Kernel/ProcessGUI.cpp
@@ -64,14 +64,17 @@ int Process::gui$create_window(const GUI_CreateWindowParameters* user_params)
window->set_rect(rect);
m_windows.set(window_id, move(window));
+#ifdef LOG_GUI_SYSCALLS
dbgprintf("%s<%u> gui$create_window: %d with rect {%d,%d %dx%d}\n", name().characters(), pid(), window_id, rect.x(), rect.y(), rect.width(), rect.height());
-
+#endif
return window_id;
}
int Process::gui$destroy_window(int window_id)
{
+#ifdef LOG_GUI_SYSCALLS
dbgprintf("%s<%u> gui$destroy_window (window_id=%d)\n", name().characters(), pid(), window_id);
+#endif
if (window_id < 0)
return -EINVAL;
auto it = m_windows.find(window_id);
@@ -83,7 +86,9 @@ int Process::gui$destroy_window(int window_id)
int Process::gui$get_window_backing_store(int window_id, GUI_WindowBackingStoreInfo* info)
{
+#ifdef LOG_GUI_SYSCALLS
dbgprintf("%s<%u> gui$get_window_backing_store (window_id=%d, info=%p)\n", name().characters(), pid(), window_id, info);
+#endif
if (!validate_write_typed(info))
return -EFAULT;
if (window_id < 0)
@@ -101,7 +106,9 @@ int Process::gui$get_window_backing_store(int window_id, GUI_WindowBackingStoreI
int Process::gui$invalidate_window(int window_id, const GUI_Rect* rect)
{
- dbgprintf("%s<%u> gui$invalidate_window (window_id=%d)\n", name().characters(), pid(), window_id);
+#ifdef LOG_GUI_SYSCALLS
+ dbgprintf("%s<%u> gui$invalidate_window (window_id=%d, rect=%p)\n", name().characters(), pid(), window_id, rect);
+#endif
if (window_id < 0)
return -EINVAL;
if (rect && !validate_read_typed(rect))