If the frame was processed by wl_display_dispatch_queue_pending, this
would be treated as no frame having been received.
Oops.
This bug was introduced by fdd14e65b1.
When the swap interval was nonzero, EGL on Wayland would wait
indefinitely for a frame callback on a suspended window, causing
applications that call eglSwapBuffers to halt.
This re-implements the wait for a surface frame so that we can add
a reasonable timeout, while setting the EGL swap interval to zero. That
allows applications to make progress despite the window being suspended.
Some insights for how to structure this workaround were gleaned from
dri2_wl_swap_buffers_with_damage in Mesa.
This initial implementation still has a race between glfwHideWindow and
glfwSwapBuffers when rendering on a separate thread. This could lead to
a window becoming visible again after being hidden on the main thread.
Related to #1350Fixes#2582Fixes#2640Fixes#2719Fixes#2723Fixes#2800Fixes#2827
This adds support for high-resolution scroll input scaled to match
legacy discrete scroll input. It is available on compositors that
support wl_seat version 8 or later.
High-resolution "discrete" values now replace non-scaled scroll
values when available.
The timer code uses no part of Cocoa and is in turn used by other
backends than Cocoa on macOS.
The macOS timer code is now labeled macOS. Cocoa-specific files are now
consistently labeled Cocoa, not macOS.
The name selection for the Vulkan loader and the EGL and client
libraries used the GLFW platform macros instead of the platform's own
macros. This caused the selection to be incorrect when building only
the Null platform on any platform but Linux (where it only accidentally
worked due to being the default case).
OSMesa was already using the correct method.
This adds support for wl_seat version 5, which adds pointer frames.
This allows two-dimensional scroll input to be emitted as single events
instead of one event per axis per motion.
It's also the the foundation for future enhancements like properly
scaled discrete scroll events and server-side key repeat.
Fixes#2494
The client-side key repeat timer fd was only created for wl_seat version
4 or later, but was then used unconditionally during event processing.
Rather than have this mechanism do nothing in a more correct way on
wl_seat version 3 or earlier (which is very old by now), this commit
creates the key repeat timer fd and then sets (hopefully gentle)
hardcoded repeat delay and rate.
Fallback decoration mouse button actions were performed for both press
and release events. The requests made using a mouse button release
serials were presumably (and correctly) discarded by the compositor.
This commit removes the generation of these nuisance requests.
Redrawing the window contents for every possible event is not
a reasonable thing for an application to do. The test should be whether
redrawing on demand plus periodic updates works with near-idle CPU use
and no extra input latency.
This change incidentally makes the test well-behaved on Wayland, where
it was previously broken due to every EGL buffer swap causing an event
to be received.
The previous implementation was based on the incorrect assumption that
the _NET_WM_STATE_ABOVE state is always retained on unmapped windows.
According to EWMH the WM should remove the _NET_WM_STATE property when
a window is unmapped.
This commit moves the adding of _NET_WM_STATE_ABOVE to before mapping
the window during glfwShowWindow. The logic for removing
_NET_WM_STATE_ABOVE from hidden windows is retained, as EWMH still
allows WMs to leave the window property on unmapped window.
Fixes#2276
The glfwCreateWindow function ensures that the width and height are
at least greater or equal than zero, but on X11 it is invalid to
create a window with dimensions that equal zero, see [1].
This change ensures that the dimensions passed to XCreateWindow are
at least 1 by 1.
This issue was detected in [2], where a call to glfwCreateWindow
was done to request a 1x1 window, with a _glfw.x11.contentScaleX of
less than 1.0 (0.958333) this results in a request for a 0x0 window
which then causes an BadWindow error from X11.
[1]: e003f52661/specs/libX11/CH03.xml (L1333-1337)
[2]: https://github.com/WerWolv/ImHex/pull/2390
This adds the glfwGetGLXFBConfig function for querying the GLXFBConfig
the GLXWindow of a window.
This commit is a squashed and modified version of PR #1925 by knokko.
The following changes were made by elmindreda:
The function signature was changed to handle GLXFBConfig being an opaque
value in core GLX. The function error checks were fixed and updated.
The struct member name was changed. The struct member clearing on
context destruction was removed. All documentation snippets were
updated.
Closes#1925
This adds the glfwGetEGLConfig function for querying the EGLConfig of
the EGLSurface of a window.
This is a re-implementation of the PR #2045 by knokko, slightly
redesigned to handle EGLConfig being an opaque type in core EGL.
Closes#2045