Commit Graph

4083 Commits

Author SHA1 Message Date
Camilla Löwy
761d7e7c4e Add keyboard layout support
This adds a keyboard layout switch callback and a query for the
human-readable name of the current layout.

Fixes #1201.
2020-05-18 21:15:38 +02:00
Camilla Löwy
d7ae90a790 Update community resource links 2020-05-05 00:38:14 +02:00
Camilla Löwy
41a19ed49c Disambiguate Vulkan support reference link 2020-05-05 00:38:14 +02:00
Camilla Löwy
949275bbed Cocoa: Fix call to NSWindow from non-main threads
glfwSwapBuffers may be called by any thread but NSWindow may not.

Bug introduced by c3ca88055f and reported
by @crujose.
2020-04-30 22:44:54 +02:00
Camilla Löwy
cab41529da X11: Improve non-XKB fallback for key mapping
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.
2020-04-23 22:13:18 +02:00
Camilla Löwy
318e08d914 X11: Add additional XKB key names for Right Alt 2020-04-23 17:42:36 +02:00
Camilla Löwy
560304e0f4 X11: Use XKB key name MENU for Menu key 2020-03-31 17:31:01 +02:00
Camilla Löwy
9ecacf1d7f X11: Check XKB key aliases in addition to names 2020-03-31 17:31:01 +02:00
Camilla Löwy
ee45b58647 X11: Fix X keycode ranges for XKB and core
This replaces the hardcoded keycode ranges and various kludgy range
checks with the actual ranges reported by Xlib and XKB.
2020-03-31 17:31:01 +02:00
Camilla Löwy
215a05af3d Update changelog and add credit
Related to #1598.
2020-03-31 17:30:51 +02:00
Ali Sherief
a41a58a95e X11: Fix function keys mapped to GLFW_KEY_UNKNOWN
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.
2020-03-31 17:03:29 +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
350ba73267 Update linmath.h
This updates our linmath.h to the latest version plus minor local fixes
for MSVC and Clang.

Fixes #1653.
2020-03-12 02:17:17 +01:00
Camilla Löwy
9516df52a4 Fix unclear language in build guide
Fixes #1658.
2020-03-12 01:57:58 +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
6aca3e99f0 Wayland: Remove unused link-time dependency
The wayland-egl library is now loaded dynamically at init.  This narrows
the pkgconfig dependencies to the link-time depdendencies.
2020-02-12 19:02:46 +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
27d19d06ca WGL: Remove unused constants 2020-02-10 17:44:57 +01:00
Camilla Löwy
4b8ac11aa3 Fix rendering race in offscreen example 2020-02-10 17:44:57 +01:00
Camilla Löwy
a0a5cc57df X11: Make libX11 dynamically loaded
This completes the dynamic loading of all X11 libraries in preparation
for run-time platform selection.
2020-02-10 17:44:56 +01:00
Camilla Löwy
0c27ed1d0e X11: Fix setting the clipboard string to itself 2020-02-10 17:44:56 +01:00
Camilla Löwy
d1ae7bac60 Put docs target in GLFW3 folder 2020-02-10 17:44:34 +01:00
Camilla Löwy
40c7e471e3 Move more non-source template files to CMake dir 2020-02-08 17:42:53 +01:00
Emmanuel Gil Peyrot
76406c7894 Mention that xdg-shell is mandatory on Wayland 2020-02-06 09:02: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
46c7c1cdff Remove AppVeyor skip commits setting 2020-01-16 23:52:39 +01:00
Camilla Löwy
13479ed27d Update changelog and add credit
Related to #1602.
2020-01-16 23:52:39 +01:00
Kovid Goyal
a5e5b782c7 X11: Fix queries crashing if monitor disconnected
Merged from downstream kovidgoyal/glfw.  First of many.

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
Crunkle
d862d56acb Fix docs install condition
Closes #1624.
2020-01-16 23:52:38 +01:00
Camilla Löwy
190673e779 Win32: Add matching comment 2020-01-16 23:52:38 +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
a491b0698c Win32: Use non-async key state for modifier hack
The synchronous key state seems to make more sense in context.
2020-01-16 23:16:43 +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
ByunghoonKim
c5cb4a253a Cocoa: Add support for VK_EXT_metal_surface
This adds optional support for the VK_EXT_metal_surface instance
extension.

Closes #1619.
2020-01-16 05:28:24 +01:00
Camilla Löwy
9372ba95fa X11: Fix parent window handle initialization
This should have been initialized to the screen root, not None.  This
issue was introduced by fe57e3c292.

Fixes #1620.
2020-01-14 21:26:21 +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
781fbbadb0 Fix Threads package not located by our config file
This fixes a missing dependency error when the imported GLFW target is
a static library.

Thanks to @mosra for reporting the bug.
2019-12-26 16:31:42 +01:00
Camilla Löwy
5dd207048c Set macOS deployment target in Travis CI build 2019-12-26 16:31:42 +01:00
Camilla Löwy
a3d28ef52c X11: Fix IC event mask not being added to our window 2019-12-26 16:31:42 +01:00
Camilla Löwy
8149a5fc00 X11: Cleanup
We can use C99 now and also we will need the event mask below.
2019-12-26 16:31:41 +01:00
Luflosi
74a46dfa0c Use the correct type in a for loop
The `sizeof()` operator has the type `size_t`, so the `for` loop
iterating over it should use the same type.

Closes #1614.
2019-12-26 16:31:37 +01:00