aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
* term_destroy(): free interactive_resizing.gridDaniel Eklöf2022-10-18-0/+2
| | | | | This grid is normally unallocated, but may be allocated if we are exiting (for whatever reason) in the middle of an interactive resize.
* fdm_ptmx(): regression: don’t return false when an interactive resize is in progressDaniel Eklöf2022-10-18-1/+1
|
* doc: foot.ini: improve documentation of cursor.colorDaniel Eklöf2022-10-17-7/+6
|
* interactive resize: improve user experienceDaniel Eklöf2022-10-17-60/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-initialize the temporary ‘normal’ grid instance each time we receive a configure event while doing an interactive resize. This way, window content will not be "erased" when the window is first made smaller, then larger again. And, if the viewport is up in the scrollback history, increasing the window size will reveal more of the scrollback, instead of just being black. The last issue is the cursor; it’s currently not "stuck" where it should be. Instead, it follows the window around. This is due to two things: 1) the temporary grid we create is large enough to contain the current viewport, but not more than that. That means we can’t "scroll up", to hide the cursor. 2) grid_resize_without_reflow() doesn’t know anything about "interactive resizing". As such, it will ensure the cursor is bound to the new grid dimensions. I don’t yet have a solution for this. This patch implements a workaround to at least reduce the impact, by simply hiding the cursor while we’re doing an interactive resize.
* changelog: crash after reverse-scrolling in the normal screenDaniel Eklöf2022-10-16-0/+3
|
* selection: scroll down: handle non-full scrollback correctlyDaniel Eklöf2022-10-16-3/+8
| | | | | | | | | When determining whether or not to cancel a selection (due to it, or part of it, being "scrolled out"), we assumed the scrollback was full. This patch changes the implementation to compare the scrollback relative selection coordinates with the scrollback relative end-of-the-scrollback coordinates.
* term: reverse scroll: free scrolled out linesDaniel Eklöf2022-10-16-0/+12
| | | | | | | | | | | | This ensures *everything* in the circular scrollback history, after the bottom of the screen, is either NULL rows, or belong to the scrollback *history* (as opposed to the future history). This fixes an issue when calculating the scrollback start, which for example would trigger a crash when moving the viewport (i.e. scrolling with the mouse, or PgUp/PgDown). Closes #1190
* sixel: don’t crash when sixel image exceeds current sixel max heightDaniel Eklöf2022-10-13-1/+2
| | | | | | | | | | | | When we try to resize a sixel past the current max height, we set col > image-width to signal this. This means ‘width’ could be smaller than ‘col’. When calculating how many sixels to emit in sixel_add_many(), we didnt’ account for this. The resulting value was -1, converted to ‘unsigned’. I.e. a very large value. This resulted in an assert triggering in sixel_add() in debug builds, and a crash in release builds.
* Merge branch 'delayed-reflow'Daniel Eklöf2022-10-10-84/+279
|\
| * render: rename term->render.resizing -> term->interactive_resizingDaniel Eklöf2022-10-10-34/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | But also, more importantly, logical fixes: * Stash the number of new scrollback lines the stashed ‘normal’ grid should be resized *to*. There’s also a couple of performance changes here: * When doing a delayed reflow (tiocswinsz timer), call sixel_reflow_grid(term, &term->normal) - there’s no need to reflow sixels in the ‘alt’ screen. * When doing a delayed reflow, free all scroll damage. It’s not needed, since we’re damaging the entire window anyway. * Use minimum size for the temporary ‘normal’ grid (that contains the current viewport). We just need it to be large enough to fit the current viewport, and be a valid grid row count (power of 2). This just so happens to be the current ‘alt’ grid’s row count...
| * render: resize: do delayed reflow immediately when failing to arm tiocswinsz timerDaniel Eklöf2022-10-10-1/+3
| |
| * term_ptmx_{pause,resume}: return success/failDaniel Eklöf2022-10-10-14/+14
| |
| * term: ptmx: don’t consume anything while doing an interactive resizeDaniel Eklöf2022-10-10-0/+11
| | | | | | | | | | The ‘normal’ grid in use during an interactive resize is temporary; all changes done to it will be lost when the resize is finished.
| * term: use SIZE_MAX instead of (size_t)-1llDaniel Eklöf2022-10-10-1/+2
| |
| * grid: resize: assert grid->cur_row is not NULL after a grid resizeDaniel Eklöf2022-10-10-0/+4
| |
| * render: delayed reflow: not enough to damage current view; need to refresh tooDaniel Eklöf2022-10-10-1/+3
| |
| * sixel: add sixel_reflow_grid()Daniel Eklöf2022-10-10-62/+70
| | | | | | | | | | | | | | | | | | This function reflows all sixels in the specified grid. The pre-existing sixel_reflow() function is a shortcut for sixel_reflow_grid(term, &term->normal) sixel_reflow_grid(term, &term->alt);
| * changelog: fixed crash when resizing window with a very large scrollbackDaniel Eklöf2022-10-10-0/+2
| |
| * render: resize: ignore ptmx read events during interactive resizeDaniel Eklöf2022-10-10-0/+19
| |
| * render: performance improvements during interactive resizeDaniel Eklöf2022-10-10-5/+37
| | | | | | | | | | | | | | | | | | | | | | Instead of copying the entire grid when an interactive resize is started, stash the complete grid (to be used in the final reflow). Copy the current viewport only, to be used during the interactive resize. This gets rid of the initial "pause" when snapshotting the grid when an interactive resize is started.
| * render: delay reflow for ‘resize-delay-ms’ millisecondsDaniel Eklöf2022-10-10-20/+123
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reflowing a large scrollback is *slow*. During an interactive resize, it can easily take long enough that the compositor fills the Wayland socket with configure events. Eventually, the socket becomes full and the compositor terminates the connection, causing foot to exit. This patch is work-in-progress, and the first step towards alleviating this. It delays the reflow by: * Snapshotting (copying) the original grid when an interactive resize is started. * While resizing, we apply a simple truncation resize of the grid (like we handle the alt screen). * When the resize is done, or paused for ‘resize-delay-ms’, the grid is reflowed. TODO: we *must* not allow any changes to the temporary (truncated) grid during the resize. Any changes to the grid would be lost when the final reflow is applied. That is, we must completely pause the ptmx pipe while a resize is in progress. Future improvements: The initial copy can be slow. We should be able to avoid it by rewriting the reflow algorithm to not free anything. This is complicated by the fact that some resources (e.g. sixel images) are currently *moved* to the new grid. They’d instead have to be copied.
* pgo: run xtgettcap without any argumentsDaniel Eklöf2022-10-10-5/+5
| | | | | | | | We execute xtgettcap in the parent terminal. Thus we don’t know if it implements XTGETTCAP, and thus it’s not guaranteed to exit - it may hang indefinitely waiting for a reply. Fix by not actually quering anything.
* xtgettcap: exit immediately when there are no capabilities to query forDaniel Eklöf2022-10-10-2/+5
|
* install.md: add `./utils/xtgettcap name` to "full PGO" instructions tooDaniel Eklöf2022-10-09-3/+5
|
* install.md: add xtgettcap to PGO build instructionsDaniel Eklöf2022-10-08-3/+5
|
* pgo: execute xtgettcap utility, to get profiling dataDaniel Eklöf2022-10-07-0/+2
| | | | | | Fixes: ../utils/xtgettcap.c:175:1: error: ‘/home/daniel/src/foot/src/utils/xtgettcap.p/xtgettcap.c.gcda’ profile count data file not found [-Werror=missing-profile]
* utils: xtgettcap: new utility, to send XTGETTCAP queriesDaniel Eklöf2022-10-07-0/+177
|
* scripts: generate-builtin-terminfo: escape fixesDaniel Eklöf2022-10-05-7/+14
| | | | | * Remove ‘:’ escaping only in raw (non-parameterized) sequences * Double-escape *all* escape characters in parameterized sequences
* scripts: generate-builtin-terminfo: double-escape backslash in STDaniel Eklöf2022-10-05-0/+6
| | | | | Fixes an issue with XTGETTCAP, where escape sequences terminated with ST, and containing parameters were missing a trailing backslash.
* render: fix nanosec "overflow" when calculating timeout valueAlexey Sakovets2022-10-05-1/+6
|
* Add zenburn themeHugo Osvaldo Barrera2022-10-04-0/+23
| | | | This is the one included by default in previous releases.
* doc: fix tiny typoNick Hastings2022-10-04-1/+1
|
* spawn: set $PWD, in addition to calling chdir(cwd)Daniel Eklöf2022-10-02-3/+6
|
* main/client: use $PWD for cwd, when $PWD is validDaniel Eklöf2022-10-02-0/+44
| | | | | | | | | If $PWD is set, and its resolved path matches the *actual* working directory, use $PWD for cwd when instantiating the terminal. This makes a difference when $PWD refers to a symlink; before this patch, we’d instantiate the terminal in the *resolved* path. Now it’ll use the symlink instead.
* slave: spawn: set PWD environment variableDaniel Eklöf2022-10-02-0/+3
| | | | | | | | This improves handling of symlinks (in CWD) when launching a new terminal instance, either through ctrl+shift+n, or using the --working-directory command line option. Closes #1179
* scripts: generate-builtin-terminfo: add synthetic ‘name’ capabilityDaniel Eklöf2022-09-28-0/+2
| | | | Same as ‘TN’; reports the terminfo name.
* terminfo: add kxIN + kxOUT (focus in/out events)Daniel Eklöf2022-09-26-1/+3
| | | | | | | | | | | | | | | These capabilities are not included in the standard ‘xterm’ or ‘xterm-256color’ terminfos. They’re used in ‘xterm+focus’ -> ‘xterm+sm+1002’ -> ‘xterm-1002|xterm+sm+1003’ -> ‘xterm-1003’ (https://invisible-island.net/ncurses/terminfo.ti.html#tic-xterm_focus) However, as far as I can tell, ncurses doesn’t use these capabilities at all.
* term: utmp: set ‘host’ to WAYLAND_DISPLAYDaniel Eklöf2022-09-23-2/+2
| | | | This is similar to what XTerm does (setting it to DISPLAY)
* Add support for creating utmp recordsDaniel Eklöf2022-09-23-11/+105
| | | | | | | | | | | | | | | | | This patch adds support for creating utmp records using the ‘utempter’ helper binary from the ‘libutempter’ package. * New config option ‘main.utempter’ * New meson command line option, -Ddefault-utempter-path. Defaults to auto-detecting the path. The default value of the new ‘main.utempter’ config option depends on the meson command line option ‘-Ddefault-utempter-path’. If ‘main.utempter’ is *not* set to ‘none’, foot will try to execute the utempter helper binary to create utmp records when a new terminal is instantiated. The record is removed when the terminal instance is destroyed.
* Merge branch 'nightfly-and-moonfly'Daniel Eklöf2022-09-23-0/+58
|\
| * Add the moonfly themeTorsten Trautwein2022-09-22-0/+29
| |
| * Add the nightfly themeTorsten Trautwein2022-09-22-0/+29
| |
* | render: overlay: fix visual glitches when double bufferingDaniel Eklöf2022-09-23-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When rendering the overlay for scrollback search, the logic assumed buffer re-use. On some compositors this isn’t happening (on e.g. KDE/plasma we’re forced to double buffer). This resulted in matches not being highlighted correctly. The problem is in how we calculated the region for which areas to clear ("un-dim"). It uses the "previous frame’s see-through area" minus the current frame’s see-through area. However, when we’ve detected that the current buffer isn’t the same as the last one, we set the last frame’s see-through region to "the entire buffer". Thus, when calculating the diff, we end up with an empty region, and nothing is highlighted. Fix by simply using the current frame’s see-through region as-is when we’ve detected we’re not re-using the last frame’s buffer.
* | render: fix application of old scroll damage when double bufferingDaniel Eklöf2022-09-23-67/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On compositors that forces us to double buffer, we need to re-apply the last frame’s damage to the current frame (which uses the buffer from the next-to-last frame). General cell updates are handled by simply copying from the last frame’s pixman buffer to the current frame’s. In an attempt to improve performance, scroll damage were up until now handled by re-playing the last frame’s scroll damage (on the current frame’s buffer). This does not work, and resulted in glitches when scrolling in the scrollback. This patch does the following: * grid_render_scroll{,_reverse}() now update the buffer’s "dirty" region. This means the generic copy-old-frames-buffer handles the scroll damage (albeit in, potentially, a less efficient way). * Tracking of, and re-applying old scroll damage is completely removed. Closes #1173
* | wayland: don’t crash with a division-by-zero when monitor dimensions are negativeDaniel Eklöf2022-09-23-1/+1
| | | | | | | | Some compositors set the physical dimensions to -1...
* | render: timer: print/log *total* rendering timeDaniel Eklöf2022-09-23-7/+13
| |
* | misc: add timespec_add()Daniel Eklöf2022-09-23-1/+19
| |
* | install.md: add ‘utf8proc’Daniel Eklöf2022-09-23-0/+1
|/
* chore: rename desktop filesVladimír Magyar2022-09-18-1/+1
|
* chore: add appstream fileVladimír Magyar2022-09-18-0/+45
| | | | | | | | Appstream file is usefull for many package management tools to show additional metadata and screenshots. Also it would solve the packaging for flathub. References: https://codeberg.org/dnkl/foot/issues/1129#issuecomment-602089
* csi: reply with 4 instead of 2 for DECRQM queries of unsupported modesCraig Barnes2022-09-18-44/+61
| | | | | | | | The status value 4 means "permanently reset", as opposed to 2, which means "reset". The former implies that there's no way to enable the mode because it's unsupported (but recognized). Note: this commit also fixes an unrelated typo in CHANGELOG.md.
* config: fix "maybe-uninitialized" error when compiling with CFLAGS=-OgCraig Barnes2022-09-17-0/+3
| | | | | | | | | | | | | | | Using GCC 12.2.0 with the following build steps: CFLAGS=-Og meson bld ninja -C bld ...produces the compiler error: ../config.c:2000:18: error: ‘sym_equal’ may be used uninitialized [-Werror=maybe-uninitialized] This commit fixes that by using BUG() to assert that all possible values are accounted for in the offending switch statement.
* input: pipe-*: set current CWD when spawning the sub-processDaniel Eklöf2022-09-10-1/+5
| | | | Closes #1166
* terminal: don’t unref a not-yet-referenced key-binding setDaniel Eklöf2022-09-06-31/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Key-binding sets are bound to a seat/configuration pair. The conf reference is done when a new terminal instance is created. When that same terminal instance is destroyed, the key binding set is unref:ed. If the terminal instance is destroyed *before* the key binding set has been referenced, we’ll still unref it. This creates an imbalance. In particular, when the there is exactly one other terminal instance referencing that same key binding set, that terminal instance will trigger a foot server crash as soon as it receives a key press/release event. This happens because the next-to-last terminal instance brought the reference count of the binding set down to 0, causing it to be free:d. Thus, we *must* reference the binding set *before* we can error out (when instantiating a new terminal instance). At this point, we don’t yet have a valid terminal instance. But, that’s ok, because all the key_binding_new_for_term() did with the terminal instance was get the "struct wayland" and "struct config" pointers. So, rename the function and simply pass these pointers explicitly. Similarly, change key_binding_for() to take a "struct config" pointer, rather than a "struct terminal" pointer. Also rename key_binding_unref_term() -> key_binding_unref().
* csi: damage *viewport* when exiting the alt screenDaniel Eklöf2022-09-06-1/+1
| | | | | This fixes a redraw issue when the normal screen were somewhere in the scrollback history when exiting the alt screen.
* config: change default ‘pad’ to 0x0 (i.e. no padding)Daniel Eklöf2022-09-03-4/+5
|
* Merge branch 'releases/1.13'Daniel Eklöf2022-08-31-6/+15
|\
| * meson: bump version to 1.13.11.13.1releases/1.13Daniel Eklöf2022-08-31-1/+1
| |
| * changelog: prepare for 1.13.1Daniel Eklöf2022-08-31-9/+3
| |
| * url-mode: connect osc-8 links only when both ID and URI matchesDaniel Eklöf2022-08-31-6/+12
| | | | | | | | | | | | | | | | | | | | | | Before this, two OSC-8 links with a matching ID would be connected even if their URIs weren’t the same. This is against the spec: The same id is only used for connecting character cells whose URIs is also the same. Character cells pointing to different URIs should never be underlined together when hovering over. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter
| * changelog: crash when resizing window, or scrollingDaniel Eklöf2022-08-31-0/+4
| |
| * grid: reflow: assert there aren’t any open URIs on the last rowDaniel Eklöf2022-08-31-0/+15
| |
| * grid: reflow: don’t line-wrap the last rowDaniel Eklöf2022-08-31-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, we would line-wrap the last row, just like any other row, and then afterwards try to reverse this, by adjusting the offset and free:ing and NULL:ing the "last row". The problem with this is if the scrollback is full. In this case, the row we’re freeing is the first row in the scrollback history. This means we’ll crash as soon as the viewport is moved to the top of the scrollback. The fix is fairly, simple. Skip the post-processing logic, and instead detect when we’re line-wrapping the last row, and skip the call to line_wrap(). This way, the last row in the new grid corresponds to the last row in the old grid.
| * grid: when setting the new viewport, ensure it’s correctly boundedDaniel Eklöf2022-08-31-17/+11
| | | | | | | | | | | | Do this by using scrollback relative coordinates, and ensure the new viewport is not larger than (grid_rows - screen_rows), as that would mean the viewport crosses the scrollback wrap-around.
| * selection: mark_selected_region(): use an enum to encode how the cells are to be updatedDaniel Eklöf2022-08-31-7/+20
| |
| * selection: restore <= 1.12 behavior in block selection wrt empty cellsDaniel Eklöf2022-08-31-1/+3
| | | | | | | | | | That is, highlight empty cells, regardless of whether they’re trailing or not.
| * ci (sr.ht): pull directly from git.sr.htDaniel Eklöf2022-08-31-3/+3
| |
| * selection: once again highlight non-trailing empty cellsDaniel Eklöf2022-08-31-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Foot 1.13.0 introduced a regression where non-trailing empty cells were highlighted inconsistently (cells that shouldn’t be highlighted, were, seemingly at random). 86663522d5915c0fdb2b8b132bacc247fcfd1fb8 “fixed” this by never highlighting *any* empty cells. This meant the behavior, compared to foot 1.12 and earlier, changed. In foot 1.12 and older versions, non-trailing empty cells were highlighted, as long as the selection covered at least one of the trailing non-empty cells. This patch restores that behavior. To understand how this works, lets first take a look at how selection works: When a selection is made, and updated (i.e. the mouse is dragged, or the selection is extended through RMB etc), we need to (un)tag and dirty the cells that are a) newly selected, or b) newly deselected. That is, we look at the diff between the “old” and the “new” selection, and only update those cells. This is for performance reasons: iterating the entire selection is not feasible with large selections. However, it also means we cannot reason about empty cells; we simply don’t know if an empty cells is a trailing empty cell, or a non-trailing one. Then, when we render a frame, we iterate all the *visible* and *selected* cells, once again tagging them as selected (this is needed since a selected cell might have lost its selected tag if the cell was written to, by the client application, after the selection was made). At this point, we *can* reason about empty cells. So, to restore the highlighting behavior to that of foot 1.12, we do this: When working with the selection diffs when a selection is updated, we don’t special case empty cells at all. Thus, all empty cells covered by the selection is highlighted, and dirtied. But, when rendering the frame, we _do_ special case them. The only difference (compared to foot 1.12) is that we *must* explicitly *clear* the selection tag, and dirty the empty cells. This is to ensure the empty cells that were incorrectly highlighted by the selection update algorithm, isn’t rendered as that. This does have a slight performance impact, as empty cells are now always re-rendered. The impact should however be small.
| * selection: never highlight selected, empty cellsDaniel Eklöf2022-08-31-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression, where empty cells "between" non-empty cells (i.e. non-trailing empty cells) sometimes were incorrectly highlighted. The idea has always been to highlight exactly those cells that will get extracted when they’re copied. This means we’ve not highlighted trailing empty cells, but we _have_ highlighted other empty cells, since they are converted to spaces when copied (whereas trailing empty cells are skipped). fa2d9f86996467ba33cc381f810ea966a4323381 changed how a selection is updated. That is, which cells gets marked as selected, and which ones gets unmarked. Since we no longer walk all the cells, but instead work with pixman regions representing selection diffs, we can no longer determine (with certainty) which empty cells should be selected and which shouldn’t. Before this patch (but after fa2d9f86996467ba33cc381f810ea966a4323381), we sometimes incorrectly highlighted empty cells that should not have been highlighted. This happened when we’ve first (correctly) highlighted a region of empty cells, but then shrink the selection such that all those empty cells should be de-selected. This patch changes the selection behavior to *never* highlight empty cells. This fixes the regression, but also means slightly different behavior, compared to pre-fa2d9f86996467ba33cc381f810ea966a4323381. The other alternative is to always highlight all empty cells. But, since I personally like the fact that we’re skipping trailing empty cells, I prefer the approach taken by this patch.
| * ci: codespell: ignore ‘zar’ (user who contributed)Daniel Eklöf2022-08-31-3/+3
| |
| * input: ignore pointer motion events on unknown surfacesDaniel Eklöf2022-08-12-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases, the compositor sends a pointer enter event with a NULL surface. It’s unclear if this is a compositor bug, or a race (where the compositor sends an enter event on a CSD surface at the same time foot unmaps the CSDs). Regardless, this causes seat->mouse_focus to be unset, which triggers a crash in foot on the next pointer motion event. This patch does two things: a) log a warning when we receive a pointer event with a NULL surface b) ignore motion events where seat->mouse_focus is NULL
| * wayland: #ifdef on XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSIONDaniel Eklöf2022-08-12-0/+8
| | | | | | | | This enables us to compile against wayland-protocols < 1.25
| * render: apply a dimmed overlay while in Unicode input modeDaniel Eklöf2022-08-12-8/+36
| |
| * changelog: add new ‘unreleased’ sectionDaniel Eklöf2022-08-12-0/+11
| |
* | url-mode: connect osc-8 links only when both ID and URI matchesDaniel Eklöf2022-08-30-6/+12
| | | | | | | | | | | | | | | | | | | | | | Before this, two OSC-8 links with a matching ID would be connected even if their URIs weren’t the same. This is against the spec: The same id is only used for connecting character cells whose URIs is also the same. Character cells pointing to different URIs should never be underlined together when hovering over. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter
* | Merge branch 'grid-reflow-viewport-crash-regression'Daniel Eklöf2022-08-30-38/+33
|\ \ | | | | | | | | | Closes #1074
| * | changelog: crash when resizing window, or scrollingDaniel Eklöf2022-08-29-0/+4
| | |
| * | grid: reflow: assert there aren’t any open URIs on the last rowDaniel Eklöf2022-08-29-0/+15
| | |
| * | grid: reflow: don’t line-wrap the last rowDaniel Eklöf2022-08-29-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, we would line-wrap the last row, just like any other row, and then afterwards try to reverse this, by adjusting the offset and free:ing and NULL:ing the "last row". The problem with this is if the scrollback is full. In this case, the row we’re freeing is the first row in the scrollback history. This means we’ll crash as soon as the viewport is moved to the top of the scrollback. The fix is fairly, simple. Skip the post-processing logic, and instead detect when we’re line-wrapping the last row, and skip the call to line_wrap(). This way, the last row in the new grid corresponds to the last row in the old grid.
| * | grid: when setting the new viewport, ensure it’s correctly boundedDaniel Eklöf2022-08-29-17/+11
|/ / | | | | | | | | | | Do this by using scrollback relative coordinates, and ensure the new viewport is not larger than (grid_rows - screen_rows), as that would mean the viewport crosses the scrollback wrap-around.
* | selection: mark_selected_region(): use an enum to encode how the cells are to be updatedDaniel Eklöf2022-08-26-7/+20
| |
* | selection: restore <= 1.12 behavior in block selection wrt empty cellsDaniel Eklöf2022-08-26-1/+3
| | | | | | | | | | That is, highlight empty cells, regardless of whether they’re trailing or not.
* | ci (sr.ht): pull directly from git.sr.htDaniel Eklöf2022-08-23-3/+3
| |
* | selection: once again highlight non-trailing empty cellsDaniel Eklöf2022-08-22-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Foot 1.13.0 introduced a regression where non-trailing empty cells were highlighted inconsistently (cells that shouldn’t be highlighted, were, seemingly at random). 86663522d5915c0fdb2b8b132bacc247fcfd1fb8 “fixed” this by never highlighting *any* empty cells. This meant the behavior, compared to foot 1.12 and earlier, changed. In foot 1.12 and older versions, non-trailing empty cells were highlighted, as long as the selection covered at least one of the trailing non-empty cells. This patch restores that behavior. To understand how this works, lets first take a look at how selection works: When a selection is made, and updated (i.e. the mouse is dragged, or the selection is extended through RMB etc), we need to (un)tag and dirty the cells that are a) newly selected, or b) newly deselected. That is, we look at the diff between the “old” and the “new” selection, and only update those cells. This is for performance reasons: iterating the entire selection is not feasible with large selections. However, it also means we cannot reason about empty cells; we simply don’t know if an empty cells is a trailing empty cell, or a non-trailing one. Then, when we render a frame, we iterate all the *visible* and *selected* cells, once again tagging them as selected (this is needed since a selected cell might have lost its selected tag if the cell was written to, by the client application, after the selection was made). At this point, we *can* reason about empty cells. So, to restore the highlighting behavior to that of foot 1.12, we do this: When working with the selection diffs when a selection is updated, we don’t special case empty cells at all. Thus, all empty cells covered by the selection is highlighted, and dirtied. But, when rendering the frame, we _do_ special case them. The only difference (compared to foot 1.12) is that we *must* explicitly *clear* the selection tag, and dirty the empty cells. This is to ensure the empty cells that were incorrectly highlighted by the selection update algorithm, isn’t rendered as that. This does have a slight performance impact, as empty cells are now always re-rendered. The impact should however be small.
* | theme: change default color theme to solarized-dark-normal-brightsDaniel Eklöf2022-08-22-40/+44
| | | | | | | | | | | | | | | | | | This is my variant of the solarized theme, were only the first eight colors (i.e. the "normal") colors are from the solarized theme. The remaining eight (the "bright" colors) are brightened versions of the "normal" colors. This results in a theme that is usually in all applications, not just those that are "aware" that the terminal color theme is "solarized".
* | selection: never highlight selected, empty cellsDaniel Eklöf2022-08-22-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression, where empty cells "between" non-empty cells (i.e. non-trailing empty cells) sometimes were incorrectly highlighted. The idea has always been to highlight exactly those cells that will get extracted when they’re copied. This means we’ve not highlighted trailing empty cells, but we _have_ highlighted other empty cells, since they are converted to spaces when copied (whereas trailing empty cells are skipped). fa2d9f86996467ba33cc381f810ea966a4323381 changed how a selection is updated. That is, which cells gets marked as selected, and which ones gets unmarked. Since we no longer walk all the cells, but instead work with pixman regions representing selection diffs, we can no longer determine (with certainty) which empty cells should be selected and which shouldn’t. Before this patch (but after fa2d9f86996467ba33cc381f810ea966a4323381), we sometimes incorrectly highlighted empty cells that should not have been highlighted. This happened when we’ve first (correctly) highlighted a region of empty cells, but then shrink the selection such that all those empty cells should be de-selected. This patch changes the selection behavior to *never* highlight empty cells. This fixes the regression, but also means slightly different behavior, compared to pre-fa2d9f86996467ba33cc381f810ea966a4323381. The other alternative is to always highlight all empty cells. But, since I personally like the fact that we’re skipping trailing empty cells, I prefer the approach taken by this patch.
* | config: add setting for underline thicknessYorick Peterse2022-08-20-1/+29
| | | | | | | | | | | | | | | | This adds an "underline-thickness" setting to the "main" section, similar to the existing "underline-offset" setting. This setting is used to specify a custom height for regular (= non-cursor) underlines. Fixes #1136
* | ci: codespell: ignore ‘zar’ (user who contributed)Daniel Eklöf2022-08-20-3/+3
| |
* | input: ignore pointer motion events on unknown surfacesDaniel Eklöf2022-08-12-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases, the compositor sends a pointer enter event with a NULL surface. It’s unclear if this is a compositor bug, or a race (where the compositor sends an enter event on a CSD surface at the same time foot unmaps the CSDs). Regardless, this causes seat->mouse_focus to be unset, which triggers a crash in foot on the next pointer motion event. This patch does two things: a) log a warning when we receive a pointer event with a NULL surface b) ignore motion events where seat->mouse_focus is NULL
* | wayland: #ifdef on XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSIONDaniel Eklöf2022-08-12-0/+8
| | | | | | | | This enables us to compile against wayland-protocols < 1.25
* | render: apply a dimmed overlay while in Unicode input modeDaniel Eklöf2022-08-08-8/+36
| |
* | changelog: add new ‘unreleased’ sectionDaniel Eklöf2022-08-07-0/+11
| |
* | Merge branch 'releases/1.13'Daniel Eklöf2022-08-07-6/+9
|\|
| * meson: bump version to 1.13.01.13.0Daniel Eklöf2022-08-07-1/+1
| |
| * changelog: prepare for 1.13.0Daniel Eklöf2022-08-07-5/+8
|/
* grid: get rid of empty row at the bottom after reflowingDaniel Eklöf2022-08-05-0/+22
| | | | | | | | | | | | | | | | | | | | | | | When the window is resized and we reflow the text, we ended up inserting an empty row at the bottom. This happens whenever the actual last row has a hard linebreak (which almost always is the case); we then end the reflow with a line break, causing an extra, empty, row to be allocated and inserted. This patch fixes this by detecting when: 1) the last row is empty 2) the next to last row has a hard line break In this case, we roll back the last line break, by adjusting the new offset we just calculated, and free:ing the empty row. TODO: it would be nice if we could detect this in the reflow loop instead, and avoid doing the last line break all together. I haven’t yet been able to find a way to do this correctly. Closes #1108
* Add support for xdg_toplevel.wm_capabilitiesSimon Ser2022-08-04-5/+55
| | | | See https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/122
* Add no-op xdg_toplevel.configure_bounds handlerSimon Ser2022-08-03-1/+10
| | | | Next commit uses v5.
* server: Use "normal" socket activation, not inetdMax Gautier2022-07-30-2/+5
| | | | | | | | | | | | | | | | | Systemd, when doing socket activation, pass file descriptors in a non-stable order when there is multiples ones. But we only use one, so we don't need to identify it, and the file descriptors always start at 3. So use 3 for the systemd service. Source : sd_listen_fds (systemd man pages) We also need to unset variables systemd pass to socket activated process, since we don't need them and sub-process (footclient and theirs forks) could be confused by those. Closes #1107
* config: reset errno before calling getline() againDaniel Eklöf2022-07-29-0/+3
| | | | Related to #1107