Commit Graph

5451 Commits

Author SHA1 Message Date
Camilla Löwy 6ea5bf9032 Fix Markdown formatting for changelog entry
(cherry picked from commit 378e5fc814)
2023-12-12 16:03:37 +01:00
Camilla Löwy 1fab407e44 Update changelog and add credit
Related to #2377
Related to #2405

This was adapted to 3.3-stable from
7b152019da.
2023-12-12 16:02:47 +01:00
FuzzyQuills 7cdd41170b Cocoa: No NSWindowStyleMaskResizable in fullscreen
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 #2377
Closes #2405

(cherry picked from commit 8e9a5d29a8)
2023-12-12 15:58:33 +01:00
Camilla Löwy ea3ea62708 Update changelog and add credit
Related to #2348
2023-12-12 13:47:37 +01:00
lo-v-ol eeeb56eb23 EGL: Fix GLFW_CONTEXT_NO_ERROR on Mesa
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
2023-12-12 13:47:37 +01:00
Camilla Löwy 378e5fc814 Fix Markdown formatting for changelog entry 2023-12-12 13:46:48 +01:00
Camilla Löwy 7b152019da Add credit
Related to #2377
Related to #2405
2023-12-11 21:28:48 +01:00
FuzzyQuills 8e9a5d29a8
Cocoa: No NSWindowStyleMaskResizable in fullscreen
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 #2377
Closes #2405
2023-12-11 21:25:44 +01:00
Camilla Löwy e0de6ea513 EGL: Only use EGL_EXT_present_opaque on Wayland
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.
2023-12-07 18:04:48 +01:00
Camilla Löwy 79d957ca18 Add credit
Fixes #2397

(cherry picked from commit 68edc66aa4)
2023-12-07 18:04:48 +01:00
Camilla Löwy 63bba49e31 Cocoa: Fix compilation error on OS X 10.8
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)
2023-12-07 18:04:48 +01:00
Peter Johnson 80d45cdfd7 Win32: Fix invalid hat bit mask being accepted
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)
2023-12-07 18:04:48 +01:00
Camilla Löwy 683b7524d2 Improve documentation relating to key tokens
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)
2023-12-07 18:04:48 +01:00
Camilla Löwy 356f56a166 Fix list of possible errors for glfwGetKeyName
(cherry picked from commit 557a633b2d)
2023-12-07 18:04:48 +01:00
Camilla Löwy 5f936a6276 Fix glfwGetKeyName not checking key token is valid
(cherry picked from commit b1517e5b3e)
2023-12-07 18:04:48 +01:00
Camilla Löwy 1c989eace3 Clarify documentation for glfwMakeContextCurrent
(cherry picked from commit 3f31519de8)
2023-12-07 18:04:48 +01:00
Camilla Löwy c98860db9e Add assertions for context function invariants
Related to #2327

(cherry picked from commit 93d70cb6a8)
2023-12-07 18:04:48 +01:00
Camilla Löwy cb0dafa7c0 Fix potential violation of invariant
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.
2023-12-07 18:04:08 +01:00
Camilla Löwy 11f517e557 Fix return value on error for glfwGetKeyScancode
The documentation says it should be -1, not zero.

(cherry picked from commit 8c5471d6cd)
2023-12-07 17:33:52 +01:00
Camilla Löwy 46cebb5081 EGL: Only use EGL_EXT_present_opaque on Wayland
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
2023-12-07 16:51:13 +01:00
Camilla Löwy 68edc66aa4 Add credit
Fixes #2397
2023-12-07 16:01:47 +01:00
Camilla Löwy ddd92a4fa8 Update changelog and add credit
Related to #2327
2023-12-06 18:34:22 +01:00
Camilla Löwy 5e4496cb42 Cocoa: Fix compilation error on OS X 10.8
The occlusion state parts of NSWindow are OS X 10.9+ only but we still
(technically) support building for only 10.8.

