aboutsummaryrefslogtreecommitdiff
path: root/render.c (follow)
Commit message (Collapse)AuthorAgeLines
...
* term: asynchronous client application terminationDaniel Eklöf2021-07-31-1/+1
| | | | | | | | | | | | | | | | | | 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.
* Only brighten palette colors with bold-text-in-bright=palette-basedDavid Rosca2021-07-26-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
|
* render: csd_title(): use a custom font, sized based on the title bar’s heightDaniel Eklöf2021-07-24-3/+8
| | | | | | | | 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
|
* render: prevent cells from overflowing into marginTimur Celik2021-07-20-1/+2
|
* render: use a single backing SHM pool for CSD surface buffersDaniel Eklöf2021-07-18-36/+37
|
* shm: refactor: move away from a single, global, buffer listDaniel Eklöf2021-07-17-27/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: replace 'locked' attribute with a ref-counterDaniel Eklöf2021-07-17-7/+5
| | | | | | | | | | | | | | | | | 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-1/+1
|
* shm: move ‘size’ to the private buffer structDaniel Eklöf2021-07-17-1/+1
|
* shm: rename buffer.mmapped to buffer.dataDaniel Eklöf2021-07-17-3/+3
|
* render: Allow cells to bleed into their neighborTimur Celik2021-07-17-38/+40
| | | | | | | | | | | | | | | | 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*.
* url-mode: use shm_get_many()Daniel Eklöf2021-07-15-14/+78
| | | | | | | | | | | | | | | | If we have lots of URLs, we use up a *lot* of SHM buffers (and thus pools). Each and every one is a single mmap(), of at least 4K. Since all URL labels are created and destroyed at the same time, it makes sense to use a single pool for all buffers. To do this, we must now do two passes; first one to generate the actual string (label content), and to calculate the label sizes. Then we use this information to allocate all SHM buffers at once, from the same pool. Finally, we iterate the URLs again, this time to actually render them.
* shm: add shm_get_many() - allows buffers to share a single poolDaniel Eklöf2021-07-15-0/+4
| | | | | | | | | | | | | | shm_get_many() always returns new buffers (i.e. never old, cached ones). The newly allocated buffers are also marked for immediate purging, meaning they’ll be destroyed on the next call to either shm_get_buffer(), or shm_get_many(). Furthermore, we add a new attribute, ‘locked’, to the buffer struct. When auto purging buffers, look at this instead of comparing cookies. Buffer consumers are expected to set ‘locked’ while they hold a reference to it, and don’t want it destroyed behind their back.
* render: search: set clip regionDaniel Eklöf2021-07-15-0/+6
| | | | | Fixes crash when the search box has been reduced in height, due to limited window space.
* render: scrollback indicator: improve handling of very small window sizesDaniel Eklöf2021-07-15-10/+17
|
* render: margins: use correct background colorDaniel Eklöf2021-07-15-6/+3
| | | | | | * Sync actual color used, with how render_cell() selects the background color * Use color_dim_for_search(), not color_dim()
* render: track alpha directly, rather whether to use it or notDaniel Eklöf2021-07-15-6/+5
|
* render: tiocswinsz: don’t remove/close the fd passed as argumentDaniel Eklöf2021-07-14-2/+4
| | | | | | | | There’s a chance the resize timeout FD was closed, and *reused*, after epoll() told us the FD is readable, but before our callback runs. Thus, closing the FD provided as an argument is dangerous, as it may refer to something completely different.
* Revert "render: don’t assume PIXMAN_a8r8g8b8 for color glyphs"Daniel Eklöf2021-07-14-2/+2
| | | | | | | This reverts commit 9b4796e996a6b524718591df8d8ea1ebe3b9bbbd. Sub-pixel anti-aliasing also uses 32-bit glyphs (but x8r8g8b8, instead of a8r8g8b8)...
* render: don’t assume PIXMAN_a8r8g8b8 for color glyphsDaniel Eklöf2021-07-14-2/+2
| | | | We may want to use PIXMAN_b8g8r8a8 on big-endian in the future.
* render: require glyph count > 0 and cell-cols also for forced double-width PUAsDaniel Eklöf2021-07-02-4/+4
|
* allow-overflowing-double-width-glyphs: take glyph offset into accountDaniel Eklöf2021-07-02-3/+3
| | | | | | | | A narrow, but offset:ed glyph should still be considered double width. This patch also fixes a crash, when the maybe-double width glyph is in the last column. This is a regression.
* render: don’t look at glyphs[0]->cols when determining if overflow should be allowedDaniel Eklöf2021-06-30-1/+1
| | | | | Use ‘cell_cols’ instead, which is the number of cells we’ll actually be using.
* composed: store compose chains in a binary search treeDaniel Eklöf2021-06-24-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation stored compose chains in a dynamically allocated array. Adding a chain was easy: resize the array and append the new chain at the end. Looking up a compose chain given a compose chain key/index was also easy: just index into the array. However, searching for a pre-existing chain given a codepoint sequence was very slow. Since the array wasn’t sorted, we typically had to scan through the entire array, just to realize that there is no pre-existing chain, and that we need to add a new one. Since this happens for *each* codepoint in a grapheme cluster, things quickly became really slow. Things were ok:ish as long as the compose chain struct was small, as that made it possible to hold all the chains in the cache. Once the number of chains reached a certain point, or when we were forced to bump maximum number of allowed codepoints in a chain, we started thrashing the cache and things got much much worse. So what can we do? We can’t sort the array, because a) that would invalidate all existing chain keys in the grid (and iterating the entire scrollback and updating compose keys is *not* an option). b) inserting a chain becomes slow as we need to first find _where_ to insert it, and then memmove() the rest of the array. This patch uses a binary search tree to store the chains instead of a simple array. The tree is sorted on a “key”, which is the XOR of all codepoints, truncated to the CELL_COMB_CHARS_HI-CELL_COMB_CHARS_LO range. The grid now stores CELL_COMB_CHARS_LO+key, instead of CELL_COMB_CHARS_LO+index. Since the key is truncated, collisions may occur. This is handled by incrementing the key by 1. Lookup is of course slower than before, O(log n) instead of O(1). Insertion is slightly slower as well: technically it’s O(log n) instead of O(1). However, we also need to take into account the re-allocating the array will occasionally force a full copy of the array when it cannot simply be growed. But finding a pre-existing chain is now *much* faster: O(log n) instead of O(n). In most cases, the first lookup will either succeed (return a true match), or fail (return NULL). However, since key collisions are possible, it may also return false matches. This means we need to verify the contents of the chain before deciding to use it instead of inserting a new chain. But remember that this comparison was being done for each and every chain in the previous implementation. With lookups being much faster, and in particular, no longer requiring us to check the chain contents for every singlec chain, we can now use a dynamically allocated ‘chars’ array in the chain. This was previously a hardcoded array of 10 chars. Using a dynamic allocated array means looking in the array is slower, since we now need two loads: one to load the pointer, and a second to load _from_ the pointer. As a result, the base size of a compose chain (i.e. an “empty” chain) has now been reduced from 48 bytes to 32. A chain with two codepoints is 40 bytes. This means we have up to 4 codepoints while still using less, or the same amount, of memory as before. Furthermore, the Unicode random test (i.e. write random “unicode” chars) is now **faster** than current master (i.e. before text-shaping support was added), **with** test-shaping enabled. With text-shaping disabled, we’re _even_ faster.
* render: use cell cols from compose chain, not graphemeDaniel Eklöf2021-06-24-1/+2
| | | | | | fcft’s view of how many columns a grapheme cluster is may differ from our own. Make sure the rendered glyph matches the number of columns that were allocated when the cluster was printed.
* render: don’t modify the cell’s x position. Fixes broken underlinesDaniel Eklöf2021-06-24-6/+7
|
* render: we’ve already assigned ‘base’ a couple of lines higher upDaniel Eklöf2021-06-24-2/+1
|
* render: repair parenthesis after rebaseDaniel Eklöf2021-06-24-5/+5
|
* render: ensure ‘cell_cols’ have been initializedDaniel Eklöf2021-06-24-1/+1
|
* render: handle fcft_glyph_rasterize() failure correctlyDaniel Eklöf2021-06-24-3/+8
|
* render: use column count from grapheme instead of first glyph, when we have oneDaniel Eklöf2021-06-24-2/+8
|
* wip: grapheme shapingDaniel Eklöf2021-06-24-43/+85
|
* wayland: apply CSD/SSD changes in the surface configure eventDaniel Eklöf2021-06-23-11/+11
| | | | | | | | | | | | | | | | | | The configure event asks the client to change its decoration mode. The configured state should not be applied immediately. Clients must send an ack_configure in response to this event. See xdg_surface.configure and xdg_surface.ack_configure for details. In particular, ”the configured state should *not* be applied immediately”. Instead, treat CSD/SSD changes like all other window dimension related changes: store the to-be mode in win->configure, and apply it in the surface configure event. This fixes an issue where foot incorrectly resized the window when the server switched between CSD/SSD at run-time.
* config: add csd.button-color optionDaniel Eklöf2021-06-20-4/+18
| | | | | | | | This option controls the foreground color of the minimize/maximize/close buttons. I.e. the color used to draw the minimize/maximize/close glyphs. It defaults to default background color.
* render: don’t create/destroy the title update timer each timeDaniel Eklöf2021-06-18-30/+2
| | | | | Create it once when instantiating the terminal. Add a boolean to track whether the timer is running or not.
* render: use a timer instead of relying on the frame callback for title update throttlingDaniel Eklöf2021-06-18-13/+50
| | | | | | | | | | | | | | | | | | | | | Using the frame callback works most of the time, but e.g. Sway doesn’t call it while the window is hidden, and thus prevents us from updating the title in e.g. stacked views. This patch uses a timer FD instead. We store a timestamp from when the title was last updated. When the application wants to update the title, we first check if we already have a timer running, and if so, does nothing. If no timer is running, check the timestamp. If enough time has passed, update the title immediately. If not, instantiate a timer and wait for it to trigger. Set the minimum time between two updates to ~8ms (twice per frame, for a 60Hz output, and ~once per frame on a 120Hz output). Closes #591
* config: add underline-offset optionDaniel Eklöf2021-06-17-1/+5
| | | | | | | | This option allows the user to configure a custom underline offset. That is, use the user provided offset instead of the font provided one. Closes #490
* vt: emit a tab character if all cells between cursor and tab stop are emptyDaniel Eklöf2021-06-08-1/+1
| | | | | | | | | | | | | | | | | | | | | | TAB (\t) move the cursor to the next tab stop. That’s it, according to the specification. However, many terminal emulators try to keep tabs in the grid, to be able to e.g. copy them. That is, copying a text chunk containing tabs should result in tabs being pasted, not spaces. In order to do that, we need to print a tab character to the grid. To improve text reflow of tabs, we also print spaces to the subsequent cells, up until (but not including) the next tab stop. However, we can only do this if all the cells between the cursor and the next tab stop are empty, since (obviously), we cannot overwrite pre-existing characters. Finally, while some fonts render tabs as spaces (i.e. an empty glyph), some use a glyph representing “unprintable” characters, or similar. Thus, we need to exclude cells with tab characters when rendering.
* render: reverse video only swaps *default* fg/bgDaniel Eklöf2021-06-08-4/+4
| | | | | | | | | This matches XTerm behavior, and fixes vttest 11.6.6.2: Test non-VT100 -> Test ISO-6429 colors -> Test of VT102-style features with BCE -> Test of screen features
* config: add boolean option tweak.pua-double-widthDaniel Eklöf2021-06-01-7/+11
| | | | | | | When enabled, PUA (Private Usage Area) codepoints are always treated as double-width glyphs, regardless of the actual glyph width. Requires allow-overflowing-double-width-glyphs=yes
* config: add cursor.underline-thicknessDaniel Eklöf2021-05-22-18/+44
| | | | | | | | | | | | | Works in pretty much the same way as ‘beam-thickness’, except that the default value is “the font’s underline thickness”. This means, that when unset, the cursor underline thickness scales with the font size. But, when explicitly set, either to a point size value, or a pixel size, it remains fixed at that size. Closes #524
* render: stop spamming “resize” INFO logsDaniel Eklöf2021-05-17-3/+0
| | | | | | | | It _may_ be acceptable in e.g. tiling WMs, where windows are seldom resized interactively. But in a stacking WM where the typical way of resizing windows is by interactive resizes, this spams way too much.
* render: simply check for an invalid (not set) scaling factorDaniel Eklöf2021-05-17-1/+1
|
* render: set tracking point count to 0 if there’s no active selectionDaniel Eklöf2021-05-15-1/+1
|
* term: rename CELL_MULT_COL_SPACER -> CELL_SPACER, and change its definitionDaniel Eklöf2021-05-14-5/+5
| | | | | | | | | | | | | | | | | | | | | 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.
* render: force underlines to be visibleDaniel Eklöf2021-05-12-2/+5
| | | | | | | | | | | | | | | 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
* quirk: remove plasma/kwin quirkDaniel Eklöf2021-05-12-1/+0
| | | | | | 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.
* 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/+0
| | | | A non-busy buffer should always have an empty dirty region
* 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-179/+185
| | | | | | | | | | | * 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: track busy buffers’ age, and add compile-time option to force double bufferingDaniel Eklöf2021-05-12-0/+6
| | | | | | | | | 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).
* box-drawing: add Unicode 13 U+1FB70 - U+1FB8BDaniel Eklöf2021-05-04-3/+28
| | | | Part of #471
* render: only apply alpha when we’re using the default bg for backgroundDaniel Eklöf2021-05-04-4/+6
| | | | | | | | 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)
* config: add ‘beam-thickness’ optionDaniel Eklöf2021-04-30-10/+11
| | | | | | | | | | | * 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.
* render: modify background color for highlighted text when fg == bgDaniel Eklöf2021-04-24-0/+5
| | | | | | | | When rendering a selected/highlighted cell where the foreground and background colors are the same, invert the background color to make the selected text legible. Closes #455
* render: do render concealed text when it’s highlightedDaniel Eklöf2021-04-23-1/+4
|
* config: bold-text-in-bright: add ‘palette-based’ as a special valueDaniel Eklöf2021-04-17-4/+6
| | | | | | | | | When ‘bold-text-in-bright’ is set ‘to palette-based’, colors matching one of the 8 regular palette colors are brightened by using the corresponding bright palette color. Other colors, or all colors if ‘bold-text-in-bright’ is set to ‘yes|true’, are brightened by increasing the luminance.
* render: brighten: use corresponding bright palette color for base 8 colorsDaniel Eklöf2021-04-17-2/+11
| | | | | | | | When brightening one of the 8 base (“regular”) colors, use the corresponding bright palette color, instead of increasing the luminance. Closes #449
* render: no need to blend fully opaque sixel images - just blit themDaniel Eklöf2021-04-14-1/+1
|
* render: don’t let URL jump label sub-surfaces extend outside window geometryDaniel Eklöf2021-04-10-27/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have no guarantee that sub-surfaces extending outside the window geometry are rendered correctly (if at all). For example, both Sway and River will render the window border on top of the sub-surface. Future versions of Sway may clip the sub-surface. Since jump-labels are positioned slightly above, and to the left of the URLs first character, having a label on either the top row, or on the first column, will likely position it outside the window. This is handled by simply setting x/y to 0 (or, to -margin, since the label coordinate is later offsetted with the window margins). Second, if the label is very long, it may extend outside the window. This is very unusual for labels only showing the key, and not the URL itself, but could happen in this case too, if e.g. the user has configured double-width key characters. This is handled by calculating its maximum width, and then truncating the label. Although very unlikely, it is possible for a label to also extend outside the window’s vertical size. This could happen for very small font sizes, where the label’s own margins are large, relative to the font size. This case is currently not handled. Closes #443
* Merge branch 'optionally-render-box-drawing-characters-using-font-glyphs'Daniel Eklöf2021-04-10-1/+3
|\ | | | | | | Closes #430
| * config: add box-drawings-uses-font-glyphs=no|yes optionDaniel Eklöf2021-04-09-1/+3
| | | | | | | | | | | | | | | | | | When disabled, we render box drawing characters ourselves. This is the default. When enabled, we instead use font glyphs. I.e. no special treatment. Closes #430
* | render: draw underline cursor below text underlineDaniel Eklöf2021-04-09-2/+3
|/ | | | | | | This ensures the cursor is visible on cells where the text is underlined. Closes #415
* osc: implement OSC 17+19: change selection background/foreground colorsDaniel Eklöf2021-04-08-3/+3
| | | | | And of course, we also implement the corresponding reset sequences, OSC 117+119.
* config/terminal: refactor: remove “default_*” color members from terminal structDaniel Eklöf2021-04-07-8/+8
| | | | Access the original colors in the configuration instead.
* render: make sure surface buffer sizes are a multiple of the scaling factorDaniel Eklöf2021-03-25-11/+41
| | | | | | | | | | | | | | | | | | | | | The buffer attached to a surface with wl_surface_attach() must have a width and height that both are a multiple of the scale configured for that buffer: The new size of the surface is calculated based on the buffer size transformed by the inverse buffer_transform and the inverse buffer_scale. This means that at commit time the supplied buffer size must be an integer multiple of the buffer_scale. If that's not the case, an invalid_size error is sent. Due to a libwayland bug[^1], this is currently *not* being reported as an error. However, recent versions of Sway have started enforcing this, and is e.g. dropping (not rendering) sub-surfaces that does not adhere to this. [^1]: https://gitlab.freedesktop.org/wayland/wayland/-/issues/194 Closes #409
* render: render_osd(): no need to pass width/height as parametersDaniel Eklöf2021-03-25-8/+8
| | | | | | All uses of render_osd() passes buf->width/buf->height as width/height. Thus, we can simply remove the width/height parameters and have render_osd() use buf->width and buf->height directly.
* render: draw sixels before taking the render worker lockDaniel Eklöf2021-03-25-2/+2
| | | | | | | This fixes a possible deadlock; render_sixels_images() may call render_cell(), which may need to take the worker lock (when rendering either a blinking cell, or a box drawing glyph that isn’t yet in the glyph cache).
* ime: don’t pass ‘term’ to ime_update_cursor_rect()Daniel Eklöf2021-03-25-2/+2
| | | | | | | | | In all instances where we call ime_update_cursor_rect(), the ‘term’ argument is the same as seat->kbd_focus. So, let ime_update_cursor_rect() use that directly instead. Also make ime_send_cursor_rect() static (i.e. local to ime.c).
* ime: move preedit state from terminal struct to the seat structDaniel Eklöf2021-03-25-34/+56
| | | | | | | | | | | | | | | | | This ensures different seat’s don’t step on each others IME pre-edit state. It also removes most dependencies on having a valid term pointer for many IME operations. We’re still not all the way, since we support disabling IME with a private mode, which is per terminal, not seat. Thus, we still require the seat to have keyboard focus on one of our windows. Closes #324. But note that *rendering* of multiple seat’s IME pre-edit strings is still broken.
* render: sixels: render cursor, if it’s partially covered by an opaque sixelDaniel Eklöf2021-03-11-1/+3
|
* sixel: implement P2=1 - transparent pixelsDaniel Eklöf2021-03-11-30/+44
| | | | | | | | | | | | | | | | | | | | | | | | When P2=1, empty pixels are transparent. This patch also changes the behavior of P2=0|2, from setting empty pixels to the default background color, to instead use the *current* background color. To implement this, a couple of changes are needed: * Sixel pixels always use alpha=1.0, except for *empty* cells when P2=1 (i.e. transparent pixels). * The renderer draws sixels with the OVER operator, instead of the SRC operator. * The renderer *must* now render the cells beneath the sixel. As an optimization, this is only done for sixels where P2=1. I.e. for fully opaque sixels, there’s no need to render the cells beneath. The sixel renderer isn’t yet hooked into the multi-threaded renderer. This means *rows* (not just the cells) beneath maybe-transparent sixels are rendered single-threaded. Closes #391.
* render: jump-labels: case insensitive comparison when looking for matching keysDaniel Eklöf2021-03-04-1/+1
|
* url-mode: snapshot screen state when entering URL modeDaniel Eklöf2021-02-26-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, we automatically exited URL mode whenever we received data on the PTY. This was done since we don’t know _what_ has changed on the screen, and we don’t want to display misleading jump labels. However, this becomes a problem in curses-like applications that periodically updates part of the screen. For example, a statusbar with a clock. This patch changes this behavior; instead of cancelling URL mode when receiving PTY data, we snapshot the grid when entering URL mode. When *rendering*, we use the snapshot:ed grid, while PTY updates modify the “real” grid. Snapshot:ing the grid means taking a full/deep copy of the current grid, including sixel images etc. Finally, it isn’t necessary to “damage” the entire view when *entering* URL mode, since we’re at that point the renderer is in sync with the grid. But we *do* need to damage the entire view when exiting URL mode, since the grid changes on the “real” grid hasn’t been tracked by the renderer.
* urls: add key binding that toggles whether URLs are displayed on jump-labelDaniel Eklöf2021-02-21-2/+19
| | | | | | | | | | | | | | | | | By default, the URL isn’t shown on the jump-label. For auto-detect URLs, doing so is virtually always useless, as the URL is already visible in the grid. For OSC-8 URLs however, the URL is often _not_ visible in the grid. Many times, seeing the URL is still not needed (if you’re doing ‘ls --hyperlink’, you already know what the URIs are). But it is still useful to have a way to show the URLs. This patch adds a new key binding action that can be used in url-mode to toggle the URL on and off in the jump label. It is bound to ctrl+t by default.
* urls: remove free-form ‘text’ member from URL structDaniel Eklöf2021-02-21-12/+2
|
* url-mode: multiple URL (parts) with the same ID is assigned a single key sequenceDaniel Eklöf2021-02-21-0/+6
| | | | | | | | | | In case an URL is split up into multiple parts, those parts are now treated as a single URL when it comes to key assignment. Only the *first* URL part is actually assigned a key combo. The other parts are ignored. We still highlight them, but for all other purposes they are ignored.
* wayland: drop ‘_surface’ suffix from subsurface struct instancesDaniel Eklöf2021-02-17-21/+21
|
* render-timer: use wayl_win_subsurface_new/destroy()Daniel Eklöf2021-02-17-2/+3
|
* scrollback-indicator: use wayl_win_subsurface_new/destroy()Daniel Eklöf2021-02-17-34/+9
|
* search: use wayl_win_subsurface_new/destroy()Daniel Eklöf2021-02-17-9/+9
|
* csd: use wayl_win_subsurface_new/destroy()Daniel Eklöf2021-02-17-5/+5
|
* url-mode: convert struct wl_url to use wayl_win_subsurface_new()Daniel Eklöf2021-02-17-2/+2
|
* render: block all signals in the rendering threadsDaniel Eklöf2021-02-11-0/+5
|