Commit graph

2955 commits

Author SHA1 Message Date
Daniel Eklöf
134e1d307c
Merge branch 'bold-is-bright'
Closes #199
2020-11-14 22:09:51 +01:00
Daniel Eklöf
11ea06c71d
install: simplify sentence 2020-11-14 14:12:22 +01:00
Daniel Eklöf
a6fc5d64e8
pkgbuild: remove -fno-plt 2020-11-14 14:00:57 +01:00
Daniel Eklöf
fb32d339a7
install: remove -fno-plt from recommended CFLAGS
It appears to _worsen_ the performance...
2020-11-14 13:57:56 +01:00
Daniel Eklöf
7c110d75ba
changelog: bold-text-in-bright 2020-11-14 11:23:01 +01:00
Daniel Eklöf
ee5607b9eb
render: brighten color of bold text if default.bold-text-in-bright=yes
Closes #199
2020-11-14 11:22:35 +01:00
Daniel Eklöf
60a1ebac2b
doc: foot.ini: document default.bold-text-in-bright 2020-11-14 11:22:23 +01:00
Daniel Eklöf
34abf665e2
config: add default.bold-text-in-bright option 2020-11-14 11:22:19 +01:00
Daniel Eklöf
c764a45ee0
changelog: move pipe-* actions from ‘fixed’ to ‘added’ 2020-11-13 23:26:03 +01:00
Daniel Eklöf
b931ba3bda
readme: don’t uppercase titles 2020-11-13 17:50:47 +01:00
Daniel Eklöf
5b43477cc2
config: enable allow-overflowing-double-width-glyphs by default 2020-11-13 17:50:16 +01:00
Daniel Eklöf
4b645376fd
render: improve sixel rendering performance
Up until now, we’ve always re-rendered the entire image (the part of
it that is visible at least), *every* time we render a frame.

This is not really needed. In many cases, the cells covered by the
image hasn’t been touched.

Rewrite the sixel rendering code to only render the part of the sixel
image that covers dirty cells.

This is done on a per-row basis. I.e. Each *row* of the image that
covers at least one dirty cell is re-rendered. For this to work, we
now also dirty all cells covered by the image when we emit the image.

Finally, for this to work, the sixels need to be rendered *before* we
do the normal grid render pass (since that will clear all dirty bits).
2020-11-13 16:54:40 +01:00
Daniel Eklöf
08e4d2c238
changelog: fix link to readme#keypad 2020-11-12 18:20:54 +01:00
Daniel Eklöf
3df34055d2
Merge branch 'keypad-numlock-override'
Closes #194
2020-11-12 18:19:33 +01:00
Daniel Eklöf
e2a7c7f243
pkgbuild: append ‘foot-terminfo’ dependency in package_foot-git()
This ensures that:

* Main dependencies are still checked before the package is built
* Makepkg doesn’t complain about missing dependency foot-terminfo
2020-11-12 08:02:57 +01:00
Daniel Eklöf
0ec69eb846
pkgbuild: make foot-terminfo a hard dependency for foot 2020-11-11 21:07:17 +01:00
Daniel Eklöf
121adbe825
Merge branch 'preempt-render-scheduling-on-configure-events'
Closes #190
2020-11-11 19:04:13 +01:00
Daniel Eklöf
2af65471a6
readme/doc:foot.1: document the (new) keypad behavior 2020-11-11 18:37:28 +01:00
Daniel Eklöf
deb2c2db6d
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-11-11 18:28:37 +01:00
Daniel Eklöf
bdaf20ba71
input: track num lock state 2020-11-11 18:28:13 +01:00
Daniel Eklöf
2382d6b448
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-11-11 18:26:47 +01:00
Daniel Eklöf
75bd780f02
input: use XKB_MOD_NAME_* macros instead of hard-coded strings 2020-11-11 18:25:54 +01:00
Daniel Eklöf
02ee570c27
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-11-10 19:20:35 +01:00
Daniel Eklöf
c9de30e2bc
client: let getopt_long(3) print error messages
Closes #191
2020-11-10 19:04:20 +01:00
Daniel Eklöf
3fa3c58c8b
input: ignore keymap if we don’t recognize its format 2020-11-09 19:59:48 +01:00
Daniel Eklöf
85220a5543
wayland: use wl_*_release() instead of wl_*_destroy()
This lets the compositor free up internal state.
2020-11-09 19:59:45 +01:00
Daniel Eklöf
71e98d5b8f
Merge branch 'jeromenerf-patch-1'
Closes #185
2020-11-07 11:54:00 +01:00
jeromenerf
dbac3e4e4a Fix documentation snippets
- zsh doesn't like "export var+=value", make it two steps
- meson was complaining with "ERROR: Must specify at least one directory name.", so add the relative "../.."
2020-11-06 21:30:39 +01:00
Daniel Eklöf
6f28c16023
Merge branch 'releases/1.5' 2020-11-06 20:21:33 +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
2281ee852a
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:12:15 +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
9ce79e2ef0
config: add support for pipe-* actions in mouse bindings
Closes #183
2020-11-06 19:30:05 +01:00
Daniel Eklöf
398f0b699a
config: mouse combos: set count=1 if user has omitted click count 2020-11-06 19:30:05 +01:00
Daniel Eklöf
8ede3dc886
config: break out “[cmd arg1 arg2]” parsing to separate function 2020-11-06 19:30:05 +01:00
Daniel Eklöf
a1a68b7d50
config: don’t use memcmp() to compare structs 2020-11-06 19:30:04 +01:00
Daniel Eklöf
b541ce9d5c
wayland: output removed: only call surface_leave() if term is actually mapped on that output 2020-11-06 19:25:54 +01:00
Daniel Eklöf
a8fb51a34c
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-04 19:01:59 +01:00
Daniel Eklöf
9209adf6fa
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-03 19:44:51 +01:00
Daniel Eklöf
f3e6941c9a
search: add {clipboard,primary}-paste key bindings
These bindings copy from the clipboard or primary selection into the
search buffer.

Default bindings:

* clipboard-paste: ctrl+v, ctrl+y
* primary-paste: shift+insert
2020-11-01 12:39:57 +01:00
Daniel Eklöf
43f293f22e
selection: do mime-type based decoding before passing data to callback
The intention here is to make *all* text_from_clipboard() and
text_from_primary() callers benefit from mime-type base
decoding (e.g. URI list decoding).

Previously, the decoding was done *in* the callback, which meant only
the “default” clipboard/primary selection paste functions, and DnD,
recognized URI lists.
2020-11-01 11:52:11 +01:00