mirror of
https://github.com/swaywm/sway.git
synced 2026-04-06 07:15:44 -04:00
sway/tree: Simplify sway_node teardown
A sway_node may end up being referenced in either a queued transaction, pending transaction or as a dirty node. To manage this, the transaction system has been responsible for destroying containers, workspaces and outputs at the end of their last referenced transaction. This significantly complicates the teardown flow of surfaces and outputs. Instead, remove the node from transactions and dirty lists so that the callsite can remove and free the node immediately.
This commit is contained in:
parent
4f59eeef05
commit
e28e6484e8
16 changed files with 125 additions and 149 deletions
|
|
@ -428,7 +428,7 @@ void force_modeset(void) {
|
|||
apply_stored_output_configs();
|
||||
}
|
||||
|
||||
static void begin_destroy(struct sway_output *output) {
|
||||
static void output_teardown(struct sway_output *output) {
|
||||
|
||||
wl_list_remove(&output->layout_destroy.link);
|
||||
wl_list_remove(&output->destroy.link);
|
||||
|
|
@ -444,7 +444,6 @@ static void begin_destroy(struct sway_output *output) {
|
|||
if (output->enabled) {
|
||||
output_disable(output);
|
||||
}
|
||||
output_begin_destroy(output);
|
||||
wl_list_remove(&output->link);
|
||||
|
||||
output->wlr_output->data = NULL;
|
||||
|
|
@ -453,17 +452,19 @@ static void begin_destroy(struct sway_output *output) {
|
|||
wl_event_source_remove(output->repaint_timer);
|
||||
output->repaint_timer = NULL;
|
||||
|
||||
output_destroy(output);
|
||||
|
||||
request_modeset();
|
||||
}
|
||||
|
||||
static void handle_destroy(struct wl_listener *listener, void *data) {
|
||||
struct sway_output *output = wl_container_of(listener, output, destroy);
|
||||
begin_destroy(output);
|
||||
output_teardown(output);
|
||||
}
|
||||
|
||||
static void handle_layout_destroy(struct wl_listener *listener, void *data) {
|
||||
struct sway_output *output = wl_container_of(listener, output, layout_destroy);
|
||||
begin_destroy(output);
|
||||
output_teardown(output);
|
||||
}
|
||||
|
||||
static void handle_present(struct wl_listener *listener, void *data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue