Commit graph

64 commits

Author SHA1 Message Date
Daniel Eklöf
2c7ee09dad
Merge branch 'scroll-damage-performance' 2020-03-29 12:07:53 +02:00
Daniel Eklöf
a2a370acba
conf: rename 'startup-mode' to 'initial-window-mode' 2020-03-28 12:04:00 +01:00
Daniel Eklöf
598ac4bcd0
Merge branch 'master' into scroll-damage-performance 2020-03-27 21:16:42 +01:00
Daniel Eklöf
e197368c0f
config: add 'startup-mode' option
This option controls the initial window mode: windowed, maximized or
fullscreen. The default is windowed.
2020-03-26 19:39:12 +01:00
Daniel Eklöf
0baa249d8b
shm: make max pool size user configurable (via a 'tweak' setting) 2020-03-25 20:48:02 +01:00
Daniel Eklöf
0419156494
search: replace hard-coded key bindings with "user configurable" ones
They aren't really user configurable. At least not yet.

However, with this, we now handle raw key codes just like the normal
key bindings. Meaning, e.g. ctrl+g, ctrl+a, ctrl+e etc now works while
searching with e.g. a russian layout.
2020-03-18 15:30:14 +01:00
Daniel Eklöf
c87cec8c1e
conf: bindings: case insensitive matching against 'none' 2020-03-18 14:52:04 +01:00
Daniel Eklöf
87d641695a
conf: change default key binding for spawn-terminal to ctrl+shift+n 2020-03-17 19:51:25 +01:00
Daniel Eklöf
6e63fdb053
conf: make delayed rendering timeouts configurable
This adds an undocumented 'tweak' section to footrc, with two new
options:

* delayed-render-lower
* delayed-render-upper

Both takes an integer value, representing the lower/upper timeout
values (in nano seconds) for delayed rendering.
2020-03-17 16:46:54 +01:00
Daniel Eklöf
6657573866
Merge branch 'master' into bindings 2020-03-12 17:19:54 +01:00
Daniel Eklöf
5cbd0527d7
config: key-bindings: verify key combo isn't already mapped to another action 2020-03-12 17:19:09 +01:00
Daniel Eklöf
c58f9a9ef9
config: mouse-bindings: verify button isn't already mapped
A button may only be mapped to a single action. Detect when the user
tried to map the same button to multiple actions and error out.

To clear a binding (for example, to free up a button from the default
bindings), one can set the action it is bound to to
`NONE` (e.g. `primary-paste=NONE`).
2020-03-12 10:46:27 +01:00
Daniel Eklöf
45384839f0
config/input: implement mouse bindings
* New config section, "mouse-bindings", where bindings are defined on
  the form "action=BTN_<name>
* pointer_button() handler now scans the bindings list instead of
  hardcoding primary-paste to BTN_MIDDLE.
* The implementation handles single- double- and triple clicks in the
  bindings, but there is currently no way to define anything but a
  single-click binding in the configuration.
2020-03-12 10:20:05 +01:00
Daniel Eklöf
9fae38a4b2
config: 'invalid key' is always an error, not a warning 2020-03-12 10:19:21 +01:00
Daniel Eklöf
65ff582358
bindings: add minimize/maximize/fullscreen actions
These actions are by default not bound to anything.
2020-03-12 09:34:09 +01:00
Daniel Eklöf
5a89ac67eb
config: add str_to_bool() 2020-03-11 16:10:14 +01:00
Daniel Eklöf
048edc58f1
config: load custom key bindings
This adds parsing of a new section - "key-bindings" - where the user
can configure the key bindings on the form "action=combo1 .. comboN"

The validity of the key combinations are checked with the default XKB
keymap.
2020-03-09 20:03:04 +01:00
Daniel Eklöf
fc7b3b2d85
Merge branch 'master' into bindings 2020-03-09 18:49:44 +01:00
Daniel Eklöf
25792a7e8c
server/client: add XDG_SESSION_ID to the default socket path
This allows multiple foot servers to run in multiple sessions.
2020-03-09 18:47:10 +01:00
Daniel Eklöf
fcf4832775
input: convert the rest of the normal key bindings to configurable bindings
New actions defined and implemented:

* scrollback up/down
* font size up/down/reset
* spawn terminal

Break out key combo parsing to a new function,
parse_key_binding_for_action(). This function parses a string
containing one or more space separated key combo definitions on the
form (mod1+mod2+...+key), where key is a XKB key name (e.g. KP_Add).

Convert all hardcoded key bindings to configuration based
bindings. These still cannot actually be configured by the user, but
at least lives in the conf struct.
2020-03-08 15:17:57 +01:00
Daniel Eklöf
18313dcbec
config: csd: error out on invalid key 2020-03-08 14:08:48 +01:00
Daniel Eklöf
b22bb30976
wip: initial framework for dealing with key/mouse bindings in different modes
This adds initial support for defining key and mouse bindings that are
applied in different terminal modes/states.

For example, there are two arrays dealing with key and mouse bindings
in the "normal" mode. Most bindings will go here.

There's also an array for "search" mode. These bindings will be used
when the user has started a scrollback search.

In the future, there may be a model selection mode as well. Or maybe
"search" and "modal selection" will be combined into a single
"keyboard" mode. We'll see.

Since the keyboard bindings depend on the current XKB keymap,
translation from the user specified key combination string cannot be
done when loading the configuration, but must be done when we've
received a keymap from the wayland server.

We should explore if it's possible to load some kind of default keymap
just to be able to verify the validity of the key combination strings
at configuration load time, to be able to reject the configuration at
startup.

A couple of key bindings have been added as proof of concept.

