Commit graph

2454 commits

Author SHA1 Message Date
Daniel Eklöf
d49d1fd59d
input: scrolling: don't send events to client if cursor is outside grid 2020-08-07 22:07:16 +02:00
Daniel Eklöf
76c3629cbf
input: mouse: motion/enter: cleanup inside/outside grid handling 2020-08-07 22:04:37 +02:00
Daniel Eklöf
0a9aa2dd32
changelog: 'of' -> 'in' 2020-08-07 20:08:30 +02:00
Daniel Eklöf
4178418010
input: button: button events aren't passed to clients, when cursor is outside grid
Don't send mouse button escapes to a mouse grabbing client when the
cursor is outside the grid (i.e. when it is inside the margins).

Also don't do *any* kind of selection when the cursor is outside the
grid. Previously, we only checked this for selection_start(), but
e.g. double clicking would run selection_extend(), or
selection_mark_word() etc.
2020-08-07 19:59:03 +02:00
Daniel Eklöf
721ca80abe
input: motion: do selection update even if cursor is outside the grid
Previously, the selection was only updated when the mouse cursor was
inside the grid. This makes it difficult to e.g. do large selections
fast, since you often end up moving the cursor outside the grid, or
outside the terminal window even.

Now, we update the selection regardless of *where* the cursor is. This
is done by bounding the row/col we pass to 'selection_update()' to the
grid, while still setting the seat's row/col to -1 when the cursor is
outside the grid, to ensure the xcursor etc are set correctly.

Care must also be taken to *not* pass any motion events to a mouse
grabbing client, when the cursor is outside the grid.

Closes #70.
2020-08-07 19:58:56 +02:00
Daniel Eklöf
158722b642
input: fix col/row calculation when cursor is in the top or left margin
This fixes an issue where the col/row were incorrectly set to 0
instead of -1, when the mouse cursor was inside the grid margins.

This resulted in e.g. the mouse cursor having the wrong shape, and
foot incorrectly handling mouse events as if they were inside the
grid.
2020-08-07 19:51:34 +02:00
Daniel Eklöf
f952d5a305
Merge branch 'syslog' into master 2020-08-07 12:19:54 +02:00
Daniel Eklöf
e0e3ab0ae7
Merge branch 'xstrndup+xrealloc' into master 2020-08-07 12:17:49 +02:00
Craig Barnes
4564c82513 xmalloc: add xrealloc() and xstrndup() functions 2020-08-07 01:05:04 +01:00
Craig Barnes
8541ce10a2 log: simplify _sys_log() function 2020-08-06 23:31:21 +01:00
Daniel Eklöf
22eed3e579
Merge branch 'desktop-keywords' into master 2020-08-06 23:32:25 +02:00
Daniel Eklöf
41b4bfe792
ci: disable freebsd-x64 and alpine-x86
Disabled freebsd since foot hasn't been ported to freebsd yet.
Disabled alpine x86 since builds.sr.ht doesn't yet support non-x64 builds.
2020-08-06 23:28:06 +02:00
Daniel Eklöf
c9fd046310
ci: new: alpine x86 2020-08-06 23:25:53 +02:00
Daniel Eklöf
019b6bc039
fix printf-format errors in 32-bit builds 2020-08-06 23:20:46 +02:00
Birger Schacht
056099149d Add keywords to desktop files
The desktop entry specification lists 'Keywords' to acilitate searching
through entries.
https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html
These initial values are based on the keywords from gnome-terminal.
2020-08-06 20:36:03 +02:00
Daniel Eklöf
644859019e
Merge branch 'xmalloc' into master 2020-08-06 12:18:36 +02:00
Craig Barnes
014019e98d xmalloc: log error to syslog() in fatal_error() function 2020-08-05 20:11:51 +01:00
Craig Barnes
f1fce96a1d config: handle allocation failure explicitly 2020-08-04 23:28:16 +01:00
Daniel Eklöf
c07d14e1c0
grid: reflow: don't insert <width> spacer cells for *every* empty cell
Only do it for the last, non-empty cell.
2020-08-04 18:07:54 +02:00
Daniel Eklöf
32a155fbf4
input: disable debug loggin 2020-08-04 18:07:41 +02:00
Daniel Eklöf
4919ccbc70
term: remove unusued 'damage' list 2020-08-04 18:07:22 +02:00
Daniel Eklöf
a371ea0f02
input: ignore ISO Level 3 Shift (AltGr) when hiding the mouse cursor 2020-08-04 07:38:21 +02:00
Daniel Eklöf
d929862245
config: move cursor.hide-when-typing to mouse.hide-when-typing 2020-08-04 07:33:15 +02:00
Daniel Eklöf
8f04e898af
footrc: add new option 'scrollback.multiplier' 2020-08-03 20:12:31 +02:00
Daniel Eklöf
61bd21c6f3
Merge branch 'scrollback-multiplier' into master 2020-08-03 20:11:58 +02:00
Daniel Eklöf
36468b0406
config: add scrollback.multiplier option
This option is used to multiply the mouse scroll amount for mouse and
trackpad based scrollback scrolling.

