aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2022-10-04 11:44:05 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2022-10-14 15:56:07 +0200
commit9400bd963c59fd59f597c1477b8021a82ca0a72e (patch)
tree17b385ae457750385526d96a81f0ffaa82052a41
parentAvoid double free in criteria_destroy() (diff)
downloadsway-9400bd963c59fd59f597c1477b8021a82ca0a72e.tar.gz
sway-9400bd963c59fd59f597c1477b8021a82ca0a72e.tar.zst
sway-9400bd963c59fd59f597c1477b8021a82ca0a72e.zip
Add support for ext-idle-notify-v1
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3753
-rw-r--r--include/sway/server.h1
-rw-r--r--sway/desktop/idle_inhibit_v1.c2
-rw-r--r--sway/input/seat.c2
-rw-r--r--sway/server.c2
4 files changed, 7 insertions, 0 deletions
diff --git a/include/sway/server.h b/include/sway/server.h
index 4cce17cc..055c067d 100644
--- a/include/sway/server.h
+++ b/include/sway/server.h
@@ -52,6 +52,7 @@ struct sway_server {
52 struct wl_listener output_layout_change; 52 struct wl_listener output_layout_change;
53 53
54 struct wlr_idle *idle; 54 struct wlr_idle *idle;
55 struct wlr_idle_notifier_v1 *idle_notifier_v1;
55 struct sway_idle_inhibit_manager_v1 *idle_inhibit_manager_v1; 56 struct sway_idle_inhibit_manager_v1 *idle_inhibit_manager_v1;
56 57
57 struct wlr_layer_shell_v1 *layer_shell; 58 struct wlr_layer_shell_v1 *layer_shell;
diff --git a/sway/desktop/idle_inhibit_v1.c b/sway/desktop/idle_inhibit_v1.c
index 82353038..3a4d0b87 100644
--- a/sway/desktop/idle_inhibit_v1.c
+++ b/sway/desktop/idle_inhibit_v1.c
@@ -1,5 +1,6 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <wlr/types/wlr_idle.h> 2#include <wlr/types/wlr_idle.h>
3#include <wlr/types/wlr_idle_notify_v1.h>
3#include "log.h" 4#include "log.h"
4#include "sway/desktop/idle_inhibit_v1.h" 5#include "sway/desktop/idle_inhibit_v1.h"
5#include "sway/input/seat.h" 6#include "sway/input/seat.h"
@@ -140,6 +141,7 @@ void sway_idle_inhibit_v1_check_active(
140 } 141 }
141 } 142 }
142 wlr_idle_set_enabled(manager->idle, NULL, !inhibited); 143 wlr_idle_set_enabled(manager->idle, NULL, !inhibited);
144 wlr_idle_notifier_v1_set_inhibited(server.idle_notifier_v1, inhibited);
143} 145}
144 146
145struct sway_idle_inhibit_manager_v1 *sway_idle_inhibit_manager_v1_create( 147struct sway_idle_inhibit_manager_v1 *sway_idle_inhibit_manager_v1_create(
diff --git a/sway/input/seat.c b/sway/input/seat.c
index b21e1b86..987e1c9f 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -7,6 +7,7 @@
7#include <wlr/types/wlr_cursor.h> 7#include <wlr/types/wlr_cursor.h>
8#include <wlr/types/wlr_data_device.h> 8#include <wlr/types/wlr_data_device.h>
9#include <wlr/types/wlr_idle.h> 9#include <wlr/types/wlr_idle.h>
10#include <wlr/types/wlr_idle_notify_v1.h>
10#include <wlr/types/wlr_keyboard_group.h> 11#include <wlr/types/wlr_keyboard_group.h>
11#include <wlr/types/wlr_output_layout.h> 12#include <wlr/types/wlr_output_layout.h>
12#include <wlr/types/wlr_primary_selection.h> 13#include <wlr/types/wlr_primary_selection.h>
@@ -112,6 +113,7 @@ void seat_idle_notify_activity(struct sway_seat *seat,
112 } 113 }
113 if ((source & mask) > 0) { 114 if ((source & mask) > 0) {
114 wlr_idle_notify_activity(server.idle, seat->wlr_seat); 115 wlr_idle_notify_activity(server.idle, seat->wlr_seat);
116 wlr_idle_notifier_v1_notify_activity(server.idle_notifier_v1, seat->wlr_seat);
115 } 117 }
116} 118}
117 119
diff --git a/sway/server.c b/sway/server.c
index a87fc7cf..f6720755 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -17,6 +17,7 @@
17#include <wlr/types/wlr_export_dmabuf_v1.h> 17#include <wlr/types/wlr_export_dmabuf_v1.h>
18#include <wlr/types/wlr_gamma_control_v1.h> 18#include <wlr/types/wlr_gamma_control_v1.h>
19#include <wlr/types/wlr_idle.h> 19#include <wlr/types/wlr_idle.h>
20#include <wlr/types/wlr_idle_notify_v1.h>
20#include <wlr/types/wlr_layer_shell_v1.h> 21#include <wlr/types/wlr_layer_shell_v1.h>
21#include <wlr/types/wlr_linux_dmabuf_v1.h> 22#include <wlr/types/wlr_linux_dmabuf_v1.h>
22#include <wlr/types/wlr_pointer_constraints_v1.h> 23#include <wlr/types/wlr_pointer_constraints_v1.h>
@@ -116,6 +117,7 @@ bool server_init(struct sway_server *server) {
116 wlr_xdg_output_manager_v1_create(server->wl_display, root->output_layout); 117 wlr_xdg_output_manager_v1_create(server->wl_display, root->output_layout);
117 118
118 server->idle = wlr_idle_create(server->wl_display); 119 server->idle = wlr_idle_create(server->wl_display);
120 server->idle_notifier_v1 = wlr_idle_notifier_v1_create(server->wl_display);
119 server->idle_inhibit_manager_v1 = 121 server->idle_inhibit_manager_v1 =
120 sway_idle_inhibit_manager_v1_create(server->wl_display, server->idle); 122 sway_idle_inhibit_manager_v1_create(server->wl_display, server->idle);
121 123