aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* box-drawing: wedges: pre-load x_halfs[] and y_thirds[]Daniel Eklöf2021-08-05-64/+71
| | | | This reduces the number of loads in the rest of the function.
* box-drawing: wedges: avoid floating point mathDaniel Eklöf2021-08-05-68/+66
| | | | | Re-use the pre-calculated offsets used by the sextants. This is the correct thing to do since wedges *should* align with sextants.
* box-drawing: pre-calculate sextant x,y offsetsDaniel Eklöf2021-08-05-6/+19
| | | | | | | | We’re using floating point math, as a way to ensure that sextant primitives overlap, rather than leaving empty spaces, or being uneven, when the cell width/height isn’t divisible with 2 (width) or 3 (height). This gets rid of all floating point math from the sextant drawing functions.
* box-drawing: deal with quads in the same as sextantsDaniel Eklöf2021-08-05-79/+42
| | | | | | That is, encode which “pieces” make up each quad in a static array, and use a single function to draw all quads using the four primitives “upper left/right, lower left/right”.
* box-drawing: don’t inline horizontal-one-eighth-block-NDaniel Eklöf2021-08-05-1/+1
|
* box-drawing: don’t inline light diagionalDaniel Eklöf2021-08-05-2/+2
|
* Merge branch 'box-drawing-wedges'Daniel Eklöf2021-08-05-15/+356
|\ | | | | | | Closes #474
| * box-drawing: wedges: fix alignment of inverted wedgesDaniel Eklöf2021-08-05-33/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | We render the inverted wedges by first rendering a non-inverted triangle, and then inverting it with PIXMAN_OP_OUT. In cases where truncating and round():ing the triangle points have different results, the final, inverted wedge ends up being unaligned with the corresponding sixel(s). This patch fixes that by handling the pre-inverted triangles specifically. I.e. we don’t re-use the same triangle coordinates as the corresponding non-inverted triangle.
| * box-drawing: wedges: don’t group similar cases togetherDaniel Eklöf2021-08-05-48/+100
| | | | | | | | | | Since they’re not exactly alike, we still need branches within each case. Better to split them up - one case per codepoint.
| * box-drawing: add U+1FB3C-U+1FB6F, U+1FB9A and U+1FB9BDaniel Eklöf2021-08-05-15/+228
|/ | | | | | These are the “wedges” from the Unicode 13 “Legacy Computing” symbols. Closes #474
* term: disable debug loggingDaniel Eklöf2021-08-05-1/+1
|
* Merge branch 'async-client-termination'Daniel Eklöf2021-08-03-66/+212
|\
| * term: send SIGTERM/SIGKILL to the entire process groupDaniel Eklöf2021-07-31-8/+10
| |
| * changelog: asynchronous client application terminationDaniel Eklöf2021-07-31-0/+6
| |
| * term: fix release builds when LOG_ENABLE_DBG=0Daniel Eklöf2021-07-31-1/+2
| |
| * term: consolidate shutdown related state into an anonymous structDaniel Eklöf2021-07-31-39/+48
| |
| * term: rename: slave_died() -> fdm_client_terminated()Daniel Eklöf2021-07-31-5/+6
| |
| * term: asynchronous client application terminationDaniel Eklöf2021-07-31-43/+170
|/ | | | | | | | | | | | | | | | | | When the foot window is closed, and we need to terminate the client application, do this in an asynchronous fashion: * Don’t do a blocking call to waitpid(), instead, rely on the reaper callback * Use a timer FD to implement the timeout before sending SIGKILL (instead of using SIGALRM). * Send SIGTERM immediately (we used to *just* close the PTY, and then wait 2 seconds before sending SIGTERM). * Raise the timeout from 2 seconds to 60 Full shutdown now depends on *two* asynchronous tasks - unmapping the window, and waiting for the client application to terminate. Only when *both* of these have completed do we proceed and call term_destroy(), and the user provided shutdown callback.
* Merge branch 'tilde-expansion-in-include'Daniel Eklöf2021-07-31-9/+28
|\ | | | | | | Closes #659
| * config: include: use xasprintf() instead of two calls to snprintf()Daniel Eklöf2021-07-30-3/+1
| |
| * doc: foot.ini: include paths are allowed to begin with ~/Daniel Eklöf2021-07-30-6/+4
| |
| * config: include: handle get_user_home_dir() returning NULLDaniel Eklöf2021-07-30-2/+9
| |
| * config: include: add support for ~-expansionDaniel Eklöf2021-07-30-1/+17
| | | | | | | | Closes #659
* | editorconfig: don’t trim trailing whitespace in *.scdDaniel Eklöf2021-07-30-4/+2
| | | | | | | | Doing so ruins the indentation of empty-line separated paragraphs.
* | client: remove info log of client app’s exit-codeDaniel Eklöf2021-07-30-2/+0
|/
* doc: foot.ini: indent listsDaniel Eklöf2021-07-30-14/+14
|
* Merge branch 'editorconfig'Daniel Eklöf2021-07-28-0/+19
|\
| * editorconfig: initialDaniel Eklöf2021-07-28-0/+19
|/
* Merge branch 'bright_bold'Daniel Eklöf2021-07-26-2/+8
|\
| * Only brighten palette colors with bold-text-in-bright=palette-basedDavid Rosca2021-07-26-2/+8
|/
* changelog: initialize output scaling factor to 1Daniel Eklöf2021-07-26-0/+5
|
* wayland: set scale to 1 by defaultNihal Jere2021-07-26-0/+1
| | | | | The wl_output protocol specifies that the client should assume that scale is 1 if not set by the compositor.
* readme: mention XTVERSIONDaniel Eklöf2021-07-25-0/+5
|
* Merge branch 'dont-hang-when-wl-connection-is-broken'Daniel Eklöf2021-07-25-1/+11
|\ | | | | | | Closes #651
| * wayland: prevent hang when terminating due to broken Wayland connectionDaniel Eklöf2021-07-24-1/+11
|/ | | | | | | | | | | | | | | | | | | | | If the call to fdm_wayl() with EPOLLHUP was followed by calls to wayl_roundtrip(), foot would hang. The reason for this is that the EPOLLHUP handler in fdm_wayl() would call wl_display_cancel_read(). wayl_roundtrip() also calls wl_display_cancel_read() (since we normally have called wl_display_prepare_read()), before calling wl_display_roundtrip(). When calling wl_display_cancel_read() two times in a row, without a wl_display_prepare_read() in between, wl_display_roundtrip() hangs. Fix by not calling wl_display_cancel_read() in fdm_wayl(). This ensures our invariant holds: wl_display_prepare_read() is *always* in effect outside of fdm_wayl(). Closes #651
* doc: meson: no need to check for scdoc againDaniel Eklöf2021-07-24-1/+0
| | | | We’re already checking for scdoc in the top-level meson.build
* meson: add -Ddocs=disabled|enabled|auto command line optionDaniel Eklöf2021-07-24-6/+18
| | | | | When enabled (the default, if scdoc is found), we build and install the man pages, example foot.ini, readme, changelog and license files.
* Merge branch 'csd-title'Daniel Eklöf2021-07-24-86/+268
|\ | | | | | | Closes #638
| * doc: foot.ini: mention that csd.font is sized using the title bar sizeDaniel Eklöf2021-07-24-1/+3
| |
| * foot.ini: add csd.fontDaniel Eklöf2021-07-24-0/+1
| |
| * render: render_osd(): use fcft_text_run_rasterize(), if availableDaniel Eklöf2021-07-24-6/+32
| |
| * render: render_osd(): fix rendering of color bitmap glyphsDaniel Eklöf2021-07-24-6/+11
| |
| * render: render_osd(): don’t re-instantiate foreground color for each glyphDaniel Eklöf2021-07-24-0/+2
| |
| * render: render_osd(): don’t assume a monospace fontDaniel Eklöf2021-07-24-6/+1
| |
| * config: add csd.font optionDaniel Eklöf2021-07-24-18/+95
| |
| * changelog: window title in CSDsDaniel Eklöf2021-07-24-0/+5
| |
| * render: csd_title(): use a custom font, sized based on the title bar’s heightDaniel Eklöf2021-07-24-3/+43
| | | | | | | | | | | | | | | | We still use the primary font, but use a custom size, based on the title bar’s height. This fixes an issue where the window title could be way too small, or way too big. And changed size when the terminal font size was changed.
| * render: render_osd() now needs a ‘font’ argumentDaniel Eklöf2021-07-24-3/+3
| |
| * render: render_osd(): pass font as argumentDaniel Eklöf2021-07-24-5/+9
| |
| * render: refresh CSD in render_refresh_title(), not render_update_title()Daniel Eklöf2021-07-24-1/+2
| | | | | | | | | | This fixes an issue where the CSD title sometimes got stuck on an “old” title.
| * render: refresh CSDs when updating the titleDaniel Eklöf2021-07-24-0/+1
| |
| * render: csd_title(): use render_osd() to render the current window titleDaniel Eklöf2021-07-24-11/+25
| |
| * render: must now set alpha in bg color when calling render_osd()Daniel Eklöf2021-07-24-4/+4
| |
| * render: render_osd(): set clip region, use background alphaDaniel Eklöf2021-07-24-53/+61
| | | | | | | | | | | | | | | | | | Set clip region in render_osd(). This ensures we don’t step outside the pixman buffer when rendering the glyphs. Furthermore, don’t ignore the alpha channel in the background color. Move render_osd() to make it visible to the render_csd_*() functions.
| * render: color_dim(): retain alpha channelDaniel Eklöf2021-07-24-1/+2
|/
* readme: add OSC-9 to list of supported OSC sequencesDaniel Eklöf2021-07-24-0/+1
|
* osc: fix typo in LOG_DBG() messageCraig Barnes2021-07-24-1/+1
|
* readme: fix a typoKnut Anders Hatlen2021-07-23-1/+1
|
* pgo: add stub for search_selection_cancelled()Daniel Eklöf2021-07-23-0/+2
| | | | | | | Fixes PGO build failures caused by 251545203baa65364e491ddbe71ab3f8080bfe25 Closes #648
* Merge branch 'search-crash-when-selection-is-cancelled'Daniel Eklöf2021-07-22-0/+16
|\ | | | | | | Closes #644
| * search: redraw search box after selection has been cancelledDaniel Eklöf2021-07-22-0/+1
| |
| * search: reset match state when selection is cancelledDaniel Eklöf2021-07-22-0/+15
|/ | | | | | | | | | | | While we’re in scrollback search mode, the selection may be cancelled (for example, if the application is scrolling out the selected text). Trying to e.g. extend the search selection after this has happened triggered a crash. This fixes it by simply resetting the search match state when the selection is cancelled. Closes #644
* doc: ctlseq: improve description of OSC 52 responseDaniel Eklöf2021-07-22-2/+2
|
* Merge branch 'pgo-shm-fixes'Daniel Eklöf2021-07-22-0/+11
|\ | | | | | | Closes #642
| * pgo: fix PGO builds with clangDaniel Eklöf2021-07-22-0/+11
|/ | | | | | | | Add stubs for shm_chain_new(), shm_chain_free() and shm_unref(). This fixes ‘pgo’ linking failures in the ‘generate’ phase when doing a PGO build with clang. Closes #642
* Merge branch 'prevent-overflow-into-margin'Daniel Eklöf2021-07-20-1/+7
|\
| * render: prevent cells from overflowing into marginTimur Celik2021-07-20-1/+7
|/
* changelog: add new ‘unreleased’ sectionDaniel Eklöf2021-07-18-0/+11
|
* Merge branch 'releases/1.8'Daniel Eklöf2021-07-18-6/+5
|\
| * meson/pkgbuild: bump version to 1.8.21.8.2releases/1.8Daniel Eklöf2021-07-18-2/+2
| |
| * changelog: prepare for 1.8.2Daniel Eklöf2021-07-18-4/+3
| |
| * Merge branch 'master' into releases/1.8Daniel Eklöf2021-07-18-451/+1082
| |\ | |/ |/|
* | changelog: remove entries that are no longer relevantDaniel Eklöf2021-07-18-4/+0
| | | | | | | | | | The tweak.allow-overflowing-double-width-glyphs option have been superseded by tweak.overflowing-glyphs.
* | Merge branch 'csd-shared-shm-pool'Daniel Eklöf2021-07-18-56/+48
|\ \
| * | render: use a single backing SHM pool for CSD surface buffersDaniel Eklöf2021-07-18-56/+44
| | |
| * | shm: get_many(): allow “NULL” buffers - buffers where width or height is 0Daniel Eklöf2021-07-18-0/+4
|/ / | | | | | | | | | | | | | | When a zero-sized buffer is requested, simply return a NULL buffer, instead of crashing with a Wayland protocol error. This makes it easier to request many buffers, where some may be zero-sized, without having to pack the width/height and bufs arrays.
* | term: erase_scrollback(): destroy sixels that touch the scrollbackDaniel Eklöf2021-07-18-13/+55
| |
* | sixel: destroy(): don’t unref a NULL pixman imageDaniel Eklöf2021-07-18-2/+3
| |
* | Merge branch 'crash-when-selection-is-in-scrollback-and-scrollback-is-erased'Daniel Eklöf2021-07-18-23/+166
|\ \ | | | | | | | | | Closes #633
| * | changelog: crash when \E[3J was executed with a selection in the scrollbackDaniel Eklöf2021-07-18-0/+3
| | |
| * | term: add unit test for term_erase_scrollback()Daniel Eklöf2021-07-18-0/+97
| | |
| * | csi: erase scrollback: cancel selection if it touches the scrollbackDaniel Eklöf2021-07-18-23/+66
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This breaks out the scrollback erasing logic for \E[3J from csi.c, and moves it to the new function term_erase_scrollback(), and changes the logic to calculate the start and end row (absolute) numbers of the scrollback, and only iterate those, instead of iterating *all* rows, filtering out those that are on-screen. It also adds an intersection range check of the selection range, and cancels the selection if it touches any of the deleted scrollback rows. This fixes a crash when trying to render the next frame, since the selection now references rows that have been freed. Closes #633
* | Merge branch 'refactor-shm-buffer-management'Daniel Eklöf2021-07-18-277/+382
|\ \
| * | shm: chain_free: BUG() if there are buffers remaining after purgeDaniel Eklöf2021-07-17-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | There may be buffers left, if their destruction has been deferred. However, they should be on the 'deferred' list, not the chain's buffer list. If there are buffers left on the chain's list, that means someone forgot to call shm_unref().
| * | shm: get_buffer: purge mismatching buffers in first buffer iterationDaniel Eklöf2021-07-17-26/+6
| | | | | | | | | | | | | | | | | | There's no longer any need to defer purging of mismatching buffer (i.e. buffers whose width/height doesn't match the requested ones) to after the cache lookup loop.
| * | shm: refactor: move away from a single, global, buffer listDaniel Eklöf2021-07-17-164/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, *all* buffers have been tracked in a single, global buffer list. We've used 'cookies' to separate buffers from different contexts (so that shm_get_buffer() doesn't try to re-use e.g. a search-box buffer for the main grid). This patch refactors this, and completely removes the global list. Instead of cookies, we now use 'chains'. A chain tracks both the properties to apply to newly created buffers (scrollable, number of pixman instances to instantiate etc), as well as the instantiated buffers themselves. This means there's strictly speaking not much use for shm_fini() anymore, since its up to the chain owner to call shm_chain_free(), which will also purge all buffers. However, since purging a buffer may be deferred, if the buffer is owned by the compositor at the time of the call to shm_purge() or shm_chain_free(), we still keep a global 'deferred' list, on to which deferred buffers are pushed. shm_fini() iterates this list and destroys the buffers _even_ if they are still owned by the compositor. This only happens at program termination, and not when destroying a terminal instance. I.e. closing a window in a “foot --server” does *not* trigger this. Each terminal instatiates a number of chains, and these chains are destroyed when the terminal instance is destroyed. Note that some buffers may be put on the deferred list, as mentioned above.
| * | shm: remove deferred buffers from main list immediatelyDaniel Eklöf2021-07-17-53/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When unref:ing a "busy" buffer, destruction is (still) deferred to the buffer release event. However, we now move the buffer off the buffer list immediately, and instead push it to a 'deferred' list. This prevents buffer re-use of buffers scheduled for destruction. It also means less buffers to iterate through when trying to find a re-usable buffer in shm_get_buffer(), since we no longer have to wade through a potentially long list of to-be-deleted buffers.
| * | shm: replace 'locked' attribute with a ref-counterDaniel Eklöf2021-07-17-53/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial ref-count is either 1 or 0, depending on whether the buffer is supposed to be released "immeidately" (meaning, as soon as the compositor releases it). Two new user facing functions have been added: shm_addref() and shm_unref(). Our renderer now uses these two functions instead of manually setting and clearing the 'locked' attribute. shm_unref() will decrement the ref-counter, and destroy the buffer when the counter reaches zero. Except if the buffer is currently "busy" (compositor owned), in which case destruction is deferred to the release event. The buffer is still removed from the list though.
| * | shm: we may exit with busy buffers remaining (seen on KDE)Daniel Eklöf2021-07-17-8/+22
| | |
| * | shm: move ‘size’ to the private buffer structDaniel Eklöf2021-07-17-18/+18
| | |
| * | shm: replace inclusion of terminal.h with a forward declaration of damageDaniel Eklöf2021-07-17-1/+1
| | | | | | | | | | | | It’s the only thing we “need” from terminal.h
| * | shm: rename buffer.mmapped to buffer.dataDaniel Eklöf2021-07-17-12/+14
| | |
| * | shm: split up buffer struct into internal/private and public partsDaniel Eklöf2021-07-17-99/+127
|/ /
* | Merge branch 'allow-bleeding-glyphs'Daniel Eklöf2021-07-17-75/+71
|\ \
| * | render: Allow cells to bleed into their neighborTimur Celik2021-07-17-75/+71
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a `confined` flag to each cell to track if the last rendered glyph bled into it's right neighbor. To keep things simple, bleeding into any other neighbor cell than the immediate right one is not allowed. This should cover most use cases. Before rendering a row we now do a prepass and mark all cells unclean that are affected by a bleeding neighbor. If there are consecutive bleeding cells, the whole group must be re-rendered even if only a single cell has changed. The patch also deprecates both old overflowing glyph options *allow-overflowing-double-width-glyphs* and *pua-double-width* in favor of a single new one named *overflowing-glyphs*.
* | Merge branch 'decsdm'Daniel Eklöf2021-07-16-5/+7
|\ \ | | | | | | | | | Closes #631
| * | csi: invert the meaning of DECSDMDaniel Eklöf2021-07-14-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There has been some confusion whether enabling DECSDM (private mode 80) enables or disables sixel scrolling. Foot currently enables scrolling when DECSDM is set, and this patch changes this, such that setting DECSDM now *disables* scrolling. The confusion is apparently due to a documentation error in the VT340 manual, as described in https://github.com/dankamongmen/notcurses/issues/1782#issuecomment-863603641. And that makes sense, in a way: the SDM in DECSDM stands for Sixel Display Mode. I.e. it stands to reason that enabling that disables scrolling. Anyway, this lead to https://github.com/hackerb9/lsix/issues/41, where it was eventually proven (by testing on a real VT340), that foot, and a large number of other terminals (including XTerm) has it wrong: https://github.com/hackerb9/lsix/issues/41#issuecomment-873269599.
* | | shm: codespellDaniel Eklöf2021-07-15-1/+1
| | |
* | | shm: auto-purge when we have multiple buffers eligible for re-useDaniel Eklöf2021-07-15-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It may happen that we end up with multiple non-busy, same-sized buffers for the same cookie (context), and thus eligible for re-use. Before this patch, we would keep all those buffers around. This is completely unnecessary. Under normal circumstances, we’ll either be re-using a single buffer, or swap between two. In the second case, the “other” buffer is always busy, and thus not eligible for re-use. So, if we _do_ detect multiple, re-usable buffers, pick the one with the lowest “age” (increasing the chance of applying damage tracking, instead of re-drawing everything), and mark the other one for purging.
* | | wayland: win_destroy: unmap URL labelsDaniel Eklöf2021-07-15-0/+6
| | |