aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
| * | | render: explain _why_ we set a clip regionDaniel Eklöf2020-03-24-0/+1
| | | |
| * | | shm: scroll: implement offset wrap-aroundDaniel Eklöf2020-03-24-42/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Impose a maximum memfd size limit. In theory, this can be 2GB (wl_shm_create_pool() is the limiting factor - its size argument is an int32_t). For now, use 256MB. This is mainly to reduce the amount of virtual address space used by the compositor, which keeps at least one mmapping (of the entire memfd) around. One mmapping *per terminal window* that is. Given that we have 128TB with 48-bit virtual addresses, we could probably bump this to 2GB without any issues. However, 256MB should be enough. TODO: check how much we typically move the offset when scrolling in a fullscreen window on a 4K monitor. 256MB may turn out to be too small. On 32-bit shm_scroll() is completely disabled. There simply isn't enough address space. * Wrapping is done by moving the offset to "the other end" of the memfd, and copying the buffer contents to the new, wrapped offset. The "normal" scrolling code then does the actual scrolling. This means we'll re-instantiate all objects twice when wrapping.
| * | | render: bug: clear clip region before tinting the windowDaniel Eklöf2020-03-24-0/+1
| | | |
| * | | render: attach buffer just before commitDaniel Eklöf2020-03-24-1/+3
| | | |
| * | | render: clear scroll damage list when we force-refresh the entire windowDaniel Eklöf2020-03-24-0/+1
| | | |
| * | | quirks: add KDE quirk: surface must be damaged *after* being attachedDaniel Eklöf2020-03-24-13/+43
| | | | | | | | | | | | | | | | | | | | | | | | KDE resets all surface damage when a buffer is attached. Add a quirk that adds a full-buffer damage to the surface. This quirk is intended to be called after attaching a buffer to a surface.
| * | | Merge branch 'master' into scroll-damage-performanceDaniel Eklöf2020-03-24-30/+22
| |\ \ \
| * | | | shm: shm_scroll(): initial implementation of reverse scrollingDaniel Eklöf2020-03-23-27/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented by truncating the file size and moving the offset backwards. This means we can only reverse scroll when we've previously scrolled forward. TODO: figure out if we can somehow do fast reverse scrolling even though offset is 0 (or well, less than required for scrolling).
| * | | | shm: scroll: move top/bottom region handling from renderer into shmDaniel Eklöf2020-03-23-59/+57
| | | | | | | | | | | | | | | | | | | | | | | | | This allows us to restore the regions without copying the contents to temporary memory.
| * | | | render: scroll: use shm scrolling even though we have a top regionDaniel Eklöf2020-03-23-3/+20
| | | | |
| * | | | render: scroll: take margins into account when restoring bottom scroll regionDaniel Eklöf2020-03-23-5/+5
| | | | |
| * | | | render: scroll: move comment to where it belongsDaniel Eklöf2020-03-23-12/+10
| | | | |
| * | | | render: margins: caller explicitly asks for top/bottom marginsDaniel Eklöf2020-03-23-7/+10
| | | | |
| * | | | render: margins: regression: fix incorrect marginsDaniel Eklöf2020-03-23-6/+17
| | | | |
| * | | | shm: add shm_can_scroll()Daniel Eklöf2020-03-23-0/+8
| | | | |
| * | | | Merge branch 'master' into scroll-damage-performanceDaniel Eklöf2020-03-23-13/+18
| |\ \ \ \
| * | | | | shm: print performance warning when FALLOC_FL_PUNCH_HOLE isn't supportedDaniel Eklöf2020-03-22-3/+6
| | | | | |
| * | | | | shm: verify the system supports FALLOC_FL_PUNCH_HOLEDaniel Eklöf2020-03-22-0/+12
| | | | | |
| * | | | | shm: scroll: no need to instantiate a new buffer when ftruncate() failsDaniel Eklöf2020-03-22-21/+1
| | | | | |
| * | | | | render: use shm_scroll() when we believe it will be fasterDaniel Eklöf2020-03-22-54/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shm_scroll() is fast when memmove() is slow. That is, when scrolling a *small* amount of lines, shm_scroll() is fast. Conversely, when scrolling a *large* number of lines, memmove() is fast. For now, assume the two methods perform _roughly_ the same given a certain number of bytes they have to touch. This means we should use shm_scroll() when number of scroll lines is less than half the screen. Otherwise we use memmove. Since we need to repair the bottom scroll region after a shm_scroll, those lines are added to the count when determining which method to use. TODO: * Check if it's worth to do shm scrolling when we have a top scroll region. * Do more performance testing with a) various amount of scrolling lines, and b) larger bottom scroll regions.
| * | | | | shm: new function, shm_scroll()Daniel Eklöf2020-03-22-72/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function "scrolls" the buffer by the specified number of (pixel) rows. The idea is move the image offset by re-sizing the underlying memfd object. I.e. to scroll forward, increase the size of the memfd file, and move the pixman image offset forward (and the Wayland SHM buffer as well). Only increasing the file size would, obviously, cause the memfd file to grow indefinitely. To deal with this, we "punch" a whole from the beginning of the file to the new offset. This frees the associated memory. Thus, while we have a memfd file whose size is (as seen by e.g. fstat()) is ever growing, the actual file size is always the original buffer size. Some notes: * FALLOC_FL_PUNCH_HOLE can be quite slow when the number of used pages to drop is large. * all normal fallocate() usages have been replaced with ftruncate(), as this is *much* faster. fallocate() guarantees subsequent writes wont fail. I.e. it actually reserves (disk) space. While it doesn't allocate on-disk blocks for on-disk files, it *does* zero-initialize the in-memory blocks. And this is slow. ftruncate() doesn't do this. TODO: implement reverse scrolling (i.e. a negative row count).
* | | | | | ci: initial sr.ht build manifestDaniel Eklöf2020-03-28-0/+42
| | | | | |
* | | | | | conf: rename 'startup-mode' to 'initial-window-mode'Daniel Eklöf2020-03-28-7/+8
| |_|_|/ / |/| | | |
* | | | | client: add --maximized and --fullscreenDaniel Eklöf2020-03-27-9/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now create a copy of the config for each client, and updates it with the values passed from the client. Since we're not actually cloning it (and e.g. strdup() all strings etc) we can't call conf_destroy() to free it, but need to free just the strings we've replaced.
* | | | | foot: add --maximized and --fullscreen command line optionsDaniel Eklöf2020-03-26-0/+30
| | | | |
* | | | | config: add 'startup-mode' optionDaniel Eklöf2020-03-26-1/+39
| |_|/ / |/| | | | | | | | | | | | | | | This option controls the initial window mode: windowed, maximized or fullscreen. The default is windowed.
* | | | render: fdm refresh handler: don't clear pending flagsDaniel Eklöf2020-03-24-22/+17
| | | | | | | | | | | | | | | | | | | | The pending flags may already be set (from a previous call to the FDM hook). In this case, they should not be cleared.
* | | | term: delayed rendering: failure to read timers is always an errorDaniel Eklöf2020-03-24-8/+5
| |/ / |/| |
* | | delayed rendering: ignore frame callback if delayed rendering is activeDaniel Eklöf2020-03-23-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we applied delayed rendering (that is, we gave the client a chance to do more writes before we scheduled a render refresh) only when the renderer were idle. However, with e.g. a high keyboard repeat rate, it is very much possible to start the render loop and then never break out of it while receiving keyboard input. This causes screen flickering, as we're no longer even trying to detect the clients transaction boundaries. So, let's rewrite how this is done. First, we give the user the ability to disable delayed rendering altogether, by setting either the lower or upper timeout to 0. Second, when delayed rendering is enabled, we ignore the frame callback. That is, when receiving input, we *always* reschedule the lower timeout timer, regardless of whether the render is idle or not. The render's frame callback handler will *not* render the grid if the delayed render timers are armed. This means for longer client data bursts, we may now skip frames. That is, we're trading screen flicker for the occasional frame hickup. For short client data bursts we should behave roughly as before. This greatly improves the behavior of fullscreen, or near fullscreen, updates of large grids (example, scrolling in emacs in fullscreen, with a vertical buffer split).
* | | term: delayed rendering: read timers even though is_armed = falseDaniel Eklöf2020-03-23-5/+8
|/ / | | | | | | | | | | | | | | | | There's a race/chance that we'll have disarmed the delayed rendering timers and still get the call. While it _shouldn't_ be anything to read from the timers, it doesn't hurt to try. And, if the timers *are* readable, not reading them means we'll end up in an infinite FDM loop.
* | render: resize: update saved 'normal' cursor if we're in alt screenDaniel Eklöf2020-03-22-0/+15
| | | | | | | | | | | | | | | | | | | | | | When resizing in alt mode, we never updated the saved 'normal' cursor. This meant that when we exited alt mode, the cursor would be positioned where it was in the old pre-resize/reflow grid. Now, we update the saved cursor in the same way we update visible cursor. The result is that when we exit the alt screen, the cursor is restored to the same coordinates it would have been updated to had the resize been done in the 'normal' screen.
* | server: purge *all* buffers when a terminal shuts downDaniel Eklöf2020-03-18-2/+7
| | | | | | | | | | Previously we only purged the main grid buffers. Now we also purge the search buffers and the CSD buffers.
* | shm: new functions: shm_cookie_*()Daniel Eklöf2020-03-18-4/+5
| | | | | | | | These functions return a SHM cookie given a terminal instance.
* | shm: log size of purged bufferDaniel Eklöf2020-03-18-2/+3
| |
* | search: replace hard-coded key bindings with "user configurable" onesDaniel Eklöf2020-03-18-167/+228
| | | | | | | | | | | | | | | | They aren't really user configurable. At least not yet. However, with this, we now handle raw key codes just like the normal key bindings. Meaning, e.g. ctrl+g, ctrl+a, ctrl+e etc now works while searching with e.g. a russian layout.
* | input: bindings: don't match raw key code alone - mods must also matchDaniel Eklöf2020-03-18-2/+8
| |
* | conf: bindings: case insensitive matching against 'none'Daniel Eklöf2020-03-18-8/+8
| |
* | input: bind key bindings to raw key codes tooDaniel Eklöf2020-03-18-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, when looking for a matching user key binding, we only matched *symbols*. This means that the physical keys that generate a specific key binding is layout dependent. What's worse, it may not even be possible to generate the key binding at all. Russian is one such layout, where all the "normal" (us) symbols are replaced. By using raw key codes, we can get around this - the key code has a direct mapping to the physical key. However, matching raw key codes **only** doesn't always make sense either. For now, match **both** symbols _and_ key codes. Symbols take precedence. TODO: we might have to make this configurable _per binding_. Note: 'search' mode still uses mostly hardcoded shortcuts that still have this problem (i.e. ctrl+g doesn't work with a russian layout).
* | input: key-binding: log error when we fail to translate to XKB symbolDaniel Eklöf2020-03-18-1/+10
| |
* | doc: foot.5: spawn-terminal: mention OSC 7Daniel Eklöf2020-03-17-1/+3
| |
* | doc: foot.1: document ctrl+shift+nDaniel Eklöf2020-03-17-0/+5
| |
* | README: document ctrl+shift+nDaniel Eklöf2020-03-17-0/+5
| |
* | changelog: mention change of default key binding for spaw-terminalDaniel Eklöf2020-03-17-0/+1
| |
* | conf: change default key binding for spawn-terminal to ctrl+shift+nDaniel Eklöf2020-03-17-3/+3
| |
* | conf: make delayed rendering timeouts configurableDaniel Eklöf2020-03-17-7/+65
| | | | | | | | | | | | | | | | | | | | | | This adds an undocumented 'tweak' section to footrc, with two new options: * delayed-render-lower * delayed-render-upper Both takes an integer value, representing the lower/upper timeout values (in nano seconds) for delayed rendering.
* | term: ptmx: don't set 'pending' flag when app sync updates are in useDaniel Eklöf2020-03-17-38/+34
| |
* | render: don't try to resize if we're shutting downDaniel Eklöf2020-03-17-0/+3
| | | | | | | | | | | | This fixes an issue where we sometimes (depends on compositor?) tried to signal a TIOCSWINSZ and failed. This caused us to log a misleading error message.
* | doc: foot.1: mention default value for '--log-colorize'Daniel Eklöf2020-03-17-1/+2
| |
* | doc: foot.1: fix typo - this isn't yambarDaniel Eklöf2020-03-17-1/+1
| |
* | doc: foot.5: mention default value for 'pad'Daniel Eklöf2020-03-17-1/+1
| |
* | doc: foot.5: mention default value for 'geometry'Daniel Eklöf2020-03-17-1/+1
| |
* | render: render non-block cursors after rendering the glyph + decorationsDaniel Eklöf2020-03-17-4/+9
| | | | | | | | | | | | This fixes an issue where an 'underline' cursor wasn't visible on underlined text - the cursor was rendered first, and then shadowed by the text underline.
* | term: ptmx: don't enqueue extra frame render when app sync updates have been changedDaniel Eklöf2020-03-16-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Track whether app-sync updates were enabled or disabled while handling the current chunk of PTMX data. This fixes and issue where we called render_refresh() unnecessarily under (at least) the following conditions: * Application sent "BSU <data> ESU" in the *same* chunk. In this case we never saw that app sync was enabled and triggered delayed rendering as usual. * Application sent ESU. While we had noticed app sync updates being enabled in earlier PTMX reads, when it was disabled *in the current* PTMX read, we treated it as if it had not been enabled at all. This caused us to trigger delayed rendering. Now we call render_refresh() directly from ESU, and detect the "flip off" case in PTMX read and avoid triggering a delayed rendering. The end result of all this is that each key press (for e.g. scrolling in a pager application) went from two frames being rendered, to a single frame.
* | alt-screen: use a custom 'saved' cursor when switching to alt screenDaniel Eklöf2020-03-16-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes an issue where we failed to restore the cursor correctly when exiting from the alternate screen, if the client had sent escapes to save the cursor position while inside the alternate screen. This was because we used the *same* storage for saving the cursor position through escapes, as for saving it when entering the alternate screen. Fix by using a custom variable dedicated to normal <--> alt screen switching.
* | wayland: add FDs to FDM as soon as the FDs are readyDaniel Eklöf2020-03-15-6/+6
| |
* | wayland: store display FD in wayland structDaniel Eklöf2020-03-15-6/+9
| | | | | | | | | | | | | | | | This way we: * Don't have to call wl_display_get_fd() all the time * No longer call fdm_del_no_close() even though the FD hasn't been added to the FDM.
* | completions: zsh: don't strip spaces from font name completionsDaniel Eklöf2020-03-15-1/+7
| |
* | main: log version at startupDaniel Eklöf2020-03-15-0/+2
| |
* | changelog: add indexDaniel Eklöf2020-03-15-0/+7
| |
* | Merge branch 'releases/1.2'Daniel Eklöf2020-03-15-2/+8
|\ \
| * | meson/PKGBUILD: bump version to 1.2.31.2.3releases/1.2Daniel Eklöf2020-03-15-2/+8
| | |
* | | changelog: spacesDaniel Eklöf2020-03-14-0/+15
| | |
* | | Merge branch 'releases/1.2'Daniel Eklöf2020-03-14-6/+13
|\| | | |/ |/|
| * changelog: mention fix for #51.2.2Daniel Eklöf2020-03-14-0/+2
| |
| * term: use logical DPI+scale factor when scaling fontsDaniel Eklöf2020-03-14-23/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes an issue where the fonts were rendered too small when the output had fractional scaling. For integral scaling, using the logical (scaled) DPI multiplied with the scaling factor results in the same final DPI value as if we had used the physical DPI. But for fractional scaling, this works around the fact that the compositor downscales the surface after we've rendered it. Closes #5
| * quirks: weston_csd_{on,off}: don't do anything in fullscreen modeDaniel Eklöf2020-03-14-0/+4
| |
| * changelog: updated to mention fix for #3Daniel Eklöf2020-03-14-0/+4
| | | | | | | | I really need to learn to update the changelog **with** the fix...
| * terminal: appky scale factor when force-resizing on font reloadDaniel Eklöf2020-03-14-1/+1
| | | | | | | | | | | | | | If we don't, we'll end up e.g. increasing the window size when moving the window between outputs with different scaling. Closes #3
| * client: log path we actually tried to connect to (and failed)Daniel Eklöf2020-03-14-1/+1
| |
| * client: update --server-socket usage to mention XDG_SESSION_IDDaniel Eklöf2020-03-14-1/+1
| |
| * changelog: updateDaniel Eklöf2020-03-14-0/+9
| |
| * server/client: add XDG_SESSION_ID to the default socket pathDaniel Eklöf2020-03-14-3/+10
| | | | | | | | This allows multiple foot servers to run in multiple sessions.
| * .desktop: 'terminal' is not a common icon nameDaniel Eklöf2020-03-14-2/+2
| | | | | | | | | | Not all icon themes have a 'terminal' icon. 'utilities-terminal' on the other hand is a standardized icon name.
| * changelog: remove 'unreleased' sectionDaniel Eklöf2020-03-14-8/+0
| |
* | changelog: upper case initial letterDaniel Eklöf2020-03-14-1/+1
| |
* | changelog: mention removal of Sway 1.2 keyboard/pointer workaroundsDaniel Eklöf2020-03-14-0/+1
| |
* | input: remove Sway 1.2 keyboard/pointer workaroundsDaniel Eklöf2020-03-14-52/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sway 1.4 is better than 1.2, in that we always have keyboard focus when we get a keyboard_key() event. That however is because it doesn't send keyboard_leave() on e.g. a TTY switch. Still, this is good enough - foot handles this and doesn't crash. We are also able to process input without having to refocus the window. And, Sway master (what will become Sway 1.5) has fixed this for real - we now get a keyboard_leave() and pointer_leave() event on a TTY switch. And the corresponding enter events when switching back.
* | input: add debug logs to all keyboard/pointer enter/leave/action eventsDaniel Eklöf2020-03-14-4/+22
| |
* | Merge branch 'scale-fonts-using-logical-dpi-plus-scale-factor'Daniel Eklöf2020-03-13-23/+82
|\ \
| * | changelog: mention fix for #5Daniel Eklöf2020-03-11-0/+2
| | |
| * | term: use logical DPI+scale factor when scaling fontsDaniel Eklöf2020-03-11-23/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes an issue where the fonts were rendered too small when the output had fractional scaling. For integral scaling, using the logical (scaled) DPI multiplied with the scaling factor results in the same final DPI value as if we had used the physical DPI. But for fractional scaling, this works around the fact that the compositor downscales the surface after we've rendered it. Closes #5
* | | sixel: improve handling of images when reflowing the gridsDaniel Eklöf2020-03-13-42/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the sixels' 'row' attribute when re-flowing a grid, to ensure it is rendered at the correct place. This should work in most cases, but will break when the cell size has changed (e.g. font size increase/decrease, or a DPI change). This patch also moves the sixel image list from the terminal struct into the grid struct. The sixels are per-grid after all.
* | | input: maximize: unset fullscreen before toggling maximized stateDaniel Eklöf2020-03-12-0/+2
| | |
* | | doc/foot.5: formatting fixesDaniel Eklöf2020-03-12-15/+15
| | |
* | | README: shortcuts (bindings) _can_ be changedDaniel Eklöf2020-03-12-4/+2
| | |
* | | Merge branch 'bindings'Daniel Eklöf2020-03-12-87/+560
|\ \ \
| * | | doc/foot.5: mention that *all* actions can be used in mouse bindingsDaniel Eklöf2020-03-12-0/+2
| | | |
| * | | doc/foot.5: add an example that uses ShiftDaniel Eklöf2020-03-12-1/+2
| | | |
| * | | Merge branch 'master' into bindingsDaniel Eklöf2020-03-12-5/+10
| |\ \ \ | |/ / / |/| | |
* | | | quirks: weston_csd_{on,off}: don't do anything in fullscreen modeDaniel Eklöf2020-03-12-0/+4
| |/ / |/| |
* | | config: add str_to_bool()Daniel Eklöf2020-03-11-5/+10
| | |
| * | config: key-bindings: verify key combo isn't already mapped to another actionDaniel Eklöf2020-03-12-11/+53
| | |
| * | config: mouse-bindings: verify button isn't already mappedDaniel Eklöf2020-03-12-5/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | A button may only be mapped to a single action. Detect when the user tried to map the same button to multiple actions and error out. To clear a binding (for example, to free up a button from the default bindings), one can set the action it is bound to to `NONE` (e.g. `primary-paste=NONE`).
| * | changelog: user configurable key- and mouse bindingsDaniel Eklöf2020-03-12-0/+2
| | |
| * | config/input: implement mouse bindingsDaniel Eklöf2020-03-12-20/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New config section, "mouse-bindings", where bindings are defined on the form "action=BTN_<name> * pointer_button() handler now scans the bindings list instead of hardcoding primary-paste to BTN_MIDDLE. * The implementation handles single- double- and triple clicks in the bindings, but there is currently no way to define anything but a single-click binding in the configuration.
| * | config: 'invalid key' is always an error, not a warningDaniel Eklöf2020-03-12-4/+3
| | |
| * | bindings: add minimize/maximize/fullscreen actionsDaniel Eklöf2020-03-12-0/+39
| | | | | | | | | | | | These actions are by default not bound to anything.
| * | quirks: weston_csd_{on,off}: don't do anything in fullscreen modeDaniel Eklöf2020-03-12-0/+4
| | |
| * | Merge branch 'master' into bindingsDaniel Eklöf2020-03-10-9/+21
| |\ \ | |/ / |/| |
* | | changelog: updated to mention fix for #3Daniel Eklöf2020-03-10-0/+4
| | | | | | | | | | | | I really need to learn to update the changelog **with** the fix...