aboutsummaryrefslogtreecommitdiff
path: root/backend/session
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-02-12 09:12:31 +0100
committeremersion <contact@emersion.fr>2018-02-12 09:12:31 +0100
commit5e58d46cc1a90810e3ee76203cee8ca2f14fb462 (patch)
treea5019d87cdc121842ab7cf867fbcac0fde4ccff0 /backend/session
parent3497e53516d96ad67b26115e2e06218f68e1114d (diff)
Add wlr_signal_emit_safe
Diffstat (limited to 'backend/session')
-rw-r--r--backend/session/direct-freebsd.c5
-rw-r--r--backend/session/direct.c5
-rw-r--r--backend/session/logind.c7
-rw-r--r--backend/session/session.c3
4 files changed, 12 insertions, 8 deletions
diff --git a/backend/session/direct-freebsd.c b/backend/session/direct-freebsd.c
index c0621416..fe4ff653 100644
--- a/backend/session/direct-freebsd.c
+++ b/backend/session/direct-freebsd.c
@@ -15,6 +15,7 @@
#include <wayland-server.h>
#include <wlr/backend/session/interface.h>
#include <wlr/util/log.h>
+#include <wlr/util/signal.h>
#include "backend/session/direct-ipc.h"
const struct session_impl session_direct;
@@ -95,12 +96,12 @@ static int vt_handler(int signo, void *data) {
if (session->base.active) {
session->base.active = false;
- wl_signal_emit(&session->base.session_signal, session);
+ wlr_signal_emit_safe(&session->base.session_signal, session);
ioctl(session->tty_fd, VT_RELDISP, 1);
} else {
ioctl(session->tty_fd, VT_RELDISP, VT_ACKACQ);
session->base.active = true;
- wl_signal_emit(&session->base.session_signal, session);
+ wlr_signal_emit_safe(&session->base.session_signal, session);
}
return 1;
diff --git a/backend/session/direct.c b/backend/session/direct.c
index 9d6cd36d..245683ea 100644
--- a/backend/session/direct.c
+++ b/backend/session/direct.c
@@ -15,6 +15,7 @@
#include <wayland-server.h>
#include <wlr/backend/session/interface.h>
#include <wlr/util/log.h>
+#include <wlr/util/signal.h>
#include "backend/session/direct-ipc.h"
enum { DRM_MAJOR = 226 };
@@ -107,7 +108,7 @@ static int vt_handler(int signo, void *data) {
if (session->base.active) {
session->base.active = false;
- wl_signal_emit(&session->base.session_signal, session);
+ wlr_signal_emit_safe(&session->base.session_signal, session);
struct wlr_device *dev;
wl_list_for_each(dev, &session->base.devices, link) {
@@ -130,7 +131,7 @@ static int vt_handler(int signo, void *data) {
}
session->base.active = true;
- wl_signal_emit(&session->base.session_signal, session);
+ wlr_signal_emit_safe(&session->base.session_signal, session);
}
return 1;
diff --git a/backend/session/logind.c b/backend/session/logind.c
index 1ece051f..f6150817 100644
--- a/backend/session/logind.c
+++ b/backend/session/logind.c
@@ -13,13 +13,14 @@
#include <wlr/config.h>
#include <wlr/backend/session/interface.h>
#include <wlr/util/log.h>
+#include <wlr/util/signal.h>
#ifdef WLR_HAS_SYSTEMD
#include <systemd/sd-bus.h>
#include <systemd/sd-login.h>
#elif defined(WLR_HAS_ELOGIND)
#include <elogind/sd-bus.h>
- #include <elogind/sd-login.h>
+ #include <elogind/sd-login.h>
#endif
enum { DRM_MAJOR = 226 };
@@ -250,7 +251,7 @@ static int pause_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_e
if (major == DRM_MAJOR) {
session->base.active = false;
- wl_signal_emit(&session->base.session_signal, session);
+ wlr_signal_emit_safe(&session->base.session_signal, session);
}
if (strcmp(type, "pause") == 0) {
@@ -286,7 +287,7 @@ static int resume_device(sd_bus_message *msg, void *userdata, sd_bus_error *ret_
if (!session->base.active) {
session->base.active = true;
- wl_signal_emit(&session->base.session_signal, session);
+ wlr_signal_emit_safe(&session->base.session_signal, session);
}
}
diff --git a/backend/session/session.c b/backend/session/session.c
index 2bbbd4ef..4b81e230 100644
--- a/backend/session/session.c
+++ b/backend/session/session.c
@@ -13,6 +13,7 @@
#include <wlr/backend/session.h>
#include <wlr/backend/session/interface.h>
#include <wlr/util/log.h>
+#include <wlr/util/signal.h>
extern const struct session_impl session_logind;
extern const struct session_impl session_direct;
@@ -49,7 +50,7 @@ static int udev_event(int fd, uint32_t mask, void *data) {
wl_list_for_each(dev, &session->devices, link) {
if (dev->dev == devnum) {
- wl_signal_emit(&dev->signal, session);
+ wlr_signal_emit_safe(&dev->signal, session);
break;
}
}