Commit graph

999 commits

Author SHA1 Message Date
Daniel Eklöf
66f941d00a
vt: only define esc_as_string() when debug logging has been enabled 2019-11-30 00:02:19 +01:00
Daniel Eklöf
cd9510aa7b
vt: disable logging BELL 2019-11-30 00:00:41 +01:00
Daniel Eklöf
616896e2a5
csi/ocs/vt: log unhandled/unrecognized sequences as debug messages
Having them as error messages was nice when we where still missing
lots of sequences.

Now we don't anymore, and these just spam stdout as well as syslog
when e.g. cat:ing binary data.
2019-11-29 23:59:24 +01:00
Daniel Eklöf
3026b8981a
vt: there are actually many state transitions that are no-ops
In most states, most 8-bit values are no-ops. This is already handled;
action() recognizes ACTION_NONE as a no-op. Thus, all we need to do is
remove the assertion.
2019-11-29 23:38:01 +01:00
Daniel Eklöf
8b7158703d
term: reset: don't access rows directly
We've just re-set the grid offsets, meaning rows 0..term->rows may not
all have been initialized.

Call grid_row_and_alloc() to ensure they are.
2019-11-29 23:36:04 +01:00
Daniel Eklöf
bf9a9e7b90
term: xcursor: use 'hand2' instead of 'left_ptr' when mouse tracking
Mouse tracking always reports clicks, so using a cursor that suggests
you can click makes sense I think.
2019-11-29 22:30:56 +01:00
Daniel Eklöf
f41788c185
term: xcursor cleanup
Show 'text' cursor when:

* we have no mouse tracking enabled
* forced selection has been enabled (shift being held down)
* We're *not* scrollback searching

In all other cases, show the 'left_ptr' cursor.
2019-11-29 22:15:03 +01:00
Daniel Eklöf
2c12549f93
input: pointer-leave: reset moused *before* doing anything else
And update xcursor. This is currently not necessary, but doesn't hurt.
2019-11-29 22:13:19 +01:00
Daniel Eklöf
6947928a7f
input: pointer-enter: add debug log 2019-11-29 22:12:54 +01:00
Daniel Eklöf
6b9837056e
input: keyboard_leave: reset focused *before* doing anything else
And update xcursor. This is necessary since we may still have mouse
focus. But without keyboard focus, we don't display the 'text'
xcursor.
2019-11-29 22:11:41 +01:00
Daniel Eklöf
876cd6895f
search: update xcursor when starting and ending a search 2019-11-29 22:11:15 +01:00
Daniel Eklöf
c8724fe656
wayland: terminal_from_surface: recognize scrollback search surfaces
This fixes an assertion when hovering over the input field for
scrollback searches.
2019-11-29 22:10:28 +01:00
Daniel Eklöf
304ee33fd6
wayland: always flush after dispatching messages
This means we don't have to e.g. roundtrip when setting the cursor.
2019-11-29 22:09:56 +01:00
Daniel Eklöf
c2e81cd4b2
doc: foot.1: mention that selection is kept after ending a scrollback search 2019-11-29 22:09:08 +01:00
Daniel Eklöf
cb168ec8d7
font: add missing ';' 2019-11-28 21:33:45 +01:00
Daniel Eklöf
bd3f2fdf0e
font: use pixelsizefixupfactor on regular bitmap fonts too, if set
But if it isn't set, only estimate it if the font is a *scalable*
non-outline (bitmap) font.
2019-11-28 21:32:28 +01:00
Daniel Eklöf
b58fd1c205
osc 52: default to 'clipboard' if no source/target has been specified 2019-11-28 20:56:55 +01:00
Daniel Eklöf
2956a7d472
input: keyboard/pointer_leave: warn if we didn't see corresponding enter event 2019-11-28 19:47:00 +01:00
Daniel Eklöf
a319cc813c
input: keyboard/pointer_enter: assert surface != NULL 2019-11-28 19:46:27 +01:00
Daniel Eklöf
0dd37f0a36
terminal: use the 'text' xcursor pointer whenever selection is possible 2019-11-28 19:35:47 +01:00
Daniel Eklöf
729ba8b8ac
input: pointer_button: apply same workaround as in pointer_motion
Sway 1.2 has been seen to send pointer_button events without first
having sent pointer_enter.
2019-11-28 19:26:52 +01:00
Daniel Eklöf
9efa28b4c6
input: sway 1.2 bug: keyboard_leave() called with surface == NULL 2019-11-28 19:24:16 +01:00
Daniel Eklöf
b96fb2ddab
render: fix rendering of cursor when cell is reversed
When the user had configured the cursor color, we failed to
invert (reverse) the foreground and background color when the cursor
was on a cell with the 'reverse' attribute set.
2019-11-28 19:22:21 +01:00
Daniel Eklöf
903581b7eb
async: first synchronous write may succeed partially
When trying to write (to e.g. the slave, or to a clipboard receiver),
we first try to send the data synchronously, and only if that fails do
we switch to asynchronous mode.

However, the first synchronous may (in fact, is likely to) succeed
partially.
2019-11-28 19:20:25 +01:00
Daniel Eklöf
c5602fde96
font: set pixman filter when re-scaling glyph 2019-11-27 21:33:08 +01:00
Daniel Eklöf
5b6c941b0a
generate-version: redirect *both* stdout and stderr to /dev/null 2019-11-27 21:19:59 +01:00
Daniel Eklöf
c18ff22a95
font: estimate pixel size fixup when not provided by fontconfig
But only do this when the font is scalable but not an outline. This is
only true for color bitmap fonts (emoji fonts), and not e.g. regular
bitmap fonts.
2019-11-26 19:02:36 +01:00
Daniel Eklöf
20a8fd6acf
font: use DPI=75 if there's no DPI attribute from fontconfig
This is the fontconfig default as well
2019-11-26 19:02:36 +01:00
Daniel Eklöf
f358211904
font: underline/strikeout: use y-scale, not x-scale 2019-11-26 19:02:35 +01:00
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