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>
dev
Robert Beckett 5 years ago committed by Daniel Stone
parent 1aa3f52fb5
commit c569bdc236
  1. 2
      include/libweston/libweston.h
  2. 2
      libweston/compositor.c
  3. 4
      libweston/launcher-direct.c
  4. 2
      libweston/launcher-logind.c
  5. 4
      libweston/launcher-weston-launch.c

@ -1140,7 +1140,7 @@ struct weston_compositor {
struct wl_signal output_heads_changed_signal; /* arg: weston_output */ struct wl_signal output_heads_changed_signal; /* arg: weston_output */
struct wl_signal session_signal; struct wl_signal session_signal;
int session_active; bool session_active;
struct weston_layer fade_layer; struct weston_layer fade_layer;
struct weston_layer cursor_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->heads_changed_signal);
wl_signal_init(&ec->output_heads_changed_signal); wl_signal_init(&ec->output_heads_changed_signal);
wl_signal_init(&ec->session_signal); wl_signal_init(&ec->session_signal);
ec->session_active = 1; ec->session_active = true;
ec->output_id_pool = 0; ec->output_id_pool = 0;
ec->repaint_msec = DEFAULT_REPAINT_WINDOW; ec->repaint_msec = DEFAULT_REPAINT_WINDOW;

@ -104,14 +104,14 @@ vt_handler(int signal_number, void *data)
struct weston_compositor *compositor = launcher->compositor; struct weston_compositor *compositor = launcher->compositor;
if (compositor->session_active) { if (compositor->session_active) {
compositor->session_active = 0; compositor->session_active = false;
wl_signal_emit(&compositor->session_signal, compositor); wl_signal_emit(&compositor->session_signal, compositor);
drmDropMaster(launcher->drm_fd); drmDropMaster(launcher->drm_fd);
ioctl(launcher->tty, VT_RELDISP, 1); ioctl(launcher->tty, VT_RELDISP, 1);
} else { } else {
ioctl(launcher->tty, VT_RELDISP, VT_ACKACQ); ioctl(launcher->tty, VT_RELDISP, VT_ACKACQ);
drmSetMaster(launcher->drm_fd); drmSetMaster(launcher->drm_fd);
compositor->session_active = 1; compositor->session_active = true;
wl_signal_emit(&compositor->session_signal, compositor); wl_signal_emit(&compositor->session_signal, compositor);
} }

@ -272,7 +272,7 @@ launcher_logind_activate_vt(struct weston_launcher *launcher, int vt)
static void static void
launcher_logind_set_active(struct launcher_logind *wl, bool active) launcher_logind_set_active(struct launcher_logind *wl, bool active)
{ {
if (!wl->compositor->session_active == !active) if (wl->compositor->session_active == active)
return; return;
wl->compositor->session_active = active; wl->compositor->session_active = active;

@ -207,12 +207,12 @@ launcher_weston_launch_data(int fd, uint32_t mask, void *data)
switch (ret) { switch (ret) {
case WESTON_LAUNCHER_ACTIVATE: case WESTON_LAUNCHER_ACTIVATE:
launcher->compositor->session_active = 1; launcher->compositor->session_active = true;
wl_signal_emit(&launcher->compositor->session_signal, wl_signal_emit(&launcher->compositor->session_signal,
launcher->compositor); launcher->compositor);
break; break;
case WESTON_LAUNCHER_DEACTIVATE: case WESTON_LAUNCHER_DEACTIVATE:
launcher->compositor->session_active = 0; launcher->compositor->session_active = false;
wl_signal_emit(&launcher->compositor->session_signal, wl_signal_emit(&launcher->compositor->session_signal,
launcher->compositor); launcher->compositor);
break; break;

Loading…
Cancel
Save