Commit graph

4922 commits

Author SHA1 Message Date
Jonas Ådahl
5c2557b421 terminal: Make seat xcursor update focus aware
When term_xcursor_update_for_seat() was called on e.g. keyboard focus
loss, it'd update the curret xcursor to 'text' even if it was e.g. on
top of the window title, or resize areas. This makes the function a bit
more focus aware, and will not be so eager to set the text xcursor.
2021-11-29 16:26:40 +01:00
Daniel Eklöf
d70a21355c
Merge branch 'letter-spacing-regression' 2021-11-15 19:28:54 +01:00
Daniel Eklöf
b22322bfd1
config: letter-spacing: add missing ‘return’
The missing return caused us to fall through to the bottom of the
function, where we ended with an error message:

  [main].letter-spacing: 0: not a valid option: letter-spacing

Closes #795
2021-11-15 19:22:06 +01:00
Daniel Eklöf
c645be7585
Merge branch 'footclient-xdg-desktop' 2021-11-15 12:17:50 +01:00
Daniel Eklöf
843ba49565
footclient.desktop: new XDG desktop file, for footclient 2021-11-15 12:14:51 +01:00
Daniel Eklöf
31966f5494
meson: add -Dthemes=false|true
This adds a new meson option that controls whether the example theme
files should be installed or not. The default is true.

Previously, themes were gated by the -Ddocs option.
2021-11-14 23:12:18 +01:00
Daniel Eklöf
48758a101e
changelog: add new ‘unreleased’ section 2021-11-14 18:26:24 +01:00
Daniel Eklöf
dc6c650adb
Merge branch 'releases/1.10' 2021-11-14 18:25:48 +01:00
Daniel Eklöf
589404b32e
meson: bump version to 1.10.0 2021-11-14 18:12:30 +01:00
Daniel Eklöf
d00d1b2514
changelog: prepare for 1.10.0 2021-11-14 18:10:43 +01:00
Daniel Eklöf
ef862bd747
Merge branch 'user-notification-cleanup' 2021-11-14 17:56:24 +01:00
Craig Barnes
759bc8007b user-notification: config: various small cleanups
* Rename user_notification_add() to user_notification_add_fmt()
* Add new user_notification_add() helper function
* Use xvasprintf() to replace user_notification_add_va()
* Make better use of helper functions in config.c
2021-11-14 15:16:32 +00:00
Daniel Eklöf
0686f94b18
config: remove options that were deprecated in 1.8.x
* [main].bell
* [main].jump-label-letters
* [main].url-launch
* [main].osc8-underline
2021-11-14 14:21:11 +01:00
Craig Barnes
26515b7ab9 changelog: fix minor grammatical mistake 2021-11-14 11:42:23 +00:00
Daniel Eklöf
9fedb43511
themes: solarized-dark: add commented out selection fg/bg colors 2021-11-13 17:48:04 +01:00
Daniel Eklöf
d8c7536124
themes: add solarized-dark-normal-brights
This is a custom version of solarized-dark, where the bright colors
have been generated by increasing the regular colors’ luminance by
20%.

In other words, this version does *not* have the solarized colors that
normally occupy the bright colors. Thus, if you want the full
solarized experience in e.g. editors, make sure to use editor-specific
24-bit themes.
2021-11-13 17:45:43 +01:00
Daniel Eklöf
d1a76a67c0
Merge branch 'configurable-dim-colors'
Closes #776
2021-11-13 17:40:34 +01:00
Daniel Eklöf
c01904a2c7
config: add [colors].dim0-7
This allows you to configure custom colors to be used when colors are
being dimmed (`\E[2m`).

It is implemented by color matching (just like
bold-text-in-bright=palette-based); the color-to-be-dimmed is matched
against the current color palette.

If it matches one of the regular colors (colors 0-7), the
corresponding “dim” color will be used.

If it matches one of the bright colors (colors 8-15), the
corresponding “regular” color will be used (but *only* if the “dim”
color has been set).

Otherwise, the color is dimmed by reducing its luminance.

The default behavior, i.e. when dim0-7 hasn’t been configured, is to
dim by reducing luminance for *all* colors. I.e. we don’t do any color
matching at all. In particular, this means that dimming a bright color
will *not* result in the corresponding “regular” color.

Closes #776
2021-11-13 17:39:08 +01:00
Daniel Eklöf
0d2a429109
doc: foot.ini: try to clear up the meaning of (AA)RRGGBB 2021-11-13 17:22:07 +01:00
Daniel Eklöf
c0e67e7c2f
config: scrollback.indicator.text: use value_to_wchars() 2021-11-13 12:40:59 +01:00
Daniel Eklöf
ff6b0fe011
Merge branch 'modify-other-keys-mode-2' 2021-11-13 11:38:08 +01:00
Daniel Eklöf
4a74050999
input: add support for modifyOtherKeys=2
Similar to modifyOtherKeys=1 (foot’s default, and only, mode), except
that:

