It is reportedly possible for IOHIDDeviceCopyMatchingElements to return
NULL on macOS 13 if the application lacks input monitoring permissions.
This commit only prevents the segfault. More work will be needed to
correctly handle this situation, including Game Controller support.
Related to #2320Closes#2321
(cherry picked from commit 2c1d31009f)
Mesa EGL requires the context version to be set to 2.0 or greater before
EGL_CONTEXT_OPENGL_NO_ERROR_KHR in the attribute list.
Without this, context creation via Mesa EGL with
EGL_CONTEXT_OPENGL_NO_ERROR_KHR set fails with EGL_BAD_ATTRIBUTE.
Fixes#2348
(cherry picked from commit eeeb56eb23)
On macOS 10.15 Catalina and earlier, not having the resizable bit
cleared in NSWindowStyleMask in fullscreen leads to windows minimising
when clicked anywhere in the content area.
On all tested macOS versions it also causes the fullscreen window to be
resizable by the user.
Regression introduced by 0d599026d0.
Fixes#2377Closes#2405
(cherry picked from commit 8e9a5d29a8)
The EGL_EXT_present_opaque extension is primarily a workaround meant for
Wayland, even if the language in it doesn't mention this. GLFW
previously always enabled this extension where supported. This caused
issues on X11 when running the Nvidia binary blob.
This commit ensures the extension is only enabled on Wayland.
Fixes#2365
This was adapted to 3.3-stable from
46cebb5081.
The occlusion state parts of NSWindow are OS X 10.9+ only but we still
(technically) support building for only 10.8.
Fixes#2161
(cherry picked from commit 5e4496cb42)
It is reportedly possible to get opposing directions of an XInput DPad
bit mask set simultaneously with some controllers.
This commit ensures that those values are not passed on to other parts
of GLFW.
This commit is based on the PR #2291 by @ PeterJohnson but with the
following changes:
- moved XInput-specific special case to XInput implementation
- attempt to preserve data by only masking out the invalid axis
- admin (credit, changelog, commit message)
Closes#2291
(cherry picked from commit 52405a9d59)
Shifted the documentation away from the term 'named keys' as something
different than keys that glfwGetKeyName will return a name for. The
already existing term 'key token' should now be used to refer to the
GLFW_KEY_* constants.
The associated term 'named mouse button' was also replaced with
'supported mouse button'.
The parts explaining which key tokens will return a valid scancode from
glfwGetKeyScancode have hopefully been clarified. This issue was
reported in #2055.
The GLFW_KEY_UNKNOWN constant has been moved out of the list of key
tokens to simplify and hopefully clarify the related documentation.
Various other keyboard key related edits were made, hopefully resulting
in improvements.
Related to #2055
(cherry picked from commit 9959dc69ca)
The shared function for reading back context attributes,
_glfwRefreshContextAttribs, did not check whether the newly created
context had been successfully made current. This violated the invariant
that the context TLS slot always points to a valid window and that its
context is current whenever _glfw.platform.getProcAddress is called.
Related to #2327
This was adapted to 3.3-stable from
fa0ea5c41f and
ddd92a4fa8.
The Wayland implementation of glfwWaitEvents* keeps waiting until it
sees evidence that a significant event has been processed. However,
this included updating an animated cursor (not a significant event)
but did not include previously buffered Wayland events or libdecor
events (definitely significant events).
This commit corrects these cases.
(cherry picked from commit d097e35743)
When setting the visibility of a libdecor frame on a compositor that
supports XDG decorations, libdecor 0.1 will update the geometry of the
XDG surface. GLFW attempted to set the visibility before having told
libdecor what size the content area is. This caused a Wayland protocol
error when libdecor attempted to set the window size to 0x0.
This commit adds setting the content area size for the libdecor frame
directly after creation, allowing libdecor to know what it's doing.
(cherry picked from commit 23e40548b1)
Much of libdecor is initialized only after certain events have been
received from the compositor and some parts of libdecor 0.1 are unsafe
to use until this delayed initialization has completed.
Since libdecor does not provide an API to query if or be notified when
this has happened, GLFW processed events until its newly created
libdecor frame had created its XDG shell objects.
This commit switches to using a generic Wayland sync point created just
after libdecor (and presumably its plugin) has set up its delayed
initialization, instead of relying on the more specific implementation
detail mentioned above.
It also makes this wait mandatory before the first libdecor frame is
created instead of a pre-condition for certain libdecor frame calls,
hopefully removing even more dependence on implementation details.
(cherry picked from commit 9fdc425931)
The current wording states that all keys have synthetic key release
events generated after focus is lost, but keys that aren't named
don't have any state held, so no such events are generated for them.
The new wording clarifies that only named keys have the events generated
for them.
(cherry picked from commit dbe810e403)
Passing a context-less window to a function that requires a context only
emits a harmless GLFW_NO_WINDOW_CONTEXT error.
(cherry picked from commit 0bd3e879e1)
The bitmask passed to MsgWaitForMultipleObjects was missing
QS_SENDMESSAGE, causing glfwWaitEventsTimeout not to return when the
thread received messages sent from other threads.
Fixes#2408
(cherry picked from commit 509f4131be)
Many years ago this value was changed from F13 to Print Screen with
1ae9ce1e0a. However, this was later
reverted to F13 with 5759d0fdf2.
This changes it back to Print Screen for consistency with other
platforms.
Closes#1786Fixes#2169
(cherry picked from commit c940695eb0)
A GLFW_CURSOR_UNAVAILABLE error would be emitted each time the cursor
moved over the fallback decorations if the standard cursor shape
appropriate for that part was missing on the system.
These errors served no useful purpose and have been removed.
(cherry picked from commit 00a663dafd)
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)