Commit Graph

63 Commits

Author SHA1 Message Date
Doug Binks
95d464bb4b Add glfwGetWindowTitle
This adds a function for querying the current title of a window.  This
currently returns a copy of the last title set via GLFW.

Fixes #1448
Closes #1909
Closes #2482
2024-02-19 14:20:52 +01:00
Camilla Löwy
f0ec791386 X11: Cleanup
The actual reported bug was fixed at some point during the refactoring
of the Wayland backend.  This is only a bit of tidying.  Updating the
cache before emitting events is always a nice thing to do.

Closes #2046
2024-02-16 12:34:03 +01:00
Camilla Löwy
b61f3fc479 Wayland: Fix invalid size protocol error
This could happen when resizing a window with fallback decorations.

Fixes #2204
2024-02-16 00:13:32 +01:00
Camilla Löwy
30127690a2 Add credit
Related to #2445
2024-02-12 15:59:11 +01:00
Camilla Löwy
6565c0cc04 Update changelog and add credit
Related to #2446
2024-02-12 13:06:59 +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
Jan Schürkamp
9317970243 Wayland: Implement glfwRequestWindowAttention
This implements window attention requests via the xdg-activation-v1
protocol.

This was updated by @ elmindreda to work with recent Wayland related
 changes to the main branch:
 - Switched to current way of handling Wayland protocol files
 - Added the xdg-activation-v1.xml protocol file to deps/wayland
 - Added missing macros to rename protocol interface globals

The protocol file was copied from wayland-protocols 1.33.

Closes #2287
2024-01-30 20:20:42 +01:00
Doug Binks
7321b56cad
Reorder credit 2024-01-28 17:18:11 +00:00
Hilderin
c8521b7fda
Win 32: Fix disabled cursor mode when connected over RDP
Fixes #1276
Based on PR #1279 by @Pokechu22

Co-authored-by: Pokechu22 <8334194+Pokechu22@users.noreply.github.com>
2024-01-28 17:08:27 +00: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
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
Camilla Löwy
7b152019da Add credit
Related to #2377
Related to #2405
2023-12-11 21:28:48 +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
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
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
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
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
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
Camilla Löwy
2b580012da Add credit
Related to #2199
2023-03-03 14:46:43 +01:00
Camilla Löwy
9b1f63bad9 Add credit
Closes #2256
2023-03-02 17:47:36 +01:00
Camilla Löwy
57cbded076 Add credit
Related to #2225
2022-12-16 13:44:59 +01:00
Camilla Löwy
b2b087cd8e Fix documented errors for gamma ramp functions
Fixes #2186
2022-09-20 17:02:51 +02:00
Camilla Löwy
ed1d9e1ca7 Document X11 WM_CLASS hint behavior
Fixes #2180
2022-09-15 22:25:10 +02:00
Camilla Löwy
c812b9d87c Add conditional compilation for platform units
This is a step towards being able to compile GLFW manually without
needing to duplicate a lot of platform- or OS-specific logic.
2022-09-15 22:24:39 +02:00
Camilla Löwy
ef6c9d8b4f Wayland: Fix window opacity on older systems
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
2022-08-01 19:19:51 +02:00
Michael Pennington
b9ed25d2e9 Wayland: Add GLFW_WAYLAND_APP_ID window hint
This adds a window hint string for the xdg_toplevel::app_id, which is
used by desktop environments to connect windows with application icons
and other information.  This is similar to the WM_CLASS property on X11.

A few very minor fixes were done by @elmindreda during merge.

Fixes #2121
Closes #2122
2022-07-24 17:51:54 +02:00
Camilla Löwy
71be34a6c3 Wayland: Fix crash if mouse connected after init
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
2022-07-15 16:17:12 +02:00
Camilla Löwy
91a96ed434 Update changelog and add credit
Related to #2042
Related to #2043
2022-07-15 16:17:12 +02:00
Camilla Löwy
6dd526fb1a Win32: Fix right Shift scancode when using CJK IME
Fixes #2050
2022-07-11 20:54:22 +02:00
Camilla Löwy
8e725338bf Add credit
Related to #2150
2022-07-11 20:54:03 +02:00
Camilla Löwy
dfb26023fc Update changelog and add credit
Related to #2113
Related to #2120
2022-07-07 23:48:42 +02:00
Camilla Löwy
0d599026d0 Cocoa: Fix clearing of unrelated window style bits
Whenever GLFW changed the window style mask, a new mask was created
from scratch based on the attributes set on the GLFW window object.
This caused us to potentially clear unrelated window style bits.

