Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

output-layout: emit add before change event #3311

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions types/wlr_output_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,15 @@ static struct wlr_output_layout_output *output_layout_output_create(

wlr_addon_init(&l_output->addon, &output->addons, layout, &addon_impl);

wlr_signal_emit_safe(&layout->events.add, l_output);

return l_output;
}

void wlr_output_layout_add(struct wlr_output_layout *layout,
struct wlr_output *output, int lx, int ly) {
struct wlr_output_layout_output *l_output =
wlr_output_layout_get(layout, output);
bool is_new = l_output == NULL;
if (!l_output) {
l_output = output_layout_output_create(layout, output);
if (!l_output) {
Expand All @@ -215,10 +216,6 @@ void wlr_output_layout_add(struct wlr_output_layout *layout,
l_output->state->auto_configured = false;
output_layout_reconfigure(layout);
output_update_global(output);

if (is_new) {
wlr_signal_emit_safe(&layout->events.add, l_output);
}
}

struct wlr_output_layout_output *wlr_output_layout_get(
Expand Down Expand Up @@ -413,7 +410,6 @@ void wlr_output_layout_add_auto(struct wlr_output_layout *layout,
struct wlr_output *output) {
struct wlr_output_layout_output *l_output =
wlr_output_layout_get(layout, output);
bool is_new = l_output == NULL;
if (!l_output) {
l_output = output_layout_output_create(layout, output);
if (!l_output) {
Expand All @@ -425,10 +421,6 @@ void wlr_output_layout_add_auto(struct wlr_output_layout *layout,
l_output->state->auto_configured = true;
output_layout_reconfigure(layout);
output_update_global(output);

if (is_new) {
wlr_signal_emit_safe(&layout->events.add, l_output);
}
}

struct wlr_output *wlr_output_layout_get_center_output(
Expand Down