aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-05-18 09:35:27 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-05-18 09:36:57 +0000
commit3e1e3ea38ce8ed43ee61ddb584298f45dd72f1d5 (patch)
treebb49b303710a70070bbd845b724b806cf3f1fc1d
parentRevert "xkbcommon: require libxkbcommon >= 1.8.0" (diff)
libxkbcommon: don't require 1.8.0
The version bump was done since we now use XKB_VMOD_NAME_*; macros added in libxkbcommon 1.8.0. Not all distros have updated libxkbcommon yet (read: Debian). Since it's fairly easy to work around, let's do that. Closes #2103
-rw-r--r--CHANGELOG.md3
-rw-r--r--input.c1
-rw-r--r--key-binding.c1
-rw-r--r--meson.build1
-rw-r--r--xkbcommon-vmod.h18
5 files changed, 24 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 00c1f0a0..cb478f87 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -105,8 +105,11 @@
instead of `10-bit`.
* Allow setting either selection background, or selection foreground,
only ([#1846][1846]).
+* Drop required version of libxkbcommon from 1.8.0 back to 1.0.0
+ ([#2103][2103]).
[1846]: https://codeberg.org/dnkl/foot/issues/1846
+[2103]: https://codeberg.org/dnkl/foot/issues/2103
### Deprecated
diff --git a/input.c b/input.c
index b6c56fde..271ffb88 100644
--- a/input.c
+++ b/input.c
@@ -40,6 +40,7 @@
#include "url-mode.h"
#include "util.h"
#include "vt.h"
+#include "xkbcommon-vmod.h"
#include "xmalloc.h"
#include "xsnprintf.h"
diff --git a/key-binding.c b/key-binding.c
index e5b7ac81..a2883ed5 100644
--- a/key-binding.c
+++ b/key-binding.c
@@ -11,6 +11,7 @@
#include "terminal.h"
#include "util.h"
#include "wayland.h"
+#include "xkbcommon-vmod.h"
#include "xmalloc.h"
struct vmod_map {
diff --git a/meson.build b/meson.build
index ae263851..7b9490d9 100644
--- a/meson.build
+++ b/meson.build
@@ -319,6 +319,7 @@ executable(
'url-mode.c', 'url-mode.h',
'user-notification.c', 'user-notification.h',
'wayland.c', 'wayland.h', 'shm-formats.h',
+ 'xkbcommon-vmod.h',
srgb_funcs, wl_proto_src + wl_proto_headers, version,
dependencies: [math, threads, libepoll, pixman, wayland_client, wayland_cursor, xkb, fontconfig, utf8proc,
tllist, fcft],
diff --git a/xkbcommon-vmod.h b/xkbcommon-vmod.h
new file mode 100644
index 00000000..44d818ec
--- /dev/null
+++ b/xkbcommon-vmod.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <xkbcommon/xkbcommon-names.h>
+
+/* Added in libxkbcommon 1.8.0 */
+#if !defined(XKB_VMOD_NAME_ALT)
+/* Common *virtual* modifiers, encoded in xkeyboard-config in the compat and
+ * symbols files. They have been stable since the beginning of the project and
+ * are unlikely to ever change. */
+#define XKB_VMOD_NAME_ALT "Alt"
+#define XKB_VMOD_NAME_HYPER "Hyper"
+#define XKB_VMOD_NAME_LEVEL3 "LevelThree"
+#define XKB_VMOD_NAME_LEVEL5 "LevelFive"
+#define XKB_VMOD_NAME_META "Meta"
+#define XKB_VMOD_NAME_NUM "NumLock"
+#define XKB_VMOD_NAME_SCROLL "ScrollLock"
+#define XKB_VMOD_NAME_SUPER "Super"
+#endif