Commit graph

213 commits

Author SHA1 Message Date
Daniel Eklöf
567989e9f3
main: usage for --server now hints about 'footclient' 2019-11-03 13:46:09 +01:00
Daniel Eklöf
61dfa1365e
slave: restore signals before calling exec() 2019-11-03 13:24:15 +01:00
Daniel Eklöf
d26c67e589
main: ignore SIGHUP in master process 2019-11-03 13:23:49 +01:00
Daniel Eklöf
32129083bd
main: pre-allocate fonts
Since fonts are cached, this adds no additional memory. However, it
makes the first terminal window in --server mode start much faster,
since the (primary) fonts have already been loaded.

Fallback fonts are still loaded on-demand.
2019-11-02 13:50:40 +01:00
Daniel Eklöf
0bd2ddd8ad
term_init(): initialize slave TERM from term_init() argument 2019-11-01 21:03:08 +01:00
Daniel Eklöf
69d62d3cd2
slave: set TERM environment variable in slave process 2019-11-01 21:01:15 +01:00
Daniel Eklöf
a1efd65746
server: implement a --server mode
In this mode, foot listens on a UNIX socket and creates terminal
windows when clients connect.

A connecting client sends argc/argv to the server, and the server
instantiates a new terminal window.

When the terminal window is closed, the exit code is sent back to the
client.
2019-11-01 20:39:09 +01:00
Daniel Eklöf
32c6ed7069
main: register signal handlers for SIGINT and SIGTERM 2019-11-01 20:36:55 +01:00
Daniel Eklöf
1e41a25f00
terminal: call user-defined callback when destroying terminal
main uses this to get the exit code of the terminal.
2019-11-01 20:34:32 +01:00
Daniel Eklöf
291a928a49
render: call wl_display_flush() after rendering
This allows us to remove that call from the main event loop.
2019-11-01 20:01:36 +01:00
Daniel Eklöf
b7546abca9
main: get exit value from wayland struct 2019-10-30 20:26:08 +01:00
Daniel Eklöf
445bbe3469
wayland: track multiple terminals
The wayland 'term' member is gone and replaced by a list,
'terms'. This list contains all currently running terminal (windows).
2019-10-30 20:02:06 +01:00
Daniel Eklöf
a853896715
main: free 'config' on command line parse error 2019-10-30 18:06:47 +01:00
Daniel Eklöf
fe974956b0
term: integrate directly with FDM 2019-10-28 18:35:16 +01:00
Daniel Eklöf
0979a0e2e5
terminal: implement term_init() and term_destroy() 2019-10-28 18:25:19 +01:00
Daniel Eklöf
664641104c
main: remove a couple of includes 2019-10-27 19:28:23 +01:00
Daniel Eklöf
3684547fd7
main: kbd repeat FD is handled by the wayland backend 2019-10-27 19:23:22 +01:00
Daniel Eklöf
4a63defeb1
wayland: backend now configures FD as non-blocking, not main 2019-10-27 19:21:36 +01:00
Daniel Eklöf
2eaa258e11
main: cleanup 2019-10-27 19:21:27 +01:00
Daniel Eklöf
251cf98388
wayland: move keyboard repeat handling into wayland 2019-10-27 19:16:12 +01:00
Daniel Eklöf
1e75b89552
wayland: integrate directly with the FDM 2019-10-27 19:11:35 +01:00
Daniel Eklöf
61cc8c3c55
wayland: implement wayl_init()
Wayland instantiation is now done by the wayland backend, not in main.
2019-10-27 19:08:48 +01:00
Daniel Eklöf
1adab32906
term: wayland struct is now not a part of the terminal struct
We do however need access to it, so provide a pointer. The difference
is that now we can have a *single* wayland instance, but multiple
terminal instances.
2019-10-27 18:51:14 +01:00
Daniel Eklöf
8c534d0520
input: input_repeat() takes a 'struct wayland' pointer 2019-10-27 18:44:58 +01:00
Daniel Eklöf
9f0b1f94c2
wayland: change all wayland callbacks to take a wayland pointer
Instead of passing the terminal to the wayland callbacks, pass a
'struct wayland' pointer.
2019-10-27 18:43:07 +01:00
Daniel Eklöf
eda04d0560
wayland: add back-pointer to terminal
This can, in the future, be extended to e.g. a list, to support
multiple windows.
2019-10-27 17:13:29 +01:00
Daniel Eklöf
c9455d5f21
kbd: move into wayland 2019-10-27 17:10:32 +01:00
Daniel Eklöf
061bbd7049
kbd: break out XKB kbd struct to a separate file 2019-10-27 16:21:19 +01:00
Daniel Eklöf
5ca1ee701b
wayland: move clipboard/primary structs into the wayland struct
These are application global and very wayland specific
2019-10-27 16:15:32 +01:00
Daniel Eklöf
9e6c28f5b6
wayland: implement wayl_win_destroy() 2019-10-27 16:01:44 +01:00
Daniel Eklöf
942ff566a2
wayland: implement wayl_destroy() 2019-10-27 15:57:23 +01:00
Daniel Eklöf
f63458ef33
term: move per-window wayland objects from wayland struct to terminal struct
Short term, we want to break out the wayland backend from the terminal
struct. Long term, we might want to support multiple windows.

