Commit graph

2197 commits

Author SHA1 Message Date
Daniel Eklöf
96f480b14d
render: doh! flush the last surface damage *outside* of the rendering loop 2020-07-13 14:18:43 +02:00
Daniel Eklöf
74c3b4be1a
main: free 'cwd' at exit
This fixes an issue where e.g. failing to initialize the Wayland
backend would leave cwd un-free:d
2020-07-13 14:17:55 +02:00
Daniel Eklöf
ed620f1854
render: render_margin: add 'damage_{top,bottom,left,right}' arguments 2020-07-13 14:06:02 +02:00
Daniel Eklöf
0336f47f05
render: render_margin(): remove top/bottom arguments
All calls to render_margin() set top=true and bottom=true anyway.
2020-07-13 14:03:58 +02:00
Daniel Eklöf
9f21799cb2
render: merge wl surface damage for consecutive dirty rows 2020-07-13 13:44:52 +02:00
Daniel Eklöf
09bdf20aa0
render: keep lock while pushing dirty rows to worker queue
Instead of locking the queue for each dirty row we append, and
signaling a condition variable, just keep the lock while going through
the visible rows.

Release the lock once done.

Since we take the lock *before* posting the 'start' semaphore, all
workers will be waiting for the lock to be released.

Then, one at a time they'll get the lock and pick a row to
render. The queue will never get empty - when all rows have been
rendered, each worker will pick a 'frame done' "job" from the queue,
and break the rendering loop.
2020-07-13 13:27:23 +02:00
Daniel Eklöf
669d36afa8
Merge branch 'renderer-dont-special-case-cursor-cell' 2020-07-13 13:22:09 +02:00
Daniel Eklöf
58f0bf5ff3
doc: foot.5: 'runtime' -> 'at runtime' 2020-07-12 20:23:54 +02:00
Daniel Eklöf
fe6c228b13
render: don't render cursor when it has been explicitly hidden 2020-07-12 13:08:19 +02:00
Daniel Eklöf
2bdd0a7c80
render: remove most of the special handling of cursor rendering
Previously, we had to explicitly render the old cursor cell *before*
applying scrolling damage.

We then rendered all the dirty rows, *without* rendering the cursor -
even if the cursor cell was among the dirty rows.

Finally, when everything else was done, we explicitly rendered the
cursor cell.

This meant a lot of code, and unnecessary render_cell() calls, along
with unnecessary wl_surface_damage_buffer() calls.

This was a necessary in the early design of foot, but not anymore.

We can simply mark both the old cursor cell, and the current one, as
dirty and let the normal rendering framework render it. All we need to
do is pass the cursor column to render_row(), so that it can pass
has_cursor=true in the appropriate call to render_cell(). We pass -1
here for all rows, except the cursor's row, where we pass the actual
cursor column.

With this, there's no need to calculate whether the cursor is visible
or not; just mark it's cell as dirty, and if that row is visible, the
normal rendering will take care of it.

This also simplifies the state needed to be saved between two frames;
we only need a row pointer, and the cursor column index.

Part of https://codeberg.org/dnkl/foot/issues/35
2020-07-12 12:56:10 +02:00
Daniel Eklöf
0bdbf45418
changelog: hollow cursor is now based on keyboard focus, not visual focus 2020-07-11 18:43:50 +02:00
Daniel Eklöf
ab875c824a
term: update cursor on kbd focus changes, not visual focus changes 2020-07-11 11:14:32 +02:00
Daniel Eklöf
b5776487ab
input: include seat name in debug log output 2020-07-11 11:13:45 +02:00
Daniel Eklöf
12a1688ce3
render: use kbd-focus instead of visual focus for hollow block cursor
When determining whether we should render a hollow block cursor,
i.e. to signal that we're unfocused, base the decision on the
terminals current keyboard focus, not visual focus.
2020-07-11 09:06:36 +02:00
Daniel Eklöf
7d8974f930
term: remove term_has_kbd_focus(), use term->kbd_focus instead 2020-07-11 09:06:20 +02:00
Daniel Eklöf
8c72e9434e
term: cache kbd-focused state, just like we cache visual focus state
There's one difference however, when we receive a kbd unfocus call,
*all* seats must have us unfocused before we actually change the
state.
2020-07-11 09:04:46 +02:00
Daniel Eklöf
ed0cb06b48
Merge branch 'multi-seat'
Closes #32
2020-07-11 08:30:47 +02:00
Daniel Eklöf
1c13061f35
wayland: destroy cursor theme when removing pointer capability 2020-07-10 19:32:48 +02:00
Daniel Eklöf
5677df629e
wayland: seat: instantiate pointer surface in capabilities event
This way we only instantiate the surface for seats that actually have
a pointer.
2020-07-10 19:24:33 +02:00
Daniel Eklöf
bf62519d83
wayland: read XCURSOR_{THEME,SIZE} in reload_xcursor theme 2020-07-10 12:06:55 +02:00
Daniel Eklöf
71584aed38
seat: use separate 'enter' serials for keyboard and mouse 2020-07-09 11:20:46 +02:00
Daniel Eklöf
4e48d550ef
multi-seat: improve handling of multiple (mouse) pointers
* xcursor always set for all pointers
* xcursor sometimes not updated when it should be
* mouse grabbed state wasn't per seat, but global (i.e. "does at least
  one seat enable mouse grabbing")
