Commit graph

195 commits

Author SHA1 Message Date
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
Daniel Eklöf
fb018eb64e
main: render_resize() scales the width and height
Thus, when we call render_resize() with *old* with/height values, we
must scale them back to their original values.

This fixes an issue where, for example, moving a window between
outputs with different scales caused the window to keep growing.
2019-08-30 17:56:23 +02:00
Daniel Eklöf
47da5b4086
main: request server-side decorations 2019-08-30 17:55:45 +02:00
Daniel Eklöf
1e4b11b0fa
search: don't destroy/recreate search (sub)surface
Create the sub-surface once, at startup. Then, instead of destroying
it when committing/cancelling a search, unmap it (by attaching a NULL
buffer to it).
2019-08-29 20:22:07 +02:00
Daniel Eklöf
af8682210e
main: destroy sub-compositor at exit 2019-08-29 20:17:53 +02:00
Daniel Eklöf
44a353a7f7
search: move wayland surface variables into the term struct 2019-08-29 20:15:33 +02:00
Daniel Eklöf
66912cbfb5
search: use a sub-surface to render the search buffer 2019-08-29 19:34:41 +02:00
Daniel Eklöf
c2b4f4daa6
main: log cell width/height at info level, not debug
This complements the INFO logs from the renderer when the terminal is
resized.
2019-08-28 21:01:36 +02:00
Daniel Eklöf
43fc297fbd
main: free search buffer 2019-08-27 19:43:50 +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
4e2067446a
main: use slave's exit value as our exit value 2019-08-23 17:23:47 +02:00
Daniel Eklöf
d8fb80ea32
term: rename colors256 -> table 2019-08-21 18:50:24 +02:00
Daniel Eklöf
631e0c0870
term: use colors256 array for *all* colors
That is, remove the 'regular' and 'bright' color arrays. This is
possible since the 256-color array is defined such that the first 16
colors map to the regular and bright colors.
2019-08-21 18:47:48 +02:00
Daniel Eklöf
d7aaeaedee
csi: move 256-color table into the terminal struct 2019-08-21 17:56:21 +02:00
Daniel Eklöf
3efc30c6a1
main: fix debug logs 2019-08-21 17:55:40 +02:00
Daniel Eklöf
842d114cdb
main: don't set scale before we know what it actually should be 2019-08-21 17:55:11 +02:00
Daniel Eklöf
0a80269be7
main: we *do* track outputs 2019-08-21 17:54:58 +02:00
Daniel Eklöf
d5bc46f333
render: reload cursor theme when scale (may) have changed 2019-08-21 17:53:52 +02:00
Daniel Eklöf
f45e5c6aef
Remove all references to cairo; we now use pixman only 2019-08-16 22:11:22 +02:00