aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
| * search: match_to_end_of_word(): use a local macro to bump coordDaniel Eklöf2021-05-17-15/+21
| |
| * search: match_to_end_of_word(): use has_wrapped_around() while extracting textDaniel Eklöf2021-05-17-1/+3
| |
| * search: match_to_end_of_word(): we always extend the selection with at least one characterDaniel Eklöf2021-05-17-3/+1
| |
| * search: match_to_end_of_word(): skip newlines when copying from extraction bufferDaniel Eklöf2021-05-17-1/+7
| |
| * search: match_to_end_of_word(): refactorDaniel Eklöf2021-05-17-61/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite match_to_end_of_word() in terms of * selection_find_word_boundary_right() * extract_begin() + extract_one() + extract_finish() This adds a small overhead, in that extract_*() allocates an internal buffer, from which we then immediately copy, into our newly resized prompt buffer. On the other hand, this makes the matching behavior more consistent with regular mouse selections, and we don’t have to keep two very similar match-to-next-word-boundary implementations in sync.
| * extract: add extract_finish_wide(), and optionally skip stripping trailing empty cellsDaniel Eklöf2021-05-17-13/+55
| | | | | | | | | | | | | | | | extract_finish() returns the extracted text in UTF-8, while extract_finish_wide() returns the extracted text in Unicode. This patch also adds a new argument to extract_finish{,_wide}, that when set to true, skips stripping trailing empty cells.
| * selection: expose find_word_boundary_{left,right}()Daniel Eklöf2021-05-17-12/+21
| |
| * search: find_next(): proper check for scrollback wrap aroundDaniel Eklöf2021-05-17-5/+15
|/ | | | | | Besides disallowing matches that crosses the scrollback wrap-around, this also fixes a crash when the trying to search beyond the last output, when the scrollback history hasn’t yet been completely filled.
* Merge branch 'box-drawing-use-pixman'Daniel Eklöf2021-05-17-114/+279
|\
| * box-drawing: pre-calculate the LIGHT and HEAVY thicknessesDaniel Eklöf2021-05-17-4/+16
| |
| * box-drawing: always pass ‘buf’ as the first parameterDaniel Eklöf2021-05-17-6/+6
| | | | | | | | | | This way, the compiler doesn’t have to waste instructions on re-ordering the parameters
| * box-drawing: don’t inline _thickness()Daniel Eklöf2021-05-17-1/+1
| | | | | | | | | | It results in quite a lot of floating point instructions being emitted in almost every box drawing function we have...
| * box-drawing: use fill_boxes() instead of fill_rectangles()Daniel Eklöf2021-05-17-30/+20
| |
| * box-drawing: increase brightness of solid shadesDaniel Eklöf2021-05-17-3/+3
| |
| * config: add tweak.box-drawing-solid-shades=yes|noDaniel Eklöf2021-05-17-10/+31
| | | | | | | | | | | | | | | | | | | | When enabled, shades are rendered as solid blocks, using a darker variant of the current foreground color. When disabled, shades are instead rendered in a checker box pattern, using the foreground color unmodified. Default is enabled.
| * box-drawing: use an a8 buffer when primary font is antialiasedDaniel Eklöf2021-05-17-1/+3
| | | | | | | | | | This causes relevant box drawing characters (diagonals, arcs etc) to be antialiased as well.
| * box-drawing: change_buffer_format: abort on pixman failureDaniel Eklöf2021-05-17-0/+6
| |
| * box-drawing: apply antialiasing to LIGHT ARCsDaniel Eklöf2021-05-17-40/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When drawing on an a8 buffer, apply antialiasing to LIGHT ARCs. This is done by supersampling; draw to a 4 times bigger buffer, then downsample, where each downsampled pixel is the average of the corresponding 4x4 pixel from the supersampled buffer. We also need to take supersampling into account while adjusting the row and col when pixel aligning the arcs with the regular horizontal/vertical lines. The shape of the ARCs can still be improved. Still, this is a much needed improvement over the current implementation. Closes #279
| * box-drawing: draw_pixman_shade(): named struct initializationDaniel Eklöf2021-05-17-1/+1
| |
| * box-drawing: fix typo: missing ‘.’ in struct member initializationDaniel Eklöf2021-05-17-1/+1
| |
| * box-drawing: shades can now be rendered either using solid color, or checker boxDaniel Eklöf2021-05-17-21/+51
| | | | | | | | | | For now, switching is done using a static variable. In the future, this could be a user option.
| * box-drawing: temporary “fix” for LIGHT ARCs with a8 buffersDaniel Eklöf2021-05-17-1/+22
| | | | | | | | | | | | We don’t have a method to draw the arcs using pixman yet. Work around this by replacing the a8 buffer with an a1 buffer, and render the arcs using our old, non-antialiased, way.
| * box-drawing: swap amount of shade for LIGHT and DARK shadesDaniel Eklöf2021-05-17-2/+2
| | | | | | | | | | The DARK shade is the one most dense, and thus the one that looks brightest.
| * box-drawing: draw shades as “antialiased” blocksDaniel Eklöf2021-05-17-18/+36
| | | | | | | | | | | | | | | | When rendering to an a8 surface, render shades using “transparent” pixman rectangles. When these glyphs are composited with a color, the resulting look is the color, but darkened.
| * box-drawing: use pixman_image_fill_boxes() for rect()Daniel Eklöf2021-05-17-10/+2
| |
| * box-drawing: implement LIGHT diagonal lines using pixmanDaniel Eklöf2021-05-17-30/+52
| | | | | | | | Use trapezoids to rasterize the diagonal lines.
| * box-drawing: rect(): implement using pixmanDaniel Eklöf2021-05-17-7/+15
| | | | | | | | Use pixman_image_fill_rectangles() to render rectangles. Duh!
| * box-drawing: {h,v}line: implement using pixmanDaniel Eklöf2021-05-17-14/+20
| | | | | | | | | | | | | | | | Use pixman_image_fill_rectangles() to render horizontal and vertical lines. Despite the name, this *is* the appropriate function to use, since our lines *do* have a thickness, and thus *are* rectangles.
| * box-drawing: U+256C - BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL: add missing cornerDaniel Eklöf2021-05-17-1/+1
| | | | | | | | The inner corner, where the upper/left lines meet, were missing
| * 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