Mouse bindings aren't handled at all yet, and is likely to be
re-written. For example, we can probably translate the configuration
strings at configuration load time.
2020-03-08 12:08:46 +01:00
Daniel Eklöf
27ef5b472a
config: change default CSD button width from 22 -> 26 2020-03-06 19:11:31 +01:00
Daniel Eklöf
c90d70b2bf
config: CSD borders are always invisible
That is, remove all configuration options and always draw them fully
transparent.
2020-03-03 18:18:59 +01:00
Daniel Eklöf
9699c9b8bf
csd: initial implementation of minimize/maximize/close buttons 2020-03-02 20:29:28 +01:00
Daniel Eklöf
1b2050de7b
config: no need to free 'line' between each call to getline()
getline() will re-use the allocated line if it large enough, or resize
it otherwise. Thus there's no need to free it and set it to NULL
between each call.
2020-03-02 18:48:29 +01:00
Daniel Eklöf
74175b5bd1
config: prefer $SHELL over /etc/passwd
If the user hasn't configured a shell in footrc, use $SHELL. Only if
that variable isn't set do we use the shell from /etc/passwd.
2020-03-02 18:45:38 +01:00
Daniel Eklöf
22ce09eb44
config: make CSD user configurable
The user can now configure the following:

* Whether to prefer CSDs or SSDs. But note that this is only a hint to
  the compositor - it may deny our request. Furthermore, not all
  compositors implement the decoration manager protocol, meaning CSDs
  will be used regardless of the user configuration (GNOME/mutter
  being the most prominent one).
* Title bar size and color, including transparency
* Border size and color, including transparency

Also drop support for rendering the CSDs inside the main surface.
2020-03-02 18:42:49 +01:00
Daniel Eklöf
5717a0dfb0
config: change default geometry from 800x600 -> 700x500
If the display resolution *is* 800x600, using this size is bad since
there will typically be panels and other things on the screen too.

Not that 800x600 is something we expect to see in real life, but may
happen on virtual displays.
2020-02-29 11:01:23 +01:00
Daniel Eklöf
3a9a2bb6a4
config: add default font when using the default config
When there is no configuration file, and we're using the default
configuration, we accidentally jumped pasted the code that ensures
we have at least "monospace" in the font list.
2020-02-28 18:33:30 +01:00
Daniel Eklöf
ac32bcda07
main: geometry defaults to 800x600 pixels 2020-02-25 19:05:48 +01:00
Daniel Eklöf
6af4b87ec5
config: add 'login-shell' option 2020-02-20 18:35:10 +01:00
Daniel Eklöf
9ab9247b88
config: add 'pad' option, default to 2 2020-02-15 19:00:56 +01:00
Daniel Eklöf
8f4ec9aa47
Implement --hold
When specified, we don't exit when the slave/client process exits.
2020-02-03 19:58:32 +01:00
Daniel Eklöf
caa76bcdea
config: enable user to specify path to configuration file 2019-12-17 19:08:43 +01:00
Daniel Eklöf
6d31bd63be
config: add 'server_socket_path' and set a default value 2019-12-14 12:59:06 +01:00
Daniel Eklöf
6da88ddf01
config: trim leading spaces from fonts
When splitting the font configuration into multiple font
specifications, we now trim leading spaces.

This makes no actual difference; fontconfig matched the fonts just
fine anyway, but this looks better in the logs.
2019-12-05 19:33:54 +01:00
Daniel Eklöf
29b5a14f55
config: change default bright5 and bright 6 colors
They where previously identical to the corresponding 'regular'
colors. Now, we've done a saturated add with 0x202020 (which seems to
be roughly the difference between the other regular and bright
colors).
2019-09-21 12:09:50 +02:00
Daniel Eklöf
68e89c6fbf
config: change default 'regular0' color
0x222222 appears to be more visible against the default
background (0x111111) than 0x000000.
2019-09-21 12:01:29 +02:00
Daniel Eklöf
5ce60703a5
config: turn info log message into a debug log message 2019-08-23 20:21:27 +02:00
Daniel Eklöf
990eacdad4
colors: change default 'bright0' from 000000 -> 666666 2019-08-23 19:42:14 +02:00
Daniel Eklöf
7026f60717
add config + command line option for setting initial window width/height 2019-08-23 17:26:41 +02:00
Daniel Eklöf
81107753bf
render: replace all usage of cairo with pixman 2019-08-16 22:06:06 +02:00
Daniel Eklöf
9fe6e8cc48
Add background alpha support 2019-08-15 18:15:43 +02:00
Daniel Eklöf
4b81fa3eab
config: set to NULL before calling getline()
This fixes a crash on musl-based distros
2019-08-12 19:31:56 +02:00
Daniel Eklöf
ca5e693524
config: don't log a NULL path 2019-08-12 19:31:21 +02:00
Daniel Eklöf
d4a25f7f96
config: remove old, commented out code 2019-08-08 22:20:58 +02:00
Daniel Eklöf
4801e39eae
conf: make number of scrollback lines configurable 2019-08-01 20:08:39 +02:00
Daniel Eklöf
db6939fdc5
config: remove commented out code 2019-07-30 22:03:07 +02:00
Daniel Eklöf
73b4d5d05a
font: add support for fallback fonts
A top-level font now has a list of fallback fonts. When a glyph cannot
be found, we try each fallback font in turn, until we either find one
that has the glyph, or until we've exhausted the list.

To make this actually work in practise (read: to make performance
acceptable), the cache is re-worked and is now populated on demand.

It also supports non-ASCII characters, by using the 4-byte unicode
character as index instead.

Since having an array that can be indexed by a 4-byte value isn't
really viable, we now have a simple hash table instead of an array.
2019-07-30 18:04:28 +02:00