aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2023-07-12 10:14:15 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2023-07-19 09:28:33 +0200
commitee4637b086aed256c7698b9f68786e6de5d8da00 (patch)
treec55e185db2dd3be42484d24dd6edfe34906a0108 /sway/input/seat.c
parentswaynag: handle wayland-cursor failures (diff)
downloadsway-ee4637b086aed256c7698b9f68786e6de5d8da00.tar.gz
sway-ee4637b086aed256c7698b9f68786e6de5d8da00.tar.zst
sway-ee4637b086aed256c7698b9f68786e6de5d8da00.zip
Deprecate seat idle_wake
Sway has two knobs to control idling: - seat idle_inhibit: when the seat is active (ie. not idle), this extends the active state. When the seat is idle, this is ignored. - seat idle_wake: when the seat is idle, this wakes up the seat. When the seat is active, this is ignored. The motivation for the deprecation is two-fold: - The concept of "seat idle state" is ill-defined. Each idle-notify-v1 client will pass a different idle timeout. With the old logic, a seat was declared idle if and only if all idle-notify-v1 timeouts have expired. However, if only a portion of the timeouts have expired, then some clients would wake up, and the rest would stay active. This is inconsistent with the definition of idle_inhibit/idle_wake: idle_inhibit was used for clients which are waking up. - It never worked properly with the new idle-notify-v1 protocol and no-one noticed. Only the legacy KDE idle protocol is taken into account, but that protocol is not used anymore.
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 82f4eb5f..a84e4d52 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -100,22 +100,11 @@ void seat_destroy(struct sway_seat *seat) {
100 100
101void seat_idle_notify_activity(struct sway_seat *seat, 101void seat_idle_notify_activity(struct sway_seat *seat,
102 enum sway_input_idle_source source) { 102 enum sway_input_idle_source source) {
103 uint32_t mask = seat->idle_inhibit_sources; 103 if ((source & seat->idle_inhibit_sources) == 0) {
104 struct wlr_idle_timeout *timeout; 104 return;
105 int ntimers = 0, nidle = 0;
106 wl_list_for_each(timeout, &server.idle->idle_timers, link) {
107 ++ntimers;
108 if (timeout->idle_state) {
109 ++nidle;
110 }
111 }
112 if (nidle == ntimers) {
113 mask = seat->idle_wake_sources;
114 }
115 if ((source & mask) > 0) {
116 wlr_idle_notify_activity(server.idle, seat->wlr_seat);
117 wlr_idle_notifier_v1_notify_activity(server.idle_notifier_v1, seat->wlr_seat);
118 } 105 }
106 wlr_idle_notify_activity(server.idle, seat->wlr_seat);
107 wlr_idle_notifier_v1_notify_activity(server.idle_notifier_v1, seat->wlr_seat);
119} 108}
120 109
121/** 110/**