summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Beckett <bob.beckett@collabora.com>2019-07-10 16:40:12 +0100
committerDaniel Stone <daniel@fooishbar.org>2019-07-18 06:35:41 +0000
commitc569bdc23612eab518b6f60cf60fb3ab775cf5e4 (patch)
tree3880c2f3ec0979f3176b490c4fed372c30e0ffeb
parent1aa3f52fb5adb68cbc7879a8c1dd1d9399d88e16 (diff)
libweston: make session_active a bool
compositor->session_active should be a bool as it tracks a boolean condition. Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
-rw-r--r--include/libweston/libweston.h2
-rw-r--r--libweston/compositor.c2
-rw-r--r--libweston/launcher-direct.c4
-rw-r--r--libweston/launcher-logind.c2
-rw-r--r--libweston/launcher-weston-launch.c4
5 files changed, 7 insertions, 7 deletions
diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h
index 2c1e8645..9f99b9d0 100644
--- a/include/libweston/libweston.h
+++ b/include/libweston/libweston.h
@@ -1140,7 +1140,7 @@ struct weston_compositor {
struct wl_signal output_heads_changed_signal; /* arg: weston_output */
struct wl_signal session_signal;
- int session_active;
+ bool session_active;
struct weston_layer fade_layer;
struct weston_layer cursor_layer;
diff --git a/libweston/compositor.c b/libweston/compositor.c
index deb2edd7..848ae4e6 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -7195,7 +7195,7 @@ weston_compositor_create(struct wl_display *display,
wl_signal_init(&ec->heads_changed_signal);
wl_signal_init(&ec->output_heads_changed_signal);
wl_signal_init(&ec->session_signal);
- ec->session_active = 1;
+ ec->session_active = true;
ec->output_id_pool = 0;
ec->repaint_msec = DEFAULT_REPAINT_WINDOW;
diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c
index d59de1bd..9fa329b6 100644
--- a/libweston/launcher-direct.c
+++ b/libweston/launcher-direct.c
@@ -104,14 +104,14 @@ vt_handler(int signal_number, void *data)
struct weston_compositor *compositor = launcher->compositor;
if (compositor->session_active) {
- compositor->session_active = 0;
+ compositor->session_active = false;
wl_signal_emit(&compositor->session_signal, compositor);
drmDropMaster(launcher->drm_fd);
ioctl(launcher->tty, VT_RELDISP, 1);
} else {
ioctl(launcher->tty, VT_RELDISP, VT_ACKACQ);
drmSetMaster(launcher->drm_fd);
- compositor->session_active = 1;
+ compositor->session_active = true;
wl_signal_emit(&compositor->session_signal, compositor);
}
diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c
index 3b0a10d8..9c10c097 100644
--- a/libweston/launcher-logind.c
+++ b/libweston/launcher-logind.c
@@ -272,7 +272,7 @@ launcher_logind_activate_vt(struct weston_launcher *launcher, int vt)
static void
launcher_logind_set_active(struct launcher_logind *wl, bool active)
{
- if (!wl->compositor->session_active == !active)
+ if (wl->compositor->session_active == active)
return;
wl->compositor->session_active = active;
diff --git a/libweston/launcher-weston-launch.c b/libweston/launcher-weston-launch.c
index e5d828ce..7bac0a30 100644
--- a/libweston/launcher-weston-launch.c
+++ b/libweston/launcher-weston-launch.c
@@ -207,12 +207,12 @@ launcher_weston_launch_data(int fd, uint32_t mask, void *data)
switch (ret) {
case WESTON_LAUNCHER_ACTIVATE:
- launcher->compositor->session_active = 1;
+ launcher->compositor->session_active = true;
wl_signal_emit(&launcher->compositor->session_signal,
launcher->compositor);
break;
case WESTON_LAUNCHER_DEACTIVATE:
- launcher->compositor->session_active = 0;
+ launcher->compositor->session_active = false;
wl_signal_emit(&launcher->compositor->session_signal,
launcher->compositor);
break;