* selection enabled state wasn't per seat
2020-07-09 09:52:11 +02:00
Daniel Eklöf
699cbaf380
readme: add multi-seat support to the feature list 2020-07-09 09:18:18 +02:00
Daniel Eklöf
3397e735a5
changelog: add multi-seat support 2020-07-09 09:17:42 +02:00
Daniel Eklöf
6bbd4a5110
focus in/out: terminal checks whether it is a state change or not 2020-07-09 09:16:54 +02:00
Daniel Eklöf
a6da07b3dd
wayland: globals: destroy: seat: use keyboard/pointer listener interfaces 2020-07-09 08:52:39 +02:00
Daniel Eklöf
b6342bb36d
wayland: globals: destroy: handle seats being destroyed 2020-07-09 08:47:56 +02:00
Daniel Eklöf
fc9fde88c3
input: only call term_kbd_focus_{in,out}() on actual state change
That is, only call term_kbd_focus_in() if we're the *first* seat
focusing that terminal, and only call term_kbd_focus_out() if we're
the *last* seat that focused it.
2020-07-09 08:46:25 +02:00
Daniel Eklöf
98f3ccfe79
wayland: log: be clear that these are the XCRUSOR_* environment variables 2020-07-08 20:04:02 +02:00
Daniel Eklöf
d377221e24
xcursor: trigger theme reload in pointer-enter event
Previously, we triggered a theme reload on output changes. This is
completely wrong. We may get a new output with a scale different from
the output the pointer is actually on.

Now, we store the current scale along with the theme. We then trigger
a call to reload the xcursor theme *every* time the pointer enters a
surface. When it does, we use the current scale factor of the terminal
that owns that surface.

If the terminal covers multiple outputs, with different scale factors,
we'll use the largest scale factor. This may not be 100% correct. But
to fix that, we'd need to track which regions of a surface are mapped
on which outputs. Too complicated I say.
2020-07-08 19:52:17 +02:00
Daniel Eklöf
5539af2597
wayland: seat: log keyboard/pointer capability 2020-07-08 19:30:34 +02:00
Daniel Eklöf
11373a6561
multi-seat: re-enable OSC 52 support 2020-07-08 19:28:08 +02:00
Daniel Eklöf
4c7d29f7eb
multi-seat: re-enable selection support (excluding OSC 52) 2020-07-08 18:41:09 +02:00
Daniel Eklöf
04e566492c
multi-seat: re-enable scrollback search support 2020-07-08 18:20:34 +02:00
Daniel Eklöf
58415428cf
multi-seat: re-enable mouse button+motion reporting support 2020-07-08 18:16:43 +02:00
Daniel Eklöf
be2490022d
multi-seat: enable xcursor theme support again 2020-07-08 18:08:39 +02:00
Daniel Eklöf
c470825067
wip: multi-seat support
Compiles and runs, but mouse, clipboard and other things have been
disabled.
2020-07-08 16:45:26 +02:00
Daniel Eklöf
bd0a003a4c
meson/PKGBUILD: bump fcft requirement to 2.2.0 2020-07-07 11:57:07 +02:00
Daniel Eklöf
69e4213e4a
term: don't use deprecated fcft_size_adjust()
When resizing the font on-the-fly, we now do a complete
font-reload (this is basically what fcft_size_adjust() did anyway).

To get the correct size, we maintain the current size ourselves.

We get the initial size from the user-provided font pattern, by
converting the string to an FcPattern, and using FcPatternGet() to
retrieve both the FC_SIZE and FC_PIXEL_SIZE attributes. These
attributes are then removed from the pattern, and the pattern is
converted back to a string.

The terminal struct maintains a copy of the font sizes. These are
initially set to the sizes from the config.

When the user resizes the font, the terminal-local sizes are
adjusted. To ensure the primary and user-configured fallback fonts are
resizes equally much, convert any pixel sizes to point sizes at this
point.

When the font size is reset, we reload the font sizes from the
config (thus once again returning actual pixel-sizes, if that's what
the user has configured).
2020-07-07 10:44:55 +02:00
Daniel Eklöf
3063204289
sixel: overwrite_by_row: handle case where 'width' goes past end of row
Cap 'width' to maximum number of columns available.
2020-07-07 10:42:59 +02:00
Daniel Eklöf
b1214bf635
readme: wiki: 'faq' has been renamed to 'troubleshooting' 2020-06-30 19:49:55 +02:00
Daniel Eklöf
45b7db06bf
readme: add link to FAQ in the wiki 2020-06-30 19:43:10 +02:00
Daniel Eklöf
c3cf05f8fb
doc: foot.5: make it clear that 'login-shell' is a boolean option 2020-06-30 17:46:35 +02:00
Daniel Eklöf
db7a51e3a4
changelog: grammar 2020-06-30 17:46:25 +02:00
Daniel Eklöf
a259eda535
config: add 'blink' option to cursor section in footrc
This option controls whether the default cursor should blink or
not. The default is to *not* blink.
2020-06-30 17:45:34 +02:00
Daniel Eklöf
7f65bd1c20
csi: '\E[0 q' resets the cursor style to the default, not '\E[2 q'
Also update 'Se' capability in the terminfo, to reflect this.
2020-06-30 17:44:43 +02:00
Daniel Eklöf
fd4904d82a
csi: debug: print 'private' *after* parameters 2020-06-30 17:42:57 +02:00
Daniel Eklöf
08309537ce
Merge branch 'sixel-performance' 2020-06-30 17:41:59 +02:00
Daniel Eklöf
fad5838dba
Merge branch 'master' into sixel-performance 2020-06-29 22:03:26 +02:00
Daniel Eklöf
62be729c45
scroll: destroy scrolled out sixels before scroll is applied
The logic that breaks out of sixel loops does not work for rows that
has already wrapped around.

Thus, we need to destroy sixels that are about to be scrolled
out *before* we actually scroll.

Since this is the *only* time we destroy sixels (instead of
overwriting it), rename the sixel functions. And, since they now do a
very specific thing, they can be greatly simplified (and thus faster).
2020-06-29 22:01:02 +02:00