Age | Commit message (Collapse) | Author |
|
This replaces the --fuzzy-match algorithm. Available choices are normal,
prefix and fuzzy. Levenshtein distance was investigated, but it seems
pretty rubbish for tofi's use case, where you normally want a good match when
you've only typed a small portion of the target string.
|
|
I had misunderstood the purpose of the OpenType line gap field 'hlgp'. I
thought this was a suggested total line spacing, but it's actually extra
spacing to be added to (ascender - descender).
|
|
|
|
This was broken in the recent changes to allow fractional scaling, as a
calculation hadn't been updated.
|
|
|
|
|
|
|
|
I now understand how this was supposed to be done.
|
|
|
|
The main change is that we now always have to set up the dummy surface
which was previously only used when multiple monitors were present. This
is because there's no way to determine an output's fractional scale
factor without displaying a surface on it, and we need to know the scale
factor before we create our main window surface.
The extra compositor round-trips lead to a slight slowdown for single
monitor setups (to the same speed as multi-monitor setups), but it's
currently unavoidable as far as I know.
|
|
|
|
This is the next step in supporting fractional scaling, as
wl_surface_set_buffer_scale only supports integer scale factors.
|
|
|
|
Instead of scaling various theme parameters ourselves, just set the
scale in Cairo. This shouldn't result in any visible changes, but lays
the ground work for fractional scaling support.
|
|
|
|
|
|
This allows rounded background corners to work when a padding of -1 is
specified.
|
|
|
|
|
|
This turned out to be much more complex than anticipated, and the
potential for bugs is therefore quite high.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Previously, string vectors were built by reading input line-by line, and
multiple copies of string vectors were made when searching.
Now, input is read into one big buffer, and string vectors only contain
references to the strings in this buffer. This both speeds up reading of
input, and avoids unnecessary copying of strings in various places.
The main downside currently is that input read from stdin is no longer
UTF-8 normalised. This means, for example, that a search for `e` won't
necessarily match `é`. Normalisation is very slow relative to the rest
of tofi, however, and not needed for most use-cases. This could either
be solved by accepting the slowdown, or making this an option, such as
--unicode or --unicode-normalize.
|
|
|
|
|
|
|
|
We can assume that string vectors generated by tofi are already
normalised, so don't waste time normalising them again.
Also make sure to validate strings from the user.
|
|
Also fix a potential segfault in character parsing found by AFLplusplus.
|
|
|
|
|
|
Each piece of text is now individually themable, with foreground and
background colours and optionally rounded background corners.
|
|
The list was getting far too long, and is about to get even longer with
text styling options. The user is instead directed to the manpage.
Also, don't print usage to stderr if `-h` was passed.
|
|
This change avoids warning about old compositors on newer versions of
Sway. Sway never actually supported version 4, and recently changed to
report only version 3 as supported.
|
|
|
|
|
|
|
|
This adds `_sorted` to the names of `string_vec_find` and
`desktop_vec_find`, to make it clear that these functions require their
input to already be sorted.
Also fix a potential bug from not sorting the list of desktops in drun
mode.
|
|
By using a hash table rather than binary search to find existing items,
we can avoid the need to sort the input.
|
|
Some of the string vec code was still assuming that it was just a list
of `char *`s, rather than `struct scored_string`s. Correcting that makes
future changes a little less error prone, and allows significantly
simpler history sorting for tofi-run.
|
|
This is a short-term workaround for history sorting not working, due to
the binary search used to find exiting items relying on the input
already being sorted.
|
|
|
|
|
|
|
|
|
|
|