Commit Graph

4472 Commits

Author SHA1 Message Date
Camilla Löwy
31b038663a EGL: Add better error for no stereo
(cherry picked from commit 93e93135f2)
2022-10-31 22:04:00 +01:00
Camilla Löwy
6fb86c089e EGL: Add better errors for client API mismatch
Because EGL ties client API support to configs, attempts to create
a context with an unavailable client API will fail with the unhelpful
"failed to find suitable config" error description.

This attempts to detect cases where there are usable configs for the
other client API and emit a hopefully more helpful error.

Related to #2173

(cherry picked from commit e057666642)
2022-10-31 22:03:56 +01:00
Camilla Löwy
bc36010350 Check if context creation APIs match when sharing
(cherry picked from commit 6b57e08bb0)
2022-10-31 22:03:47 +01:00
Camilla Löwy
bd13f55ca8 WGL: Fix count of displayable pixel formats
We only care about displayable pixel formats (as defined in
WGL_ARB_pixel_format) for window context creation.

This changes pixel format enumeration to ignore non-displayable formats,
which are specified to be listed after displayable ones, by always using
the return value of DescribePixelFormat as the pixel format count.

(cherry picked from commit 2c0f34b60f)
2022-10-31 22:03:35 +01:00
Camilla Löwy
8b4f1ebbea 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

(cherry picked from commit ef6c9d8b4f)
2022-10-31 22:02:06 +01:00
Camilla Löwy
1f675ab62f GLX: Add support for loading glvnd libGLX
(cherry picked from commit c18851f52e)
2022-10-31 21:57:21 +01:00
Camilla Löwy
ed55529ce8 EGL: Add support for loading glvnd libOpenGL
(cherry picked from commit 55aad3c37b)
2022-10-31 21:48:45 +01:00
Camilla Löwy
426c6ed6b1 X11: Preserve unrelated values in WM_NORMAL_HINTS
This stops GLFW overwriting the whole WM_NORMAL_HINTS property every
time it updates size-related parts of it.

(cherry picked from commit 7d73629e50)
2022-10-31 21:48:04 +01:00
Camilla Löwy
1fe29e2c19 Fix native access macros being mutually exclusive
The documentation was updated with the introduction of run-time platform
selection, but the preprocessor logic was not.

(cherry picked from commit 2efc598d70)
2022-10-31 21:47:57 +01:00
TheChocolateOre
34bfb52641 Fix typos and other issues in docs
This fixes spelling, grammar and punctuation issues, missing words and
stray words across the documentation.  A confusing sentence was removed
from the tutorial.

Closes #2085

(cherry picked from commit 2e12ef00bb)
2022-10-31 21:47:01 +01:00
Camilla Löwy
3670cd0561 Wayland: Remove unreachable code
This platform function is only called if the cursor is enabled.

(cherry picked from commit 3a5c726d1b)
2022-10-31 21:34:38 +01:00
Camilla Löwy
0ee9b7281b Wayland: Clean up pointer helper function order
(cherry picked from commit 7be6a2cabe)
2022-10-31 21:34:33 +01:00
Camilla Löwy
5f3e5542cf Refactor cursor mode paths
This is the refactoring part of adding GLFW_CURSOR_CAPTURED, separated
out to help keep 3.3-stable similar to the main branch.

Related to #58.

(cherry picked from commit a46f829de8)
2022-10-31 21:29:42 +01:00
Camilla Löwy
632d35e0d4 Wayland: Fix leaks of pointer related objects
(cherry picked from commit 03af6b3d4c)
2022-10-31 21:19:15 +01:00
Camilla Löwy
5189d52ae3 Wayland: Clean up pointer locking
Shorten names and allow C99 declarations.  Replace helper function with
the NULL check it was hiding.  Separate cursor hiding from pointer
locking.

