Commit c569bdc2 authored by Robert Beckett's avatar Robert Beckett Committed by Daniel Stone

libweston: make session_active a bool

compositor->session_active should be a bool as it tracks a boolean
condition.
Signed-off-by: Robert Beckett's avatarRobert Beckett <bob.beckett@collabora.com>
parent 1aa3f52f
......@@ -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;
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment