aboutsummaryrefslogtreecommitdiff
path: root/main.c (follow)
Commit message (Collapse)AuthorAgeLines
* font: calculate underline/strikeout metrics in font, not mainDaniel Eklöf2019-09-29-43/+0
|
* main: unset DESKTOP_STARTUP_IDDaniel Eklöf2019-09-26-0/+4
| | | | | | This is used in the desktop startup notification protocol. We don't support it (is it even used on Wayland?), but need to ensure programs launced from within foot doesn't inherit it.
* main: initialize scale to '1'Daniel Eklöf2019-09-26-6/+4
| | | | | | | | | | This ensures we always have a valid (but possibly incorrect) scaling value. This allows us to simplify code that uses the scale - it doesn't have to verify the scale if valid. Furthermore, since render_resize() is the function that actually updates term->scale, make sure to call it *before* updating the cursor (otherwise, the cursor will use the old scaling value).
* selection: primary: don't require compositor to implement itDaniel Eklöf2019-09-25-8/+8
|
* main: we prefer xdg-output-manager version 2, but get by with 1Daniel Eklöf2019-09-24-1/+1
|
* main: log (at debug level) global interfaces and their versionsDaniel Eklöf2019-09-24-1/+1
|
* It's Hz, not HZDaniel Eklöf2019-09-21-2/+2
|
* main: -f,--font now accepts a list of fontsDaniel Eklöf2019-09-21-2/+21
| | | | | | | This makes -f,--font behave just like the configuration file option 'font'; the first font in the list is the primary font, and the remaining fonts are fallback fonts used when a glyph cannot be found in the primary font.
* main: round strikeout and underline position fallback handlingDaniel Eklöf2019-09-20-2/+2
|
* main: round strikeout position, and ceil strikeout thicknessDaniel Eklöf2019-09-20-2/+2
| | | | | | | This fixes an issue where sometimes the strikeout thickness where truncated to 0 (e.g. Cascadia Code). Note that we already do this for the underline calculations.
* main: names for poll FD indicesDaniel Eklöf2019-09-20-10/+20
|
* main: better names of timers for delayed rendering timeoutsDaniel Eklöf2019-09-20-12/+18
|
* main: track output refresh rateDaniel Eklöf2019-09-20-2/+7
|
* main: improve delayed renderingDaniel Eklöf2019-09-20-12/+38
| | | | | | | | | | | | | | | | We now use two timers for delayed rendering; one _lower_ limit timeout that is reset each time we receive input from the slave. We never render *before* this timeout. Since it's reset, this means rendering may be pushed further into the future. To prevent this from happening indefinitely, the second timer defines the _upper_ limit. This timer is only reset after rendering. Thus, slave input may now increase the rendering delay, but only up to a certain limit. The lower limit is as before, 1ms. The upper limit is set to 16ms (the time between frame updates on a 60HZ output).
* main: use a timer FD to delay render refresh after client dataDaniel Eklöf2019-08-30-10/+23
| | | | | | This ensures we never wait *longer* than 1ms (previously, we could end up doing multiple polls, each with a timeout value of 1ms - thereby potentially delaying the refresh indefinitely).
* main: render_resize() scales the width and heightDaniel Eklöf2019-08-30-3/+7
| | | | | | | | Thus, when we call render_resize() with *old* with/height values, we must scale them back to their original values. This fixes an issue where, for example, moving a window between outputs with different scales caused the window to keep growing.
* main: request server-side decorationsDaniel Eklöf2019-08-30-0/+41
|
* search: don't destroy/recreate search (sub)surfaceDaniel Eklöf2019-08-29-0/+7
| | | | | | Create the sub-surface once, at startup. Then, instead of destroying it when committing/cancelling a search, unmap it (by attaching a NULL buffer to it).
* main: destroy sub-compositor at exitDaniel Eklöf2019-08-29-0/+2
|
* search: move wayland surface variables into the term structDaniel Eklöf2019-08-29-8/+12
|
* search: use a sub-surface to render the search bufferDaniel Eklöf2019-08-29-0/+5
|
* main: log cell width/height at info level, not debugDaniel Eklöf2019-08-28-1/+1
| | | | | This complements the INFO logs from the renderer when the terminal is resized.
* main: free search bufferDaniel Eklöf2019-08-27-0/+2
|
* add config + command line option for setting initial window width/heightDaniel Eklöf2019-08-23-13/+31
|
* main: use slave's exit value as our exit valueDaniel Eklöf2019-08-23-0/+21
|
* term: rename colors256 -> tableDaniel Eklöf2019-08-21-11/+5
|
* term: use colors256 array for *all* colorsDaniel Eklöf2019-08-21-15/+10
| | | | | | That is, remove the 'regular' and 'bright' color arrays. This is possible since the 256-color array is defined such that the first 16 colors map to the regular and bright colors.
* csi: move 256-color table into the terminal structDaniel Eklöf2019-08-21-0/+24
|
* main: fix debug logsDaniel Eklöf2019-08-21-2/+3
|
* main: don't set scale before we know what it actually should beDaniel Eklöf2019-08-21-4/+0
|
* main: we *do* track outputsDaniel Eklöf2019-08-21-2/+0
|
* render: reload cursor theme when scale (may) have changedDaniel Eklöf2019-08-21-15/+10
|
* Remove all references to cairo; we now use pixman onlyDaniel Eklöf2019-08-16-2/+0
|
* render: replace all usage of cairo with pixmanDaniel Eklöf2019-08-16-2/+2
|
* Add background alpha supportDaniel Eklöf2019-08-15-0/+1
|
* output: track output we're mapped on, and use maximum scaleDaniel Eklöf2019-08-12-5/+52
| | | | | | Our surface may be on multiple outputs at the same time. In this case, we use the largest scale factor, and let the compositor down scale on the "other" output(s).
* output: resize on scale changesDaniel Eklöf2019-08-12-3/+6
|
* output: initial support for output scalingDaniel Eklöf2019-08-12-2/+130
| | | | | | * Not updated run-time; only scale at start up used * Multiple monitors (outputs) not supported, as we can't track which output we're on (yet).
* main: add -h,--help and -v,--version command line optionsDaniel Eklöf2019-08-11-5/+26
|
* main: make all polled FDs non-blockingDaniel Eklöf2019-08-05-56/+73
| | | | | | | | | | And handle read() returning EAGAIN. This fixes an issue with the keyboard repeat timer, which sometimes would return EAGAIN. Most likely because POLLIN was set on it, but then before we get to handle it, the timer was canceled (by a key up event).
* input: use a timer fd to handle keyboard key repeatDaniel Eklöf2019-08-05-116/+20
| | | | | | | | | | | Instead of running a repeater thread that writes the key to repeat over a pipe, use a simple timer fd. No more locking or condition signalling. No need to track start/stop/exist states. We simply set up the initial timeout value to be the 'delay', and the interval to be the repeat 'rate'.
* threads: set thread titlesDaniel Eklöf2019-08-01-0/+7
|
* conf: make number of scrollback lines configurableDaniel Eklöf2019-08-01-0/+1
|
* font: initial support for double-width *and* color emoji glyphsDaniel Eklöf2019-07-31-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fonts are now loaded with FT_LOAD_COLOR and we recognize and support the FT_PIXEL_MODE_BGRA pixel mode. This is mapped to a CAIRO_FORMAT_ARGB32 surface, that is blitted as-is (instead of used as a mask like we do for gray and mono glyphs). Furthermore, since many emojis are double-width, we add initial support for double-width glyphs. These are assumed to always be utf8. When PRINT:ing an utf8 character, we check its width, and add empty "spacer" cells after the cell with the multi-column glyph. When rendering, we render the columns in each row backwards. This ensures the spacer cells get cleared *before* we render the glyph (so that we don't end up erasing part of the glyph). Finally, emoji fonts are usually bitmap fonts with *large* glyphs. These aren't automatically scaled down. I.e. even if we request a glyph of 13 pixels, we might end up getting a 100px glyph. To handle this, fontconfig must be configured to scale bitmap fonts. When it is, we can look at the 'scalable' and 'pixelsizefixup' properties, and use these to scale the rendered glyph.
* main: don't shadow final return value inside poll loopDaniel Eklöf2019-07-30-3/+3
|
* main: font metrics should be debug loggedDaniel Eklöf2019-07-30-3/+1
|
* main: pty buffers appear to be ~20KB on modern linux kernelsDaniel Eklöf2019-07-30-1/+1
|
* font: add support for fallback fontsDaniel Eklöf2019-07-30-13/+13
| | | | | | | | | | | | | | | A top-level font now has a list of fallback fonts. When a glyph cannot be found, we try each fallback font in turn, until we either find one that has the glyph, or until we've exhausted the list. To make this actually work in practise (read: to make performance acceptable), the cache is re-worked and is now populated on demand. It also supports non-ASCII characters, by using the 4-byte unicode character as index instead. Since having an array that can be indexed by a 4-byte value isn't really viable, we now have a simple hash table instead of an array.
* render: add a 'clean' bit to each cell; only render cells that aren't cleanDaniel Eklöf2019-07-30-2/+4
| | | | | | | | | | | This patch takes a bit from the foreground color value in a cell (todo: split up foreground/background into bitfields with a separate field for 'foreground/background' has been set), and only re-renders cells that aren't marked as clean. Note: we use a 'clean' bit rather than a 'dirty' bit to make it easy to erase cells - we can (keep doing) do that by simply memsetting a cell range to 0.
* wip: initial multithreaded rendererDaniel Eklöf2019-07-29-1/+43
|
* font: populate glyph cache (ASCII characters only) when instantiating fontDaniel Eklöf2019-07-28-6/+3
|
* cairo-ft: remove all usages of cairo-ftDaniel Eklöf2019-07-28-34/+0
|
* main: calculate *all* font metrics from the FreeType faceDaniel Eklöf2019-07-28-8/+17
|
* font: load FreeType face, and set it's pixel sizesDaniel Eklöf2019-07-28-5/+7
|
* mouse: use discrete axis event if availableDaniel Eklöf2019-07-26-1/+1
| | | | This improves the scroll experience with certain devices
* render: move frame_callback to term.renderDaniel Eklöf2019-07-24-2/+2
|
* render: add render_refresh()Daniel Eklöf2019-07-24-6/+3
|
* conf: allow the user to configure a fixed cursor colorDaniel Eklöf2019-07-23-0/+8
| | | | | | | | | | | | | | | | | | | The default is to reverse the foreground/background colors in the cell with the cursor. But, if the user configures a specific set of cursor colors, those will always be used, regardless of other cell attributes (dim, reverse etc). The cursor color is specified as two color values, 'text' and 'cursor'. The block cursor uses the 'cursor' color as background, and the 'text' color for the glyph. All other cursor styles uses the 'cursor' color for the cursor, but uses the cell's foreground color for the glyph (meaning, dim/reverse/etc applies).
* csi: let CSI 0 q mean "switch to user configured cursor style"Daniel Eklöf2019-07-22-0/+1
| | | | | | | | According to the specs, \E[0 q means a blinking block cursor. However, since it also states that \E[1 q *also* is a blinking block cursor, and that it is the default, *and* given that fact that parameter-less CSIs typically means "reset", let's make it mean "reset to the user configured cursor style".
* conf: make cursor's default style configurableDaniel Eklöf2019-07-22-0/+1
|
* term: group 'blink' state together in a structDaniel Eklöf2019-07-22-6/+8
|
* term: group 'flash' state together in a structDaniel Eklöf2019-07-22-6/+8
|
* main: no need to damage the _entire_ view on blink timerDaniel Eklöf2019-07-21-1/+11
|
* blink: implement 'blink'Daniel Eklöf2019-07-21-0/+24
|
* flash: implement 'flash'Daniel Eklöf2019-07-21-0/+24
| | | | | | | | | | Use our own escape sequence for the 'flash' terminfo entry. Implemented by arming a timer FD and setting a boolean that indicates we're currently "flashing". The renderer draws a semi-transparent yellowish layer over the entire window when "flashing" is active.
* dcs: we have no parent terminal to pass through toDaniel Eklöf2019-07-21-1/+0
|
* csi: implement CSI 22t and CSI 23tDaniel Eklöf2019-07-21-0/+3
| | | | | | | | | | | 22;0|1|2t pushes the current window title/icon to the stack, while 23 pops it. The second parameter, 0|1|2 has the following meaning: 0 - push/pop icon+title 1 - push/pop icon 2 - push/pop title
* term: track current window title in terminal structDaniel Eklöf2019-07-21-1/+2
|
* conf: config now provides the colors (though still only hardcoded colors)Daniel Eklöf2019-07-21-12/+34
|
* term: prepare for configurable colors; add color variables to terminalDaniel Eklöf2019-07-21-2/+2
|
* dcs: sort of implement DCS passthroughDaniel Eklöf2019-07-19-0/+1
| | | | | | | We now store the passthrough characters in a buffer, and call dcs_passthrough() on unhook. However, dcs_passthrough() doesn't do anything.
* osc: allocate data buffer dynamicallyDaniel Eklöf2019-07-19-0/+1
|
* main: allow TERM to be set on the command lineDaniel Eklöf2019-07-18-1/+7
|
* conf: TERM can now be set in footrcDaniel Eklöf2019-07-18-1/+1
|
* main: use our own terminfo 'foot' by defaultDaniel Eklöf2019-07-18-1/+1
|
* glyph-cache: generate at startup, never update while renderingDaniel Eklöf2019-07-18-7/+37
|
* render: cache generated glyphs for regular ASCII charactersDaniel Eklöf2019-07-18-0/+2
| | | | | | | | To avoid having to re-generate glyphs, cache the glyphs. For now, we only cache ASCII characters, as this allows us to lookup the cache by simply indexing with the character (into a 256-entry array).
* conf: improve configuration file parsingDaniel Eklöf2019-07-17-1/+3
| | | | | | | * Strip whitespaces from keys and values * Detect (and ignore) comments * Detect syntax errors (no value specified etc) * Error out on syntax errors and invalid keys
* main: allow user to override shell on the command lineDaniel Eklöf2019-07-17-2/+19
|
* slave: report exec() failure back to main processDaniel Eklöf2019-07-17-13/+41
|
* main: jump to cleanup on failure to load cursor pointer themeDaniel Eklöf2019-07-17-1/+1
|
* slave: exec shell from confDaniel Eklöf2019-07-17-1/+1
|
* main: fallback for strikeout positioning seems to workDaniel Eklöf2019-07-16-2/+0
|
* render: implement strikeoutDaniel Eklöf2019-07-16-1/+24
|
* render: implement 'underline'Daniel Eklöf2019-07-16-8/+34
|
* terminal: foreground/background in cell attributes are now uint32_tDaniel Eklöf2019-07-16-0/+5
| | | | This reduces the cell size, and thus improves the cache behavour
* conf: initial support for configuration fileDaniel Eklöf2019-07-16-7/+13
| | | | | | | * Look for configuration file in (in this order): - XDG_CONFIG_HOME/footrc - ~/.config/footrc * Currently supports setting the font
* main: default font is 'monospace'Daniel Eklöf2019-07-16-1/+1
|
* main: set TERM=xterm-directDaniel Eklöf2019-07-15-0/+1
|
* rename project to 'foot'Daniel Eklöf2019-07-11-2/+2
|
* selection: add support for pasting *from* primaryDaniel Eklöf2019-07-11-5/+24
|
* selection: initial copy-to-clipboard functionalityDaniel Eklöf2019-07-11-0/+34
|
* selection: selections can be made, and are renderedDaniel Eklöf2019-07-11-0/+4
| | | | | | | * Start selection on mouse button down * Update selection on motion * Button release cancels selection if there were no motion after start * Renderer detects cells inside the selection and inverts their colors
* grid: don't pre-allocate the entire grid (with all scrollback lines)Daniel Eklöf2019-07-10-8/+4
| | | | | | | | | | The row array may now contain NULL pointers. This means the corresponding row hasn't yet been allocated and initialized. On a resize, we explicitly allocate the visible rows. Uninitialized rows are then allocated the first time they are referenced.
* main: hopefully fix logical error in delayed renderingDaniel Eklöf2019-07-10-1/+1
| | | | | We want the timeout_ms to *not* be -1 (i.e. someone has requested delayed rendering), while we're *not* getting client output.
* terminal: rename and redefine cursor keys mode and keypad keys modeDaniel Eklöf2019-07-09-2/+2
|
* input: add support for dead keys (composing)Daniel Eklöf2019-07-09-0/+5
|
* render: store frame callback pointer in terminal structDaniel Eklöf2019-07-09-1/+3
| | | | This allows us to free it when exiting
* cleanupDaniel Eklöf2019-07-09-2/+0
|
* main: verify compositor has WL_SHM_FORMAT_ARGB8888Daniel Eklöf2019-07-08-1/+8
|