The modifier bits for lock keys were only set when the corresponding key
was reported as held down or latched, but not when it was released and
locked.
This avoids glfwCreateWindow emitting GLFW_FEATURE_UNAVAILABLE or
GLFW_FEATURE_UNIMPLEMENTED on Wayland because shared code was calling
unimplemented or unavailable platform functions during final setup.
It also makes it consistent with the final setup of full screen windows.
The Wayland backend was the only one where half the window and input
related code was in the init module. As those bits want to share more
utility code with the window module, the interface between them grows.
To prevent that, this gathers nearly all window and input related code
into the window module.
The code assumed that all data offers were selections that supported
plaintext UTF-8.
The initial data offer events are now handled almost tolerably. Only
selection data offers are used for clipboard string and only if they
provide plaintext UTF-8. Drag and drop data offers are now rejected as
soon as they enter a surface.
Related to #2040
The string pointer used to write the contents of our clipboard data
offer was never updated, causing it to repeat parts of the beginning of
the string until the correct number of bytes had been written.
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.
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.
Corrects the protocol violation when creating an xdg_surface from a
wl_surface that already has a buffer due to EGL buffer swaps.
This commit is based on PR #1731 by @ghost, but adapted and altered:
- The XDG surface and role are now only created when a window is shown
to prevent application lists from showing command-line applications
with off-screen-only windows
- The special case of Wayland+EGL buffer swap is now in the EGL code
to mirror how X11 is handled
- Adaption to run-time platform selection and separate credits file
Fixes#1492Closes#1731