aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
| * doc: footrc: document modifiers in mouse bindingsDaniel Eklöf2020-08-13-3/+5
| |
| * changelog: modifier support in mouse bindingsDaniel Eklöf2020-08-13-0/+2
| |
| * config: key/mouse bindings: refactor: less parsing in keyboard_enter()Daniel Eklöf2020-08-13-443/+524
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies the handling of mouse and keyboard bindings. Before, the bindings where parsed *both* when loading the configuration, and then on every keyboard enter event. This was done since keys require a keymap to be decoded. Something we don't have at configuration time. The idea was that at config time, we used a default keymap just to verify the key combo strings were valid. The following has changed: * The bindings in the config struct is now *one* key combo per entry. Previously, it was one *action* per entry, and each entry had one or more key combos. Doing it this way makes it easier when converting the binding in the keyboard enter event (which previously had to expand the combos anyway). * The bindings in the config struct no longer contains any unparsed strings. A key binding contains a decoded 'modifier' struct (which specifies whether e.g. ctrl, or shift, or ctrl+shift must be pressed for the binding to be used). It also contains a decoded XKB keysym. * A mouse binding in the config struct is similar to a key binding, except it contains the button, and click count instead of the XKB key sym. * The modifiers in the user-specified key combo is decoded at config time, by using the pre-defined XKB constants XKB_MOD_NAME_<modifier>. The result is stored in a 'modifiers' struct, which is just a collection of booleans; one for each supported modifier. The supported modifiers are: shift, ctrl, alt and meta/super. * The key sym is decoded at config time using xkb_keysym_from_name(). This call does *not* depend on a keymap. * The mouse button is decoded at config time using a hardcoded mapping table (just like before). * The click count is currently hard-coded to 1. * In the keyboard enter event, all we need to do is pre-compute the xkb_mod_mask_t variable for each key/mouse binding, and find all the *key codes* that map to the (already decoded) symbol. For mouse bindings, the modifiers are the *only* reason we convert the mouse bindings at all. In fact, on button events, we check if the seat has a keyboard. If not, we use the mouse bindings from the configuration directly, and simply filter out those with a non-empty set of modifiers.
| * input: pointer-leave: don't reset mouse properties with memset()Daniel Eklöf2020-08-13-1/+6
| | | | | | | | | | Using memset() also clears the mouse bindings. This is both incorrect, and leaked memory.
| * wayland: global-remove: return after finding a matching seatDaniel Eklöf2020-08-13-0/+1
| |
| * wayland: global-remove: fix call to pointer_listener.leave()Daniel Eklöf2020-08-13-5/+9
| | | | | | | | | | Don't call it when we have keyboard focus, call it when we have mouse focus.
| * config: wip: add support for modifiers in mouse bindingsDaniel Eklöf2020-08-13-31/+207
| | | | | | | | | | | | | | Mouse bindings can now include modifiers. They are specified in pretty much the same way as in keyboard bindings: Control+BTN_LEFT
* | input: don't crash on mouse motion events on the render timer surfaceDaniel Eklöf2020-08-14-1/+8
|/
* render: oops... swprintf() needs to number of *chars*, not *bytes*Daniel Eklöf2020-08-13-1/+1
|
* render: fix printf-errors in 32-bit buildsDaniel Eklöf2020-08-13-2/+3
|
* config: add tweak.render-timer optionDaniel Eklöf2020-08-13-55/+158
| | | | | | | | | This can be set to 'none' (the default), 'osd', 'log' or 'both'. When 'osd' is enabled, we'll render the frame rendering time to a sub-surface after each frame. When 'log' is enabled, the frame rendering time is logged on stderr.
* doc: footclient.1: move DESCRIPTION up before OPTIONSDaniel Eklöf2020-08-13-10/+10
|
* doc: foot.1: move DESCRIPTION up before OPTIONSDaniel Eklöf2020-08-13-10/+10
|
* selection: improve handling of multi-column charactersDaniel Eklöf2020-08-13-13/+14
| | | | | * Don't assume multi-column characters are exactly *two* columns * Check for CELL_MULT_COL_SPACER values instead of using wcwidth()
* selection: handle multi-column characters when reversing selection directionDaniel Eklöf2020-08-13-16/+30
|
* changelog: cancelling -> cancelingDaniel Eklöf2020-08-13-1/+1
|
* Merge branch 'selection-inversion' into masterDaniel Eklöf2020-08-13-0/+41
|\
| * selection: adjust start point when the selection changes directionDaniel Eklöf2020-08-12-0/+41
| | | | | | | | | | | | | | | | | | Without this, the initial cell will always be selected, regardless of how the selection is moved to the left or right. With this patch, the initial cell will only be selected while the selection is being made in the original direction. Changing direction of the selection moves the start point to next/previous character.
* | Merge branch 'custom-selection-colors' into masterDaniel Eklöf2020-08-13-8/+33
|\ \ | |/ |/|
| * config: make selection foreground/background colors configurableDaniel Eklöf2020-08-12-8/+33
|/ | | | | | | | | The default is still to inverse the regular foreground/background colors. If the user sets *both* of the new options, selection-foreground and selection-background, those colors will *always* be used for selected cells, instead of inverting the regular foreground/background colors.
* doc: foot.1: don't talk about using '--' on the command lineDaniel Eklöf2020-08-12-3/+2
| | | | This used to be necessary, but isn't anymore.
* search: don't update/refresh match when modifier keys are pressedDaniel Eklöf2020-08-12-0/+3
|
* search: fix viewport not moving if we tried to move it past the scrollback startDaniel Eklöf2020-08-12-21/+57
| | | | | | | | | | | | If the match was somewhere near the scrollback beginning, and if the entire scrollback hadn't yet been filled, we ended up trying to move the viewport past the beginning of the scrollback, which we then adjusted in the wrong direction, causing the viewport to not move at all. Besides being a bad user experience, since the new match wasn't visible, foot would also crash if you manually scrolled up to the match.
* Revert "ci: sr.ht: just testing..."Daniel Eklöf2020-08-11-2/+2
| | | | This reverts commit b7b7b56b3d64d1eca008082331d94eecfd60dfdf.
* ci: sr.ht: just testing...Daniel Eklöf2020-08-11-2/+2
|
* render: fix compilation errors in 32-bit buildsDaniel Eklöf2020-08-11-6/+9
| | | | timeval.tv_usec is an 'unsigned long long' on 32-bit
* ci: gitlab: let's see if we can do 32-bit buildsDaniel Eklöf2020-08-11-4/+24
|
* main: include our own bitness when logging the architectureDaniel Eklöf2020-08-11-1/+1
|
* shm: don't even try to punch a memfd hole in 32-bitDaniel Eklöf2020-08-11-0/+6
| | | | | This ensures we don't issue a warning if we fail, something that will just confuse users, as SHM scrolling is disabled in 32-bit anyway.
* Merge branch 'xmalloc-conversion' into masterDaniel Eklöf2020-08-09-65/+146
|\
| * Handle allocation failures explicitly in *_init() functionsCraig Barnes2020-08-09-4/+20
| |
| * Convert most dynamic allocations to use functions from xmalloc.hCraig Barnes2020-08-08-68/+133
|/
* changelog: add birger to 'contributers' for the upcoming releaseDaniel Eklöf2020-08-08-0/+1
|
* Merge branch 'selection-improvements' into masterDaniel Eklöf2020-08-08-32/+84
|\ | | | | | | Closes #70
| * input: motion: improve commentDaniel Eklöf2020-08-08-2/+1
| |
| * input: pointer-enter: add comment describing what we're doingDaniel Eklöf2020-08-08-0/+6
| |
| * input: motion: regression: check for RMB when updating selectionDaniel Eklöf2020-08-08-4/+6
| | | | | | | | | | | | | | | | | | | | While refactoring this code, the check for LMB or RMB got changed to LMB or "any button". This fixes that. It also adds a boolean 'cursor_is_on_grid', which should make the code easier to read and understand.
| * input: scrolling: don't send events to client if cursor is outside gridDaniel Eklöf2020-08-07-1/+8
| |
| * input: mouse: motion/enter: cleanup inside/outside grid handlingDaniel Eklöf2020-08-07-29/+49
| |
| * changelog: 'of' -> 'in'Daniel Eklöf2020-08-07-1/+1
| |
| * input: button: button events aren't passed to clients, when cursor is outside gridDaniel Eklöf2020-08-07-9/+9
| | | | | | | | | | | | | | | | | | | | 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.
| * input: motion: do selection update even if cursor is outside the gridDaniel Eklöf2020-08-07-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * input: fix col/row calculation when cursor is in the top or left marginDaniel Eklöf2020-08-07-4/+9
| | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'base64' into masterDaniel Eklöf2020-08-08-5/+2
|\ \
| * | base64: simplify is_valid() by using reverse_lookup tableCraig Barnes2020-08-08-5/+2
|/ /
* | Merge branch 'attrs' into masterDaniel Eklöf2020-08-07-10/+18
|\ \ | |/ |/|
| * Replace GCC "unused" and "format" attributes with portable macrosCraig Barnes2020-08-07-10/+18
|/
* Merge branch 'syslog' into masterDaniel Eklöf2020-08-07-25/+6
|\
| * log: simplify _sys_log() functionCraig Barnes2020-08-06-25/+6
| |
* | Merge branch 'xstrndup+xrealloc' into masterDaniel Eklöf2020-08-07-0/+15
|\ \ | |/ |/|
| * xmalloc: add xrealloc() and xstrndup() functionsCraig Barnes2020-08-07-0/+15
|/
* Merge branch 'desktop-keywords' into masterDaniel Eklöf2020-08-06-0/+2
|\
| * Add keywords to desktop filesBirger Schacht2020-08-06-0/+2
| | | | | | | | | | | | | | 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.
* | ci: disable freebsd-x64 and alpine-x86Daniel Eklöf2020-08-06-0/+0
| | | | | | | | | | 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.
* | ci: new: alpine x86Daniel Eklöf2020-08-06-0/+44
| |
* | fix printf-format errors in 32-bit buildsDaniel Eklöf2020-08-06-4/+5
|/
* Merge branch 'xmalloc' into masterDaniel Eklöf2020-08-06-68/+225
|\
| * xmalloc: log error to syslog() in fatal_error() functionCraig Barnes2020-08-05-1/+3
| |
| * config: handle allocation failure explicitlyCraig Barnes2020-08-04-68/+223
|/
* grid: reflow: don't insert <width> spacer cells for *every* empty cellDaniel Eklöf2020-08-04-7/+10
| | | | Only do it for the last, non-empty cell.
* input: disable debug logginDaniel Eklöf2020-08-04-1/+1
|
* term: remove unusued 'damage' listDaniel Eklöf2020-08-04-7/+2
|
* input: ignore ISO Level 3 Shift (AltGr) when hiding the mouse cursorDaniel Eklöf2020-08-04-1/+2
|
* config: move cursor.hide-when-typing to mouse.hide-when-typingDaniel Eklöf2020-08-04-10/+38
|
* footrc: add new option 'scrollback.multiplier'Daniel Eklöf2020-08-03-0/+1
|
* Merge branch 'scrollback-multiplier' into masterDaniel Eklöf2020-08-03-2/+22
|\
| * config: add scrollback.multiplier optionDaniel Eklöf2020-08-03-2/+22
|/ | | | | | | This option is used to multiply the mouse scroll amount for mouse and trackpad based scrollback scrolling. Closes #54.
* input: hide-when-typing: ignore modifiersDaniel Eklöf2020-08-03-1/+7
|
* changelog: add craigbarnes to 'contributors' for the upcoming releaseDaniel Eklöf2020-08-03-0/+2
|
* Merge branch 'footclient-man-synopsis' into masterDaniel Eklöf2020-08-03-2/+2
|\
| * doc: fix "SYNOPSIS" section in footclient(1) man pageCraig Barnes2020-08-03-2/+2
| |
* | Merge branch 'e-escape' into masterDaniel Eklöf2020-08-03-10/+10
|\ \ | |/ |/|
| * Replace non-portable "\e" escape in string literals with "\033"Craig Barnes2020-08-02-10/+10
|/
* config: clean upDaniel Eklöf2020-08-02-10/+1
| | | | | Better parsing means we catch syntax errors earlier, meaning we can remove some of the checks.
* Merge branch 'socket-path-uses-wayland-display-instead-of-xdg-session-id' into masterDaniel Eklöf2020-08-02-17/+26
|\
| * server/client: use $WAYLAND_DISPLAY instead of $XDG_SESSION_ID in default socket pathDaniel Eklöf2020-08-02-17/+26
|/ | | | | | | | | 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.
* main: update --help with correct default path for -s,--serverDaniel Eklöf2020-08-02-2/+2
| | | | I missed this in f3c301ee8b94c3354080695326ceedc7a3866321 when fixing
* doc: foot.1: fix default path in -s,--serverDaniel Eklöf2020-08-02-6/+15
| | | | | | | | | | | | | | | | | | | 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.
* input: don't hide cursor if key is 'shift'Daniel Eklöf2020-08-01-5/+7
| | | | | Since shift is used to enable selecting text in mouse-grabbing applications, hiding the cursor in this case is counter productive.
* Revert "slave: use an event FD to communicate errors after fork before exec"Daniel Eklöf2020-08-01-17/+20
| | | | | | | | | | | | | | | | | This reverts commit 027a8de6f547115fd90b8ee612fc616b61d5000c. 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().
* slave: use an event FD to communicate errors after fork before execDaniel Eklöf2020-08-01-20/+17
| | | | | | | | 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.
* slave: emit user-notifications before dup:ing stdin/stdout/stderrDaniel Eklöf2020-08-01-45/+50
| | | | | | | | | 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.
* slave: user-notifications: skip the O_NONBLOCK dance when there aren't any notificationsDaniel Eklöf2020-07-31-1/+1
|
* slave: restore pts file status flags after emitting user-notificationsDaniel Eklöf2020-07-31-3/+5
| | | | | | | | | | | | | | | 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.
* slave: user-notifications: don't block in write(3)Daniel Eklöf2020-07-31-0/+18
| | | | | | | | | | | 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.
* slave: user-notifications: emit errors first, then warnings and last deprecationsDaniel Eklöf2020-07-31-2/+21
|
* config: pipe-*: fix length calculation of the pipe command substringDaniel Eklöf2020-07-31-1/+1
|
* config: add 'hide-when-typing'Daniel Eklöf2020-07-31-15/+56
| | | | | | 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.
* config: configuration errors are no longer fatalDaniel Eklöf2020-07-31-80/+144
| | | | | Instead of refusing to start foot on configuration errors, we start and print a user-notification.
* config: add 'pipe-selected' key bindingDaniel Eklöf2020-07-31-13/+43
| | | | | | | This works just like pipe-visible and pipe-scrollback, but pipes the user-selected text, if any, to the external tool. Closes #51
* install: tllist is a *build* dependency, not a *runtime* dependencyDaniel Eklöf2020-07-31-1/+1
|
* doc+readme: make it clear(er) that RMB can be hold-and-draggedDaniel Eklöf2020-07-31-2/+6
|
* user-notification: 'productify' the user-warning systemDaniel Eklöf2020-07-30-62/+127
| | | | | | | | * Rename user_warning to user_notification * Add warning and error types (in addition to the existing deprecated) * Simplify logic when emitting a user notification after forking; we don't need to copy the notification data since we're in a new process and have total control over that memory.
* readme: remove 'explanation' of server/daemon modeDaniel Eklöf2020-07-30-1/+1
| | | | It is described in a separate section anyway.
* config: tokenize key bindings' pipe command when loading the configurationDaniel Eklöf2020-07-30-65/+50
| | | | | | This allows us to detect syntax errors early on, and is also more efficient since we don't have to re-tokenize the command line every time the binding is executed.
* changelog: use <section>.<option> syntaxDaniel Eklöf2020-07-30-2/+1
|
* slave: don't ignore write(3) errorsDaniel Eklöf2020-07-29-3/+14
|
* config: emit a user-warning for deprecated option 'scrollback'Daniel Eklöf2020-07-29-0/+11
|
* term: add capability to print warnings *inside* the terminalDaniel Eklöf2020-07-29-5/+51
| | | | | This is intended to be used to print e.g. deprecation warnings inside the terminal, *before* the shell is started.
* changelog: update scrollback indicator entry to reflect moved optionsDaniel Eklöf2020-07-29-2/+2
|