Commit graph

970 commits

Author SHA1 Message Date
Daniel Eklöf
ae91c53fb2
font: pass dpi=96 to fontconfig
TODO: use actual output PPI. Question is *which* output...
2019-11-26 19:02:35 +01:00
Daniel Eklöf
204bfa02f4
wayland: calculate output PPI (pixels-per-inch) 2019-11-26 19:02:35 +01:00
Daniel Eklöf
bc86cd61c7
font: move metrics from terminal struct to font struct 2019-11-26 19:02:35 +01:00
Daniel Eklöf
431800a8a5
font: cleanup and return error when failing to load font file 2019-11-25 20:17:15 +01:00
Daniel Eklöf
a277eaeb31
font: use FT_Set_Pixel_Sizes() instead of FT_Set_Char_Size()
Since we're working with pixel sizes anyway...
2019-11-25 20:14:48 +01:00
Daniel Eklöf
36ed308723
gitignore: makepkg generated directories (pkg + src) 2019-11-24 18:46:35 +01:00
Daniel Eklöf
b6ae775903
Merge branch 'dont-use-git-submodules-in-subprojects' 2019-11-24 15:38:58 +01:00
Daniel Eklöf
55d65e049f
tllist: import static copy under 'subprojects' 2019-11-24 15:38:31 +01:00
Daniel Eklöf
5d409ce276
tllist: add git submodule under 'external' 2019-11-24 15:37:59 +01:00
Daniel Eklöf
0c8f7f2694
tllist: completely remove 2019-11-24 15:36:51 +01:00
Daniel Eklöf
34f699657a
generate-version: handle builds that aren't git clones 2019-11-24 13:59:33 +01:00
Daniel Eklöf
e333bd2176
input: document why wayl->focused may be NULL 2019-11-24 00:06:50 +01:00
Daniel Eklöf
721ac4ab31
wayland: change disconnected log type from err -> warn 2019-11-23 13:56:11 +01:00
Daniel Eklöf
50bcfbf086
PKGBUILD: update url to point to new hosting service 2019-11-23 12:41:50 +01:00
Daniel Eklöf
1a68a7cf0b
input: improve behavior when sway bugs out
When we receive a keyboard_key or pointer_motion event without first
having received a keyboard_enter or pointer_enter event (that being
the "sway bugs" part), we generally don't know _which_ terminal window
the event was intended for.

However, if we only have *one* window open (always the case for a
regular 'foot' process, or when there's a single footclient connected
to a foot server process), then obviously we can "guess" which window
the event was intended for... so do that.

Now, the only time the event is ignored is when we're a server process
with more than one window open (= more than one footclient connected).
2019-11-22 22:28:41 +01:00
Daniel Eklöf
937fd6933b
input: use xkb_keymap_key_repeats() to determine if we should start repeat timer 2019-11-22 22:19:00 +01:00
Daniel Eklöf
fd82ffdf52
input: keyboard_key: don't start repeater unless we generated output
I.e. what we're effectively doing is *not* repeating modifier
keys.

Besides being the "right" thing to do, this also works around another
Sway 1.2 bug, where being in a focused foot window and then switching
to a vt and back would cause us to be stuck in an endless key repeat
loop that would only stop when unfocusing, focusing back and then
unfocusing once again.
2019-11-22 22:02:50 +01:00
Daniel Eklöf
9d24e68e62
input: workaround buggy Sway sending bad input events
Sway 1.2 has been seen sending keyboard_key() events without first
sending a keyboard_enter() event.

This can be triggered by:

1. start a foot terminal
2. unfocus it (move focus to another window)
3. switch to a vt
4. switch back to sway
5. focus the foot terminal

At this point, Sway will *not* send the keyboard_enter() event, but
instead send a keyboard_key() event.

(furthermore, if you now unfocus the window again, sway will send a
keyboard_leave() event, still without having sent a keyboard_enter()
event).

Sway has _also_ been seen crashing in wl_pointer_motion(). Though this
was in a build without proper debug information, everything points to
a similar issue - i.e. sway is sending a motion event without first
having sent an enter event.

Workaround this by detecting this and logging a warning the first time
it happens. The event is then ignored.
2019-11-22 22:00:26 +01:00
Daniel Eklöf
fc7069e1a6
selection: text_to_clipboard: assert the clipboard serial is not 0 2019-11-22 21:55:47 +01:00
Daniel Eklöf
f9e7ae8a89
selection: selection_to_clipboard: exit early on no-selection
When there's no selection, exit early to avoid trying to get grid data
from row -1.
2019-11-22 21:55:47 +01:00
Daniel Eklöf
da92abef31
selection: we already have a direct pointer to the clipboard struct 2019-11-22 21:55:46 +01:00
Daniel Eklöf
34eac2dbe3
keyboard repeat: pass current input serial to keyboard_key()
This fixes an assertion when holding in ctrl+shift+c (copy to
clipboard); subsequent "presses" would set the clipboard serial to 0,
which we would then assert on in the next iteration when we tried to
cancel the previous copy.
2019-11-22 21:55:46 +01:00
Daniel Eklöf
ee45c48deb
term: shutdown: handle *not* being unmapped
When we're shutting down a terminal, we destroy our Wayland window,
and assume that will unmap us.

There are cases when this isn't true (most likely when e.g. a screen
locker is active, and the unmap is being deferred).

Handle by explicitly setting focused to NULL.
2019-11-21 18:18:35 +01:00
Daniel Eklöf
8c945c9832
input: may get keyboard_exit() event with no focused terminal
This happens on Sway when exiting a screen locker. Or at least that's
when we see the problem; it's unclear if the event occurs when
starting the screen locker, or when exiting it. Or maybe its both.

