Commit Graph

4683 Commits

Author SHA1 Message Date
Camilla Löwy
40aa77a160 Remove superfluous CMake flag in GH build workflow
The source directory already defaults to the current directory.
2024-01-13 21:04:50 +01:00
Camilla Löwy
9f6da7e7c6 Win32: Fix some of the errors for Null-only on VS
This workaround is needed whenever windows.h is included after glfw3.h.
2024-01-13 21:04:41 +01:00
Camilla Löwy
ab09dc8fb1 Add credit
I lost track of the existing PR #2245 when fixing #2161 with
5e4496cb42.

Closes #2245
2023-12-26 14:47:51 +01:00
Doug Binks
b4c3ef9d0f
Clarify documentation for contributing
Added location of credits, news and guides.
2023-12-24 12:23:23 +00:00
Camilla Löwy
2c1d31009f Cocoa: Fix segfault querying joystick elements
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 #2320
Closes #2321
2023-12-12 18:36:14 +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
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
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
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
23ea072c41
Reorder changelog entry 2023-11-27 16:56:58 +00:00
Doug Binks
659d161446
Reorder credit 2023-11-24 17:06:18 +00:00
Grzesiek11
dbe810e403
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.
2023-11-24 17:04:13 +00:00
Camilla Löwy
afd22ebcf3 Add credit
Related to #2403
2023-11-21 21:26:45 +01:00
Scr3amer
97820bc329
Null: Remove duplicated function declaration
The declaration of _glfwRequestWindowAttentionNull was duplicated.

Closes #2403
2023-11-21 20:28:39 +01:00
Camilla Löwy
d9709904fe Linux: Fix POSIX version not set for Null build
When compiling GLFW on Linux with only the Null platform enabled, the
CMake files did not set the required POSIX version macro.

Fixes #2402
2023-11-21 17:40:43 +01:00
Camilla Löwy
a87acd8c1f Update changelog and add credit
Related to #2229
2023-11-16 23:08:50 +01:00
Camilla Löwy
2a4dd9c28f Cleanup 2023-11-16 23:08:30 +01:00
Michael Skec
c992226a9c Linux: Fix memory leak when inotify init failed
This introduces regex_compiled boolean to track whether the regex is
compiled successfully.

Closes #2229
2023-11-16 20:49:23 +01:00
Camilla Löwy
0bd3e879e1 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.
2023-11-16 20:49:23 +01:00
Camilla Löwy
509f4131be 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
2023-11-16 20:49:23 +01:00
Camilla Löwy
01d7c331fd Wayland: Fix zero being used in place of NULL 2023-11-16 20:49:23 +01:00
Camilla Löwy
938a3c29b2 Update Doxyfile template for Doxygen 1.9.7 2023-11-16 20:49:23 +01:00
Doug Binks
3ed6e9d89a
Updated credit 2023-11-15 17:48:30 +01:00
Doug Binks
9a80225ddf
Add credits
Related to #2386 and #2420
2023-11-15 16:48:19 +01:00
Doug Binks
46c2e35c55
Updated changelog 2023-11-15 16:44:24 +01:00
moritz-h
93a3ba8080
Win32: Add library name suffix to pkg-config file
Closes #2386
2023-11-15 16:37:46 +01:00
Camilla Löwy
3eaf1255b2 Wayland: Cleanup
Update naming and declarations to current standard.
2023-06-01 20:12:56 +02:00
Camilla Löwy
6b48f2be97 Wayland: Merge function called once
This brings together the two halves of the cursor setting logic for the
fallback decorations.
2023-06-01 20:12:22 +02:00
Camilla Löwy
00a663dafd Wayland: Fix fallback decorations emitting errors
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.
2023-06-01 20:12:13 +02:00
Camilla Löwy
3fa2360720 Update changelog
Related to #2198
2023-03-31 16:18:46 +02:00
TheBrokenRail
0b94e1b29b Wayland: Fix detection of joysticks after init
Closes #2198
2023-03-31 16:18:46 +02:00