Closes #54.
2020-08-03 20:08:39 +02:00
Daniel Eklöf
93b03c91ed
input: hide-when-typing: ignore modifiers 2020-08-03 18:19:43 +02:00
Daniel Eklöf
2ee9830e2a
changelog: add craigbarnes to 'contributors' for the upcoming release 2020-08-03 08:17:26 +02:00
Daniel Eklöf
6e826d0e0a
Merge branch 'footclient-man-synopsis' into master 2020-08-03 07:54:37 +02:00
Daniel Eklöf
2f679694a5
Merge branch 'e-escape' into master 2020-08-03 07:52:52 +02:00
Craig Barnes
657c98d520 doc: fix "SYNOPSIS" section in footclient(1) man page 2020-08-03 02:53:25 +01:00
Craig Barnes
11a1d99da7 Replace non-portable "\e" escape in string literals with "\033" 2020-08-02 23:54:04 +01:00
Daniel Eklöf
91da76656c
config: clean up
Better parsing means we catch syntax errors earlier, meaning we can
remove some of the checks.
2020-08-02 20:01:07 +02:00
Daniel Eklöf
73b33afff2
Merge branch 'socket-path-uses-wayland-display-instead-of-xdg-session-id' into master 2020-08-02 19:28:44 +02:00
Daniel Eklöf
5e26d3ef47
server/client: use $WAYLAND_DISPLAY instead of $XDG_SESSION_ID in default socket path
Foot is a Wayland client and cannot be run outside of a Wayland
session. As such, it makes more sense to use $WAYLAND_SESSION instead
of $XDG_SESSION_ID in the default socket path since this makes it
clearer which Wayland session we belong to.

Closes #55.
2020-08-02 13:10:31 +02:00
Daniel Eklöf
387e8de751
main: update --help with correct default path for -s,--server
I missed this in f3c301ee8b when fixing
2020-08-02 12:41:48 +02:00
Daniel Eklöf
f3c301ee8b
doc: foot.1: fix default path in -s,--server
The documentation incorrectly stated that the default path is
$XDG_RUNTIME_DIR/foot.sock.

The correct default path is

* $XDG_RUNTIME_DIR/foot-$XDG_SESSION_ID.sock
* $XDG_RUNTIME_DIR/foot-no-session.sock
* /tmp/foot.sock

Depending on whether XDG_RUNTIME_DIR and XDG_SESSION_ID has been set
or not.

This also removes the '<>' from the default when XDG_SESSION_ID is not
set.

Closes #53.
2020-08-02 12:32:10 +02:00
Daniel Eklöf
a026938547
input: don't hide cursor if key is 'shift'
Since shift is used to enable selecting text in mouse-grabbing
applications, hiding the cursor in this case is counter productive.
2020-08-01 15:39:25 +02:00
Daniel Eklöf
bae3244ec6
Revert "slave: use an event FD to communicate errors after fork before exec"
This reverts commit 027a8de6f5.

