aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Orzechowski <orzechowski.alexander@gmail.com>2022-08-18 07:14:28 -0400
committerAlexander Orzechowski <orzechowski.alexander@gmail.com>2022-08-18 07:16:16 -0400
commit346e52420171cedaf1fb7dffe7e37f99b478c5b1 (patch)
tree21a32b367f99010298c18769ea19226b30bafe65
parentef4baea0e2f799c7bdd2e077dac4174fa31e85df (diff)
Remove wlr_signal_emit_safe
-rw-r--r--include/util/signal.h8
-rw-r--r--util/meson.build1
-rw-r--r--util/signal.c34
3 files changed, 0 insertions, 43 deletions
diff --git a/include/util/signal.h b/include/util/signal.h
deleted file mode 100644
index fd93073a..00000000
--- a/include/util/signal.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef UTIL_SIGNAL_H
-#define UTIL_SIGNAL_H
-
-#include <wayland-server-core.h>
-
-void wlr_signal_emit_safe(struct wl_signal *signal, void *data);
-
-#endif
diff --git a/util/meson.build b/util/meson.build
index a416490f..8933f2e7 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -6,7 +6,6 @@ wlr_files += files(
'log.c',
'region.c',
'shm.c',
- 'signal.c',
'time.c',
'token.c',
)
diff --git a/util/signal.c b/util/signal.c
deleted file mode 100644
index 39618465..00000000
--- a/util/signal.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "util/signal.h"
-
-static void handle_noop(struct wl_listener *listener, void *data) {
- // Do nothing
-}
-
-void wlr_signal_emit_safe(struct wl_signal *signal, void *data) {
- struct wl_listener cursor;
- struct wl_listener end;
-
- /* Add two special markers: one cursor and one end marker. This way, we know
- * that we've already called listeners on the left of the cursor and that we
- * don't want to call listeners on the right of the end marker. The 'it'
- * function can remove any element it wants from the list without troubles.
- * wl_list_for_each_safe tries to be safe but it fails: it works fine
- * if the current item is removed, but not if the next one is. */
- wl_list_insert(&signal->listener_list, &cursor.link);
- cursor.notify = handle_noop;
- wl_list_insert(signal->listener_list.prev, &end.link);
- end.notify = handle_noop;
-
- while (cursor.link.next != &end.link) {
- struct wl_list *pos = cursor.link.next;
- struct wl_listener *l = wl_container_of(pos, l, link);
-
- wl_list_remove(&cursor.link);
- wl_list_insert(pos, &cursor.link);
-
- l->notify(l, data);
- }
-
- wl_list_remove(&cursor.link);
- wl_list_remove(&end.link);
-}