diff options
Diffstat (limited to 'include/sway/desktop/idle_inhibit_v1.h')
-rw-r--r-- | include/sway/desktop/idle_inhibit_v1.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/sway/desktop/idle_inhibit_v1.h b/include/sway/desktop/idle_inhibit_v1.h index e5ed8a3d..4d4e59b0 100644 --- a/include/sway/desktop/idle_inhibit_v1.h +++ b/include/sway/desktop/idle_inhibit_v1.h | |||
@@ -4,6 +4,14 @@ | |||
4 | #include <wlr/types/wlr_idle.h> | 4 | #include <wlr/types/wlr_idle.h> |
5 | #include "sway/server.h" | 5 | #include "sway/server.h" |
6 | 6 | ||
7 | enum sway_idle_inhibit_mode { | ||
8 | INHIBIT_IDLE_APPLICATION, // Application set inhibitor (when visible) | ||
9 | INHIBIT_IDLE_FOCUS, // User set inhibitor when focused | ||
10 | INHIBIT_IDLE_FULLSCREEN, // User set inhibitor when fullscreen + visible | ||
11 | INHIBIT_IDLE_OPEN, // User set inhibitor while open | ||
12 | INHIBIT_IDLE_VISIBLE // User set inhibitor when visible | ||
13 | }; | ||
14 | |||
7 | struct sway_idle_inhibit_manager_v1 { | 15 | struct sway_idle_inhibit_manager_v1 { |
8 | struct wlr_idle_inhibit_manager_v1 *wlr_manager; | 16 | struct wlr_idle_inhibit_manager_v1 *wlr_manager; |
9 | struct wl_listener new_idle_inhibitor_v1; | 17 | struct wl_listener new_idle_inhibitor_v1; |
@@ -15,14 +23,24 @@ struct sway_idle_inhibit_manager_v1 { | |||
15 | struct sway_idle_inhibitor_v1 { | 23 | struct sway_idle_inhibitor_v1 { |
16 | struct sway_idle_inhibit_manager_v1 *manager; | 24 | struct sway_idle_inhibit_manager_v1 *manager; |
17 | struct sway_view *view; | 25 | struct sway_view *view; |
26 | enum sway_idle_inhibit_mode mode; | ||
18 | 27 | ||
19 | struct wl_list link; | 28 | struct wl_list link; |
20 | struct wl_listener destroy; | 29 | struct wl_listener destroy; |
21 | }; | 30 | }; |
22 | 31 | ||
23 | void idle_inhibit_v1_check_active( | 32 | void sway_idle_inhibit_v1_check_active( |
24 | struct sway_idle_inhibit_manager_v1 *manager); | 33 | struct sway_idle_inhibit_manager_v1 *manager); |
25 | 34 | ||
35 | void sway_idle_inhibit_v1_user_inhibitor_register(struct sway_view *view, | ||
36 | enum sway_idle_inhibit_mode mode); | ||
37 | |||
38 | struct sway_idle_inhibitor_v1 *sway_idle_inhibit_v1_user_inhibitor_for_view( | ||
39 | struct sway_view *view); | ||
40 | |||
41 | void sway_idle_inhibit_v1_user_inhibitor_destroy( | ||
42 | struct sway_idle_inhibitor_v1 *inhibitor); | ||
43 | |||
26 | struct sway_idle_inhibit_manager_v1 *sway_idle_inhibit_manager_v1_create( | 44 | struct sway_idle_inhibit_manager_v1 *sway_idle_inhibit_manager_v1_create( |
27 | struct wl_display *wl_display, struct wlr_idle *idle); | 45 | struct wl_display *wl_display, struct wlr_idle *idle); |
28 | #endif | 46 | #endif |