Fixes #2161
2023-12-06 18:34:22 +01:00
Camilla Löwy 0ede5f58c6 Simplify joystick hat value assertions 2023-12-06 18:34:22 +01:00
Peter Johnson 52405a9d59 Win32: Fix invalid hat bit mask being accepted
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
2023-12-06 18:34:12 +01:00
Camilla Löwy 9959dc69ca Improve documentation relating to key tokens
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
2023-12-05 19:10:06 +01:00
Camilla Löwy 557a633b2d Fix list of possible errors for glfwGetKeyName 2023-12-05 18:36:54 +01:00
Camilla Löwy b1517e5b3e Fix glfwGetKeyName not checking key token is valid 2023-12-05 18:36:54 +01:00
Camilla Löwy 3f31519de8 Clarify documentation for glfwMakeContextCurrent 2023-12-05 18:36:54 +01:00
Camilla Löwy 1b2605dbcd Fix missing new constant in release notes 2023-12-05 18:36:54 +01:00
Camilla Löwy 93d70cb6a8 Add assertions for context function invariants
Related to #2327
2023-12-05 18:36:54 +01:00
Camilla Löwy fa0ea5c41f Fix potential violation of invariant
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
2023-12-05 18:36:54 +01:00
Camilla Löwy 8c5471d6cd Fix return value on error for glfwGetKeyScancode
The documentation says it should be -1, not zero.
2023-12-05 18:36:38 +01:00
Camilla Löwy 2a4e26870b Fix remaining use of actions/checkout@v2
Related to #2255
2023-12-05 16:18:59 +01:00
Camilla Löwy fb94e4268b Remove changelog entry
This bug was introduced since the last release and should not be listed.
2023-12-01 12:38:57 +01:00
Camilla Löwy 31f08cc7fc Wayland: Fix heuristics for what counts as events
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)
2023-11-30 21:34:16 +01:00
Camilla Löwy 9809035ed2 Wayland: Fix protocol error on undecorated window
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)
2023-11-30 21:34:06 +01:00
Camilla Löwy 7cc8879ab9 Wayland: Use Wayland to wait for libdecor to init
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)
2023-11-30 21:31:58 +01:00
Camilla Löwy d097e35743 Wayland: Fix heuristics for what counts as events
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.
2023-11-30 18:52:43 +01:00
Camilla Löwy 23e40548b1 Wayland: Fix protocol error on undecorated window
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.
2023-11-30 18:52:43 +01:00
Camilla Löwy 9fdc425931 Wayland: Use Wayland to wait for libdecor to init
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.
2023-11-30 18:52:12 +01:00
Doug Binks 89b149a56f Reorder credit
(cherry picked from commit 659d161446)
2023-11-28 22:19:11 +01:00
Grzesiek11 b52b074be5 Documentation: only named keys generate synthetic key releases
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)
2023-11-28 22:19:08 +01:00
Camilla Löwy b211975131 Update changelog and add credit
Related to #2229

(cherry picked from commit a87acd8c1f)
2023-11-28 22:18:36 +01:00
Camilla Löwy 2c09407bff Cleanup
(cherry picked from commit 2a4dd9c28f)
2023-11-28 22:17:40 +01:00
Michael Skec 7c7cc59889 Linux: Fix memory leak when inotify init failed
This introduces regex_compiled boolean to track whether the regex is
compiled successfully.

Closes #2229

(cherry picked from commit c992226a9c)
2023-11-28 22:16:53 +01:00
Camilla Löwy 6f9686f1f4 Fix unneccessary use of "must"
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)
2023-11-28 22:15:43 +01:00
Camilla Löwy 89bea58b18 Win32: Fix glfwWaitEventsTimeout ignoring messages
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)
2023-11-28 22:15:23 +01:00
Camilla Löwy ff156743ab Update Doxyfile template for Doxygen 1.9.7
This was adapted to 3.3-stable from
938a3c29b2.
2023-11-28 22:04:48 +01:00
Doug Binks 23ea072c41
Reorder changelog entry 2023-11-27 16:56:58 +00:00