(cherry picked from commit e85b645b8a)
2022-10-31 21:18:12 +01:00
Camilla Löwy
78edf2516e Wayland: Static function more static when static
(cherry picked from commit 26b85215c0)
2022-10-31 21:12:07 +01:00
Camilla Löwy
74090d30cd Wayland: Clean up cursor theme loading
(cherry picked from commit 6987294df9)
2022-10-31 21:12:01 +01:00
Camilla Löwy
ad206bdaee 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

(cherry picked from commit 71be34a6c3)
2022-10-31 21:11:11 +01:00
Camilla Löwy
b08271d315 Wayland: Clean up shared memory buffer creation
(cherry picked from commit 7cc8b053b8)
2022-10-31 21:02:14 +01:00
Camilla Löwy
2ca3bda1cc Update changelog and add credit
Related to #2042
Related to #2043

(cherry picked from commit 91a96ed434)
2022-10-31 20:59:10 +01:00
Björn Hempel
388d0cf7c2 Linux: Fix joystick without buttons being ignored
Joysticks in Linux without buttons were ignored by device enumeration.
Remove the mandatory button attribute from detection.

Fixes #2042
Closes #2043

(cherry picked from commit c424fe5589)
2022-10-31 20:58:19 +01:00
Camilla Löwy
4affd2207c Make events test window appear on Wayland
(cherry picked from commit c50d53160f)
2022-10-31 20:58:13 +01:00
Camilla Löwy
dea9914692 Wayland: Fix reappearing key repeat
If the key or character callback performs actions that indirectly
updates the key repeat timer, those changes would be undone once the key
callback returned.

This fixes the order of operations so that key repeat is fully set up
before the key related events are emitted.

(cherry picked from commit 40b5a8a37c)
2022-10-31 20:57:20 +01:00
Camilla Löwy
1acd67eeb6 Wayland: Clean up key repeat logic
(cherry picked from commit 9180923ea0)
2022-10-31 20:57:02 +01:00
Camilla Löwy
a8d543f1f8 Wayland: Make text input logic static
Since the seat listener was moved into wl_window.c there is no reason
for text input to have external linkage.

(cherry picked from commit a1a73ee862)
2022-10-31 20:56:39 +01:00
Camilla Löwy
ca5ccd819d Wayland: Update state before emitting events
(cherry picked from commit e47cb7c1e2)
2022-10-31 20:56:17 +01:00
Camilla Löwy
41bb7b8617 Wayland: Do not emit events for destroyed window
During platform window destruction, all of its callbacks have already
been removed, so emitting events for it does nothing.

(cherry picked from commit 4df24735ef)
2022-10-31 20:54:45 +01:00
Camilla Löwy
ccbbada181 Wayland: Fix non-standard struct initialization
(cherry picked from commit d77aaa770f)
2022-10-31 20:54:34 +01:00
Camilla Löwy
fe2ac5027b Start 3.3.9 2022-07-22 16:04:36 +02:00
Camilla Löwy
7482de6071 Documentation work
Fixes #1596

(cherry picked from commit aa80d24d01)
2022-07-15 00:11:23 +02:00
Camilla Löwy
0f341802e1 Win32: Fix right Shift scancode when using CJK IME
Fixes #2050

(cherry picked from commit 6dd526fb1a)
2022-07-15 00:11:23 +02:00
Camilla Löwy
935d7098b6 Documentation work
(cherry picked from commit 2796e61af7)
2022-07-15 00:11:23 +02:00
Camilla Löwy
5937eec914 Wayland: Cleanup
(cherry picked from commit 88a39006e3)
2022-07-15 00:11:23 +02:00
Camilla Löwy
20d11f7f97 Wayland: Fix comment typo
(cherry picked from commit 5c948a6e6e)
2022-07-15 00:11:23 +02:00
Camilla Löwy
8d989cdc41 Add credit
Related to #2150

(cherry picked from commit 8e725338bf)
2022-07-15 00:11:23 +02:00
JoelNiemela
5324177d90 Fix typos in docs
Closes #2150

