Commit graph

2784 commits

Author SHA1 Message Date
Daniel Eklöf
3156db74ec
meson/pkgbuild: bump version to 1.5.4 2020-12-01 19:52:36 +01:00
Daniel Eklöf
f6aa1495d7
input: relax requirements for overriding keypad application mode
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.
2020-12-01 19:47:16 +01:00
Daniel Eklöf
9a33559fda
keymap: add ‘CSI 27;<mod>;27~’ escapes for Esc with modifiers 2020-12-01 19:46:14 +01:00
Daniel Eklöf
86de007311
doc: foot.5: minor highlighting fixes 2020-12-01 19:45:08 +01:00
Daniel Eklöf
54e4f8e407
doc: foot.1: no need to say foot.ini twice 2020-12-01 19:45:05 +01:00
Daniel Eklöf
7430d03c6d
changelog: update contributors 2020-12-01 19:44:27 +01:00
Daniel Eklöf
8f785e5a0d
render: don’t call term_arm_blink_timer() from multiple threads
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.
2020-12-01 19:43:05 +01:00
Daniel Eklöf
ee3935c371
sixel: fix crash when an explicit sixel size had a height less than 6 pixels 2020-12-01 19:42:57 +01:00
Craig Barnes
20910abf36
client: fix handling of "-m" command-line flag 2020-12-01 19:42:19 +01:00
Daniel Eklöf
8bd711c33b
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
2020-12-01 19:41:49 +01:00
Daniel Eklöf
9c7cded616
keymap: fix alt+return combos
All alt+return combos mapped to the same escape sequence as alt+return
itself.

With this patch, alt+<mod(s)>+return map to a standard ‘CSI 27;x;13~’
sequence.
2020-12-01 19:41:33 +01:00
Daniel Eklöf
3a3616af96
keymap: use same lookup table for Tab and ISO_Left_Tab
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
2020-12-01 19:41:29 +01:00
Daniel Eklöf
ca150fbdd5
readme: don’t uppercase titles 2020-12-01 19:40:46 +01:00
Daniel Eklöf
3526af34d7
config: enable allow-overflowing-double-width-glyphs by default 2020-12-01 19:40:43 +01:00
Daniel Eklöf
d86b6b3031
changelog: fix link to readme#keypad 2020-12-01 19:40:13 +01:00
Daniel Eklöf
8970c7ea18
readme/doc:foot.1: document the (new) keypad behavior 2020-12-01 19:40:03 +01:00
Daniel Eklöf
dea8e89fda
input: enforce ‘numerical’ keypad mode when Num Lock override is enabled
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
2020-12-01 19:39:10 +01:00
Daniel Eklöf
4f0d057243
input: track num lock state 2020-12-01 19:39:05 +01:00
Daniel Eklöf
7dcc885a7a
csi: implement “CSI ? 1035” - toggle Num Lock override
This adds a num_lock_modifier state to the terminal, and hooks up
“CSI?1035h/l” to toggle it.
2020-12-01 19:38:36 +01:00
Daniel Eklöf
61f4845a59
input: use XKB_MOD_NAME_* macros instead of hard-coded strings 2020-12-01 19:37:29 +01:00
Daniel Eklöf
3031ddfc16
wayland: preempt render scheduling in ‘configure’ events
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
2020-12-01 19:35:58 +01:00
Daniel Eklöf
99b3e20126
changelog: add entry for 1.5.4 2020-12-01 19:33:22 +01:00
Daniel Eklöf
90abdab345
meson/pkgbuild: bump version to 1.5.3 2020-11-06 20:16:27 +01:00
Daniel Eklöf
442e10dd28
selection: fix enum type
enum selection_scroll_direction is used when extending a selection by
auto-scrolling the terminal content while the mouse is outside the
grid.

What we want is enum selection_direction.
2020-11-06 20:13:44 +01:00
Daniel Eklöf
66f846d723
selection: explicitly set direction when right-click extending
Fixes an issue where right-click-and-dragging to extend a selection
caused one cell being removed from the selection.

Closes #180
2020-11-06 20:09:26 +01:00
Daniel Eklöf
c512dc4490
input: don’t use seat->kbd_focus as terminal when processing a key press
When converting mouse scroll events to keyboard input (in alternate
scroll mode), we need to use seat->mouse_focus, not seat->kbd_focus.

To enable this, break out key press/release handling code to a
separate function that takes an explicit term argument. Call this
function from keyboard_key(), input_repeat() and in alternate scroll
mode.

Closes #179
2020-11-06 20:09:16 +01:00
Daniel Eklöf
273f105af5
tiocswinsz: fix compilation error on e.g. ppc64
On some platforms, TIOCSWINSZ has a very large value, >
0x80000000.

On some platforms, the `request` argument to `ioctl(3)` is an `int`.

