This is partly based on the implementation of libdecor support in
PR #1693 by @ christianrauch.
Where available, the libdecor library is loaded at init and becomes the
preferred method for window decorations. On compositors that support
XDG decorations, libdecor in turn uses those. If not, libdecor has
a plug-in archtecture and may load additional libraries to either use
compositor-specific decorations or draw its own.
If necessary, support for libdecor can be disabled with the
GLFW_WAYLAND_LIBDECOR init hint. This is mostly in case some part of
the dynamic loading or duplication of header material added here turns
out to cause problems with future versions of libdecor-0.so.0.
Fixes#1639Closes#1693
Related to #1725
This was adapted to 3.3-stable from
fbdb53b9ca.
This commit simplifies the detection of which element of a fallback
decorated window the pointer has entered. Instead of looping through
the list of windows, the user pointer of fallback decoration surfaces is
set to the GLFW window object.
(cherry picked from commit cd466cf9fd)
This replaces (one case of) manual management of weak links between
windows and monitors, both objects with complex life times, with
wl_object pointers used as opaque key values.
(cherry picked from commit efa9297a41)
This is in preparation for adding support for libdecor, which creates
its own proxies on our display. It will likely also be helpful to some
people using native access on Wayland.
This is partly based on the implementation of libdecor support in
PR #1693 by @ christianrauch.
(cherry picked from commit 91c837ace5)
If a window was initially fullscreen then it would not get an XDG
decoration object. If the window was later switched to windowed mode it
would then get fallback decorations instead of XDG ones.
(cherry picked from commit 735fc101f5)
This is not intended as a replacement for actually querying the desktop
for the correct size, but it appears to be a better fallback value.
(cherry picked from commit 82e77dbff4)
Fixes the following CI warning:
"Node.js 12 actions are deprecated. Please update the following
actions to use Node.js 16: actions/checkout@v2..."
Closes#2255
(cherry picked from commit 9a87635686)
Both config parameters are "desired", but one is older and never had its
name updated.
This commit at least makes it clearer that they are similar.
(cherry picked from commit ab1b1edfd0)
Because EGL ties client API support to configs, attempts to create
a context with an unavailable client API will fail with the unhelpful
"failed to find suitable config" error description.
This attempts to detect cases where there are usable configs for the
other client API and emit a hopefully more helpful error.
Related to #2173
(cherry picked from commit e057666642)
We only care about displayable pixel formats (as defined in
WGL_ARB_pixel_format) for window context creation.
This changes pixel format enumeration to ignore non-displayable formats,
which are specified to be listed after displayable ones, by always using
the return value of DescribePixelFormat as the pixel format count.
(cherry picked from commit 2c0f34b60f)
On systems lacking the EGL_EXT_present_opaque extension, some
compositors treat any buffer with an alpha channel as per-pixel
transparent.
This commit ignores any EGLConfig with an alpha channel if the extension
is missing and the window is created with GLFW_TRANSPARENT_FRAMEBUFFER
set to false.
This is technically not a breaking change since GLFW_ALPHA_BITS is not
a hard constraint, but it is still going to inconvenience anyone using
the framebuffer alpa channel to store other kinds of data.
Related to #1895
(cherry picked from commit ef6c9d8b4f)
The documentation was updated with the introduction of run-time platform
selection, but the preprocessor logic was not.
(cherry picked from commit 2efc598d70)
This fixes spelling, grammar and punctuation issues, missing words and
stray words across the documentation. A confusing sentence was removed
from the tutorial.
Closes#2085
(cherry picked from commit 2e12ef00bb)
This is the refactoring part of adding GLFW_CURSOR_CAPTURED, separated
out to help keep 3.3-stable similar to the main branch.
Related to #58.
(cherry picked from commit a46f829de8)
Shorten names and allow C99 declarations. Replace helper function with
the NULL check it was hiding. Separate cursor hiding from pointer
locking.
(cherry picked from commit e85b645b8a)
The cursor theme was only loaded if the chosen seat had a mouse
(wl_pointer) during initialization. If a mouse was connected only after
glfwInit, there would be no cursor theme but the rest of the cursor
related code assumed one had already been loaded.
This also moves the details of cursor theme loading out into a separate
function to declutter platform init.
Because the original cursor theme loading code checked whether we got
a wl_shm, and because the rest of the code just assumes we have
a wl_shm, initialization will now fail if there isn't one.
Fixes#1450
(cherry picked from commit 71be34a6c3)
Joysticks in Linux without buttons were ignored by device enumeration.
Remove the mandatory button attribute from detection.
Fixes#2042Closes#2043
(cherry picked from commit c424fe5589)
If the key or character callback performs actions that indirectly
updates the key repeat timer, those changes would be undone once the key
callback returned.
This fixes the order of operations so that key repeat is fully set up
before the key related events are emitted.
(cherry picked from commit 40b5a8a37c)
During platform window destruction, all of its callbacks have already
been removed, so emitting events for it does nothing.
(cherry picked from commit 4df24735ef)