(cherry picked from commit 060631c965)
2022-07-15 00:11:23 +02:00
Camilla Löwy
2f3c6aa150 Cocoa: Cleanup
(cherry picked from commit 2db528d8cd)
2022-07-15 00:11:23 +02:00
Camilla Löwy
8c63c935ea Documentation work
Related to #2113
Related to #2120

(cherry picked from commit 78b19548d9)
2022-07-15 00:11:23 +02:00
Camilla Löwy
876a177f6c Update changelog and add credit
Related to #2113
Related to #2120

(cherry picked from commit dfb26023fc)
2022-07-15 00:11:23 +02:00
Nikita Fediuchin
1e49024e76 Cocoa: Fix search path for private Vulkan loader
According to both Apple and LunarG, a private copy of the macOS Vulkan
loader libvulkan.1.dylib should be placed in the Frameworks directory
of the bundle and not its main executable directory.

This commit updates the dynamic loading path accordingly.

Fixes #2113
Closes #2120

(cherry picked from commit 9b7713cf92)
2022-07-15 00:11:23 +02:00
Camilla Löwy
109f836675 Add support for VK_KHR_portability_enumeration
The use of this extension is required to enable the MoltenVK physical
device as of Vulkan SDK 1.3.216.0.  This is because MoltenVK is still
very (very) slightly non-conformant.

This was adapted to 3.3-stable from
3b3d58df47 and
84e165ef64.
2022-07-15 00:09:48 +02:00
Camilla Löwy
2568d703cd Update glad to include Vulkan 1.3 2022-07-13 23:27:23 +02:00
Camilla Löwy
9950cc52df 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

(cherry picked from commit 0d599026d0)
2022-07-13 23:20:54 +02:00
Camilla Löwy
e50ee39eac Cocoa: Fix GLFW_MAXIMIZED for nonresizable windows
The reasoning here is that glfwRestoreWindow will change nothing for
a windowed non-resizable window on Cocoa, and silently refusing to
maximize seems slightly more like something other platforms would do.

This is possibly either the right thing to do or the wrong one.

(cherry picked from commit 6f8ec4075b)
2022-07-13 23:16:01 +02:00
Camilla Löwy
70a024232a Cocoa: Disable macOS fullscreen when non-resizable
Windows with GLFW_RESIZABLE set to false should not be resizable by the
user.

This is adapted to 3.3-stable from
98d6e8485b and
36f0bf00a9.
2022-07-13 23:14:20 +02:00
Camilla Löwy
0cd8813e82 Wayland: Do not decorate fullscreen windows
If a fullscreen window with GLFW_DECORATED set had its XDG decorations
changed to client mode by the compositor, it would seemingly receive
GLFW fallback decorations as if it was windowed mode.

This is possibly related to #2001.

(cherry picked from commit da6713cd09)
2022-07-13 22:48:35 +02:00
Camilla Löwy
e541b7969a Wayland: Only create EGL window if using EGL
(cherry picked from commit d578c2ddfe)
2022-07-13 22:48:35 +02:00
Camilla Löwy
be333cf0fd Wayland: Cleanup
This moves what is effectively showing the window to where that is done
on other platforms, i.e. last in the platform CreateWindow function.

(cherry picked from commit 74b4ceb835)
2022-07-13 22:48:35 +02:00
Camilla Löwy
758d4b1987 Wayland: Make function behavior match name
The logic that checks the decorated attribute belongs on the outside
along with other related checks (fullscreen, monitor, decoration mode).

(cherry picked from commit c4fbe80d90)
2022-07-13 22:48:35 +02:00
Camilla Löwy
1ac6fbc499 Wayland: Remove premature surface commit calls
Note that the handling of configure events, acks and commits is still
not ideal.  This is just a small step in, hopefully, a good direction.

Fullscreen toggling via glfwSetWindowMonitor now works on Weston, but
mostly incidentally.

(cherry picked from commit be7f4513c0)
2022-07-13 22:48:35 +02:00