Commit graph

904 commits

Author SHA1 Message Date
Daniel Eklöf
2e0888bf3d
wayland: xdg_toplevel_close(): call term_shutdown() 2019-10-30 20:05:34 +01:00
Daniel Eklöf
9d5926ce12
term: add term_shutdown()
This function unmaps the terminal window, removes itself from the
wayland list of terminals and then finally destroys itself.

We ensure we don't get any callbacks/events referring to a free:d
terminal struct, we close all terminal related FDs and unmap the
wayland window.

Then, to be really really sure there aren't any (by the FDM) queued up
events, we delay the self-destruction to the next FDM poll iteration,
by opening an event FD and adding it to the FDM.

The callback for the event FD removes the FD from the FDM again, and
closes it. And then proceeds to destroy the terminal.
2019-10-30 20:03:11 +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
e084bf2b0f
Merge branch 'term-init-cleanup' 2019-10-30 18:07:22 +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
18921f7f45
term: move client startup to a new function, slave_spawn() 2019-10-30 18:05:03 +01:00
Daniel Eklöf
348f3738da
term: break out font initialization to a separate function 2019-10-30 17:50:12 +01:00
Daniel Eklöf
7dcd6b7d55
term: break out render worker threads initialization to a separate function 2019-10-30 17:45:59 +01:00
Daniel Eklöf
54accd8060
term: break out color cube initialization to a separate function 2019-10-30 17:40:09 +01:00
Daniel Eklöf
8d6817a999
term: require all font variants to load 2019-10-30 17:37:30 +01:00
Daniel Eklöf
ad0f8a02d5
Merge branch 'fdm' 2019-10-30 17:31:44 +01:00
Daniel Eklöf
ce5f5e4d51
slave: rename slave_spawn() -> slave_exec() 2019-10-30 17:30:58 +01:00
Daniel Eklöf
a42df2434b
scrollback: regression: fix rendering of scrollback diffs less than a screen
When doing "small" scrolls (typically done via mouse wheel or
similar), we render the scrolling by emitting a "scroll damage".

A recent commit changed how scroll damage is rendered; only when the
view is at the bottom ("following" the screen output) do we render the
damage.

To fix this, add a new type of scroll damage,
SCROLL_DAMAGE_IN_VIEW and SCROLL_DAMAGE_REVERSE_IN_VIEW.

These signal to the renderer that it should always render the damage.
2019-10-29 21:09:37 +01:00
Daniel Eklöf
4ec9db8e18
term: no need to stack-allocate an array of worker contexts 2019-10-28 19:23:41 +01:00
Daniel Eklöf
8e6f87eb17
render worker context: allocate, and let worker threads free
Since we now initialize the worker threads from term_init(), which
returns before the threads terminate, we can no longer use
stack-allocated worker contexts.

We _could_ put them in the terminal struct. But a simpler solution is
to allocate them in term_init(), and let the threads free them when
they don't need them anymore.
2019-10-28 18:51:04 +01:00
Daniel Eklöf
720d0df067
term: open FDs before allocating terminal struct 2019-10-28 18:46:03 +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
89cec15920
render: regression: don't apply scroll damage when view is in scrollback
When user has scrolled back in the output history, new output should
not trigger scrolling.

This was true for normal cell rendering, which renders the cells *in
view*, not caring where the "front" of the output is.

However, we still applied scroll damage. I.e. we memmoved part of the
screen.

The fix is simple; only apply scroll damage when the view is at the
front of the output.
2019-10-28 17:58:44 +01:00
Daniel Eklöf
957fb25559
wayland: move reload_cursor_theme() and update_cursor_surface() to wayland 2019-10-27 19:36:45 +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
9a31c1ed96
wayland: free wayland/wl_window instances 2019-10-27 19:16:42 +01:00
Daniel Eklöf
6314de554d
wayl_destroy: early return on NULL 2019-10-27 19:16:25 +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
33e4b8a5b8
wayland: pull in sys/time.h, for 'struct timeval' 2019-10-27 18:46:36 +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
0120c57ed5
wayland: move wayland struct definitions to a separate file 2019-10-27 13:06:39 +01:00
Daniel Eklöf
a2b3cc6cfe
term: convert anonymous 'window' struct to named 'wl_window' struct 2019-10-27 13:04:26 +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
293adbb295
PKGBUILD: fix breakage after pacman 5.2 upgrade 2019-10-24 21:21:44 +02:00
Daniel Eklöf
6643fe5456
completions: add zsh completions 2019-10-20 11:54:58 +02: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
6fd4f6000b
font: glyph_for_wchar(): ensure glyph->valid == false, in *all* error cases 2019-10-18 19:50:48 +02:00
Daniel Eklöf
3c42691e1b
font: load fallback fonts on demand
When instantiating a primary font, build the fallback font list, but
don't actually instantiate the fallback fonts.

Instead, remember the (full) pattern that we should use if/when we
instantiate it.

Then, when looking up a glyph and we need a fallback font, loop the
list and instantiate the font(s) there and then.
2019-10-17 17:53:03 +02:00
Daniel Eklöf
e218e19ea3
font: load all fallbacks when instantiating a primary font
The caching of fallback fonts didn't work. It "worked" because we
didn't free the fonts... When we started doing that, the fallback
fonts were no longer cached.

Another solution would have been to keep the cached fallback fonts
around until exit, and free them there. But that didn't seem very
clean.

So, for now, load *all* fallbacks when instantiating a
primary (non-fallback) font.

Note that this slows down initial startup time.
2019-10-17 17:43:40 +02:00
Daniel Eklöf
5a80bcff18
font: rename cache -> glyph_cache 2019-10-17 17:12:04 +02:00