Share X11 fd polling logic with Wayland

This moves the X11 polling implementation to a separate file where it
can be used by either the X11 or Wayland backend or both.

This code should be POSIX compatible where necessary but will use the
lower latency but non-standard polling functions ppoll or pollts where
those are available.

This commit is based on work by OlivierSohn and kovidgoyal.

Fixes #1281
Closes #1285
This commit is contained in:
Camilla Löwy
2022-03-03 21:26:11 +01:00
parent 203a7c59d2
commit bb9d699ae6
7 changed files with 127 additions and 61 deletions
+1
View File
@@ -60,6 +60,7 @@ if (GLFW_BUILD_X11 OR GLFW_BUILD_WAYLAND)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_sources(glfw PRIVATE linux_joystick.h linux_joystick.c)
endif()
target_sources(glfw PRIVATE posix_poll.h posix_poll.c)
endif()
if (GLFW_BUILD_WAYLAND)