aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* meson: bump version to 1.15.01.15.0Daniel Eklöf2023-07-14-1/+1
|
* changelog: prepare for 1.15.0Daniel Eklöf2023-07-14-3/+18
|
* config: add csd.double-click-to-maximize=no|yes optionDaniel Eklöf2023-07-14-1/+19
| | | | | | | | | When enabled, double-clicking the CSD titlebar will (un)maximize the window. Defaults to ‘yes’ (since this is the old hard-coded behavior). Closes #1293
* themes: enable custom cursor colors in all themes that define such colorsDaniel Eklöf2023-07-14-4/+4
| | | | | | | | | | | | | Not all themes have/define custom cursor colors. But of those that do, nearly all already enabled them (by setting "cursor.color"), except three themes: * aeroroot * ayu-mirage * material-amber This patch makes all themes consistent, by enabling cursor.color in these last three themes too.
* config: make ‘starlight’ the default color themeDaniel Eklöf2023-07-14-23/+27
| | | | Closes #1321
* themes: aeroroot: add -*- conf -*- headerDaniel Eklöf2023-07-14-0/+1
|
* themes: starlight: add -*- conf -*- headerDaniel Eklöf2023-07-14-0/+1
|
* theme: add new theme ‘starlight’Daniel Eklöf2023-07-14-0/+23
| | | | Closes #1321
* render: don’t invert cursor colors when custom colors are being usedDaniel Eklöf2023-07-14-11/+8
| | | | | | | | | | | | When the user has configured custom cursor colors (cursor.color is set in foot.ini), don’t invert those colors when the cell is either selected, or has the ‘reverse’ attribute set. This aligns foot’s behavior with Alacritty, Kitty and Wezterm. Contour also behaves similarly, except mouse selections override the cursor colors (turning the cursor invisible). Closes #1347
* themes: ayu-mirag: disable cursor colors by defaultDaniel Eklöf2023-07-14-1/+1
| | | | | Default cursor color is "inversed fg/bg", and themes aren’t supposed to change that.
* ayu-mirage theme addedShugarSkull2023-07-14-0/+28
|
* themes: aeroroot: disable cursor colors by defaultDaniel Eklöf2023-07-14-1/+1
| | | | | Default cursor color is "inversed fg/bg", and themes aren’t supposed to change that.
* Aero root themeKyle Gunger2023-07-14-0/+35
|
* sixel: fix regression for DECGRI with a repeat count of 0CismonX2023-07-10-2/+10
|
* Merge branch 'control-shift-u'Daniel Eklöf2023-07-10-9/+24
|\ | | | | | | Closes #1183
| * changelog: mention the new default key binding for show-urls-launch under “fixed”Daniel Eklöf2023-07-10-0/+3
| | | | | | | | | | It “fixes” the key binding conflict seen on e.g. GNOME, and increases the exposure of the change to, hopefully, more users.
| * changelog: split up key binding changes for show-urls-launch and unicode-inputDaniel Eklöf2023-07-10-3/+4
| |
| * doc: foot: add default key binding for unicode inputDaniel Eklöf2023-07-10-0/+3
| |
| * doc: foot: update default key binding for URL modeDaniel Eklöf2023-07-10-1/+1
| |
| * readme: add default shortcut for unicode inputDaniel Eklöf2023-07-10-0/+3
| |
| * readme: a few more places mentioning the default URL mode shortcutDaniel Eklöf2023-07-10-2/+2
| |
| * bind control-shift-u to unicode-input, move urls to oAntoine Beaupré2023-07-10-6/+11
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having a keybinding to invoke arbitrary unicode characters is very useful. It's often used as a method of last resort to communicate with people outside of your main language. For example, if you want to type the last letter of my real name, you can invoke the latin-1 character 0xe9 or unicode 0x00e9. You can also use this to type special characters, for example, unicode U+1F4A9 is of course, the infamous PILE OF POO, which is sure to produce million laughs everywhere you go. In foot, there's no keybinding by default to invoke the very useful unicode-input command. There is no "standard" (as in "ISO") keybinding this either. But there *is* a de-facto standard currently deployed by *both* GTK and Qt (a rare feat) *and* Chrome OS (an even rarer feat) and it's control-shift-u. Alternatives include Control-x 8 (emacs), Control V u (vim), Alt (Windows, LibreOffice), or Option (Mac). I doubt we want to adopt any of those. So let's use control-shift-u for this. Unfortunately, it's currently assigned to show-urls-launch, which is unfortunate, but insurmountable. We can reassign this keybinding elsewhere. I have picked control-shift-o in my configuration, because "o" is a good mnemonic for "open URLs". Others have suggested "m" instead. Closes: #1183
* input: add basic support for touchscreen inputCismonX2023-07-05-22/+364
| | | | Closes #517
* changelog: fractional-scaling-v1 -> fractional-scale-v1Daniel Eklöf2023-07-04-2/+2
|
* meson: fix typo in meson_options.txtCraig Barnes2023-07-03-1/+1
| | | | | | | | | | | When using muon[1] instead of meson, this was causing the following error: $ muon setup bld .../meson_options.txt:26:124: error unterminated hex escape .../meson_options.txt:26:223: error unterminated string [1]: https://muon.build/
* Merge branch 'cursor-shape'Daniel Eklöf2023-07-03-82/+366
|\ | | | | | | Closes #1379
| * meson: move cursor-shape.{c,h} from ‘foot’ binary to vtlibDaniel Eklöf2023-07-03-1/+1
| | | | | | | | | | This should fix a build issue when doing partial PGO builds, when cursor-shape-v1 is *available*.
| * term_xcursor_update_for_seat(): fix missing evaluation of render_xcursor_is_valid()Daniel Eklöf2023-07-03-1/+1
| | | | | | | | | | | | | | | | | | | | When compiling *without* cursor-shape-v1 support, term_xcursor_update_for_seat() would incorrectly set shape=CURSOR_SHAPE_CUSTOM, even though no custom cursor had been set by the user. This resulted in a crash in render_xcursor_set(), when trying to use a NULL-string as custom cursor.
| * meson: log availability of cursor-shape-v1Daniel Eklöf2023-07-03-0/+4
| |
| * main/client: add a version feature flag for cursor-shapeDaniel Eklöf2023-07-03-2/+13
| |
| * render: move variables inside #ifdef, as they’re not used outside of itDaniel Eklöf2023-07-03-1/+1
| |
| * terminal: #elif -> #elseDaniel Eklöf2023-07-03-1/+1
| |
| * meson: bump wayland-protocols version required for cursor-shape to 1.32Daniel Eklöf2023-07-03-2/+1
| |
| * cursor-shape: use server-side cursors for custom (OSC-22), if possibleDaniel Eklöf2023-07-03-32/+141
| | | | | | | | | | | | | | | | | | | | | | | | Using a lookup table, try to map the user-provided xcursor string to a cursor-shape-v1 known shape. If we succeed, set the user’s custom cursor using server side cursors (i.e. using cursor-shape-v1). If not, fallback to trying to load the image ourselves (using wl_cursor_theme_get_cursor()), and set it using the legacy wl_pointer_set_cursor().
| * meson: cursor-shape: use .xml from wayland-protocolsDaniel Eklöf2023-07-03-152/+7
| | | | | | | | | | | | | | | | This patch assumes a git snapshot of wayland-protocols are installed. We need to bump the version number as soon as the next version of wayland-protocols have been released.
| * render: don’t (can’t) use cursor-shape-v1 when user has set a custom cursorDaniel Eklöf2023-07-03-14/+24
| | | | | | | | | | Well, we _could_, but we’d have to reverse map the string to a cursor-shape-v1 enum value. Let’s not do that, for now at least.
| * cursor-shape: assert lookup succeededDaniel Eklöf2023-07-03-0/+2
| |
| * pgo: update xcursor stubs to use enum instead of char pointerDaniel Eklöf2023-07-03-3/+3
| |
| * render: debug log which method we use to set the xcursorDaniel Eklöf2023-07-03-0/+3
| |
| * cursor-shape: add support for server side cursor shapesDaniel Eklöf2023-07-03-20/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | This implements support for the new cursor-shape-v1 protocol. When available, we use it, instead of client-side cursor surfaces, to select the xcursor shape. Note that we still need to keep client side pointers, for: * backward compatibility * to be able to "hide" the cursor Closes #1379
| * refactor: track current xcursor using an enum, instead of a char pointerDaniel Eklöf2023-07-03-62/+93
|/
* wayland: handle enum value XDG_TOPLEVEL_STATE_SUSPENDEDDaniel Eklöf2023-07-03-8/+15
| | | | Added in wayland-protocols-1.32
* sixel: re-scale images when the cell dimensions changeDaniel Eklöf2023-06-30-112/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, when the cell dimensions changed (i.e. when the font size changes), sixel images were either removed (the new cell dimensions are smaller than the old), or simply kept at their original size (new cell dimensions are larger). With this patch, sixels are instead resized. This means a sixel *always* occupies the same number of rows and columns, regardless of how much the font size is changed. This is done by maintaining two sets of image data and pixman images, as well as their dimensions. These two sets are the new ‘original’ and ‘scaled’ members of the sixel struct. The "top-level" pixman image pointer, and the ‘width’ and ‘height’ members either point to the "original", or the "scaled" version. They are invalidated as soon as the cell dimensions change. They, and the ‘scaled’ image is updated on-demand (when we need to render a sixel). Note that the ‘scaled’ image is always NULL when the current cell dimensions matches the ones used when emitting the sixel (to save run-time memory). Closes #1383
* meson: log availability of optional wayland protocolsDaniel Eklöf2023-06-30-0/+8
|
* wayland: typo: ‘.’ -> ‘;’Daniel Eklöf2023-06-30-1/+1
| | | | Closes #1392
* Merge branch 'sixel-performance'Daniel Eklöf2023-06-29-48/+146
|\ | | | | | | Closes #1385
| * sixel: add_ar_11(): manually unroll loopDaniel Eklöf2023-06-29-7/+18
| | | | | | | | This generates both smaller, and faster code
| * scripts: generate-alt-random: set P2=1 when emitting sixelsDaniel Eklöf2023-06-29-2/+2
| | | | | | | | | | P2=1 means "empty sixels remain at their current color". This is usually the case with modern sixel encoders.
| * sixel: refactor: shorten very verbose switch case statementsDaniel Eklöf2023-06-29-53/+14
| |
| * sixel: special case parsing of images with an aspect ratio of 1:1Daniel Eklöf2023-06-29-26/+152
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Images with an aspect ratio of 1:1 are by far the most common (though not the default). It makes a lot of sense, performance wise, to special case them. Specifically, the sixel_add() function benefits greatly from this, as it is the inner most, most heavily executed function when parsing a sixel image. sixel_add_many() also benefits, since allows us to drop a multiplication. Since sixel_add_many() always called first (no other call sites call sixel_add() directly), this has a noticeable effect on performance. Another thing that helps (though not as much), and not specifically with AR 1:1 images, is special casing DECGRI a bit. Up until now, it simply updated the current sixel parameter value. The problem is that the default parameter value is 0. But, a value of 0 should be treated as 1. By adding a special ‘repeat_count’ variable to the sixel struct, we can initialize it to ‘1’ when we see DECGRI, and then simply overwrite it as the parameter value gets updated. This allows us to drop an if..else when emitting the sixel.
* Merge branch 'fractional-scaling'Daniel Eklöf2023-06-29-315/+508
|\
| * wayland: surface_scale(): reset buffer scale when using fractional scalingDaniel Eklöf2023-06-29-0/+1
| | | | | | | | | | Since the first frame uses legacy scaling, the surface may have a buffer scale > 1, which isn’t allowed.
| * wayland: surface_scale(): improve debug loggingDaniel Eklöf2023-06-29-2/+5
| |
| * wayland: use legacy scaling until fractional_scale::preferred_scale() has been calledDaniel Eklöf2023-06-29-1/+3
| | | | | | | | | | | | | | | | | | | | This way, the initial frame is more likely to get scaled correctly; foot will guess the initial (integer) scale from the available monitors, and use that. By using legacy scaling, we force the compositor to down-scale the image to the correct scale factor. If we use the new fraction scaling method with an integer scaling factor, the initial frame gets rendered way too big.
| * wayland: refactor: surface_scale(): pass wl_window pointer, instead of wayland globalDaniel Eklöf2023-06-29-13/+13
| |
| * wayland: surface_scale(): assert surface width/height is a multiple of scaleDaniel Eklöf2023-06-29-0/+7
| | | | | | | | | | When doing legacy scaling (non-fractional scaling), assert the surface’s width and height are multiples of the (integer) scale.
| * wayland: warn when fractional scaling isn’t availableDaniel Eklöf2023-06-29-0/+8
| |
| * feature: add a feature flag (for --version) for fractional scalingDaniel Eklöf2023-06-29-2/+15
| |
| * changelog: dpi-aware’s default value is now ‘no’Daniel Eklöf2023-06-29-0/+6
| |
| * config: dpi-aware: remove ‘auto’ value, and default to ‘no’Daniel Eklöf2023-06-29-88/+48
| | | | | | | | | | | | | | | | | | | | We now default to scaling fonts using the scaling factor, not monitor DPI. The ‘auto’ value for dpi-aware has been removed. Documentation (man pages and README) have been updated to reflect the new default.
| * changelog: mention the newly added support for fractional-scaling-v1Daniel Eklöf2023-06-29-0/+3
| |
| * wayland: update terminal when preferred scaling factor changesDaniel Eklöf2023-06-29-0/+2
| | | | | | | | | | | | When the window’s preferred scaling factor is changed (through the fractional-scaling protocol), update the terminal; resize font, resize sub-surfaces etc.
| * wayland: surface_scale(): implement fractional scalingDaniel Eklöf2023-06-29-2/+11
| | | | | | | | This is done by setting the surface’s viewport destination
| * wayland: initialize window scale to -1Daniel Eklöf2023-06-29-0/+1
| |
| * wayland: instantiate+destroy viewport for pointer surfaceDaniel Eklöf2023-06-29-1/+20
| |
| * wayland: refactor: add a buffer argument to wayl_*_scale() functionsDaniel Eklöf2023-06-29-17/+37
| | | | | | | | | | This will be needed later, when using fractional scaling + viewporter to scale.
| * wayland: refactor: wayl_surface_scale(): pass wayl_surface pointerDaniel Eklöf2023-06-29-37/+32
| | | | | | | | | | | | | | | | Instead of passing a raw wl_surface pointer, pass a wayl_surface pointer. This is needed later, when using fractional scaling to scale the surface (since then we need the surface’s viewport object).
| * wayland: refactor: wrap wl_surface pointers in a wayl_surface structDaniel Eklöf2023-06-29-139/+149
| | | | | | | | | | | | | | | | | | And add a viewport object to accompany the surface (to be used when scaling the surface). Also rename the wl_surf_subsurf struct to wayl_sub_surface, and add a wayl_surface object to it, rather than a plain wl_surface pointer (to also get the viewport pointer).
| * wayland: add viewport object to sub-surface structDaniel Eklöf2023-06-29-2/+28
| |
| * wayland: add wayl_surface_scale(), and wayl_win_scale()Daniel Eklöf2023-06-29-46/+52
| | | | | | | | | | | | | | These functions scale a surface+buffer. For now, only using the legacy scaling method (wl_surface_set_buffer_scale()).
| * render: maybe_resize(): convert local variable ‘scale’ to floatDaniel Eklöf2023-06-29-8/+13
| |
| * wayland: add wayl_fractional_scaling()Daniel Eklöf2023-06-29-0/+12
| | | | | | | | Returns true if fractional scaling is available.
| * wayland: csd_reload_font(): ‘scale’ is now a floatDaniel Eklöf2023-06-29-7/+7
| |
| * term: reload_fonts(): ‘scale’ is not a floatDaniel Eklöf2023-06-29-4/+4
| |
| * render: xcursor_update(): convert local ‘scale’ variable to floatDaniel Eklöf2023-06-29-1/+1
| |
| * render: urls(): round scaling factorDaniel Eklöf2023-06-29-1/+1
| |
| * render: search_box(): round scaling factorDaniel Eklöf2023-06-29-1/+1
| |
| * render: render_timer(): round scaling factorDaniel Eklöf2023-06-29-1/+1
| |
| * render: csd_border: round scaled border width, instead of truncatingDaniel Eklöf2023-06-29-4/+3
| |
| * render: draw_unfocused_block(): round scale, instead of truncatingDaniel Eklöf2023-06-29-1/+1
| |
| * wayland: pointer.scale: convert to floatDaniel Eklöf2023-06-29-4/+4
| |
| * term: convert ‘scale’ to a floatDaniel Eklöf2023-06-29-21/+25
| |
| * wayland: plumbing for wp-fractional-scaleDaniel Eklöf2023-06-29-0/+77
| | | | | | | | | | | | | | * Bind the wp-viewporter and wp-fractional-scale-manager globals. * Create a viewport and fractional-scale when instantiating a window. * Add fractional-scale listener (that does nothing at the moment). * Destroy everything on teardown.
| * meson: generate bindings for wp-fractional-scale + wp-viewportDaniel Eklöf2023-06-29-0/+5
|/
* correct csd section entry: hide-when-maximizedVladimir Bauer2023-06-27-1/+1
|
* config: unittest: explicitly call fcft_init() + fcft_fini()Daniel Eklöf2023-06-26-0/+4
| | | | | This plugs a memory leak, caused by fontconfig functions being called as part of the unit test implicitly allocating global objects.
* sixel: assert upper pixel of last sixel maps to last image row, *or lower*Daniel Eklöf2023-06-24-0/+2
|
* sixel: ensure enough rows have been scrolled in, to fit the imageDaniel Eklöf2023-06-24-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When emitting a sixel, we need to: a) scroll terminal content to ensure the new image fits b) position the text cursor Recent changes in the cursor positioning logic meant we reduced the number of linefeeds, to ensure 1) sixels could be printed to the bottom row without scrolling the terminal contents, and 2) the cursor was positioned on the last sixel row. Except, we’re not actually positioning the cursor on the last sixel row. We’re positioning it on the text row that maps to the *upper* pixel of the last sixel. In most cases, this _is_ the last row of the sixel. But for certain combinations of font and image sizes, it may be higher up. This patch fixes a regression, where the terminal contents weren’t scrolled up enough for certain images, causing a crash when trying to dirty a not-yet scrolled in row. The fix is this: * Always scroll by the number of rows occupied by the image, minus one. This ensures the image "fits". * Adjust the cursor position, if necessary.
* sixel: resize(): handle no size changeDaniel Eklöf2023-06-24-0/+3
|
* sixel: regression: linefeed count for chunked up sixel imageDaniel Eklöf2023-06-24-1/+6
| | | | All image chunks but the last *should* scroll the screen content.
* sixel: minor fixes after implementing support for non-1:1 aspect ratiosDaniel Eklöf2023-06-24-17/+29
| | | | | | | * Lazy initialize image height. This is necessary to prevent garbage from being rendered for "empty" sixels. * Fix plotting of non-1:1 pixels * Fix calculation of height in resize(), for non-1:1 aspect ratios
* sixel: stop cropping images to the last non-transparent rowDaniel Eklöf2023-06-24-22/+1
|
* sixel: respect sixel aspect ratioDaniel Eklöf2023-06-24-14/+52
| | | | | | | | That is, parse P1 when initializing a new sixel, and don’t ignore pad/pad in the raster attributes command. The default aspect ratio is 2:1, but most sixels will override it in the raster attributes command (to 1:1).
* sixel: fix cursor positioning logicDaniel Eklöf2023-06-24-20/+26
| | | | | | | | | | | | | | | | | | This adjusts the logic that positions the text cursor after emitting a sixel, when sixel scrolling mode is *enabled*. We’ve always mimicked XTerm’s behavior. However, XTerm recently changed its behavior, to better match that of an VT382. Now, the cursor is placed *on* the last row of the sixel, instead of on a new row after the sixel. This allows applications to print sixels to the bottom row of the terminal, without causing the content to scroll. Finally, there was a bug in the horizontal positioning of the cursor; it was placed on the *first* column of the row, instead of on the first column of the sixel.
* term: scroll: only record scroll damage when viewport is at the bottomDaniel Eklöf2023-06-23-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don’t need to record scroll damage if the viewport isn’t at the bottom, since in this case, the renderer ignores the scroll damage anyway. This fixes a performance corner case, when the viewport is at the top of the scrollback history. When application scrolls the terminal contents, and the scrollback history is full, and the viewport is at top of the history, then the viewport needs to be moved (the scrollback history is a circular buffer, and thus the top of the history “moves” when we’re scrolling in new contents). Moving the viewport typically results in another type of scroll damage (DAMAGE_SCROLL_IN_VIEW, instead of the “normal” DAMAGE_SCROLL). Thus, each application triggered scroll, will result in two scroll damage records: one DAMAGE_SCROLL, and one DAMAGE_SCROLL_IN_VIEW. These two are incompatible, meaning they can’t be merged. What’s worse, it also means the DAMAGE_SCROLL records from two application triggered scrolls cannot be merged (since there’s a DAMAGE_SCROLL_IN_VIEW in between). As a result, the renderer will not see one, or “a few” scroll damage events, but a *ton*. _Each_ one typically a single line, or so. And each one resulting in lots of traffic on the wayland socket, as we create and destroy new buffer pools, when doing “shm scrolling”. This eventually leads to the socket not being able to keep up, and the socket is closed on us, forcing us to exit. The fix is really simple: don’t record “normal” scroll damage when scrolling, _unless_ the viewport is at the bottom (and thus “follows” the application output). As soon as the user scrolls up in the history, we’ll stop emitting normal scroll damage records. This is just fine, since, as mentioned above, the renderer ignores them when the viewport isn’t at the bottom. What if the viewport is moved back down again, before the next frame has been rendered? Wont there be “missing” scroll damage records? No, because moving the viewport results in scroll damage records by itself. Closes #1380
* Fixed a type for the pixel fontsize changewout2023-06-23-1/+1
| | | | xp -> px
* render: resize: fix crash when reflowing the alt screenDaniel Eklöf2023-06-20-3/+10
| | | | | | | | | | | | | | | | When doing an interactive resize, and `resize-delay-ms` > 0 (the default), we would crash if the original screen size (i.e. the size before the interactive resize started) was larger than the last window size. For example, if we interactively go from 85 rows to 75, and then non-interactively went from 75 to 80, we’d crash. The resizes had to be made in a single go. One way to trigger this was to start an interactive resize on a floating window, and then *while resizing* toggle the window’s floating mode. Closes #1377
* add srcery themeAntoine Beaupré2023-06-20-0/+26
| | | | Based on https://srcery.sh/
* csi: CHA+HPA (cursor horizontal absolute): use term_cursor_col()Daniel Eklöf2023-06-20-1/+1
|
* term: add term_cursor_col()Daniel Eklöf2023-06-20-0/+10
| | | | | | | Set cursor column, absolute. term_cursor_to() needs to reload the current row pointer, and is thus not very effective when we only need to modify the column.