I was a bit quick on this one, and only tested error cases. Turns out,
this causes foot to hang in a blocking read(3) on the event FD.

This is because while the FD has FD_CLOEXEC, that flag is per file
descriptor. I.e. the forked copy of the event fd is closed when we
exec(), but since this isn't a pipe, nothing is signaled to the parent
process, which thus remains blocking in read(3) since its copy of the
event fd hasn't been closed.

We _could_ write a dummy value on the event fd just before exec(), but
then we wouldn't be able to catch errors from exec() self - only
errors *before* exec().
2020-08-01 09:41:31 +02:00
Daniel Eklöf
027a8de6f5
slave: use an event FD to communicate errors after fork before exec
Replace the pipe we used to communicate errors after fork(), but
before exec() to the parent process with an event FD.

The overhead in the kernel is much lower to setup an event fd,
compared to a pipe.
2020-08-01 09:33:43 +02:00
Daniel Eklöf
c8e78674ed
slave: emit user-notifications before dup:ing stdin/stdout/stderr
Since we need to restore the status flags anyway, there's nothing to
gain from emitting the user notifications after dup:ing the pts file
descriptor.

On the other hand, emitting user notifications *before* dup:ing means
we can still print error messages for e.g. write(3) errors.
2020-08-01 09:00:18 +02:00
Daniel Eklöf
7e93405b1a
slave: user-notifications: skip the O_NONBLOCK dance when there aren't any notifications 2020-07-31 19:52:50 +02:00
Daniel Eklöf
1da8142f32
slave: restore pts file status flags after emitting user-notifications
We (need to) set O_NONBLOCK on the pts file description before
emitting the user-notifications, to ensure we don't block in write(3).

However, since file status flags are per *file*, not per
file *descriptor*, this ends up setting O_NONBLOCK on the dup:ed
stdin/stdout/stderr file descriptors too.

Not all clients want this, or can handle this.

Thus we need to restore the original flags before exec:ing the client.

This fixes "makepkg" build failures.
2020-07-31 18:13:00 +02:00
Daniel Eklöf
a7d21c5c7f
slave: user-notifications: don't block in write(3)
The main process is blocking and waiting for us to close the error
pipe (in exec(3), via O_CLOEXEC).

Thus, pts data will *not* be processed until we've exec:d the shell.

Because of this we must not write too much and block in write(3). Do
this by setting O_NONBLOCK on the pts fd (*after* dup:ing it to
stdin/stderr/sdout) and watch for EAGAIN EWOULDBLOCK.
2020-07-31 17:15:51 +02:00
Daniel Eklöf
b661513245
slave: user-notifications: emit errors first, then warnings and last deprecations 2020-07-31 17:10:39 +02:00
Daniel Eklöf
9b0376efc3
config: pipe-*: fix length calculation of the pipe command substring 2020-07-31 17:10:12 +02:00
Daniel Eklöf
d4ee9be4d7
config: add 'hide-when-typing'
When enabled, the mouse cursor is hidden when the user types in the
terminal. It is un-hidden when the user moves the mouse, or when the
window loses keyboard focus.
2020-07-31 17:09:06 +02:00
Daniel Eklöf
b00dfcf7b6
config: configuration errors are no longer fatal
Instead of refusing to start foot on configuration errors, we start
and print a user-notification.
2020-07-31 17:07:14 +02:00
Daniel Eklöf
639a61abd8
config: add 'pipe-selected' key binding
This works just like pipe-visible and pipe-scrollback, but pipes the
user-selected text, if any, to the external tool.

Closes #51
2020-07-31 17:04:30 +02:00
Daniel Eklöf
33e25e7f93
install: tllist is a *build* dependency, not a *runtime* dependency 2020-07-31 16:59:23 +02:00