If the polling was interrupted by a signal or by incomplete or unrelated
data on any file descriptor, handleEvents could return before the full
timeout had elapsed.
This retries the Wayland prepare-to-read and poll until the full timeout
has elapsed or until any event was processed. Unfortunately, due to how
the Wayland client API is designed, this also includes the delete_id
for the frame callback created by eglSwapBuffers.
This means glfwWaitEvents* are still not fully functional on Wayland.
See #1911 for more details.
The display sync requests in glfwPostEmptyEvent could just accumulate as
the display was never flushed on secondary threads.
This adds a proper flush after each sync request.
Fixes#1520Closes#1521
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#1281Closes#1285
Cancel the prepared-to-read state on the calling thread before starting
to call back to user code.
Emitting close requests here is not a good choice but that is for
a future commit to address.
This uses ppoll for waiting on file descriptors with a timeout, where
that function has been available a while. On NetBSD, which will be
getting ppoll in the next release, the equivalent pollts is used.
This commit is based on work by OlivierSohn and kovidgoyal.
Related to #1281
Related to #1285
There is a seemingly unavoidable race condition when waiting for data on
the X11 display connection, as long as any other thread is also making
Xlib calls. The event data we are waiting for could be read by the
other thread as part of looking for the reply to its request, before our
poll has begun.
This commit replaces the X11 event sent by glfwPostEmptyEvent with
writing to an unnamed pipe. The race condition remains if other Xlib
calls are made on other threads, but glfwPostEmptyEvent should now be
race-free.
This commit is based on work by pcwalton, OlivierSohn, kovidgoyal and
joaodasilva.
Closes#2033
Related to #379
Related to #1281
Related to #1285
The data available on the X11 connection may be a reply or an internal
event for an X11 extension. Previously the check for whether an event
was available for us was done outside waitForEvent. This prevented data
available on other file descriptors from breaking the outer wait loop.
This commit moves the check for whether an event is available into the
wait functions, where there is enough knowledge to limit the check to
the X11 connection.
Related to #932
On Linux, the inotify descriptor was included in the set used for
select, but could not break the outer loop, leading to busy waiting
until timeout or the correct X11 event arrived.
This commit adds a new function for waiting just on X11 events.
Fixes#1872
We switched to kUTTypeURL when NSURLPboardType was deprecated, as the
official replacement symbol NSPasteboardTypeURL was not available on
every version of macOS supported by GLFW.
kUTTypeURL has now also been deprecated.
This commit moves to a compile-time choice between NSURLPboardType and
NSPasteboardTypeURL depending on the minimum targeted macOS version.
Fixes#2003
The Wayland backend now requires xkbcommon-compose, which was added in
version 0.5.0. xkbcommon 0.5.0 was released in 2014.
This removes the non-composing fallback path for text input.
By definition a hidden window on Wayland does not have valid framebuffer
contents.
This adds a window damage (refresh) event when a window is shown, to
request an initial frame for the now visible window.
A window created with GLFW_VISIBLE set was not made visible by the
initial buffer swap during context attribute refresh.
Regression introduced by @elmindreda in
094aa6d3c7.
Platform code should not generate key events with GLFW_REPEAT.
GLFW_PRESS is translated into GLFW_REPEAT by shared code based on the
key state cache.
This confused the automatic key release logic into not generating an
event with GLFW_RELEASE for a key being repeated when the window lost
input focus.
We were previously storing the pointer position only when on the main
window, so when the user clicked on a fallback decoration it would use
the last position of the cursor on the main window, instead of the
position in the decoration surface.
Fixes part of #1991.
The OpenBSD ports tree assigns its own soname version numbers, so the
hardcoded sonames GLFW uses to load libraries on non-macOS Unices are
often incorrect. Instead OpenBSD recommends that run-time loading
should leave out the version numbers entirely. The OpenBSD ld.so then
finds the correct library.
This upstreams the ports tree fixes for Xcursor and EGL, and adds the
corresponding fix for all other run-time loaded library sonames.
Tested on OpenBSD 7.0.
This issue was initially reported on IRC.