mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-30 11:10:23 -04:00
term: add term_shutdown()
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.
This commit is contained in:
parent
445bbe3469
commit
9d5926ce12
2 changed files with 103 additions and 32 deletions
|
|
@ -293,6 +293,7 @@ struct config;
|
|||
struct terminal *term_init(
|
||||
const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
||||
int argc, char *const *argv);
|
||||
bool term_shutdown(struct terminal *term);
|
||||
int term_destroy(struct terminal *term);
|
||||
|
||||
void term_reset(struct terminal *term, bool hard);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue