Commit Graph

640 Commits

Author SHA1 Message Date
Camilla Löwy
6ce6b50787 Add credit
Related to #1818.
2020-12-15 02:13:30 +01:00
Camilla Löwy
7e8da57094 Add missing changelog issue number 2020-11-19 02:49:14 +01:00
Leonard König
0dc1005c85 Wayland: Fix destroying CSDs in the correct order
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/3051

Closes #1798.
2020-11-19 02:47:30 +01:00
Camilla Löwy
3327050ca6 Cocoa: Fix ObjC being built as C with CMake 3.19
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.
2020-11-18 00:11:13 +01:00
Camilla Löwy
5c928ff452 Add credit
Related to #1774 and #1782.
2020-11-11 19:14:29 +01:00
Camilla Löwy
0bccc3852b Win32: Filter out duplicate size events
This mirrors the filtering done on X11 and Cocoa.  Possibly this should
be done by shared code instead.

Fixes #1610.
2020-11-11 19:10:19 +01:00
Camilla Löwy
ac627706ef Win32: Fix clang-cl interpreting -Wall as /Wall
Unlike -Wall, VS /Wall really means all warnings.

Closes #1780.
2020-11-11 19:10:05 +01:00
Camilla Löwy
35f3508ecd Update changelog and add credit
Related to #1786.
2020-10-20 20:03:58 +02:00
Camilla Löwy
a506a8dc73 Add credit
Related to #1779 and #1781.
2020-10-05 23:25:32 +02:00
Camilla Löwy
48aa567d0c Update changelog and add credit
Related to #1775.
2020-10-05 23:24:12 +02:00
Camilla Löwy
60e7364b30 Update changelog
Related to #1761.
2020-10-05 23:24:12 +02:00
Emmanuel Gil Peyrot
40d150c399 Docs: Remove mentions of extra-cmake-modules 2020-09-30 17:04:20 +02:00
Camilla Löwy
da26eefc61 Update changelog 2020-08-13 15:14:59 +02:00
Camilla Löwy
05dd2fa298 Win32: Disable fb transparency when it is broken
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.
2020-07-29 15:21:45 +02:00
Camilla Löwy
a2674a9034 Cocoa: Fix potential leak of CFNumber object
Spotted by Clang static analysis.
2020-07-23 22:27:40 +02:00
Camilla Löwy
782e6b6cef Make joystick platform code init on demand
This makes joystick support initialize the first time a joystick
function is called, including those gamepad functions that are layered
on top of joystick functions.

Related to #1284.
Related to #1646.
2020-07-21 17:38:56 +02:00
Camilla Löwy
f760b124ca Wayland: Fix scroll offsets being inverted
Scrolling offsets were inverted compared to X11 and Win32.

Fixes #1463.
2020-07-15 23:16:01 +02:00
Camilla Löwy
5f60c22cfa Wayland: Fix partial framebuffer size retrieval 2020-07-15 21:56:52 +02:00
Camilla Löwy
a122d91303 Documentation work for GLFW_MOUSE_PASSTHROUGH
Related to #1568.
2020-07-15 18:02:38 +02:00
Camilla Löwy
9a3664b4a9 X11: Fix detection of key events duplicated by XIM
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.
2020-07-02 21:38:03 +02:00
Camilla Löwy
6ce2070392 Win32: Fix non-BMP Unicode codepoint input
Supplementary Plane codepoints from WM_CHAR and WM_SYSCHAR messages were
reported as UTF-16 surrogate pairs.

Related to #1635.
2020-06-29 23:50:05 +02:00
Camilla Löwy
ad9eb768c9 Cocoa: Fix non-BMP Unicode codepoint input
Supplimentary Plane codepoints were reported as UTF-16 surrogate pairs.

Fixes #1635.
2020-06-29 23:03:24 +02:00
Camilla Löwy
854ce1db4e Fix format of change log entry 2020-06-29 21:14:29 +02:00
Camilla Löwy
0dea8a4441 EGL: Add support for EGL_ANGLE_platform_angle
This adds basic support for selecting the platform type (rendering
backend) when running on ANGLE.

Related to #1380.
2020-06-29 00:02:22 +02:00
Camilla Löwy
aec9fae8f3 EGL: Add support for EGL_EXT_platform_base
This adds support for EGL_EXT_platform_base and its associated X11 and
Wayland extensions, allowing us to explicitly tell EGL which window
system we are using.

This is based on work by @linkmauve in #1691.

Closes #1691.
2020-06-24 00:49:55 +02:00
Camilla Löwy
3a3c32c6b1 Add credit
Related to #1712.
2020-06-17 20:21:50 +02:00
Camilla Löwy
c72da994ba Wayland: Fix repeated keys reported to NULL window
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.
2020-06-02 19:54:30 +02:00
Camilla Löwy
399c2a1fad Clarify docs on default GL header inclusion
The documentation claims that any extension loader library header
included before the GLFW one will prevent the inclusion of the
default OpenGL header.  In reality this only worked if the loader
defined the canonical desktop OpenGL __gl_h_ inclusion guard and even
then relied on the OpenGL header to detect this.

This is the companion to 105cf32e0b, which
added the preprocessor logic to check for many known OpenGL and OpenGL
ES inclusion guards and not even attempt to include the default header
if any are present.

Some clarification of the language around header inclusion has also been
attempted, including making GLFW_INCLUDE_NONE more prominent.

Fixes #1695.
2020-06-02 18:04:49 +02:00
Camilla Löwy
9a87c2a4b4 Add feature available/implemented errors
This adds two new error codes: GLFW_FEATURE_UNAVAILABLE for when
a GLFW feature cannot be reasonably implemented on that platform, and
GLFW_FEATURE_UNIMPLEMENTED for when it can be but has not been yet.

