From 99b3e20126930e44aae97aee51afda6feeac2ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 1 Dec 2020 19:33:22 +0100 Subject: [PATCH 01/22] changelog: add entry for 1.5.4 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1e6c992..92b1d2ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog +* [1.5.4](#1-5-4) * [1.5.3](#1-5-3) * [1.5.2](#1-5-2) * [1.5.1](#1-5-1) @@ -15,6 +16,12 @@ * [1.2.1](#1-2-1) * [1.2.0](#1-2-0) + +## 1.5.4 + +### Fixed + + ## 1.5.3 ### Fixed From 3031ddfc16bbe39b5fe324b0495041c59245347c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 10 Nov 2020 19:20:35 +0100 Subject: [PATCH 02/22] =?UTF-8?q?wayland:=20preempt=20render=20scheduling?= =?UTF-8?q?=20in=20=E2=80=98configure=E2=80=99=20events?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A configure event must be “committed”. In case of resizing, that means rendering a new frame and committing that surface. render_resize() will resize the grid and *schedule* a render refresh. However, if one is already pending, the refresh will take a very (relatively) long time - until the next frame callback is received. This poses a problem when the window is hidden, since in this case, the frame callback *never* comes. This in turn means we fail to commit a new surface in response to the ‘configure’ event. And that means the compositor needs to wait for a transaction timeout before continuing. The end effect is very slow and jerky window resizing when a hidden foot window is being resized. This can happen in tiled compositors, like Sway, where a window can be tabbed (and thus invisible), but still resized when its container is resized. Closes #190 --- CHANGELOG.md | 3 +++ wayland.c | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92b1d2ac..b7a0a1f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ ### Fixed +* Resize very slow when window is hidden + (https://codeberg.org/dnkl/foot/issues/190). + ## 1.5.3 diff --git a/wayland.c b/wayland.c index a663db4d..5553b4ef 100644 --- a/wayland.c +++ b/wayland.c @@ -614,17 +614,26 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface, xdg_surface_ack_configure(xdg_surface, serial); - /* TODO: check with GNOME and tiling - presumably that didn't work - * unless we presented a *new* buffer, hence we used to do a force - * resize here */ - bool resized = render_resize(term, win->configure.width, win->configure.height); + if (term->window->frame_callback != NULL) { + /* + * Preempt render scheduling. + * + * Each configure event require a corresponding new + * surface+commit. Thus we cannot just schedule a pending + * refresh if there’s already a frame being rendered. + */ + wl_callback_destroy(term->window->frame_callback); + term->window->frame_callback = NULL; + } + + bool resized = render_resize( + term, win->configure.width, win->configure.height); if (win->configure.is_activated) term_visual_focus_in(term); else term_visual_focus_out(term); - /* TODO: remove - shouldn't be necessary with render_resize_force() */ if (!resized) { /* * If we didn't resize, we won't be committing a new surface From 61f4845a59e1757f5463d9c37874763dc635f848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 11 Nov 2020 18:25:54 +0100 Subject: [PATCH 03/22] input: use XKB_MOD_NAME_* macros instead of hard-coded strings --- input.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/input.c b/input.c index 24ae5d87..51fef43a 100644 --- a/input.c +++ b/input.c @@ -508,10 +508,10 @@ keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard, if (seat->kbd.xkb_keymap != NULL) { seat->kbd.xkb_state = xkb_state_new(seat->kbd.xkb_keymap); - seat->kbd.mod_shift = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, "Shift"); - seat->kbd.mod_alt = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, "Mod1") ; - seat->kbd.mod_ctrl = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, "Control"); - seat->kbd.mod_meta = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, "Mod4"); + seat->kbd.mod_shift = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_SHIFT); + seat->kbd.mod_alt = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_ALT) ; + seat->kbd.mod_ctrl = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_CTRL); + seat->kbd.mod_meta = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_LOGO); seat->kbd.key_arrow_up = xkb_keymap_key_by_name(seat->kbd.xkb_keymap, "UP"); seat->kbd.key_arrow_down = xkb_keymap_key_by_name(seat->kbd.xkb_keymap, "DOWN"); From 7dcc885a7acd673980478318da12468716e7d10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 11 Nov 2020 18:26:47 +0100 Subject: [PATCH 04/22] =?UTF-8?q?csi:=20implement=20=E2=80=9CCSI=20=3F=201?= =?UTF-8?q?035=E2=80=9D=20-=20toggle=20Num=20Lock=20override?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds a num_lock_modifier state to the terminal, and hooks up “CSI?1035h/l” to toggle it. --- csi.c | 8 ++++++++ terminal.c | 1 + terminal.h | 3 +++ 3 files changed, 12 insertions(+) diff --git a/csi.c b/csi.c index 7c4d5077..c86f39c1 100644 --- a/csi.c +++ b/csi.c @@ -465,6 +465,12 @@ decset_decrst(struct terminal *term, unsigned param, bool enable) term->meta.eight_bit = enable; break; + case 1035: + /* numLock */ + LOG_DBG("%s Num Lock modifier", enable ? "enabling" : "disabling"); + term->num_lock_modifier = enable; + break; + case 1036: /* metaSendsEscape */ LOG_DBG("%s meta-sends-escape", enable ? "enabling" : "disabling"); @@ -586,6 +592,7 @@ xtsave(struct terminal *term, unsigned param) case 1007: term->xtsave.alt_scrolling = term->alt_scrolling; break; case 1015: term->xtsave.mouse_urxvt = term->mouse_reporting == MOUSE_URXVT; break; case 1034: term->xtsave.meta_eight_bit = term->meta.eight_bit; break; + case 1035: term->xtsave.num_lock_modifier = term->num_lock_modifier; break; case 1036: term->xtsave.meta_esc_prefix = term->meta.esc_prefix; break; case 1049: term->xtsave.alt_screen = term->grid == &term->alt; break; case 2004: term->xtsave.bracketed_paste = term->bracketed_paste; break; @@ -616,6 +623,7 @@ xtrestore(struct terminal *term, unsigned param) case 1007: enable = term->xtsave.alt_scrolling; break; case 1015: enable = term->xtsave.mouse_urxvt; break; case 1034: enable = term->xtsave.meta_eight_bit; break; + case 1035: enable = term->xtsave.num_lock_modifier; break; case 1036: enable = term->xtsave.meta_esc_prefix; break; case 1049: enable = term->xtsave.alt_screen; break; case 2004: enable = term->xtsave.bracketed_paste; break; diff --git a/terminal.c b/terminal.c index 4651fc1a..bb986c0c 100644 --- a/terminal.c +++ b/terminal.c @@ -995,6 +995,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper, .esc_prefix = true, .eight_bit = true, }, + .num_lock_modifier = true, .tab_stops = tll_init(), .wl = wayl, .render = { diff --git a/terminal.h b/terminal.h index eede87c1..c8c62966 100644 --- a/terminal.h +++ b/terminal.h @@ -250,6 +250,8 @@ struct terminal { bool eight_bit; } meta; + bool num_lock_modifier; + /* Saved DECSET modes - we save the SET state */ struct { uint32_t origin:1; @@ -270,6 +272,7 @@ struct terminal { uint32_t mouse_urxvt:1; uint32_t meta_eight_bit:1; uint32_t meta_esc_prefix:1; + uint32_t num_lock_modifier:1; uint32_t alt_screen:1; } xtsave; From 4f0d05724364dc5fa1def6b077bd32c65d1f77ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 11 Nov 2020 18:28:13 +0100 Subject: [PATCH 05/22] input: track num lock state --- input.c | 4 ++++ wayland.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/input.c b/input.c index 51fef43a..4849d055 100644 --- a/input.c +++ b/input.c @@ -512,6 +512,7 @@ keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard, seat->kbd.mod_alt = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_ALT) ; seat->kbd.mod_ctrl = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_CTRL); seat->kbd.mod_meta = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_LOGO); + seat->kbd.mod_num = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_NUM); seat->kbd.key_arrow_up = xkb_keymap_key_by_name(seat->kbd.xkb_keymap, "UP"); seat->kbd.key_arrow_down = xkb_keymap_key_by_name(seat->kbd.xkb_keymap, "DOWN"); @@ -614,6 +615,7 @@ keyboard_leave(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, seat->kbd.alt = false; seat->kbd.ctrl = false; seat->kbd.meta = false; + seat->kbd.num = false; if (seat->kbd.xkb_compose_state != NULL) xkb_compose_state_reset(seat->kbd.xkb_compose_state); @@ -1029,6 +1031,8 @@ keyboard_modifiers(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, seat->kbd.xkb_state, seat->kbd.mod_ctrl, XKB_STATE_MODS_DEPRESSED); seat->kbd.meta = xkb_state_mod_index_is_active( seat->kbd.xkb_state, seat->kbd.mod_meta, XKB_STATE_MODS_DEPRESSED); + seat->kbd.num = xkb_state_mod_index_is_active( + seat->kbd.xkb_state, seat->kbd.mod_num, XKB_STATE_MODS_LOCKED); } if (seat->kbd_focus && seat->kbd_focus->active_surface == TERM_SURF_GRID) diff --git a/wayland.h b/wayland.h index 70c2098a..149d7c00 100644 --- a/wayland.h +++ b/wayland.h @@ -148,6 +148,7 @@ struct seat { xkb_mod_index_t mod_alt; xkb_mod_index_t mod_ctrl; xkb_mod_index_t mod_meta; + xkb_mod_index_t mod_num; xkb_keycode_t key_arrow_up; xkb_keycode_t key_arrow_down; @@ -157,6 +158,7 @@ struct seat { bool alt; bool ctrl; bool meta; + bool num; struct { tll(struct key_binding_normal) key; From dea8e89fda905d75e2f5ae425bdc363b68c6c66c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 11 Nov 2020 18:28:37 +0100 Subject: [PATCH 06/22] =?UTF-8?q?input:=20enforce=20=E2=80=98numerical?= =?UTF-8?q?=E2=80=99=20keypad=20mode=20when=20Num=20Lock=20override=20is?= =?UTF-8?q?=20enabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When num lock override has been enabled via “CSI?1035h” (the default), keypad is always considered to be in ‘numerical’ mode. This affects how keypad keys are translated to escape sequences when Num Lock is active. The keypad has four modes: * Num Lock off, numerical mode * Num Lock off, application mode * Num Lock on, numerical mode * Num Lock on, application mode The keymap is identical for numerical and application mode when Num Lock is off, meaning the keypad effectively has three different modes. In XTerm, numerical and application mode _can_ be the same, **if** the ‘numLock’ resource is set to true (the default). It is only when ‘numLock’ is false that the application mode is actually used. This patch changes foot to do the same. We don’t expose an option, but do implement “CSI ? 1035”. Closes #194 --- input.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/input.c b/input.c index 4849d055..69571f80 100644 --- a/input.c +++ b/input.c @@ -723,7 +723,8 @@ keymap_data_for_sym(xkb_keysym_t sym, size_t *count) } static const struct key_data * -keymap_lookup(struct terminal *term, xkb_keysym_t sym, enum modifier mods) +keymap_lookup(struct seat *seat, struct terminal *term, + xkb_keysym_t sym, enum modifier mods) { size_t count; const struct key_data *info = keymap_data_for_sym(sym, &count); @@ -731,16 +732,22 @@ keymap_lookup(struct terminal *term, xkb_keysym_t sym, enum modifier mods) if (info == NULL) return NULL; + const enum cursor_keys cursor_keys_mode = term->cursor_keys_mode; + const enum keypad_keys keypad_keys_mode + = (term->num_lock_modifier && seat->kbd.num + ? KEYPAD_NUMERICAL + : term->keypad_keys_mode); + for (size_t j = 0; j < count; j++) { if (info[j].modifiers != MOD_ANY && info[j].modifiers != mods) continue; if (info[j].cursor_keys_mode != CURSOR_KEYS_DONTCARE && - info[j].cursor_keys_mode != term->cursor_keys_mode) + info[j].cursor_keys_mode != cursor_keys_mode) continue; if (info[j].keypad_keys_mode != KEYPAD_DONTCARE && - info[j].keypad_keys_mode != term->keypad_keys_mode) + info[j].keypad_keys_mode != keypad_keys_mode) continue; return &info[j]; @@ -866,7 +873,7 @@ key_press_release(struct seat *seat, struct terminal *term, uint32_t serial, keymap_mods |= seat->kbd.ctrl ? MOD_CTRL : MOD_NONE; keymap_mods |= seat->kbd.meta ? MOD_META : MOD_NONE; - const struct key_data *keymap = keymap_lookup(term, sym, keymap_mods); + const struct key_data *keymap = keymap_lookup(seat, term, sym, keymap_mods); if (keymap != NULL) { term_to_slave(term, keymap->seq, strlen(keymap->seq)); From 8970c7ea1801032ffc44919dca5e4faef77449a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 11 Nov 2020 18:37:28 +0100 Subject: [PATCH 07/22] readme/doc:foot.1: document the (new) keypad behavior --- CHANGELOG.md | 7 +++++++ README.md | 20 ++++++++++++++++++++ doc/foot.1.scd | 17 +++++++++++++++++ foot.ini | 1 - 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a0a1f7..a311bc09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,13 @@ ## 1.5.4 +### Changed + +* Num Lock by default overrides the keypad mode. See + **foot.ini**(5)::KEYPAD, or [README.md](README.md#keypad) for + details (https://codeberg.org/dnkl/foot/issues/194). + + ### Fixed * Resize very slow when window is hidden diff --git a/README.md b/README.md index 0d4ce17c..7cc055ac 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ The fast, lightweight and minimalistic Wayland terminal emulator. 1. [Server (daemon) mode](#server-daemon-mode) 1. [Alt/meta](#alt-meta) 1. [Backspace](#backspace) +1. [Keypad](#keypad) 1. [DPI and font size](#dpi-and-font-size) 1. [Supported OSCs](#supported-oscs) 1. [Programmatically checking if running in foot](#programmatically-checking-if-running-in-foot) @@ -263,6 +264,25 @@ Finally, pressing alt will prefix the transmitted byte with ESC. +## KEYPAD + +By default, Num Lock overrides the run-time configuration +keypad mode; when active, the keypad is always considered to be in +_numerical_ mode. This corresponds to XTerm's `numLock` option set to +`true`. + +In this mode, the keypad keys always sends either numbers (Num +Lock is **active**) or cursor movement keys (Up, +Down, Left, Right, Page +Up, Page Down etc). + +This can be disabled programmatically with `\E[?1035l` (and enabled +again with `\E[?1035h`). + +When disabled, the keypad sends custom escape sequences instead of +numbers, when in _application_ mode. + + ## DPI and font size Font sizes are apparently a complex thing. Many applications use a diff --git a/doc/foot.1.scd b/doc/foot.1.scd index 20ac9ebc..7e61d7a7 100644 --- a/doc/foot.1.scd +++ b/doc/foot.1.scd @@ -261,6 +261,23 @@ described above *cannot* be changed. Finally, pressing *alt* will prefix the transmitted byte with ESC. +# KEYPAD + +By default, *Num Lock* overrides the run-time configuration keypad +mode; when active, the keypad is always considered to be in +_numerical_ mode. This corresponds to XTerm's *numLock* option set to +*true*. + +In this mode, the keypad keys always sends either numbers (Num Lock is +active) or cursor movement keys (up, down, left, right, page up, page +down etc). + +This can be disabled programmatically with *\E[?1035l* (and enabled +again with *\E[?1035h*). + +When disabled, the keypad sends custom escape sequences instead of +numbers, when in _application_ mode. + # CONFIGURATION See *foot.ini*(5) diff --git a/foot.ini b/foot.ini index aa0fda50..67a59c7e 100644 --- a/foot.ini +++ b/foot.ini @@ -79,7 +79,6 @@ # pipe-scrollback=[sh -c "xurls | bemenu | xargs -r firefox"] none # pipe-selected=[xargs -r firefox] none - [search-bindings] # cancel=Control+g Escape # commit=Return From d86b6b30314bb41af81aa6293e07810b39ac6dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 12 Nov 2020 18:20:54 +0100 Subject: [PATCH 08/22] changelog: fix link to readme#keypad --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a311bc09..33913da2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,8 +22,9 @@ ### Changed * Num Lock by default overrides the keypad mode. See - **foot.ini**(5)::KEYPAD, or [README.md](README.md#keypad) for - details (https://codeberg.org/dnkl/foot/issues/194). + **foot.ini**(5)::KEYPAD, or + [README.md](README.md#user-content-keypad) for details + (https://codeberg.org/dnkl/foot/issues/194). ### Fixed From 3526af34d721a0ca35e02c958556e642e13c54a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 13 Nov 2020 17:49:23 +0100 Subject: [PATCH 09/22] config: enable allow-overflowing-double-width-glyphs by default --- CHANGELOG.md | 4 ++++ config.c | 6 +++--- doc/foot.ini.5.scd | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33913da2..f6330db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,10 @@ **foot.ini**(5)::KEYPAD, or [README.md](README.md#user-content-keypad) for details (https://codeberg.org/dnkl/foot/issues/194). +* Single-width characters with double-width glyphs are now allowed to + overflow into neighboring cells by default. Set + **tweak.allow-overflowing-double-width-glyphs** to ‘no’ to disable + this. ### Fixed diff --git a/config.c b/config.c index 437bd5d8..78ae9200 100644 --- a/config.c +++ b/config.c @@ -1474,8 +1474,8 @@ parse_section_tweak( else if (strcmp(key, "allow-overflowing-double-width-glyphs") == 0) { conf->tweak.allow_overflowing_double_width_glyphs = str_to_bool(value); - if (conf->tweak.allow_overflowing_double_width_glyphs) - LOG_WARN("tweak: allow overflowing double-width glyphs"); + if (!conf->tweak.allow_overflowing_double_width_glyphs) + LOG_WARN("tweak: disabled overflowing double-width glyphs"); } else if (strcmp(key, "damage-whole-window") == 0) { @@ -1934,7 +1934,7 @@ config_load(struct config *conf, const char *conf_path, .tweak = { .fcft_filter = FCFT_SCALING_FILTER_LANCZOS3, - .allow_overflowing_double_width_glyphs = false, + .allow_overflowing_double_width_glyphs = true, .delayed_render_lower_ns = 500000, /* 0.5ms */ .delayed_render_upper_ns = 16666666 / 2, /* half a frame period (60Hz) */ .max_shm_pool_size = 512 * 1024 * 1024, diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 191c54e3..45c8b0d5 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -516,7 +516,7 @@ any of these options. Note: this feature uses _heuristics_ to determine *which* glyphs should be allowed to overflow. - Default: _false_. + Default: _yes_. *render-timer* Enables a frame rendering timer, that prints the time it takes to @@ -603,7 +603,7 @@ any of these options. GPU usage (by the compositor, not by foot), and may have a negative impact on battery life. - Default: _false_. + Default: _no_. *max-shm-pool-size-mb* This option controls the amount of *virtual* memory used by the From ca150fbdd5456c47f1aef4c1a52357464eae88e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 13 Nov 2020 17:50:34 +0100 Subject: [PATCH 10/22] =?UTF-8?q?readme:=20don=E2=80=99t=20uppercase=20tit?= =?UTF-8?q?les?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7cc055ac..75429571 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,7 @@ Finally, pressing alt will prefix the transmitted byte with ESC. -## KEYPAD +## Keypad By default, Num Lock overrides the run-time configuration keypad mode; when active, the keypad is always considered to be in @@ -369,7 +369,7 @@ emulator actually responded to. contributing foot's [logo](icons/hicolor/48x48/apps/foot.png). -# BUGS +# Bugs Please report bugs to https://codeberg.org/dnkl/foot/issues From 3a3616af962bcd53c245e648cc73185584d79a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 19 Nov 2020 19:15:13 +0100 Subject: [PATCH 11/22] keymap: use same lookup table for Tab and ISO_Left_Tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With XKB, Shift+Tab maps to XKB_KEY_ISO_Left_Tab, not XKB_Key_Tab. Previously, we had two different lookup tables for the two. The tab table was correctly populated, while the ISO-left tab wasn’t. As a result, all Shift+Tab combos (except Shift+Tab itself) was wrong, and resulted in the same escape sequence as Shift+Tab. Fix by using the same table for both tab and ISO-left tab. Closes #210 --- CHANGELOG.md | 2 ++ input.c | 4 ++-- keymap.h | 6 +----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6330db1..3153767c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ * Resize very slow when window is hidden (https://codeberg.org/dnkl/foot/issues/190). +* Key mappings for key combinations with `shift`+`tab` + (https://codeberg.org/dnkl/foot/issues/210). ## 1.5.3 diff --git a/input.c b/input.c index 69571f80..351c7e1e 100644 --- a/input.c +++ b/input.c @@ -641,8 +641,8 @@ keymap_data_for_sym(xkb_keysym_t sym, size_t *count) switch (sym) { case XKB_KEY_Escape: *count = ALEN(key_escape); return key_escape; case XKB_KEY_Return: *count = ALEN(key_return); return key_return; - case XKB_KEY_Tab: *count = ALEN(key_tab); return key_tab; - case XKB_KEY_ISO_Left_Tab: *count = ALEN(key_backtab); return key_backtab; + case XKB_KEY_Tab: /* FALLTHROUGH */ + case XKB_KEY_ISO_Left_Tab: *count = ALEN(key_tab); return key_tab; case XKB_KEY_BackSpace: *count = ALEN(key_backspace); return key_backspace; case XKB_KEY_Up: *count = ALEN(key_up); return key_up; case XKB_KEY_Down: *count = ALEN(key_down); return key_down; diff --git a/keymap.h b/keymap.h index beca9793..042b9d28 100644 --- a/keymap.h +++ b/keymap.h @@ -45,7 +45,7 @@ static const struct key_data key_return[] = { /* Tab isn't covered by the regular "modifyOtherKeys" handling */ static const struct key_data key_tab[] = { - {MOD_SHIFT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;2;9~"}, + {MOD_SHIFT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[Z"}, {MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;3;9~"}, {MOD_SHIFT | MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;4;9~"}, {MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;5;9~"}, @@ -63,10 +63,6 @@ static const struct key_data key_tab[] = { {MOD_ANY, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\t"}, }; -static const struct key_data key_backtab[] = { - {MOD_ANY, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[Z"}, -}; - static const struct key_data key_backspace[] = { {MOD_SHIFT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\x7f"}, {MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033\x7f"}, From 9c7cded616c2fadfd0e80c14381525d7aa9a4b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 19 Nov 2020 19:20:15 +0100 Subject: [PATCH 12/22] keymap: fix alt+return combos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All alt+return combos mapped to the same escape sequence as alt+return itself. With this patch, alt++return map to a standard ‘CSI 27;x;13~’ sequence. --- CHANGELOG.md | 1 + keymap.h | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3153767c..622e7e7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ (https://codeberg.org/dnkl/foot/issues/190). * Key mappings for key combinations with `shift`+`tab` (https://codeberg.org/dnkl/foot/issues/210). +* Key mappings for key combinations with `alt`+`return`. ## 1.5.3 diff --git a/keymap.h b/keymap.h index 042b9d28..5ee24cdc 100644 --- a/keymap.h +++ b/keymap.h @@ -27,19 +27,19 @@ static const struct key_data key_escape[] = { static const struct key_data key_return[] = { {MOD_SHIFT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;2;13~"}, {MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033\r"}, - {MOD_SHIFT | MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;2;13~"}, + {MOD_SHIFT | MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;4;13~"}, {MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;5;13~"}, {MOD_SHIFT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;6;13~"}, - {MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033\r"}, - {MOD_SHIFT | MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;2;13~"}, - //{MOD_META, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;9;13~"}, /* TODO: ? */ - {MOD_META | MOD_SHIFT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;2;13~"}, - {MOD_META | MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033\r"}, - {MOD_META | MOD_SHIFT | MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;2;13~"}, - {MOD_META | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;5;13~"}, - {MOD_META | MOD_SHIFT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;6;13~"}, - {MOD_META | MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033\r"}, - {MOD_META | MOD_SHIFT | MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;2;13~"}, + {MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;7;13~"}, + {MOD_SHIFT | MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;8;13~"}, + {MOD_META, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;9;13~"}, + {MOD_META | MOD_SHIFT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;10;13~"}, + {MOD_META | MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;11;13~"}, + {MOD_META | MOD_SHIFT | MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;12;13~"}, + {MOD_META | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;13;13~"}, + {MOD_META | MOD_SHIFT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;14;13~"}, + {MOD_META | MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;15;13~"}, + {MOD_META | MOD_SHIFT | MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;16;13~"}, {MOD_ANY, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\r"}, }; From 8bd711c33badbcedd7126a51804c84fa70b17994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 16 Nov 2020 08:40:11 +0100 Subject: [PATCH 13/22] render: allow-overflow: require a space in the next cell When checking if we should allow a single-width character double-width glyph to overflow into the next cell, require the next cell to either be empty, or contain a space. Closes #203 --- render.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/render.c b/render.c index bad3e218..0880a90c 100644 --- a/render.c +++ b/render.c @@ -451,12 +451,16 @@ render_cell(struct terminal *term, pixman_image_t *pix, * - the *character* width is 1 * - the *glyph* width is at least 1.5 cells * - the *glyph* width is less than 3 cells + * - *this* column isn’t the last column + * - *this* cells is followed by an empty cell, or a space */ if (term->conf->tweak.allow_overflowing_double_width_glyphs && glyph != NULL && glyph->cols == 1 && glyph->width >= term->cell_width * 15 / 10 && - glyph->width < 3 * term->cell_width) + glyph->width < 3 * term->cell_width && + col < term->cols - 1 && + (row->cells[col + 1].wc == 0 || row->cells[col + 1].wc == L' ')) { cell_cols = min(2, cols_left); } From 20910abf365ec376761112d1e5cf00484f8600c0 Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Sun, 22 Nov 2020 16:40:15 +0000 Subject: [PATCH 14/22] client: fix handling of "-m" command-line flag --- CHANGELOG.md | 1 + client.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 622e7e7a..5503dc44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ * Key mappings for key combinations with `shift`+`tab` (https://codeberg.org/dnkl/foot/issues/210). * Key mappings for key combinations with `alt`+`return`. +* `footclient` `-m` (`--maximized`) flag being ignored. ## 1.5.3 diff --git a/client.c b/client.c index f8a07daa..5af43464 100644 --- a/client.c +++ b/client.c @@ -99,7 +99,7 @@ main(int argc, char *const *argv) login_shell = true; break; - case ',': + case 'm': maximized = true; fullscreen = false; break; From ee3935c371370ec10fab04efbf9f7b60374b2a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 23 Nov 2020 19:22:40 +0100 Subject: [PATCH 15/22] sixel: fix crash when an explicit sixel size had a height less than 6 pixels --- CHANGELOG.md | 1 + sixel.c | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5503dc44..326461d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ (https://codeberg.org/dnkl/foot/issues/210). * Key mappings for key combinations with `alt`+`return`. * `footclient` `-m` (`--maximized`) flag being ignored. +* Crash with explicitly sized sixels with a height less than 6 pixels. ## 1.5.3 diff --git a/sixel.c b/sixel.c index 898b8713..0c2f213f 100644 --- a/sixel.c +++ b/sixel.c @@ -804,9 +804,6 @@ resize(struct terminal *term, int new_width, int new_height) assert(alloc_new_height >= new_height); assert(alloc_new_height - new_height < 6); - assert(new_width >= old_width); - assert(new_height >= old_height); - uint32_t *new_data = NULL; if (new_width == old_width) { @@ -827,7 +824,7 @@ resize(struct terminal *term, int new_width, int new_height) new_data = xmalloc(alloc_new_width * alloc_new_height * sizeof(uint32_t)); /* Copy old rows, and initialize new columns to background color */ - for (int r = 0; r < old_height; r++) { + for (int r = 0; r < min(old_height, new_height); r++) { memcpy(&new_data[r * new_width], &old_data[r * old_width], old_width * sizeof(uint32_t)); for (int c = old_width; c < new_width; c++) From 8f785e5a0dd10d3325862c7cd1040c81c31cb8ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 23 Nov 2020 19:26:00 +0100 Subject: [PATCH 16/22] =?UTF-8?q?render:=20don=E2=80=99t=20call=20term=5Fa?= =?UTF-8?q?rm=5Fblink=5Ftimer()=20from=20multiple=20threads?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We call term_arm_blink_timer() from render_cell(), which runs in multiple threads. This caused multiple blink timer FDs to be created and registered with the FDM, later causing read failures after one of those FDs had been closed again. This rarely happened under normal circumstances, but was easy to trigger when the whole screen was full of blinking text. As a small optimization, we don’t bother taking the lock if the timer FD already is valid. This is safe, because: 1) If the timer FD isn’t valid, we take the lock and then call term_arm_blink_timer(), which again checks if the FD is already valid. 2) The blink timer FD cannot be closed while we’re rendering cells. It is only disabled in the FDM callback, which cannot execute while we’re rendering. --- render.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/render.c b/render.c index 0880a90c..0e7de9e9 100644 --- a/render.c +++ b/render.c @@ -476,8 +476,12 @@ render_cell(struct terminal *term, pixman_image_t *pix, PIXMAN_OP_SRC, pix, &bg, 1, &(pixman_rectangle16_t){x, y, cell_cols * width, height}); - if (cell->attrs.blink) + if (cell->attrs.blink && term->blink.fd < 0) { + /* TODO: use a custom lock for this? */ + mtx_lock(&term->render.workers.lock); term_arm_blink_timer(term); + mtx_unlock(&term->render.workers.lock); + } if (has_cursor && term->cursor_style == CURSOR_BLOCK && term->kbd_focus) draw_cursor(term, cell, font, pix, &fg, &bg, x, y, cell_cols); @@ -488,7 +492,6 @@ render_cell(struct terminal *term, pixman_image_t *pix, pixman_image_t *clr_pix = pixman_image_create_solid_fill(&fg); if (glyph != NULL) { - /* Clip to cell */ if (unlikely(pixman_image_get_format(glyph->pix) == PIXMAN_a8r8g8b8)) { /* Glyph surface is a pre-rendered image (typically a color emoji...) */ if (!(cell->attrs.blink && term->blink.state == BLINK_OFF)) { From 7430d03c6d4d6ef18fad4f48a2ca318ab765d492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 21 Nov 2020 22:05:24 +0100 Subject: [PATCH 17/22] changelog: update contributors --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 326461d2..9c3b0906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,11 @@ * Crash with explicitly sized sixels with a height less than 6 pixels. +### Contributors + +* [craigbarnes](https://codeberg.org/craigbarnes) + + ## 1.5.3 ### Fixed From 54e4f8e407a30cc615a757058178ded06644a2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 26 Nov 2020 18:22:22 +0100 Subject: [PATCH 18/22] doc: foot.1: no need to say foot.ini twice --- doc/foot.1.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/foot.1.scd b/doc/foot.1.scd index 7e61d7a7..885bac7b 100644 --- a/doc/foot.1.scd +++ b/doc/foot.1.scd @@ -138,7 +138,7 @@ The following keyboard shortcuts are available. ## NORMAL MODE Note that these are just the defaults; they can be changed in -*foot.ini*, see *foot.ini*(5). +*foot.ini(5)*. *shift*+*page up*/*page down* Scroll up/down in history From 86de0073119fea3d619191bb43cdfb96144ef840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 26 Nov 2020 18:22:45 +0100 Subject: [PATCH 19/22] doc: foot.5: minor highlighting fixes --- doc/foot.ini.5.scd | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 45c8b0d5..31faf9b6 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -1,7 +1,7 @@ foot.ini(5) # NAME -foot.ini - configuration file +foot.ini - configuration file for *foot*(1) # DESCRIPTION @@ -68,7 +68,7 @@ in this order: Executable to launch. Typically a shell. Default: _$SHELL_ if set, otherwise the user's default shell (as specified in _/etc/passwd_). You can also pass arguments. For example - "/bin/bash --norc". + */bin/bash --norc*. *login-shell* Boolean. If enabled, the shell will be launched as a login shell, @@ -143,7 +143,8 @@ applications can change these at runtime. # SECTION: mouse *hide-when-typing* - Boolean. When enabled, the mouse cursor is hidden while typing. + Boolean. When enabled, the mouse cursor is hidden while + typing. Default: _no_. *alternate-scroll-mode* Boolean. This option controls the initial value for the _alternate @@ -254,8 +255,8 @@ combination is on the form _mod1+mod2+key_. The names of the modifiers and the key *must* be valid XKB key names. Note that if *Shift* is one of the modifiers, the _key_ *must* be in -upper case. For example, *Control+Shift+v* will never trigger - -*Control+Shift+V* is the correct way to write it. +upper case. For example, *Control+Shift+v* will never trigger, but +*Control+Shift+V* will. Note that *Alt* is usually called *Mod1*. From 9a33559fdaa4868ec84de673973cc4a2834940a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 28 Nov 2020 11:50:32 +0100 Subject: [PATCH 20/22] =?UTF-8?q?keymap:=20add=20=E2=80=98CSI=2027;;2?= =?UTF-8?q?7~=E2=80=99=20escapes=20for=20Esc=20with=20modifiers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + keymap.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c3b0906..20e0ad97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ * Key mappings for key combinations with `alt`+`return`. * `footclient` `-m` (`--maximized`) flag being ignored. * Crash with explicitly sized sixels with a height less than 6 pixels. +* Key mappings for `esc` with modifiers. ### Contributors diff --git a/keymap.h b/keymap.h index 5ee24cdc..8a8c968e 100644 --- a/keymap.h +++ b/keymap.h @@ -21,6 +21,21 @@ struct key_data { }; static const struct key_data key_escape[] = { + {MOD_SHIFT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;2;27~"}, + {MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;3;27~"}, + {MOD_SHIFT | MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;4;27~"}, + {MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;5;27~"}, + {MOD_SHIFT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;6;27~"}, + {MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;7;27~"}, + {MOD_SHIFT | MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;8;27~"}, + {MOD_META, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;9;27~"}, + {MOD_META | MOD_SHIFT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;10;27~"}, + {MOD_META | MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;11;27~"}, + {MOD_META | MOD_SHIFT | MOD_ALT, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;12;27~"}, + {MOD_META | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;13;27~"}, + {MOD_META | MOD_SHIFT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;14;27~"}, + {MOD_META | MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;15;27~"}, + {MOD_META | MOD_SHIFT | MOD_ALT | MOD_CTRL, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033[27;16;27~"}, {MOD_ANY, CURSOR_KEYS_DONTCARE, KEYPAD_DONTCARE, "\033"}, }; From f6aa1495d7b0fea56f8c7d96ba119b1ce6ab15ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 1 Dec 2020 18:27:56 +0100 Subject: [PATCH 21/22] input: relax requirements for overriding keypad application mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don’t require NumLock to be locked. Foot has no idea _which_ modifier the user has mapped NumLock to, meaning we really cannot require it to be locked. --- input.c | 8 +------- wayland.h | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/input.c b/input.c index 351c7e1e..dbe4cfab 100644 --- a/input.c +++ b/input.c @@ -512,7 +512,6 @@ keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard, seat->kbd.mod_alt = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_ALT) ; seat->kbd.mod_ctrl = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_CTRL); seat->kbd.mod_meta = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_LOGO); - seat->kbd.mod_num = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_MOD_NAME_NUM); seat->kbd.key_arrow_up = xkb_keymap_key_by_name(seat->kbd.xkb_keymap, "UP"); seat->kbd.key_arrow_down = xkb_keymap_key_by_name(seat->kbd.xkb_keymap, "DOWN"); @@ -615,7 +614,6 @@ keyboard_leave(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, seat->kbd.alt = false; seat->kbd.ctrl = false; seat->kbd.meta = false; - seat->kbd.num = false; if (seat->kbd.xkb_compose_state != NULL) xkb_compose_state_reset(seat->kbd.xkb_compose_state); @@ -734,9 +732,7 @@ keymap_lookup(struct seat *seat, struct terminal *term, const enum cursor_keys cursor_keys_mode = term->cursor_keys_mode; const enum keypad_keys keypad_keys_mode - = (term->num_lock_modifier && seat->kbd.num - ? KEYPAD_NUMERICAL - : term->keypad_keys_mode); + = term->num_lock_modifier ? KEYPAD_NUMERICAL : term->keypad_keys_mode; for (size_t j = 0; j < count; j++) { if (info[j].modifiers != MOD_ANY && info[j].modifiers != mods) @@ -1038,8 +1034,6 @@ keyboard_modifiers(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, seat->kbd.xkb_state, seat->kbd.mod_ctrl, XKB_STATE_MODS_DEPRESSED); seat->kbd.meta = xkb_state_mod_index_is_active( seat->kbd.xkb_state, seat->kbd.mod_meta, XKB_STATE_MODS_DEPRESSED); - seat->kbd.num = xkb_state_mod_index_is_active( - seat->kbd.xkb_state, seat->kbd.mod_num, XKB_STATE_MODS_LOCKED); } if (seat->kbd_focus && seat->kbd_focus->active_surface == TERM_SURF_GRID) diff --git a/wayland.h b/wayland.h index 149d7c00..70c2098a 100644 --- a/wayland.h +++ b/wayland.h @@ -148,7 +148,6 @@ struct seat { xkb_mod_index_t mod_alt; xkb_mod_index_t mod_ctrl; xkb_mod_index_t mod_meta; - xkb_mod_index_t mod_num; xkb_keycode_t key_arrow_up; xkb_keycode_t key_arrow_down; @@ -158,7 +157,6 @@ struct seat { bool alt; bool ctrl; bool meta; - bool num; struct { tll(struct key_binding_normal) key; From 3156db74ecc6263591b9be99bcfa9d3a331a9e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 1 Dec 2020 19:52:36 +0100 Subject: [PATCH 22/22] meson/pkgbuild: bump version to 1.5.4 --- PKGBUILD | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 976e4620..c89a7c50 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,5 +1,5 @@ pkgname=('foot-git' 'foot-terminfo-git') -pkgver=1.5.3 +pkgver=1.5.4 pkgrel=1 arch=('x86_64' 'aarch64') url=https://codeberg.org/dnkl/foot diff --git a/meson.build b/meson.build index d5e219e8..eb3792f6 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('foot', 'c', - version: '1.5.3', + version: '1.5.4', license: 'MIT', meson_version: '>=0.53.0', default_options: [