* All modifiers (and not just Ctrl) generate \E[27;m;n~ escapes
* Regular keys (with modifiers) also generate \E[27;m;n~ escapes (for
  example, C-h no longer generates ^H, but \E[27;5;104~)

For our keymap based lookups, this is handled by adding
MOD_MODIFY_OTHER_KEYS_STATE<N> variants.

For “generic” keys, we simply adjust the conditions for when to emit a
\E[27;m;n~ escape - the only requirement is that at least one modifier
is active.
2021-11-13 11:09:07 +01:00
Daniel Eklöf
9412389051
Merge branch 'no-scrollback-multiplier-on-alt-screen'
Closes #787
2021-11-13 11:05:45 +01:00
Daniel Eklöf
ebcf5a4b4f
input: don’t apply [scrollback].multiplier when alt screen is in use
Closes #787
2021-11-13 11:05:36 +01:00
Daniel Eklöf
e026ef22f4
Merge branch 'config-refactor' 2021-11-13 11:04:54 +01:00
Daniel Eklöf
b5f7c414a9
changelog: boolean options 2021-11-13 11:04:30 +01:00
Daniel Eklöf
73c5754f5d
config: value_to_wchars(): free the target variable 2021-11-13 11:04:30 +01:00
Daniel Eklöf
2f0ab1da89
config: appease compiler
../../foot/config.c:154:50: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
    log_msg(log_class, LOG_MODULE, file, lineno, formatted_msg);
                                                 ^~~~~~~~~~~~~
../../foot/config.c:154:50: note: treat the string as an argument to avoid this
    log_msg(log_class, LOG_MODULE, file, lineno, formatted_msg)
2021-11-13 11:04:30 +01:00
Daniel Eklöf
d4b9ef7607
config: drop all warning logs from the tweak section 2021-11-13 11:04:30 +01:00
Daniel Eklöf
1f39c46c17
config: value_to_enum(), return conversion success/failure as a bool
Result is set through a pointer passed as an argument. Note that we
assume enums are 32-bit, and explicitly cast them to int*.

Static asserts have been added to ensure this invariant holds.
2021-11-13 11:04:29 +01:00
Daniel Eklöf
205f1f7c02
config: parse_section_main(): explicit return from each branch
Add UNREACHABLE() at the bottom
2021-11-13 11:04:29 +01:00
Daniel Eklöf
0c0a78498f
config: add value_to_dimensions() 2021-11-13 11:04:29 +01:00
Daniel Eklöf
d29c3cf7b7
config: add {str,value}_to_uint{16,32}()
This allows us to pass the final pointer directly to the conversion
functions, as well as allowing us to print outside-range errors.
2021-11-13 11:04:29 +01:00
Daniel Eklöf
3b27a665da
config: add value_to_str()
Takes a pointer to a char*, free:s it, and strdups the current value.
2021-11-13 11:04:29 +01:00
Daniel Eklöf
c2127fb2de
config: value_to_bool: return success/fail
Write boolean value to a pointer passed as argument, return conversion
success/failure
2021-11-13 11:04:29 +01:00
Daniel Eklöf
57c7fb33af
config: add value_to_enum() 2021-11-13 11:04:28 +01:00
Daniel Eklöf
328b53b166
config: let value_to_double() log errors 2021-11-13 11:04:28 +01:00
Daniel Eklöf
def2d80b0a
config: let value_to_ulong() log errors 2021-11-13 11:04:28 +01:00
Daniel Eklöf
176b85cb10
config: add LOG_CONTEXTUAL_{ERR,WARN,ERRNO}
These work like LOG_AND_NOTIFY_* but add contextual information: path
of the conf file, line number, section name, key/option name and the
value.
2021-11-13 11:04:28 +01:00
Daniel Eklöf
534e9d8bef
config: first argument to log_and_notify() is now a ‘struct context’ 2021-11-13 11:04:28 +01:00
Daniel Eklöf
958ef9dd3b
config: rename str_to_spawn_template() -> value_to_spawn_template() 2021-11-13 11:04:27 +01:00
Daniel Eklöf
70aec2068a
config: rename str_to_fonts() -> value_to_fonts() 2021-11-13 11:04:27 +01:00
Daniel Eklöf
4aa3d1d5f8
config: rename str_to_wchars() -> value_to_wchars() 2021-11-13 11:04:27 +01:00
Daniel Eklöf
5fb86859df
config: rename str_to_double() -> value_to_double()
* str_to_double() -> value_to_double()
* str_to_pt_or_px() -> value_to_pt_or_px()
2021-11-13 11:04:27 +01:00
Daniel Eklöf
922490217e
config: rename str_to_ulong() -> value_to_ulong()
* str_to_ulong() -> value_to_ulong()
* str_to_color() -> value_to_color()
* str_to_two_colors() -> value_to_two_colors()
2021-11-13 11:04:27 +01:00
Daniel Eklöf
92e08a04ed
config: value_to_bool(): fixup 2021-11-13 11:04:27 +01:00
Daniel Eklöf
5bb2973c39
config: rename str_to_bool() -> value_to_bool()
Change argument to a ‘struct context’ pointer
2021-11-13 11:04:26 +01:00
Daniel Eklöf
82a7885324
config: pass aggregated struct to top-level section handlers 2021-11-13 11:04:26 +01:00
Craig Barnes
0e5e68d82e main: improve handling of setlocale(3) return value
There's no need to call setlocale() twice, since the first call
returns the same value as the second.

We also handle a NULL return value explicitly and show a distinct
error message for that case, since it typically indicates a
misconfigured locale and not just a non-UTF8 locale.
2021-11-10 17:41:48 +00:00
Daniel Eklöf
3e04c4e4f4
wayland: guard XDG startup notification with HAVE_XDG_ACTIVATION
Fixes compilation on systems with “too old” wayland-protocols
2021-11-09 18:23:44 +01:00