aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* render: fix underline/strikeout positioningDaniel Eklöf2019-11-30-19/+21
| | | | | | | | | | | | There were two errors: * We subtracted half the line width instead of adding it to the baseline * We rounded the line positioning and thickness before the positioning calculation. In particular, rounding the thickness before using it to adjust the position was wrong. Now we round just before the pixman call.
* render: font_baseline(): simply use the primary font's ascentDaniel Eklöf2019-11-30-16/+4
| | | | | | This is what we used as baseline for regular glyphs anyway. Thus, we can update that code to call font_baseline() now. This makes it easier to change how we define the baseline in the future.
* font: bug: bad multiplier when converting from 16.16 fixed floatDaniel Eklöf2019-11-30-1/+1
|
* term: define xcursor strings as global variablesDaniel Eklöf2019-11-30-3/+7
|
* font: cache_size -> glyph_cache_sizeDaniel Eklöf2019-11-30-4/+4
| | | | This makes it more clear it has nothing to do with the font cache.
* font: destructor: pop elements as we goDaniel Eklöf2019-11-30-1/+1
| | | | Otherwise we'll end up free:ing the same font over and over again.
* font: original -> requestedDaniel Eklöf2019-11-30-8/+8
|
* font: log freetype errorsDaniel Eklöf2019-11-30-3/+19
|
* wayland: track current xcursor, and don't update if sameDaniel Eklöf2019-11-30-0/+11
| | | | | | | | | | | | | | | We may have many windows open, which tries to update/change the xcursor at various points. Track which cursor is currently loaded, regardless of which window it was set by. If someone tries to load that very same xcursor again, simply skip it. One example is when we've moused over a window that does *not* have keyboard focus, and then the user clicks, or by some other mean gives that window keyboard focus. In many cases it will then try to set the same cursor again (most of the times, the cursor is the same regardless of keyboard focus, but not always).
* input: update xcursor on terminal with *keyboard* focus when modifiers changeDaniel Eklöf2019-11-30-4/+2
|
* term: xcursor: use selection_enabled()Daniel Eklöf2019-11-30-2/+1
| | | | | | | | Instead of duplicating the code from selection_enabled() that deals with forced selection, just call selection_enabled(). This was previously not possible since selection_enabled() didn't require keyboard_focus. Now it does.
* selection: forced selection requires keyboard focusDaniel Eklöf2019-11-30-1/+12
| | | | | | | | | | Up the requirements for enabling "forced" selection (that is, allowing selections even though mouse tracking has been disabled). * Require keyboard focus (if we don't have it, then the shift-key isn't is for us) * Don't just require shift being pressed, but that all other modifiers are *not* pressed.
* vt: don't try to move cursor outside the terminalDaniel Eklöf2019-11-29-7/+11
| | | | | | | | | When we insert an auto-newline, we must make sure we don't try to move outside the terminal window. This can for example happen when a scrolling region have been configured, and the cursor is **outside** the scrolling region (i.e. it's in the bottom margin).
* term: reset: set 'origin' to ORIGIN_ABSOLUTEDaniel Eklöf2019-11-29-0/+1
|
* font: never set glyph->cols to something that is less than 0Daniel Eklöf2019-11-29-1/+4
|
* vt: fix memory corruption: wcwidth() may return -1Daniel Eklöf2019-11-29-12/+14
| | | | | When it did, we called print_insert() with that, which in turn resulted in a too large size value passed to memmove.
* csi/vt: don't bad client data as errorsDaniel Eklöf2019-11-29-2/+2
| | | | This gets rid of spam when cat:ing binary data.
* vt: only define esc_as_string() when debug logging has been enabledDaniel Eklöf2019-11-29-0/+2
|
* vt: disable logging BELLDaniel Eklöf2019-11-29-2/+2
|
* csi/ocs/vt: log unhandled/unrecognized sequences as debug messagesDaniel Eklöf2019-11-29-4/+4
| | | | | | | | Having them as error messages was nice when we where still missing lots of sequences. Now we don't anymore, and these just spam stdout as well as syslog when e.g. cat:ing binary data.
* vt: there are actually many state transitions that are no-opsDaniel Eklöf2019-11-29-1/+0
| | | | | | In most states, most 8-bit values are no-ops. This is already handled; action() recognizes ACTION_NONE as a no-op. Thus, all we need to do is remove the assertion.
* term: reset: don't access rows directlyDaniel Eklöf2019-11-29-2/+2
| | | | | | | We've just re-set the grid offsets, meaning rows 0..term->rows may not all have been initialized. Call grid_row_and_alloc() to ensure they are.
* term: xcursor: use 'hand2' instead of 'left_ptr' when mouse trackingDaniel Eklöf2019-11-29-15/+7
| | | | | Mouse tracking always reports clicks, so using a cursor that suggests you can click makes sense I think.
* term: xcursor cleanupDaniel Eklöf2019-11-29-4/+11
| | | | | | | | | | Show 'text' cursor when: * we have no mouse tracking enabled * forced selection has been enabled (shift being held down) * We're *not* scrollback searching In all other cases, show the 'left_ptr' cursor.
* input: pointer-leave: reset moused *before* doing anything elseDaniel Eklöf2019-11-29-3/+8
| | | | And update xcursor. This is currently not necessary, but doesn't hurt.
* input: pointer-enter: add debug logDaniel Eklöf2019-11-29-0/+2
|
* input: keyboard_leave: reset focused *before* doing anything elseDaniel Eklöf2019-11-29-4/+6
| | | | | | And update xcursor. This is necessary since we may still have mouse focus. But without keyboard focus, we don't display the 'text' xcursor.
* search: update xcursor when starting and ending a searchDaniel Eklöf2019-11-29-0/+2
|
* wayland: terminal_from_surface: recognize scrollback search surfacesDaniel Eklöf2019-11-29-1/+5
| | | | | This fixes an assertion when hovering over the input field for scrollback searches.
* wayland: always flush after dispatching messagesDaniel Eklöf2019-11-29-1/+1
| | | | This means we don't have to e.g. roundtrip when setting the cursor.
* doc: foot.1: mention that selection is kept after ending a scrollback searchDaniel Eklöf2019-11-29-1/+2
|
* font: add missing ';'Daniel Eklöf2019-11-28-1/+1
|
* font: use pixelsizefixupfactor on regular bitmap fonts too, if setDaniel Eklöf2019-11-28-12/+9
| | | | | But if it isn't set, only estimate it if the font is a *scalable* non-outline (bitmap) font.
* osc 52: default to 'clipboard' if no source/target has been specifiedDaniel Eklöf2019-11-28-12/+26
|
* input: keyboard/pointer_leave: warn if we didn't see corresponding enter eventDaniel Eklöf2019-11-28-0/+10
|
* input: keyboard/pointer_enter: assert surface != NULLDaniel Eklöf2019-11-28-0/+5
|
* terminal: use the 'text' xcursor pointer whenever selection is possibleDaniel Eklöf2019-11-28-33/+69
|
* input: pointer_button: apply same workaround as in pointer_motionDaniel Eklöf2019-11-28-1/+18
| | | | | Sway 1.2 has been seen to send pointer_button events without first having sent pointer_enter.
* input: sway 1.2 bug: keyboard_leave() called with surface == NULLDaniel Eklöf2019-11-28-2/+4
|
* render: fix rendering of cursor when cell is reversedDaniel Eklöf2019-11-28-13/+19
| | | | | | When the user had configured the cursor color, we failed to invert (reverse) the foreground and background color when the cursor was on a cell with the 'reverse' attribute set.
* async: first synchronous write may succeed partiallyDaniel Eklöf2019-11-28-6/+9
| | | | | | | | | When trying to write (to e.g. the slave, or to a clipboard receiver), we first try to send the data synchronously, and only if that fails do we switch to asynchronous mode. However, the first synchronous may (in fact, is likely to) succeed partially.
* font: set pixman filter when re-scaling glyphDaniel Eklöf2019-11-27-14/+5
|
* generate-version: redirect *both* stdout and stderr to /dev/nullDaniel Eklöf2019-11-27-1/+1
|
* font: estimate pixel size fixup when not provided by fontconfigDaniel Eklöf2019-11-26-25/+73
| | | | | | But only do this when the font is scalable but not an outline. This is only true for color bitmap fonts (emoji fonts), and not e.g. regular bitmap fonts.
* font: use DPI=75 if there's no DPI attribute from fontconfigDaniel Eklöf2019-11-26-1/+1
| | | | This is the fontconfig default as well
* font: underline/strikeout: use y-scale, not x-scaleDaniel Eklöf2019-11-26-9/+9
|
* font: pass dpi=96 to fontconfigDaniel Eklöf2019-11-26-8/+8
| | | | TODO: use actual output PPI. Question is *which* output...
* wayland: calculate output PPI (pixels-per-inch)Daniel Eklöf2019-11-26-3/+12
|
* font: move metrics from terminal struct to font structDaniel Eklöf2019-11-26-34/+35
|
* font: cleanup and return error when failing to load font fileDaniel Eklöf2019-11-25-1/+4
|
* font: use FT_Set_Pixel_Sizes() instead of FT_Set_Char_Size()Daniel Eklöf2019-11-25-2/+8
| | | | Since we're working with pixel sizes anyway...
* gitignore: makepkg generated directories (pkg + src)Daniel Eklöf2019-11-24-1/+3
|
* Merge branch 'dont-use-git-submodules-in-subprojects'Daniel Eklöf2019-11-24-2/+606
|\
| * tllist: import static copy under 'subprojects'Daniel Eklöf2019-11-24-0/+603
| |
| * tllist: add git submodule under 'external'Daniel Eklöf2019-11-24-0/+4
| |
| * tllist: completely removeDaniel Eklöf2019-11-24-3/+0
|/
* generate-version: handle builds that aren't git clonesDaniel Eklöf2019-11-24-1/+1
|
* input: document why wayl->focused may be NULLDaniel Eklöf2019-11-23-1/+7
|
* wayland: change disconnected log type from err -> warnDaniel Eklöf2019-11-23-1/+1
|
* PKGBUILD: update url to point to new hosting serviceDaniel Eklöf2019-11-23-1/+1
|
* input: improve behavior when sway bugs outDaniel Eklöf2019-11-22-3/+17
| | | | | | | | | | | | | | | When we receive a keyboard_key or pointer_motion event without first having received a keyboard_enter or pointer_enter event (that being the "sway bugs" part), we generally don't know _which_ terminal window the event was intended for. However, if we only have *one* window open (always the case for a regular 'foot' process, or when there's a single footclient connected to a foot server process), then obviously we can "guess" which window the event was intended for... so do that. Now, the only time the event is ignored is when we're a server process with more than one window open (= more than one footclient connected).
* input: use xkb_keymap_key_repeats() to determine if we should start repeat timerDaniel Eklöf2019-11-22-19/+19
|
* input: keyboard_key: don't start repeater unless we generated outputDaniel Eklöf2019-11-22-54/+57
| | | | | | | | | | | I.e. what we're effectively doing is *not* repeating modifier keys. Besides being the "right" thing to do, this also works around another Sway 1.2 bug, where being in a focused foot window and then switching to a vt and back would cause us to be stuck in an endless key repeat loop that would only stop when unfocusing, focusing back and then unfocusing once again.
* input: workaround buggy Sway sending bad input eventsDaniel Eklöf2019-11-22-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sway 1.2 has been seen sending keyboard_key() events without first sending a keyboard_enter() event. This can be triggered by: 1. start a foot terminal 2. unfocus it (move focus to another window) 3. switch to a vt 4. switch back to sway 5. focus the foot terminal At this point, Sway will *not* send the keyboard_enter() event, but instead send a keyboard_key() event. (furthermore, if you now unfocus the window again, sway will send a keyboard_leave() event, still without having sent a keyboard_enter() event). Sway has _also_ been seen crashing in wl_pointer_motion(). Though this was in a build without proper debug information, everything points to a similar issue - i.e. sway is sending a motion event without first having sent an enter event. Workaround this by detecting this and logging a warning the first time it happens. The event is then ignored.
* selection: text_to_clipboard: assert the clipboard serial is not 0Daniel Eklöf2019-11-22-0/+1
|
* selection: selection_to_clipboard: exit early on no-selectionDaniel Eklöf2019-11-22-0/+3
| | | | | When there's no selection, exit early to avoid trying to get grid data from row -1.
* selection: we already have a direct pointer to the clipboard structDaniel Eklöf2019-11-22-1/+1
|
* keyboard repeat: pass current input serial to keyboard_key()Daniel Eklöf2019-11-22-1/+3
| | | | | | | This fixes an assertion when holding in ctrl+shift+c (copy to clipboard); subsequent "presses" would set the clipboard serial to 0, which we would then assert on in the next iteration when we tried to cancel the previous copy.
* term: shutdown: handle *not* being unmappedDaniel Eklöf2019-11-21-0/+14
| | | | | | | | | | When we're shutting down a terminal, we destroy our Wayland window, and assume that will unmap us. There are cases when this isn't true (most likely when e.g. a screen locker is active, and the unmap is being deferred). Handle by explicitly setting focused to NULL.
* input: may get keyboard_exit() event with no focused terminalDaniel Eklöf2019-11-21-1/+5
| | | | | | | | This happens on Sway when exiting a screen locker. Or at least that's when we see the problem; it's unclear if the event occurs when starting the screen locker, or when exiting it. Or maybe its both. Anyway, don't try to unfocus a NULL-terminal.
* log: set syslog facility to LOG_DAEMON when run in server modeDaniel Eklöf2019-11-20-5/+17
|
* main: mention why we initialize a font setDaniel Eklöf2019-11-20-0/+1
| | | | | | | | | | | | Since fonts are destroyed and removed from the font cache when the last instance is destroyed, closing the "last" terminal window in server mode would destroy the fonts, and their glyph caches. By instantiating the set in main, we ensure the fonts, and the glyph caches, remain. This makes launching new terminals (much) faster. Note that in "normal" (non-server) mode, this isn't really necessary, but also doesn't have any penalty.
* README: here -> hear (doh!)Daniel Eklöf2019-11-20-1/+1
|
* Revert "PKGBUILD: set b_pgo=generate in first call to meson"Daniel Eklöf2019-11-20-1/+3
| | | | | | | | This reverts commit 7c2dd936905de7aa21a483646b3765cd8d59eb4e. Or repeated pkgbuilds will fail since the first meson call doesn't *re*configure an already configured build tree, causing us to build with pgo=use when we should be using pgo=generate.
* Revert "input: remove unneeded(?) term_reset_view() calls"Daniel Eklöf2019-11-20-2/+2
| | | | | | | | | | | | This reverts commit 739c5cf7f026bd7792f94276e8d6b2587a6ff597. The original commit stated: Not sure why these were added here; they don't appear to be needed (we're writing to the client - it's up to the client to echo stuff, in which case we redraw as usual). But, client output doesn't cause a scrollback/view reset.
* PKGBUILD: add check()Daniel Eklöf2019-11-20-0/+4
|
* PKGBUILD: run 'ninja test' in pgo=generate phaseDaniel Eklöf2019-11-20-0/+2
| | | | Otherwise the build fails in the pgo=use phase.
* PKGBUILD: set b_pgo=generate in first call to mesonDaniel Eklöf2019-11-20-3/+1
| | | | This avoids a meson re-configure right off the bat.
* font: don't spam failures to lookup glyphsDaniel Eklöf2019-11-20-2/+2
|
* fonts: use 'weight' and 'slant', not 'style' when loading fontsDaniel Eklöf2019-11-19-6/+6
|
* doc: foot.1: highlight 'command' in the synopsisDaniel Eklöf2019-11-19-1/+1
|
* osc: copy to/from clipboard: alias 's' to 'p'Daniel Eklöf2019-11-19-5/+4
| | | | | | 'p' means 'primary', while 's' means 'selection'. Thus, a client can now request 'selection' clipboard data and will receive it from the primary selection.
* doc: foot.1: fix highlighting of reference to footclientDaniel Eklöf2019-11-19-1/+1
|
* README: add 'server mode' to the indexDaniel Eklöf2019-11-18-0/+1
|
* README: write a section about the server modeDaniel Eklöf2019-11-18-0/+34
|
* README: mention 'server mode' in the feature listDaniel Eklöf2019-11-18-0/+1
|
* tllist: switch to codeberg repo + bumpDaniel Eklöf2019-11-18-1/+1
|
* ci: run unit testsDaniel Eklöf2019-11-18-0/+2
|
* ci: verbose ninja outputDaniel Eklöf2019-11-18-2/+2
|
* meson: add 'version' dependency to footclientDaniel Eklöf2019-11-18-1/+1
| | | | | footclient (`client.c`, to be precise) includes `version.h`, which is a generated file.
* tllist: bumpDaniel Eklöf2019-11-18-0/+0
|
* terminfo: add tab stop related entries, hts and tbcDaniel Eklöf2019-11-18-0/+2
| | | | | hts - Horizontal Tab Set (?) tbc - Tab Clear
* csi: implement "Send Device Attributes (Tertiary DA)"Daniel Eklöf2019-11-18-0/+18
|
* csi: adjust reply to primary DADaniel Eklöf2019-11-18-1/+1
| | | | | | | | | | Report us as being VT220, as VT420 causes vttest to send a DECRQSS. This is a DCS request that we don't implement (there's no DCS handling *at all* - all DCS strings are ignored). Should be ok as no one appears to care about this one. Other terminals report a much lower level (urxvt for example, replies with vt100. We used to reply with vt102, which also was fine).
* csi: improve "Send Device Attributes (Primary DA)"Daniel Eklöf2019-11-18-2/+32
| | | | | | | Pretend we're a VT420, with a couple of supported features indicated. Note that I haven't verified we support *everything* that each features entails - or even what exactly a feature *is* (locator port?)
* csi: document "Send Device Attributes (Secondary DA)"Daniel Eklöf2019-11-18-0/+20
|
* csi: implement 'Query Device Status'Daniel Eklöf2019-11-18-0/+5
| | | | By replying with "Device OK"
* term: report_mouse_click(): legacy mode only supports rows/cols up to 223.Daniel Eklöf2019-11-18-2/+8
| | | | | | In the legacy mouse reporting mode, line and column numbers are limited to 223 (255-32). In case the current coordinate falls outside this, simply ignore it (don't report it).
* csi: add debug logs for the various mouse reporting modesDaniel Eklöf2019-11-18-1/+4
|
* term: assert(false) on MOUSE_X10Daniel Eklöf2019-11-18-3/+15
| | | | | This mouse mode is never enabled. I.e. we don't support it. Add asserts to catch usage of it, should we ever decide to implement it.