One step towards both the above is separating global wayland objects
from per-window objects.
2019-10-27 12:57:37 +01:00
Daniel Eklöf
5fefb950b3
fdm: use the FDM's poll loop 2019-10-27 11:46:18 +01:00
Daniel Eklöf
286db002f8
meson: fix version generation from git
run_command() was only run at configure time, meaning the generated
version (that was passed on to the sources via -DFUZZEL_VERSION)
became stale.

Fix by implementing a shell script that generates a header file, and
wrap this in a custom target that is run every time (but the generated
file is only updated when the version changes)
2019-10-19 22:09:52 +02:00
Daniel Eklöf
a789230cf9
font: font_from_name() returns an allocated font struct 2019-10-16 21:52:12 +02:00
Daniel Eklöf
5a0bb292ee
font: calculate underline/strikeout metrics in font, not main 2019-09-29 13:03:48 +02:00
Daniel Eklöf
3dd5b1fe60
main: unset DESKTOP_STARTUP_ID
This is used in the desktop startup notification protocol. We don't
support it (is it even used on Wayland?), but need to ensure programs
launced from within foot doesn't inherit it.
2019-09-26 18:41:39 +02:00
Daniel Eklöf
2d6369482e
main: initialize scale to '1'
This ensures we always have a valid (but possibly incorrect) scaling
value. This allows us to simplify code that uses the scale - it
doesn't have to verify the scale if valid.

Furthermore, since render_resize() is the function that actually
updates term->scale, make sure to call it *before* updating the
cursor (otherwise, the cursor will use the old scaling value).
2019-09-26 18:39:49 +02:00
Daniel Eklöf
16f15d1a36
selection: primary: don't require compositor to implement it 2019-09-25 19:26:55 +02:00
Daniel Eklöf
5340204cbc
main: we prefer xdg-output-manager version 2, but get by with 1 2019-09-24 19:44:14 +02:00
Daniel Eklöf
b0d5af51d0
main: log (at debug level) global interfaces and their versions 2019-09-24 19:43:43 +02:00
Daniel Eklöf
6d5d3a8d7d
It's Hz, not HZ 2019-09-21 20:09:06 +02:00
Daniel Eklöf
f20b08db3d
main: -f,--font now accepts a list of fonts
This makes -f,--font behave just like the configuration file option
'font'; the first font in the list is the primary font, and the
remaining fonts are fallback fonts used when a glyph cannot be found
in the primary font.
2019-09-21 20:01:55 +02:00
Daniel Eklöf
b2ca984ccb
main: round strikeout and underline position fallback handling 2019-09-21 00:47:17 +02:00
Daniel Eklöf
a1cd3769a3
main: round strikeout position, and ceil strikeout thickness
This fixes an issue where sometimes the strikeout thickness where
truncated to 0 (e.g. Cascadia Code).

Note that we already do this for the underline calculations.
2019-09-21 00:46:15 +02:00
Daniel Eklöf
4d558d8bed
main: names for poll FD indices 2019-09-20 22:27:27 +02:00
Daniel Eklöf
b3a419f427
main: better names of timers for delayed rendering timeouts 2019-09-20 22:21:06 +02:00
Daniel Eklöf
1a9ec997b3
main: track output refresh rate 2019-09-20 22:15:18 +02:00
Daniel Eklöf
652ff5da92
main: improve delayed rendering
We now use two timers for delayed rendering; one _lower_ limit timeout
that is reset each time we receive input from the slave. We never
render *before* this timeout. Since it's reset, this means rendering
may be pushed further into the future.

To prevent this from happening indefinitely, the second timer defines
the _upper_ limit. This timer is only reset after rendering.

Thus, slave input may now increase the rendering delay, but only up to
a certain limit.

The lower limit is as before, 1ms. The upper limit is set to 16ms (the
time between frame updates on a 60HZ output).
2019-09-20 18:12:58 +02:00
Daniel Eklöf
9f7ea6292e
main: use a timer FD to delay render refresh after client data
This ensures we never wait *longer* than 1ms (previously, we could end
up doing multiple polls, each with a timeout value of 1ms - thereby
potentially delaying the refresh indefinitely).
2019-08-30 17:57:46 +02:00