For platforms where both of the above is true, gcc will warn (and
error out if compiled with `-Werror`) on:

  ioctl(fd, TIOCSWINSZ, ...)

To silence this warning, we need to cast `TIOCSWINSZ` to an
integer.

However, doing this on platforms where `request` is an `unsigned long`
will result in `TIOCSWINSZ` being sign-extended (and thus we end up
with an invalid value).

It seems that casting to `unsigned int` works in both cases; it
silences the long -> int conversion warning, while also preserving the
correct value in all cases.
2020-11-06 20:08:52 +01:00
Daniel Eklöf
d31139515f
main: remove trailing ‘, ’ from arch log line 2020-11-06 20:08:33 +01:00
Daniel Eklöf
30f23a3b74
input: handle XKB errors
* Don’t de-reference the xkb context/keymap/state if we failed to
  instantiate them.
* Don’t try to send a translated utf8 key sequence if the translation
  failed.
* Handle xkb_compose_state_get_utf8() and xkb_state_key_get_utf8()
  returning more than 64 bytes.

This _may_ fix #171.
2020-11-06 20:08:15 +01:00
Daniel Eklöf
90544ef391
input: don’t allow diagonal resize when tiled 2020-11-06 20:08:07 +01:00
Daniel Eklöf
ebd4a32768
wayland: properly restore window size when being un-tiled
Bind to xdg-shell version 2 if available, as this enables us to
track our window’s ‘tiled’ state in the ‘configure’ events.

This in turn allows us to stash the ‘old’ window size when being
tiled, to be used again when restoring the window size when un-tiled.
2020-11-06 20:07:59 +01:00
Daniel Eklöf
9e7783596a
input: don’t crash if xkbcommon cannot find a compose file
Handle xkb_compose_table_new_from_locale() returning NULL. When this
happens, log a warning that “dead keys” will be disabled, and make
sure to never de-reference the compose table pointer.

Closes #170
2020-11-06 20:07:31 +01:00
Daniel Eklöf
e85ace0b0d
changelog: prepare for 1.5.3 2020-11-06 20:06:31 +01:00
Daniel Eklöf
549d46bda4
shm: MAP_UNINITIALIZED is a linux only mmap flag 2020-10-13 18:41:52 +02:00
Daniel Eklöf
f1e422b25a
meson/pkgbuild: bump version to 1.5.2 2020-10-13 08:04:37 +02:00
Daniel Eklöf
fdb7e40355
input: regression: don’t pass on mouse click to application if we consumed it
When we ‘consume’ a mouse button event (i.e. when we have a shortcut
mapped to it), the event should *not* be passed on to the client
application.

In 5f64c5c335, button handling was
refactored and unfortunately introduced a regression where we once
again started passing consumed button presses to the client
application.

Fixes #168
2020-10-13 08:02:09 +02:00
Daniel Eklöf
2f20550893
meson/pkgbuild: bump version to 1.5.1 2020-10-11 19:31:25 +02:00
Daniel Eklöf
77a87b30ff
changelog: prepare for 1.5.1 2020-10-11 19:31:01 +02:00
Daniel Eklöf
a32464e296
changelog: remove duplicate entry 2020-10-11 19:27:37 +02:00
Daniel Eklöf
16a525f8e2
readme/doc: add shift+insert to list of default key bindings 2020-10-11 19:27:15 +02:00
Daniel Eklöf
70a6f88823
changelog: update ‘contributors’ list 2020-10-11 19:27:12 +02:00
Sergey Nazaryev
e842f49367
selection: use appropriate check for PRIMARY paste
Assume it could be a copy-paste typo. We should check PRIMARY, not
CLIPBOARD. Without this fix, we can't use PRIMARY until we copy anything
to CLIPBOARD.
2020-10-11 19:27:07 +02:00
Daniel Eklöf
282af44784
config: bind shift+insert to primary-paste by default 2020-10-11 19:26:57 +02:00
Daniel Eklöf
4bf61fe2f1
changelog: add contributor 2020-10-11 19:26:36 +02:00
Craig Barnes
f1752c7642
config: fix "-Wformat-nonliteral" warnings 2020-10-11 19:26:32 +02:00
Daniel Eklöf
5540e3a0e2
readme: minor rewrite of server/daemon section 2020-10-11 19:26:27 +02:00
Daniel Eklöf
5477ee8894
csi: only respond to Primary DA when Ps == 0 2020-10-11 19:26:25 +02:00
Daniel Eklöf
5daaaa03c2
readme: clearer descriptions of secondary and tertiary DA responses 2020-10-11 19:26:22 +02:00
Daniel Eklöf
0fa4a18938
term: remove unused bit in xtsave struct 2020-10-11 19:26:19 +02:00
Daniel Eklöf
98c316556f
changelog: we’ve fixed several sixel+reflow related bugs 2020-10-11 19:26:10 +02:00