When GLFW_ANY_PLATFORM is used (which is the default), X11 would be
selected on a Wayland system with XWayland and where XDG_SESSION_TYPE
was not set.
Closes#2035
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#1448Closes#1909Closes#2482
This adds the GLFW_SCALE_FRAMEBUFFER window hint, enabling control of
framebuffer scaling across Wayland and macOS. On macOS, this window
hint is a new name for GLFW_COCOA_RETINA_FRAMEBUFFER, and both hint
names will modify the same hint.
This is now a more symmetric counterpart to GLFW_SCALE_TO_MONITOR and,
weirdly, they each apply neatly to half of the supported platforms.
This commit is mostly documentation updates to better integrate and
contrast these two scaling mechanisms.
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.
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
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
This is primarily a workaround for a GLFW application reading and/or
writing to the clipboard in rapid succession and catching up with the
Windows Clipboard History, which also has to contend for the lock.
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
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
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.
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
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.
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
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
This adds window hints for the initial position, in screen coordinates,
of a window. The special value GLFW_ANY_POSITION means the window
manager will be allowed to position the window.
It is not possible to set window positions on Wayland and GLFW will
always behave as if these hints are set to GLFW_ANY_POSITION.
Fixes#1603Fixes#1747
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#2121Closes#2122
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