This was always wrong but became a critical issue when Cocoa began
throwing an exception if an application cleared the
NSWindowStyleMaskFullScreen while the window is in macOS fullscreen.

This commit reworks all style mask editing so it only changes the
relevant bits, preserving all others.

This is only a narrow bug fix to prevent crashes, intended for the
stable branch.  Our interaction with macOS fullscreen is still very
poor.  The next step after this is a set of patches that improve the
interaction between the current API and macOS fullscreen.

Fixes #1886
Fixes #2110
2022-07-07 23:47:48 +02:00
Camilla Löwy
0f5b095042 Wayland: Fix erratic fallback decoration behavior
The handler for xdg_toplevel::configure treated the provided size as the
content area size when instead it is the size of the bounding rectangle
of the wl_surface and all its subsurfaces.

This caused the fallback decorations to try positioning themselves
outside themselves, causing feedback loops during interactive resizing.

Fixes #1991
Fixes #2115
Closes #2127
Related to #1914
2022-06-20 00:57:17 +02:00
Camilla Löwy
ddd087d662 Wayland: Fix behavior of leaving full screen mode
These changes make GLFW fullscreen more consistent, but unfortunately
also make GLFW even more oblivious to user-initiated XDG shell
fullscreen changes.

Fixes #1995
2022-06-20 00:57:17 +02:00
Camilla Löwy
d3ede7b684 Add credit
Related to #2108
2022-06-10 00:14:05 +02:00
Camilla Löwy
2c204ab52e Fix joystick user pointer NULL during disconnect
The joystick code did not distinguish between the allocation status of
the GLFW joystick object and whether it is connection to an OS level
joystick object.

These are now tracked separately.

Fixes #2092
2022-06-08 22:14:38 +02:00
Camilla Löwy
f843d53333 Fix glfwMakeContextCurrent using uninitialized TLS
Issue reported by danhambleton on the GLFW forum:
https://discourse.glfw.org/t/posix-thread-local-storage-tls-error-when-making-context-current/2034
2022-04-21 15:56:01 +02:00
Camilla Löwy
4cb36872a5 Wayland: Add support for file drop events
This adds support for file path drop events in text/uri-list format.

It is based on work by Pilzschaf in #2040.

Closes #2040
2022-04-03 20:09:42 +02:00
Camilla Löwy
955fbd9d26 Cocoa: Fix AirPlay causing harmless init error
Emitting an error for one specific type of failure in retrieving the
correct name for a display is not very useful, especially when
initialization is otherwise unaffected.

There should be a path for information like that but this isn't it.

Fixes #1791
2022-03-18 00:45:12 +01:00
Camilla Löwy
07a5518c3e Win32: Fix using executable instance and not ours
Operations that take an instance handle should be passed the handle of
whatever module we are inside instead of blindly passing the handle of
the executable.

This commit makes GLFW retrieve its own instance on initialization.

This makes the most difference for window classes, which are
per-instance.  Using the executable instance led to name conflicts if
there were several copies of GLFW in a single process.

Note that having this is still a bad idea unless you know what things to
avoid, and those things are mostly platform-specific.  This is partly
because the library wasn't designed for it and partly because it needs
to save, update and restore various per-process and per-session settings
like current context and video mode.

However, multiple simultaneous copies of GLFW in a single Win32 process
should now at least initialize, like is already the case on other
platforms.

Fixes #469
Fixes #1296
Fixes #1395
Related to #927
Related to #1885
2022-03-18 00:45:04 +01:00
Camilla Löwy
66a4882eb1 Add checks for some invalid values to public API
There were no checks for invalid values or asserts for all invalid NULL
pointers to glfwSetWindowIcon or glfwCreateCursor.

Fixes #1862
2022-03-18 00:23:20 +01:00
Camilla Löwy
03cfe957e7 Win32: Fix scancode and key for Alt+PrtSc events
Alt+PrtSc emits a different scancode than just PrtSc.  Since the GLFW
API assumes each key corresponds to only one scancode, this cannot be
added to the keycodes array.

Instead we replace the scancode at the point of entry.

Fixes #1993
2022-03-18 00:19:01 +01:00
Camilla Löwy
46950a5e61 Fix button field names in input guide
Fixes #2056
2022-03-13 15:27:25 +01:00