Anyway, don't try to unfocus a NULL-terminal.
2019-11-21 18:17:02 +01:00
Daniel Eklöf
55a23a5b29
log: set syslog facility to LOG_DAEMON when run in server mode 2019-11-20 19:43:31 +01:00
Daniel Eklöf
4f4ee5b39d
main: mention why we initialize a font set
Since fonts are destroyed and removed from the font cache when the
last instance is destroyed, closing the "last" terminal window in
server mode would destroy the fonts, and their glyph caches.

By instantiating the set in main, we ensure the fonts, and the glyph
caches, remain. This makes launching new terminals (much) faster.

Note that in "normal" (non-server) mode, this isn't really necessary,
but also doesn't have any penalty.
2019-11-20 19:27:16 +01:00
Daniel Eklöf
f3d212224b
README: here -> hear (doh!) 2019-11-20 11:59:11 +01:00
Daniel Eklöf
e87612fecb
Revert "PKGBUILD: set b_pgo=generate in first call to meson"
This reverts commit 7c2dd93690.

Or repeated pkgbuilds will fail since the first meson call
doesn't *re*configure an already configured build tree, causing us to
build with pgo=use when we should be using pgo=generate.
2019-11-20 10:45:15 +01:00
Daniel Eklöf
1bc9835246
Revert "input: remove unneeded(?) term_reset_view() calls"
This reverts commit 739c5cf7f0.

The original commit stated:

  Not sure why these were added here; they don't appear to be
  needed (we're writing to the client - it's up to the client to echo
  stuff, in which case we redraw as usual).

But, client output doesn't cause a scrollback/view reset.
2019-11-20 10:41:40 +01:00
Daniel Eklöf
fc961bb30e
PKGBUILD: add check() 2019-11-20 10:36:12 +01:00
Daniel Eklöf
a8c0770ce2
PKGBUILD: run 'ninja test' in pgo=generate phase
Otherwise the build fails in the pgo=use phase.
2019-11-20 10:35:44 +01:00
Daniel Eklöf
7c2dd93690
PKGBUILD: set b_pgo=generate in first call to meson
This avoids a meson re-configure right off the bat.
2019-11-20 10:34:57 +01:00
Daniel Eklöf
8deba5fdb7
font: don't spam failures to lookup glyphs 2019-11-20 10:23:17 +01:00
Daniel Eklöf
3c8a87168a
fonts: use 'weight' and 'slant', not 'style' when loading fonts 2019-11-19 17:35:02 +01:00
Daniel Eklöf
7b55f90b5b
doc: foot.1: highlight 'command' in the synopsis 2019-11-19 15:36:15 +01:00
Daniel Eklöf
1980345618
osc: copy to/from clipboard: alias 's' to 'p'
'p' means 'primary', while 's' means 'selection'. Thus, a client can
now request 'selection' clipboard data and will receive it from the
primary selection.
2019-11-19 14:05:31 +01:00
Daniel Eklöf
e8c0bf6350
doc: foot.1: fix highlighting of reference to footclient 2019-11-19 14:02:17 +01:00
Daniel Eklöf
20765a04d6
README: add 'server mode' to the index 2019-11-19 00:18:02 +01:00
Daniel Eklöf
73e2d2acde
README: write a section about the server mode 2019-11-19 00:17:13 +01:00
Daniel Eklöf
0ad975374a
README: mention 'server mode' in the feature list 2019-11-19 00:01:55 +01:00
Daniel Eklöf
248935cce6
tllist: switch to codeberg repo + bump 2019-11-18 22:28:31 +01:00
Daniel Eklöf
28131e9dc9
ci: run unit tests 2019-11-18 17:03:30 +01:00
Daniel Eklöf
4cc9b15f55
ci: verbose ninja output 2019-11-18 17:03:19 +01:00
Daniel Eklöf
310ead65ec
meson: add 'version' dependency to footclient
footclient (`client.c`, to be precise) includes `version.h`, which is
a generated file.
2019-11-18 17:01:34 +01:00
Daniel Eklöf
df9a77663c
tllist: bump 2019-11-18 16:55:07 +01:00
Daniel Eklöf
443e568ddd
terminfo: add tab stop related entries, hts and tbc
hts - Horizontal Tab Set (?)
tbc - Tab Clear
2019-11-18 13:03:35 +01:00
Daniel Eklöf
d41c4b9195
csi: implement "Send Device Attributes (Tertiary DA)" 2019-11-18 12:46:52 +01:00
Daniel Eklöf
612bf9ef4f
csi: adjust reply to primary DA
Report us as being VT220, as VT420 causes vttest to send a
DECRQSS. This is a DCS request that we don't implement (there's no DCS
handling *at all* - all DCS strings are ignored).

Should be ok as no one appears to care about this one. Other terminals
report a much lower level (urxvt for example, replies with vt100. We
used to reply with vt102, which also was fine).
2019-11-18 12:41:10 +01:00
Daniel Eklöf
2c99f692b3
csi: improve "Send Device Attributes (Primary DA)"
Pretend we're a VT420, with a couple of supported features
indicated. Note that I haven't verified we support *everything* that
each features entails - or even what exactly a feature *is* (locator
port?)
2019-11-18 12:07:17 +01:00
Daniel Eklöf
aa692d19e4
csi: document "Send Device Attributes (Secondary DA)" 2019-11-18 12:06:29 +01:00