Commit Graph

5451 Commits

Author SHA1 Message Date
Camilla Löwy
fb10e95f78 Add language tags for C code sections 2024-02-13 21:28:24 +01:00
Camilla Löwy
d93868bcf3 Win32: Fix handling of local absolute raw motion
The implementation for how to handle absolute raw motion remotely is
just how to handle absolute raw motion, period.
2024-02-13 19:12:05 +01:00
Camilla Löwy
275b92f887 Win32: Clean up RDP hidden cursor workaround 2024-02-13 18:13:01 +01:00
Camilla Löwy
6c1e3fd84c Win32: Use existing cursor creation path 2024-02-13 17:36:35 +01:00
Camilla Löwy
efffd492dd Wayland: Check all xkbcommon entry points 2024-02-13 17:36:35 +01:00
Camilla Löwy
77ced84e9c Use C99 instead of hard-coded indices 2024-02-13 17:36:35 +01:00
Camilla Löwy
8946f5314d Win32: Add GLFW_WIN32_SHOWDEFAULT
Fixes #2359
2024-02-13 17:36:35 +01:00
Camilla Löwy
2afd57bf9b Expand documentation for custom allocator
Fixes #2298
2024-02-13 17:35:59 +01:00
Camilla Löwy
a12311e596 Document GLFW_FLOATING not supported on Wayland 2024-02-12 22:50:25 +01:00
Camilla Löwy
bb951b4b71 Use C99 fminf and fmaxf 2024-02-12 22:50:25 +01:00
Camilla Löwy
5a0ab56ed7 Fix spelling 2024-02-12 22:50:25 +01:00
Camilla Löwy
30127690a2 Add credit
Related to #2445
2024-02-12 15:59:11 +01:00
Camilla Löwy
6f1ddf51a1 Wayland: Remove unused struct member 2024-02-12 13:06:59 +01:00
Camilla Löwy
6565c0cc04 Update changelog and add credit
Related to #2446
2024-02-12 13:06:59 +01:00
Victor Chernyakin
edd38207a6 Linux: Set O_CLOEXEC on evdev fd
Closes #2446
2024-02-12 13:06:59 +01:00
Camilla Löwy
9953f7ead1 Wayland: Cache framebuffer size
The calculation of framebuffer size is about to get more complicated
with the introduction of fractional-scale-v1, so only do it in one
place.

This is also a tiny preparation for eventually behaving better towards
wl_egl_window_resize.
2024-02-12 13:06:59 +01:00
Camilla Löwy
1be7bc546b Wayland: Clean up data types related to scales 2024-02-12 13:06:59 +01:00
Camilla Löwy
4c283e4a3c Wayland: Be more specific about scales
We are about to introduce another scaling method (fractional-scale-v1),
so it will become more important to be specific about what scales are
used where and what their units are.

This removes 'content scale' from window and monitor structs.  A monitor
(output) now has just a 'scale', which becomes a 'buffer scale' when
applied to a window.  A window now has a list of 'output scales' to
select its buffer scale from.  Content scales are calculated from the
respective monitor or window when queried, even if the calculation right
now is to just return the same value as before.
2024-02-12 13:06:59 +01:00
Camilla Löwy
e25c1cc74f Wayland: Make fallback concepts more distinct 2024-02-12 13:06:59 +01:00
Camilla Löwy
72164e6921 Wayland: Remove fallback decoration edge enum 2024-02-12 13:06:32 +01:00
Camilla Löwy
a268b4b3a4 Wayland: Cleanup 2024-02-11 12:32:46 +01:00
Camilla Löwy
4baeadbd66 Wayland: Put fallback decorations behind a boolean 2024-02-11 12:32:27 +01:00
Camilla Löwy
6ac0835ad2 Wayland: Cleanup 2024-02-09 14:33:13 +01:00
Camilla Löwy
ea6dd72c71 Wayland: Fix GLFW_HOVERED for fallback decorations
When using the fallback decorations, GLFW_HOVERED was true also when the
cursor was over one of the window decorations.

This also disentangles the GLFW_HOVERED state from the fallback
decorations.  Because GLFW_HOVERED should have had the same behavior as
GLFW_MAIN_WINDOW, the latter has been removed.
2024-02-09 14:33:01 +01:00
Camilla Löwy
5e97447dd5 Wayland: Clarify fallback decoration struct name
We now have three window decoration paths in the Wayland backend:
libdecor decorations, XDG decorations and fallback decorations.

This makes it clearer when code relates to the fallback decoration path,
which should increasingly (hopefully) not get used.
2024-02-09 14:22:23 +01:00
Camilla Löwy
d3a7362430 Wayland: Separate window and framebuffer resizing 2024-02-09 14:01:57 +01:00
Camilla Löwy
1fe98a0d53 Fix missing list entry dash in README 2024-02-09 14:00:02 +01:00
Camilla Löwy
a360198f8f Wayland: Implement glfwFocusWindow
This implements window focus requests via the xdg-activation-v1
protocol.  These requests will likely only work when another window of
the same application already has input focus, but that isn't unlike the
behavior of other platforms.

The GLFW_FEATURE_UNAVAILABLE error has been removed from this function
for now.

