Age | Commit message (Collapse) | Author |
|
Invoking 'tofi' now acts like dmenu, expecting newline-separated options
on stdin.
Also fix history file handling and add an option to disable it.
|
|
|
|
|
|
|
|
|
|
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.
|
|
A list of commands is now stored in $XDG_CACHE_HOME/.cache/tofi-compgen,
and regenerated as necessary.
|
|
- Split the compgen and history sorting parts of compgen(), for future
dmenu-like work.
- Add a separate tofi-compgen executable.
- Remove harfbuzz-glib usage, as we shouldn't be doing any complicated
unicode stuff.
|
|
|
|
|
|
|
|
|
|
Previously integers were used, effectively removing any sub-pixel
positioning.
|
|
We don't actually need a separate pango layout for each piece of text,
as we only use them one-by-one anyway, so just use one instead.
|
|
|
|
We don't actually need to initialise our second Cairo context / surface
until after the first one has been painted to the screen. This commit
therefore delays this initialisation (or at least the expensive memcpy),
granting a significant reduction in startup time.
The downside is that main() and entry_init() are now tied together
somewhat, but hopefully the comments help.
|
|
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.
|
|
|
|
Rather than using cairo_paint() and re-drawing the middle of the window
multiple times, use cairo_rectangle() + cairo_stroke(). This especially
helps for large (e.g. fullscreen) windows.
|
|
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.
|
|
eglInitialize() is slow (~50-100ms), and uses a fair amount of memory
(~100 MB). For such a small, simple program that just wants to launch as
quickly as possible, wl_shm performs better.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also various minor cleanup.
|
|
OpenGL ES 2 only allows byte or short indices in the element buffer, not
int.
|
|
|
|
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).
|
|
|
|
|
|
It should now find the shaders when someone just clones and builds the
code without installing.
|
|
|
|
|
|
|
|
|
|
|
|
Also fix some memory leaks.
|
|
|
|
|
|
|
|
|
|
Useable, but very barebones — not even any error message reporting.
|
|
|