aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-03-08 17:11:19 +0100
committerDrew DeVault <sir@cmpwn.com>2019-04-11 09:19:57 -0600
commitee77a65fe38e2e11a73635f79e7ed8b641771644 (patch)
tree6b30e4681c2f7c6ae49e89dba6c6a1a6b982cf7a
parentef68d7d4d129582a49c0040cb7ddaf36637fe24d (diff)
rootston: update output-management-v1 state when output is modeset
-rw-r--r--include/rootston/output.h1
-rw-r--r--rootston/output.c15
2 files changed, 12 insertions, 4 deletions
diff --git a/include/rootston/output.h b/include/rootston/output.h
index 687df3ac..74b7e6eb 100644
--- a/include/rootston/output.h
+++ b/include/rootston/output.h
@@ -22,6 +22,7 @@ struct roots_output {
struct wlr_box usable_area;
struct wl_listener destroy;
+ struct wl_listener enable;
struct wl_listener mode;
struct wl_listener transform;
struct wl_listener present;
diff --git a/rootston/output.c b/rootston/output.c
index 0f684c85..8ecac8ca 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -443,23 +443,27 @@ static void output_destroy(struct roots_output *output) {
//example_config_configure_cursor(sample->config, sample->cursor,
// sample->compositor);
- struct roots_desktop *desktop = output->desktop;
-
wl_list_remove(&output->link);
wl_list_remove(&output->destroy.link);
+ wl_list_remove(&output->enable.link);
wl_list_remove(&output->mode.link);
wl_list_remove(&output->transform.link);
wl_list_remove(&output->present.link);
wl_list_remove(&output->damage_frame.link);
wl_list_remove(&output->damage_destroy.link);
free(output);
-
- update_output_manager_config(desktop);
}
static void output_handle_destroy(struct wl_listener *listener, void *data) {
struct roots_output *output = wl_container_of(listener, output, destroy);
+ struct roots_desktop *desktop = output->desktop;
output_destroy(output);
+ update_output_manager_config(desktop);
+}
+
+static void output_handle_enable(struct wl_listener *listener, void *data) {
+ struct roots_output *output = wl_container_of(listener, output, enable);
+ update_output_manager_config(output->desktop);
}
static void output_damage_handle_frame(struct wl_listener *listener,
@@ -480,6 +484,7 @@ static void output_handle_mode(struct wl_listener *listener, void *data) {
struct roots_output *output =
wl_container_of(listener, output, mode);
arrange_layers(output);
+ update_output_manager_config(output->desktop);
}
static void output_handle_transform(struct wl_listener *listener, void *data) {
@@ -537,6 +542,8 @@ void handle_new_output(struct wl_listener *listener, void *data) {
output->destroy.notify = output_handle_destroy;
wl_signal_add(&wlr_output->events.destroy, &output->destroy);
+ output->enable.notify = output_handle_enable;
+ wl_signal_add(&wlr_output->events.enable, &output->enable);
output->mode.notify = output_handle_mode;
wl_signal_add(&wlr_output->events.mode, &output->mode);
output->transform.notify = output_handle_transform;