Related to #2284
Related to #2306
Related to #2439
2024-02-09 13:52:54 +01:00
Camilla Löwy
eeb403135d Add minor features and updates to window test
- Button label reflects window mode
- Window attention request button
- Slightly less bad button layout possibly
- Applicable button labels list expected delay
- Less telegraphic message for positions being unsupported
- Window size more likely to fit contents
2024-02-09 13:45:48 +01:00
Camilla Löwy
2d51e650be Document GLFW_FLOATING not supported on Wayland
(cherry picked from commit 12043e72189d80ef7574c2ea8fb8190288db6be7)
2024-02-05 16:25:27 +01:00
Camilla Löwy
bc788a9333 WGL: Fix pixel format count in a Parallels VM
In a Parallels VM wglGetPixelFormatAttribivARB returns fewer pixel
formats than DescribePixelFormat.  This broke context creation on
Windows in Parallels since the changes in
2c0f34b60f.  The previous version of the
code worked accidentally.

This adds a workaround by iterating through the minimum of both counts.
It should have no effect when running on conforming implementations.

Tested on Parallels by @ dougbinks.

Closes #2191
Fixes #2406
Fixes #2467

This was adapted to 3.3-stable from
00e86d4b73.
2024-02-05 16:25:27 +01:00
Camilla Löwy
ae44e10b33 Fix function return value when uninitialized
(cherry picked from commit d7aeb1eae8)
2024-02-05 16:25:27 +01:00
Camilla Löwy
438cd224d7 Fix function return value when uninitialized
(cherry picked from commit f74ff2aa10)
2024-02-05 16:25:27 +01:00
Camilla Löwy
8d95aeac69 Remove further traces of IRC channel
(cherry picked from commit 23962c9dc7)
2024-02-05 16:25:27 +01:00
Camilla Löwy
a1090c867d Wayland: Fix compilation on FreeBSD
The list of compile-time dependencies on FreeBSD lacked evdev-proto.

Unlike on Linux, the input-event-codes.h header file was not implicitly
included on FreeBSD.

Fixes #2445

This was adapted to 3.3-stable from
51920ede68.
2024-02-05 16:25:27 +01:00
Camilla Löwy
15b771759d OSMesa: Fix headers included before shared header
The shared header, internal.h, must be the first header included in
every compilation unit of GLFW.

(cherry picked from commit 291f4d89cd)
2024-02-05 16:25:27 +01:00
Bruce Mitchener
d172fec64b Update to actions/checkout@v4 from v3
This mainly updates the version of NodeJS used internally to keep
up with what's going on at GitHub Actions.

Closes #2447

This was adapted to 3.3-stable from
becf1dc14b.
2024-02-05 16:25:27 +01:00
Camilla Löwy
bfa24c9f2d Fix glfwGetKeyName incorrectly emitting error
glfwGetKeyName emitted GLFW_INVALID_VALUE when passed GLFW_KEY_UNKNOWN
and any scancode not associated with a key token on that platform.

This causes physical keys with no associated key token to emit
GLFW_INVALID_VALUE when the key and scancode are passed directly from
the key event to glfwGetKeyName.  This breaks the promise made in the
reference documentation for glfwGetKeyName.

This commit removes that error for the whole range of valid scancodes.

Fixes #1785
Fixes #2214

This was adapted to 3.3-stable from
86bf5698ec.
2024-02-05 16:25:27 +01:00
Camilla Löwy
20bd0329a5 Clarify event test reporting of keys
Reshuffled line to group key-related items together.  Omitted key code
output for unknown keys to put focus on the (lack of) name.

(cherry picked from commit d81fcb93f1)
2024-02-05 16:25:27 +01:00
Camilla Löwy
fafcba3824 Wayland: Clean up pointer axis handler
(cherry picked from commit 9afbcb442b)
2024-02-05 16:25:27 +01:00
Camilla Löwy
7554375d6d Update CODEOWNERS file
(cherry picked from commit cf29ff2b9d)
2024-02-02 13:27:42 +01:00
Camilla Löwy
dbe2d7cb4a Set timeout for build GH workflow jobs
This is in order to catch and stop any malfunctioning job.

This was adapted to 3.3-stable from
d5461d2927ac712ded603f7f133f18e9a02caeb4.
2024-02-02 13:26:50 +01:00
Camilla Löwy
00e86d4b73 WGL: Fix pixel format count in a Parallels VM
In a Parallels VM wglGetPixelFormatAttribivARB returns fewer pixel
formats than DescribePixelFormat.  This broke context creation on
Windows in Parallels since the changes in
2c0f34b60f.  The previous version of the
code worked accidentally.

This adds a workaround by iterating through the minimum of both counts.
It should have no effect when running on conforming implementations.

Tested on Parallels by @ dougbinks.

Closes #2191
Fixes #2406
Fixes #2467
2024-01-30 20:22:10 +01:00
Camilla Löwy
86d7bcb124 Fix missing checks for platform mismatch
The native access functions for monitor objects did not check whether
the correct platform was initialized and would return invalid handles if
it was not.
2024-01-30 20:20:42 +01:00
Camilla Löwy
d7aeb1eae8 Fix function return value when uninitialized 2024-01-30 20:20:42 +01:00
Camilla Löwy
f74ff2aa10 Fix function return value when uninitialized 2024-01-30 20:20:42 +01:00
Camilla Löwy
c47894a9a3 Update compilation-related parts of README 2024-01-30 20:20:42 +01:00
Camilla Löwy
42afff41fe Remove reminders to use C99 from more source files 2024-01-30 20:20:42 +01:00
Camilla Löwy
23962c9dc7 Remove further traces of IRC channel 2024-01-30 20:20:42 +01:00
Camilla Löwy
ad264f5061 Update URL for xdg-activation-v1 protocol docs 2024-01-30 20:20:42 +01:00