Commit graph

1007 commits

Author SHA1 Message Date
Daniel Eklöf
841e20b75b
input: update xcursor on terminal with *keyboard* focus when modifiers change 2019-11-30 12:02:45 +01:00
Daniel Eklöf
c8d94931e6
term: xcursor: use selection_enabled()
Instead of duplicating the code from selection_enabled() that deals
with forced selection, just call selection_enabled().

This was previously not possible since selection_enabled() didn't
require keyboard_focus. Now it does.
2019-11-30 12:01:40 +01:00
Daniel Eklöf
edb78575c7
selection: forced selection requires keyboard focus
Up the requirements for enabling "forced" selection (that is, allowing
selections even though mouse tracking has been disabled).

* Require keyboard focus (if we don't have it, then the shift-key
  isn't is for us)
* Don't just require shift being pressed, but that all other modifiers
  are *not* pressed.
2019-11-30 11:59:47 +01:00
Daniel Eklöf
0e5a69d869
vt: don't try to move cursor outside the terminal
When we insert an auto-newline, we must make sure we don't try to move
outside the terminal window.

This can for example happen when a scrolling region have been
configured, and the cursor is **outside** the scrolling
region (i.e. it's in the bottom margin).
2019-11-30 00:32:34 +01:00
Daniel Eklöf
a81c65caa2
term: reset: set 'origin' to ORIGIN_ABSOLUTE 2019-11-30 00:32:06 +01:00
Daniel Eklöf
8274e3e034
font: never set glyph->cols to something that is less than 0 2019-11-30 00:15:54 +01:00
Daniel Eklöf
88c1a8939f
vt: fix memory corruption: wcwidth() may return -1
When it did, we called print_insert() with that, which in turn
resulted in a too large size value passed to memmove.
2019-11-30 00:15:05 +01:00
Daniel Eklöf
9551be492c
csi/vt: don't bad client data as errors
This gets rid of spam when cat:ing binary data.
2019-11-30 00:12:30 +01:00
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