| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
| |
main uses this to get the exit code of the terminal.
|
| |
|
|
|
| |
* Close FDs, then delay destruction to next epoll() call
* Destroy window before destroying terminal
|
| | |
|
| |
|
|
| |
This would happen if *both* timers triggered in the same epoll() call.
|
| | |
|
| |
|
|
|
|
| |
Trying to pass a too long title (not sure what "too long" is
though...) will trigger a call to abort() inside the wayland-client
library.
|
| | |
|
| |
|
|
|
| |
We use epoll() to determine when we can read/write FDs so there's
absolutely no need for non-blocking.
|
| |
|
|
|
|
|
|
|
| |
This will trigger e.d. keyboard_leave() and wl_pointer_leave() events,
which ensures there aren't any references to the destroyed window from
the global wayland struct.
Call wl_display_roundtrip() to trigger those events *before* we
destroy the window.
|
| | |
|
| |
|
|
| |
This allows us to remove that call from the main event loop.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is perfectly possible, and legal, for a FDM handler to delete
another handler. The problem however is when the epoll returned array
of FD events contain the removed FD handler *after* the handler that
removed it.
That is, if the epoll returned array is:
[FD=13, FD=37]
and the handler for FD=13 removes FD=37, then given the current
implementation, the FD user data (our handler callback etc) will point
to a free:d address.
Add support for this situation by deferring FD handler removal *when
called from another handler*.
This is done by "locking" the FDM struct before looping the handlers
for FDs with events (and unlocking afterwards).
In fdm_del(), we check if the FDM has been locked, in which case the
FD is marked as deleted, and put on a deferred list. But
not *actually* deleted.
Meanwhile, in the FDM poll function, we skip calling handlers for
marked-for-deletion FDs.
Then, when all FDs have been processed, we loop the deferred list and
finally deletes the FDs for real.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
* Configure all FDs *completely* before moving on
* Start client before creating the wayland window
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function unmaps the terminal window, removes itself from the
wayland list of terminals and then finally destroys itself.
We ensure we don't get any callbacks/events referring to a free:d
terminal struct, we close all terminal related FDs and unmap the
wayland window.
Then, to be really really sure there aren't any (by the FDM) queued up
events, we delay the self-destruction to the next FDM poll iteration,
by opening an event FD and adding it to the FDM.
The callback for the event FD removes the FD from the FDM again, and
closes it. And then proceeds to destroy the terminal.
|
| |
|
|
|
| |
The wayland 'term' member is gone and replaced by a list,
'terms'. This list contains all currently running terminal (windows).
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/ |
|
| |\ |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since we now initialize the worker threads from term_init(), which
returns before the threads terminate, we can no longer use
stack-allocated worker contexts.
We _could_ put them in the terminal struct. But a simpler solution is
to allocate them in term_init(), and let the threads free them when
they don't need them anymore.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Wayland instantiation is now done by the wayland backend, not in main.
|
| | |
| |
| |
| |
| |
| | |
We do however need access to it, so provide a pointer. The difference
is that now we can have a *single* wayland instance, but multiple
terminal instances.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Instead of passing the terminal to the wayland callbacks, pass a
'struct wayland' pointer.
|
| | |
| |
| |
| |
| | |
This can, in the future, be extended to e.g. a list, to support
multiple windows.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
These are application global and very wayland specific
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Short term, we want to break out the wayland backend from the terminal
struct. Long term, we might want to support multiple windows.
One step towards both the above is separating global wayland objects
from per-window objects.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When doing "small" scrolls (typically done via mouse wheel or
similar), we render the scrolling by emitting a "scroll damage".
A recent commit changed how scroll damage is rendered; only when the
view is at the bottom ("following" the screen output) do we render the
damage.
To fix this, add a new type of scroll damage,
SCROLL_DAMAGE_IN_VIEW and SCROLL_DAMAGE_REVERSE_IN_VIEW.
These signal to the renderer that it should always render the damage.
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
| |
When user has scrolled back in the output history, new output should
not trigger scrolling.
This was true for normal cell rendering, which renders the cells *in
view*, not caring where the "front" of the output is.
However, we still applied scroll damage. I.e. we memmoved part of the
screen.
The fix is simple; only apply scroll damage when the view is at the
front of the output.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
run_command() was only run at configure time, meaning the generated
version (that was passed on to the sources via -DFUZZEL_VERSION)
became stale.
Fix by implementing a shell script that generates a header file, and
wrap this in a custom target that is run every time (but the generated
file is only updated when the version changes)
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
When instantiating a primary font, build the fallback font list, but
don't actually instantiate the fallback fonts.
Instead, remember the (full) pattern that we should use if/when we
instantiate it.
Then, when looking up a glyph and we need a fallback font, loop the
list and instantiate the font(s) there and then.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The caching of fallback fonts didn't work. It "worked" because we
didn't free the fonts... When we started doing that, the fallback
fonts were no longer cached.
Another solution would have been to keep the cached fallback fonts
around until exit, and free them there. But that didn't seem very
clean.
So, for now, load *all* fallbacks when instantiating a
primary (non-fallback) font.
Note that this slows down initial startup time.
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This greatly improves the performance when loading user-configured
fallback fonts.
Previously, we had to re-load these fallback fonts over and over again
for each (new) glyph.
|
| | | |
|
| | | |
|
| |/ |
|
| | |
|
| | |
|
| |
|
|
|
| |
* We don't support startup notifications
* We don't support a non-standard "new" action
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
There must be at least one scrolling row. I.e. the bottom margin must
be larger than the top margin.
Note that trying to set an invalid region really will
be *ignored*. I.e. we *don't* reset the scrolling region.
This conforms to xterm's behavior.
|
| | |
|
| |
|
|
| |
cat:ing a binary file would otherwise result in us spamming syslog.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not all compositors support buffer re-use. I.e. they will call the
frame callback *before* the previous buffer has been
released. Effectively causing us to swap between two buffers.
Previously, this made us enter an infinite re-render loop, since we
considered the window 'dirty' (and in need of re-draw) when the buffer
is different from last redraw.
Now, we detect the buffer swapping case; size must match, and we must
not have any other condition that require a full repaint.
In this case, we can memcpy() the old buffer to the new one, without
dirtying the entire grid. We then update only the dirty cells (and
scroll damage).
Note that there was a bug here, where we erased the old
cursor *before* checking for a new buffer. This worked when the buffer
had *not* changed.
Now that we need to handle the case where it *has* changed, we must do
the memcpy() *before* we erase the cursor, or the re-painted cell is
lost.
This makes foot work on Plasma, without burning CPU. The memcpy() does
incur a performance penalty, but we're still (much) faster than
e.g. konsole. In fact, we're still mostly on par with Alacritty.
|
| |
|
|
| |
Fixes 'invisible window' on Plasma
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
The 'foot' terminfo may not be installed/available when we run the
intermediate foot binary, so explicitly use 'xterm' instead.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Since Courier New is monospaced, while Arial is not.
|
| | |
|