This replaces the current situation where the Wayland code emitted
GLFW_PLATFORM_ERROR in both cases while the macOS code silently did
nothing.

If your application exits on any GLFW error, these error codes should at
least be easy to filter out from that behavior.

Ideally, GLFW_FEATURE_UNAVAILABLE should be rare and
GLFW_FEATURE_UNIMPLEMENTED should never be emitted at all.

Fixes #1692.
2020-06-02 17:18:18 +02:00
Corentin Wallez
91eebe922d Use CALayer instead of NSView for EGLNativeWindowType
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.
2020-05-22 17:37:44 +02:00
Camilla Löwy
215a05af3d Update changelog and add credit
Related to #1598.
2020-03-31 17:30:51 +02:00
Camilla Löwy
e65de2941c X11: Improve window handle race condition
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.
2020-03-31 17:03:29 +02:00
Camilla Löwy
2c8e0512dd X11: Filter out Xlib errors from other connections 2020-03-16 17:15:07 +01:00
Camilla Löwy
44b5d06583 X11: Add support for XIM callbacks
This adds support for the XIM instantiate and destroy callbacks, letting
GLFW detect both when the current input method disappears and when a new
one is started.

Tested with ibus.
2020-03-12 21:05:54 +01:00
Camilla Löwy
72366ac9a9 Cocoa: Finish launching NSApp in glfwInit
This moves the remaining bits of NSApplication initialization into
_glfwPlatformInit.  As a side-effect of this, any command-line program
initializing GLFW will get a menu bar, which is not ideal.

If this has happened to you and a bisect led you here, please see the
GLFW_COCOA_MENUBAR init hint introduced in GLFW 3.3.

If this patch is a terrible idea, please get in touch in the 3.4 release
timeframe.

This is a replacement for 6e6805000a,
which attempts to preserve the existing menu bar creation behavior for
the 3.3-stable branch.

Fixes #1649.
2020-03-12 01:56:35 +01:00
Camilla Löwy
4381b86b6b X11: Fix CJK IME input when locale CTYPE is "C"
Fixes #1587.
Fixes #1636.
2020-02-12 19:01:16 +01:00
Camilla Löwy
d973acc123 Update OpenGL bits of build documentation slightly
This removes most references to GLU, replaces the legacy CMake cache
variables for OpenGL with the modern namespaced target and switches to
$() for command substitution.

Fixes #1580.
2020-01-19 23:35:59 +01:00
Camilla Löwy
13479ed27d Update changelog and add credit
Related to #1602.
2020-01-16 23:52:39 +01:00
Camilla Löwy
65cfe743af Add credit
Related to #1624.
2020-01-16 23:52:39 +01:00
Camilla Löwy
789a2bcb39 Win32: Fix scancode when key message only had VK
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.
2020-01-16 23:52:36 +01:00
Camilla Löwy
5f1631cb0e Check scancode before use in glfwGetKeyName 2020-01-16 23:17:49 +01:00
Camilla Löwy
562c17d131 Win32: Fix no Super key release event after Win+V
The Win+V hotkey brings up a clipboard history IME that consumes the key
release.  This adds left and right Super to the modifier keys manually
polled for undetected release during event processing.

Fixes #1622.
2020-01-16 23:16:41 +01:00
Camilla Löwy
7da87aaae7 Cocoa: Add fully dynamic loading of Vulkan loader
If the application is not linked against the Vulkan loader and relies on
a third-party loader library or glfwGetInstanceProcAddress, then our
call to dlopen will fail without a custom dyld environment variable.

This adds a fallback of looking in the directory of the main executable,
which matches the bundle structure recommended by the Vulkan SDK, making
that finally work out of the box for fully dynamic loading.
2020-01-16 22:15:30 +01:00
Camilla Löwy
15d91801b7 Cocoa: Select Vulkan surface extension at runtime
This mostly just follows the pattern established by X11.

Related to #1619.
2020-01-16 21:53:18 +01:00
Camilla Löwy
aa5e313561 X11: Fix BadMatch focusing a window on non-EWMH WM
When the WM does not support EWMH or there is no WM running, GLFW falls
back to XSetInputFocus, which will emit BadMatch if the window is not
viewable, which will terminate the program.

Bug spotted on IRC.
2020-01-06 22:45:56 +01:00
Camilla Löwy
fe57e3c292 X11: Fix no window position events during resize
A window resize action that also resulting in the window being moved did
not emit any window positions events, as the position of real
ConfigureNotify events was ignored.  The real events use parent
coordinates instead of root coordinates so this adds parent tracking and
conditional translation.

Fixes #1613.
2020-01-01 16:56:32 +01:00
Camilla Löwy
6b01affd89 Update changelog 2020-01-01 01:43:40 +01:00
Camilla Löwy
bf292f0083 Update changelog and add credit 2020-01-01 01:43:30 +01:00
Camilla Löwy
4ec7daf3e9 Cocoa: Replace display link with IOKit query
This removes the final dependency on CoreVideo, using a display link to
get the refresh rate of monitors where Core Graphics report a refresh
rate of zero.  Instead we now query the I/O registry directly, similarly
to what the display link does at creation.

Thanks to @OneSadCookie for pointers to this solution.
2019-12-25 21:53:04 +01:00
Camilla Löwy
54e8e0b092 NSGL: Remove problematic swap interval workaround
Fixes #1483.
2019-12-20 09:46:48 +01:00