On Wayland we implement Client-Side Decorations if the compositors do not
implement SSDs. In that case, the destructors of the surfaces were called
in the wrong order, leading to a dereference of an already freed object.
We need to first destroy the subsurface before destroying the parent surface.
Related PR on kitty: https://github.com/kovidgoyal/kitty/pull/3066
Related issue on kitty: https://github.com/kovidgoyal/kitty/issues/3051Closes#1798.
(cherry picked from commit 0dc1005c85)
CMake 3.19 adds -xc when the LANGUAGE file property is C, breaking our
workaround for CMake 3.15 and earlier not understanding the .m suffix.
Fixes#1787.
(cherry picked from commit 3327050ca6)
This mirrors the filtering done on X11 and Cocoa. Possibly this should
be done by shared code instead.
Fixes#1610.
(cherry picked from commit 0bccc3852b)
/W3 is the default for new VS projects and the library builds cleanly
with it on VS 2010-2019 so let's try to keep it that way.
(cherry picked from commit 6b78419c9a)
Clang ignores this when C99 is enabled, while GCC does not. Removing
the checks for Clang to hopefully avoid a false sense of security.
(cherry picked from commit 9b140d08d7)
An incorrect value for _WIN32_WINNT_WINBLUE caused GLFW to think Windows
8 was 8.1 or greater. This led to a crash when attempting to call
SetProcessDpiAwareness.
Closes#1775.
(cherry picked from commit e1d71cfa4701250a44a6c02d1bbb43309ac8a46c)
On Windows 7, when GLFW framebuffer transparency and the DWM are enabled
but DWM transparency is disabled (i.e. when the Transparency setting is
disabled under Personalization > Color), the contents of the framebuffer
is combined with the last frame using additive blending instead of
replacing the previous contents.
This commit limits GLFW framebuffer transparency on Windows 7 to when
DWM transparency is enabled, removing the previous workaround of setting
a layered window color key that led to rendering artifacts.
Fixes#1512.
(cherry picked from commit 05dd2fa298)
The window decoration window can go away between calls to XQueryPointer,
for example if the GLFW_DECORATED window attribute was just cleared.
(cherry picked from commit ceb20c7f97)
Background: The IM will filter out key events, instead sending exact
duplicate events that are not filtered. It does not send these for
every event, however, so the duplicate events cannot be relied on for
key input. Instead we need to identify and discard them. Since they
are identical, they have the same timestamp as the originals.
The previous duplicate event detection would consume unrelated key
events if the keys were pressed simultaneously, as it only tracked
a single timestamp.
This fixes that issue for any combination of keys, at the expense of
a 1 KB array per GLFW window.
This fix is a stopgap until explicit IME support is done.
Based on #1472 by @LucaRood.
Fixes#1112.
Fixes#1415.
Fixes#1616.
Fixes#1663.
Closes#1472.
(cherry picked from commit 9a3664b4a9)
Supplementary Plane codepoints from WM_CHAR and WM_SYSCHAR messages were
reported as UTF-16 surrogate pairs.
Related to #1635.
(cherry picked from commit 6ce2070392)
This fixes a race between the key repeat logic and the surface leave
event handler, which could result in repeated keys being reported with
a window of NULL.
Fixes#1704.
(cherry picked from commit c72da994ba)
These are harmless errors but the code was worth fixing just to reduce
confusion and be more explicit. E.g. using a different variable name
for a new variable of a different type in win32_joystick.c.
Closes#1700.
(cherry picked from commit a84a30ab63)
The `atomCount` variable has the type `unsigned long`,
so the `for` loop iterating over it should use the same type.
Closes#1701.
(cherry picked from commit 250b94cd03)
When compiling with `-Wall` and `-pedantic-errors`, gcc complains with
```
warning: ISO C does not support the '%m' gnu_printf format [-Wformat=]
```
because the `%m` conversion specifier is a GNU extension.
Closes#1702.
(cherry picked from commit d4f5074535)
The only two EGL implementations on macOS are Swiftshader and ANGLE.
While Swiftshader supports both `NSView` and `CALayer` as
`EGLNativeWindowType`, ANGLE supports only `CALayer`. Furthermore
Swiftshader's OpenGL ES frontend is deprecated in favor of using ANGLE's
Vulkan backend on top of Swiftshader's Vulkan frontend.
This means that on macOS `EGLNativeWindowType` should be a `CALayer` for
compatibility with ANGLE.
Fixes#1169.
Closes#1680.
(cherry picked from commit 91eebe922d)
glfwSwapBuffers may be called by any thread but NSWindow may not.
Bug introduced by c3ca88055f and reported
by @crujose.
(cherry picked from commit 949275bbed)
A regression introduced by b889aa7841
broke the special handling of numpad keys for the non-XKB fallback path.
The non-functional remains were later removed. This restores the
original behavior.
(cherry picked from commit cab41529da)
This replaces the hardcoded keycode ranges and various kludgy range
checks with the actual ranges reported by Xlib and XKB.
(cherry picked from commit ee45b58647)
This fixes the issue where function keys would be reported as
GLFW_KEY_UNKNOWN if XKB was available and one of the configured keyboard
layouts was Arabic.
This is only part of #1598, because the full patch removed parts of the
fallback path for when XKB is unavailable.
Closes#1598.
(cherry picked from commit a41a58a95e)
The non-root parent window owned by the WM could be destroyed before we
process the ConfigureNotify event using the cached parent handle.
Bug was found by unmapping a decorated window.
This like all uses of the Xlib error handler is not thread safe and
there is nothing we can do about that short of moving to XCB.
Fixes#1633.
(cherry picked from commit e65de2941c)
Some synthetic key messages come with a scancode of zero, causing them
to be translate to GLFW_KEY_UNKNOWN. This fills in the missing scancode
by translating the provided virtual key.
Rather than further complicate a single-use function, its body is merged
into the key message handler.
Fixes#1623.
(cherry picked from commit 789a2bcb39)