Age | Commit message (Collapse) | Author |
|
|
|
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 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.
|
|
|
|
|
|
Each piece of text is now individually themable, with foreground and
background colours and optionally rounded background corners.
|
|
|
|
|
|
|
|
All text handling should now be explicitly UTF-8 or UTF-32, removing the
ambiguity around wchar_t and related functions.
|
|
|
|
|
|
The config file code now delays calculation of percentage values until
`config_fix_percentages()` is called. This allows the config file to be
parsed before output configuration is complete, thus allowing `--output`
and `--late-keyboard-init` to be specified in the config file.
|
|
Pagination was broken in horizontal mode before, and in general tried to
render too many results (leading to a cut-off last result). This commit
fixes both of those, with the minor caveat that you can no longer scroll
straight to the last result.
|
|
|
|
This was done by breaking the selected result into three parts, and
rendering each separately. A side-effect is that ligatures split when a
match ends inside them, but I think that's the correct behaviour (rather
than highlighting the whole ligature).
There may be issues with some non-latin languages that make much more
extensive use of ligatures / combining characters, however.
|
|
|
|
This adds some extra padding in the selection background, rather than
tightly wrapping the selection text.
|
|
Tofi will now try to autodetect how many results can be drawn if
--num-results=0 is specified, which is now the default.
|
|
This is a pretty simple implementation, but it should work for most
use cases. Notably, generic application names aren't used (though that
could be added without too much hassle), and neither are keywords (that
would be more difficult).
|
|
|
|
|
|
Implement horizontal mode for Pango, and add min-input-width option.
|
|
|
|
Tofi now uses Harfbuzz if a file is passed to --font-name, and Pango
otherwise.
|
|
The scale factor is now only used to scale font sizes, not all Cairo
drawing operations. This makes pixel-sized options correct.
|
|
|
|
|
|
Single letter style arguments have been removed.
|
|
There are too many really to use single-character args, so the next step
should be a config file.
|
|
By pointing Cairo at the mmap-ed file used to create wl_shm buffers, we
can eliminate a memcpy() on every draw, providing a decent speedup
(especially for large window sizes).
This comes at the expense of having to keep track of two Cairo contexts,
one for each of our two buffers used for double buffering. Additionally,
a single memcpy() is still required for initialisation of the second
buffer, so the startup latency isn't affected much.
|
|
Another source of slow startup is initialising Pango. If the user
supplies a ttf file, we can skip any Pango stuff and use Harfbuzz
directly with Cairo to do our font rendering, providing a large speedup.
|
|
This implements a rofi-like run cache. Other smaller changes include
simplification of resize logic now that there's only one surface.
|
|
- Remove the background image and libpng dependency
- Add a prompt
- Add xmalloc with out-of-memory handling
- Add beginnings of a rofi-like run cache
|
|
The subsurface was playing havoc with layer shell stuff, and I don't
think any potential efficiency gain is worth the complicated code to
work out how big the subsurface should be. Instead, the entry code now
just draws directly onto the main surface.
Damage information should be passed to glTexSubImage2D() in future, to
avoid redrawing the entire window every keypress.
|
|
|
|
|
|
Initialising Pango makes up a large portion of the startup time, and we
can achieve neater rendering with pure Cairo if we're just drawing
circles anyway. Therefore, this commit avoids loading Pango if no
options which require it are specified (such as --font-name or
--password-character). This reduces startup time with no background
image to ~40ms on my machine (2015 MacBook Pro).
|
|
Also fix some memory leaks.
|
|
Useable, but very barebones — not even any error message reporting.
|
|
|
|
|