aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-02-20 19:06:56 -0500
committerTony Crisci <tony@dubstepdish.com>2018-02-20 19:06:56 -0500
commit316effd7b1f6b60f70038f9a5df5d58eb879cf90 (patch)
tree7a0557a0e88078cf4584dd2064d1705dd9446ad8 /sway
parent4c4cc9c99943b4f80f1551c421b372b016dd04e6 (diff)
make handle_output_destroy() static
Diffstat (limited to 'sway')
-rw-r--r--sway/desktop/output.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 039aba25..8e0daeea 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -218,6 +218,26 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
soutput->last_frame = now;
}
+static void handle_output_destroy(struct wl_listener *listener, void *data) {
+ struct wlr_output *wlr_output = data;
+ wlr_log(L_DEBUG, "Output %p %s removed", wlr_output, wlr_output->name);
+
+ swayc_t *output_container = NULL;
+ for (int i = 0 ; i < root_container.children->length; ++i) {
+ swayc_t *child = root_container.children->items[i];
+ if (child->type == C_OUTPUT &&
+ child->sway_output->wlr_output == wlr_output) {
+ output_container = child;
+ break;
+ }
+ }
+ if (!output_container) {
+ return;
+ }
+
+ destroy_output(output_container);
+}
+
void handle_new_output(struct wl_listener *listener, void *data) {
struct sway_server *server = wl_container_of(listener, server, new_output);
struct wlr_output *wlr_output = data;
@@ -252,23 +272,3 @@ void handle_new_output(struct wl_listener *listener, void *data) {
arrange_windows(&root_container, -1, -1);
}
-
-void handle_output_destroy(struct wl_listener *listener, void *data) {
- struct wlr_output *wlr_output = data;
- wlr_log(L_DEBUG, "Output %p %s removed", wlr_output, wlr_output->name);
-
- swayc_t *output_container = NULL;
- for (int i = 0 ; i < root_container.children->length; ++i) {
- swayc_t *child = root_container.children->items[i];
- if (child->type == C_OUTPUT &&
- child->sway_output->wlr_output == wlr_output) {
- output_container = child;
- break;
- }
- }
- if (!output_container) {
- return;
- }
-
- destroy_output(output_container);
-}