aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* box-drawing: include pixman image in the buffer we’re passing aroundDaniel Eklöf2021-05-17-2/+6
|
* Merge branch 'reflow-performane-no-new-row-initialization'Daniel Eklöf2021-05-17-6/+17
|\ | | | | | | Part of #504
| * grid: reflow: free old rows as soon as we’re done with themDaniel Eklöf2021-05-17-3/+8
| | | | | | | | | | | | This reduces the memory cost of reflowing text, as we no longer needs to hold both the old and the new grid, in their entirety, in memory at the same time.
| * grid: reflow: don’t initialize newly allocated rowsDaniel Eklöf2021-05-17-3/+9
|/ | | | | | | | | | | | | We’re going to write to it immediately anyway. In most cases, *all* newly allocated, and zero-initialized, cells are overwritten. So let’s skip the zero-initialization of the new cells. There are two cases where we need to explicitly clear cells now: * When inserting a hard line break - erase the remaining cells * When done, the *last* row may not have been completely written - erase the remaining cells
* Merge branch 'font-scaling-factor-wrong'Daniel Eklöf2021-05-17-50/+22
|\ | | | | | | Closes #509
| * term: get rid of term->font_scale, use term->scale onlyDaniel Eklöf2021-05-17-22/+16
| | | | | | | | | | | | | | | | | | We only needed term->font_scale to be able to detect scaling factor changes (term->font_scale != term->scale). But, we already have the old scaling factor in all places where term_font_dpi_changed() is called, so let’s pass the old scaling factor as an argument instead.
| * changelog: fonts sometimes not being reloaded with the correct scaling factorDaniel Eklöf2021-05-17-0/+3
| |
| * render: simply check for an invalid (not set) scaling factorDaniel Eklöf2021-05-17-1/+1
| |
| * term: remove get_font_scale()Daniel Eklöf2021-05-17-39/+14
|/ | | | | | | | | | | | | | | | | | | | | | | get_font_scale() was used to get the new scaling factor when loading fonts. This was then compared to the last seen font scaling factor. If there was no difference, the fonts were not reloaded. The problem was, the initial term->scale was set differently. This sometimes led to term->scale=2, while get_font_scale() return 1. That meant, fonts were initially scaled by 2 (when dpi-aware=no). Later, when mapped on an output (and thus term->scale being set to 1), the fonts weren’t reloaded with the correct scaling factor since the cached term->font_scale value was already 1. Since term->scale always reflects the *new* scaling factor when term_font_dpi_changed() is called, use that directly, and remove get_font_scale(). Also rename the following functions: * font_should_size_by_dpi() -> font_size_by_dpi_for_scale() * font_size_by_dpi() -> font_sized_by_dpi() * font_size_by_scale() -> font_sized_by_scale()
* Merge branch 'reflow-performance'Daniel Eklöf2021-05-16-97/+171
|\ | | | | | | Part of #504
| * grid: reflow: qsort_r() is not portableDaniel Eklöf2021-05-15-11/+15
| | | | | | | | Replace with qsort() + global variable. Not thread safe!
| * grid: include <stdlib.h>, for qsort_r()Daniel Eklöf2021-05-15-0/+1
| |
| * grid: reflow: always run qsort_r(), handle rows == 0 in tp_cmp() insteadDaniel Eklöf2021-05-15-7/+5
| |
| * grid: take scrollback start into account when sorting the tracking points arrayDaniel Eklöf2021-05-15-9/+29
| | | | | | | | | | | | | | | | | | | | The row numbers in the tracking points are in absolute numbers. However, when we walk the old grid, we do so starting in the beginning of the scrollback history. We must ensure the tracking points are sorted such that the *first* one we see is the “oldest” one. I.e. the one furthest back in the scrollback history.
| * grid: fix 32-bit compilationDaniel Eklöf2021-05-15-2/+4
| |
| * grid: reflow: tag tracking point if-statements with likely/unlikelyDaniel Eklöf2021-05-15-5/+5
| |
| * grid: reflow: use a sorted array for tracking pointsDaniel Eklöf2021-05-15-27/+66
| | | | | | | | | | | | | | | | | | | | | | Instead of iterating a linked list of tracking points, for *each and every* cell in the old grid, use a sorted array. This allows us to step through the array of tracking points as we walk the old grid; each time we match a tracking point, we move to the next one. This means we only have to check a single tracking point for each cell.
| * render: set tracking point count to 0 if there’s no active selectionDaniel Eklöf2021-05-15-1/+1
| |
| * grid: reflow: no need to check for combining charactersDaniel Eklöf2021-05-14-21/+10
| | | | | | | | Since we no longer call wcwidth(), we don’t need the base character.
| * grid: don’t depend on wcwidth()Daniel Eklöf2021-05-14-41/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling wcwidth() on every character in the entire scrollback history is slow. We already have the character width encoded in the grid; it’s in the CELL_SPACERs following a multi-column character. Thus, when we see a non-SPACER character, that isn’t in the last column, peek the next character. If it’s a SPACER, get the current characters width from it. The only thing we need the width for, is to be able to print padding SPACERS in the right margin, if the there isn’t enough space on the current row for the current character.
| * term: rename CELL_MULT_COL_SPACER -> CELL_SPACER, and change its definitionDaniel Eklöf2021-05-14-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using CELL_SPACER for *all* cells that previously used CELL_MULT_COL_SPACER, include the remaining number of spacers following, and including, itself. This is encoded by adding to the CELL_SPACER value. So, a double width character will now store the character itself in the first cell (just like before), and CELL_SPACER+1 in the second cell. A three-cell character would store the character itself, then CELL_SPACER+2, and finally CELL_SPACER+1. In other words, the last spacer is always CELL_SPACER+1. CELL_SPACER+0 is used when padding at the right margin. I.e. when writing e.g. a double width character in the last column, we insert a CELL_SPACER+0 pad character, and then write the double width character in the first column on the next row.
| * grid: add compile-time define to enable timing of the reflow operationDaniel Eklöf2021-05-14-0/+17
| |
* | Merge branch 'vt-anywhere-fix2'Craig Barnes2021-05-16-3/+2
|\ \
| * | Update `term->vt.state` for each iteration of vt_from_slave() loopCraig Barnes2021-05-15-3/+2
| | | | | | | | | | | | Otherwise it may be stale when read by the anywhere() function.
* | | Merge branch 'sixel-dont-shrink-below-sra-size'Daniel Eklöf2021-05-16-6/+8
|\ \ \ | |_|/ |/| |
| * | sixel: don’t *ever* shrink image below its SRA sizeDaniel Eklöf2021-05-16-6/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | If the image was accompanied with a “Set Raster Attributes” (SRA) command, make sure we *never* shrink the image below the size specified in the SRA. Images are normally shrunk when their bottom rows are fully transparent. This enables sixels that aren’t a multiple of 6 to be emitted, without also emitting an SRA command. But if there *is* an SRA command, obey it. Verified against XTerm-367
* | Merge branch 'xdg-activation'Daniel Eklöf2021-05-14-17/+130
|\ \ | |/ |/| | | Closes #487
| * changeloge: xdg-activation supportDaniel Eklöf2021-05-14-0/+3
| |
| * ci: try switching the gitlab CI from alpine:latest -> alpine:edgeDaniel Eklöf2021-05-14-5/+5
| |
| * wayland: workaround epoll-shim defining the macro closeDaniel Eklöf2021-05-14-1/+1
| |
| * meson: add xdg-activation-v1.xml conditionallyDaniel Eklöf2021-05-14-3/+31
| | | | | | | | | | | | | | | | | | | | Only enable XDG activation when compiling against wayland-protocols 1.21. Older versions don’t have this protocol. When available, define HAVE_XDG_ACTIVATION. Make all usages of xdg_activation_v1 and xdg_activation_token_v1 conditional.
| * pgo: add wayl_win_set_urgent() stubDaniel Eklöf2021-05-14-0/+1
| |
| * wayland: set xdg activation token surface to our top-levelDaniel Eklöf2021-05-14-1/+3
| |
| * xdg-activation: initial support for setting urgency using XDG activationDaniel Eklöf2021-05-14-10/+89
|/
* Merge branch 'vt-anywhere-cleanup'Craig Barnes2021-05-13-201/+44
|\
| * vt: make anywhere() function return `term->vt.state` by defaultCraig Barnes2021-05-13-14/+14
| | | | | | | | | | Instead of passing a `default_return` parameter, which is always just the current state anyway.
| * vt: clean up handling of "anywhere" actionsCraig Barnes2021-05-13-201/+44
| |
* | Merge branch 'install-tweaks'Daniel Eklöf2021-05-13-5/+5
|\ \ | |/ |/|
| * INSTALL: fix an unclosed markdown quoteDaniel Martí2021-05-13-5/+5
|/ | | | | | | | While skimming this doc, I noticed that "-Dterminfo" wasn't rendering properly as it was lacking its closing backquote. While at it, tweak the Arch wiki link, as it redirects to replace /index.php with /title.
* Merge branch 'no-underlines-below-cell'Daniel Eklöf2021-05-12-2/+10
|\ | | | | | | Closes #503
| * render: force underlines to be visibleDaniel Eklöf2021-05-12-2/+10
|/ | | | | | | | | | | | | | | In some cases, the underline position (typically provided by the font, mind you), end up below the cell, making it visible. Note that below the cell here means below the line. I.e. the font provided underline position is below the font provided line height... Oh well. Doing this in foot rather than fcft, since other applications typically don’t have to clip the rendered text. Closes #503
* Merge branch 'remove-plasma-quirk'Daniel Eklöf2021-05-12-32/+4
|\
| * quirk: remove plasma/kwin quirkDaniel Eklöf2021-05-12-32/+4
|/ | | | | | Older version of Plasma/KWin had an issue where buffer damage recorded before the buffer was attached were ignored. This appears to have been fixed now.
* Merge branch 'double-buffering'Daniel Eklöf2021-05-12-94/+273
|\ | | | | | | Closes #478
| * changelog: improved performance when double bufferingDaniel Eklöf2021-05-12-0/+3
| |
| * render: always do a full repaint if last buffer’s dimension doesn’t matchDaniel Eklöf2021-05-12-8/+9
| |
| * render: add margins to buffer’s dirty region when rendering marginsDaniel Eklöf2021-05-12-0/+12
| |
| * shm: clear buffer’s dirty region before returning a cached bufferDaniel Eklöf2021-05-12-2/+1
| | | | | | | | A non-busy buffer should always have an empty dirty region
| * shm: set ‘age’ in newly allocated buffers to something largeDaniel Eklöf2021-05-12-1/+1
| | | | | | | | This ensures we don’t try to do a partial update of fresh buffer.
| * shm: free scroll damage before returning cached bufferDaniel Eklöf2021-05-12-0/+2
| |
| * render: warn if we’re forced to double buffer at least 5 timesDaniel Eklöf2021-05-12-1/+8
| |
| * render: code cleanup, log double buffering timeDaniel Eklöf2021-05-12-182/+189
| | | | | | | | | | | | | | | | | | | | | | * Break out cursor cell dirtying to separate functions * Break out handling of double buffering * Handle buffers with age > 1 (we’re swapping between more than 2 buffers) * Detect full screen repaints, and skip re-applying old frame’s damage * Use an allocated array insted of a tll list for old frame’s scroll damage * When logging frame rendering time, including the amount used for double buffering.
| * render: subtract current frame’s damage when there’s no scroll damageDaniel Eklöf2021-05-12-10/+6
| | | | | | | | | | | | | | | | | | | | | | When re-applying the previous frame’s damage (due to us being forced to double buffer), subtract the current frame’s damage from the region-to-copy when there’s no scroll damage on the current frame. When the current frame doesn’t have any scroll damage, the current frame’s damage is in the same coordinate system as the previous frame’s damage, and we can safely remove it from the region we copy from.
| * render: wip: re-apply last frame’s damage when forced to double bufferDaniel Eklöf2021-05-12-12/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we are forced to swap between two buffers, re-apply the old frame’s damage to the current buffer, before applying the current frame’s damage. First, while applying this frame’s scroll damage, copy it to the buffer’s scroll damage list (so that we can access it via term->render.last_buf). Also, when iterating and rendering the grid, build a pixman region of the damaged regions. This is currently done on a per-row basis. This is also stored in the buffer. Now, when being forced to double buffer, first iterate the old buffer’s damage, and re-apply it to the current buffer. Then, composite the old buffer on top of the current buffer, using the old frame’s damage region as clip region. This effectively copies everything that was rendered to the last frame. Remember, this is on a per-row basis. Then we go on and render the frame as usual. Note that it would be _really_ nice if we could subtract the current frame’s damage region from the clip region (no point in copying areas we’re going to overwrite anyway). Unfortunately, that’s harder than it looks; the current frame’s damage region is only valid *after* this frame’s scroll damage have been applied, while the last frame’s damage region is only valid *before* it’s been applied. Translating one to the other isn’t easy, since scroll damage isn’t just about counting lines - there may be multiple scroll damage records, each with its own scrolling region. This creates very complex scenarios.
| * shm: add damage tracking to bufferDaniel Eklöf2021-05-12-0/+9
| |
| * shm: track busy buffers’ age, and add compile-time option to force double bufferingDaniel Eklöf2021-05-12-11/+34
|/ | | | | | | | | By default, age all matching buffers that are busy (i.e. in use by the compositor). This allows us to detect whether we can apply the current frame’s damage directly, or if we need to prepare the buffer first (e.g. copy old buffer, or re-apply last frame’s damage etc).
* wayland: codespell: pre-empt -> preemptDaniel Eklöf2021-05-11-1/+1
|
* wayland: add comment describing the configure preempt workaroundDaniel Eklöf2021-05-10-1/+26
|
* Merge branch 'sixel-assertion'Daniel Eklöf2021-05-08-3/+19
|\ | | | | | | Closes #494
| * changelog: sixel assertion hit when a sixel fills the scrollbackDaniel Eklöf2021-05-08-0/+2
| |
| * sixel: don’t emit sixels that will end up covering more than the entire scrollbackDaniel Eklöf2021-05-08-2/+16
| | | | | | | | | | | | | | This limit can be reached by the sixel alone, or the sixel + the final newline. Closes #494
| * sixel: fix assertion: image is allowed to cover the entire scrollbackDaniel Eklöf2021-05-08-1/+1
|/
* Merge branch 'osc8-mem-leak'Daniel Eklöf2021-05-08-5/+10
|\ | | | | | | Closes #495
| * term: reset: combine memset+initializers of vt structDaniel Eklöf2021-05-08-3/+4
| |
| * term: reset: fix reset of the VT structDaniel Eklöf2021-05-08-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | 1. Free buffers and strings 2. memset() the vt struct 3. re-initialize members that must not be zero We _could_ replace the memset() with explicit zeroing of all the members. It’s just that there’s a lot of arrays, so this is much easier. Closes #495
| * term: osc8-open: assert URI in VT struct is NULLDaniel Eklöf2021-05-08-0/+2
|/
* Merge branch 'simplify-parse_section_colors'Craig Barnes2021-05-08-16/+14
|\
| * config: simplify parse_section_colors()Craig Barnes2021-05-08-16/+14
| |
* | config: simplify parsing of "scaling-filter" values slightlyCraig Barnes2021-05-08-12/+9
|/
* Merge branch 'config-code-size'Daniel Eklöf2021-05-08-106/+186
|\
| * config: avoid tll() code expansion when generating default bindingsDaniel Eklöf2021-05-07-29/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | tll_push_back() is a macro that results in quite a lot of instructions. Expanding this macro explicitly in many places thus causes code explosion. This is what happened in when we generate the default key/mouse bindings. Fix by calling tll_push_back() in a no-inline function. Reduces code size with ~4-5K
| * config: don’t inline str_to_*() functionsDaniel Eklöf2021-05-07-8/+8
| |
| * config: implement LOG_AND_NOTIFY_* macros in terms of no-inline functionsDaniel Eklöf2021-05-07-35/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduces code size by quite a lot: From: section size addr .text 37857 0 ... Total 45169 To: section size addr .text 31681 0 ... Total 38993 LTO release build goes from 500K -> 492K
| * xmalloc: export xvasprintf()Daniel Eklöf2021-05-07-1/+3
| |
| * log: add va_list versions of log_* functionsDaniel Eklöf2021-05-07-33/+73
| |
* | Merge branch 'color-table-config'Daniel Eklöf2021-05-08-4/+28
|\ \ | |/ |/| | | Closes #489
| * configure full color palette in foot.iniRyan Farley2021-05-08-4/+28
|/ | | | | Allow the use of numeric keys in [colors] to configure the full set of 256 colors in the palette. Fixes #489
* Merge branch 'bell-enhancement'Daniel Eklöf2021-05-07-54/+125
|\
| * consistent booleans in config, reset legacy bellRyan Farley2021-05-07-6/+12
| |
| * update changelogRyan Farley2021-05-07-0/+6
| |
| * clearly mark bell as a sectionRyan Farley2021-05-07-1/+1
| |
| * style, consistent bool names, deprecate old configRyan Farley2021-05-07-6/+32
| |
| * enhanced bell configurationRyan Farley2021-05-07-63/+96
| | | | | | | | | | | | | | | | | | | | Add a separate section for bell configuration, with a bell-specific command option and a setting to allow that command to run without regard to keyboard focus (for those of us who enjoy being beeped at at all times, for example). The actions are also no longer mutually exclusive; this is primarily anticipating urgency support which cannot be replicated outside the process (in server mode anyway) and would thus be complementary to any notification or arbitrary command.
* | Merge branch 'bump-fcft-to-2-4-0'Daniel Eklöf2021-05-07-1/+3
|\ \ | |/ |/|
| * meson: require fcft >= 2.4Daniel Eklöf2021-05-07-1/+3
|/
* Merge branch 'fix-color-cube'Daniel Eklöf2021-05-06-3/+10
|\ | | | | | | Closes #479
| * config: fix color cube generationDaniel Eklöf2021-05-06-3/+10
|/ | | | Closes #479
* doc: foot.ini: update max-shm-pool-size-mb sectionDaniel Eklöf2021-05-05-7/+10
| | | | | | | * less highlighting * it’s ‘virtual *address space*’ * mention it’s only supported on Linux * mention it’s only supported on 64-bit archs (but not necessarily x86_64)
* Merge branch 'more-unicode-13-box-drawings'Daniel Eklöf2021-05-04-6/+260
|\ | | | | | | Related to #471
| * box-drawing: add Unicode 13 U+1FB70 - U+1FB8BDaniel Eklöf2021-05-04-6/+260
|/ | | | Part of #471
* Merge branch 'bg-alpha-on-default-bg-only'Daniel Eklöf2021-05-04-4/+8
|\
| * render: only apply alpha when we’re using the default bg for backgroundDaniel Eklöf2021-05-04-4/+8
|/ | | | | | | | In all other cases, alpha is disabled. This includes: * Palette- or RGB-colors matching the default background color * When any kind of reverse video is enabled (e.g. DECSCNM, or ANSI reverse)
* Merge branch 'missing-xkb-build-dependency'Daniel Eklöf2021-05-04-3/+3
|\
| * meson: add ‘xkb’ as a dependency to vtlib, pgolib and pgoDaniel Eklöf2021-05-01-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of these include wayland.h (either directly, or indirectly), which pulls in xkbcommon.h. Reported by swayyyy on IRC: FAILED: libvtlib.a.p/dcs.c.o In file included from ../../terminal.h:19, from ../../dcs.h:4, from ../../dcs.c:1: ../../wayland.h:9:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory 9 | #include <xkbcommon/xkbcommon.h> | ^
* | Merge branch 'custom-exit-code'Daniel Eklöf2021-05-04-21/+57
|\ \ | | | | | | | | | Closes #466
| * | doc: foot.1 footclient.1: document exit statusDaniel Eklöf2021-05-04-3/+24
| | |
| * | main/client: change exit codeDaniel Eklöf2021-05-04-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | * foot exits with -26/230 * footclient exits with -36/220 This is to give each application a range of exit codes. Currently unused, but we may want to change this in the future.
| * | foot/footclient: use a custom exit code when foot/footclient fail to runDaniel Eklöf2021-05-04-18/+33
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, foot and footclient uses the exit code from the client application (i.e. the shell). However, foot (or footclient) itself may fail to run; if run outside of a Wayland session, or no fonts are installed, or the client application/shell cannot be found (“foot lsdjfldsjf”) etc. Up until now, there has been no way to differentiate these kind of failures from the client application exiting with code 1. This patch changes foot’s failure exit code to -27/229, and footclient’s to -28/228. Note that footclient will exit with foot’s -27/229 if footclient ran successfully, but the foot server failed to instantiate a new window. Closes #466.
* | Merge branch 'beam-thickness'Daniel Eklöf2021-05-04-29/+57
|\ \ | | | | | | | | | Closes #464
| * | config: add ‘beam-thickness’ optionDaniel Eklöf2021-04-30-29/+57
| |/ | | | | | | | | | | | | | | | | | | | | * Rename cursor.style value ‘bar’ to ‘beam’. ‘bar’ remains recognized, but should eventually be deprecated and then removed. * Add ‘cursor.beam-thickness’ option, a pt-or-px value specifying the thickness of the beam cursor. Defaults to 1.5pt. * Rename (and export) pt_or_px_as_pixels() to term_pt_or_px_as_pixels() * Change term_pt_or_px_as_pixels() to round point values instead of truncating them.