aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/desktop')
-rw-r--r--include/sway/desktop/idle_inhibit_v1.h12
-rw-r--r--include/sway/desktop/launcher.h40
-rw-r--r--include/sway/desktop/transaction.h14
3 files changed, 55 insertions, 11 deletions
diff --git a/include/sway/desktop/idle_inhibit_v1.h b/include/sway/desktop/idle_inhibit_v1.h
index 58d54c68..84cc666d 100644
--- a/include/sway/desktop/idle_inhibit_v1.h
+++ b/include/sway/desktop/idle_inhibit_v1.h
@@ -1,8 +1,6 @@
1#ifndef _SWAY_DESKTOP_IDLE_INHIBIT_V1_H 1#ifndef _SWAY_DESKTOP_IDLE_INHIBIT_V1_H
2#define _SWAY_DESKTOP_IDLE_INHIBIT_V1_H 2#define _SWAY_DESKTOP_IDLE_INHIBIT_V1_H
3#include <wlr/types/wlr_idle_inhibit_v1.h> 3#include <wlr/types/wlr_idle_inhibit_v1.h>
4#include <wlr/types/wlr_idle.h>
5#include "sway/server.h"
6 4
7enum sway_idle_inhibit_mode { 5enum sway_idle_inhibit_mode {
8 INHIBIT_IDLE_APPLICATION, // Application set inhibitor (when visible) 6 INHIBIT_IDLE_APPLICATION, // Application set inhibitor (when visible)
@@ -16,12 +14,9 @@ struct sway_idle_inhibit_manager_v1 {
16 struct wlr_idle_inhibit_manager_v1 *wlr_manager; 14 struct wlr_idle_inhibit_manager_v1 *wlr_manager;
17 struct wl_listener new_idle_inhibitor_v1; 15 struct wl_listener new_idle_inhibitor_v1;
18 struct wl_list inhibitors; 16 struct wl_list inhibitors;
19
20 struct wlr_idle *idle;
21}; 17};
22 18
23struct sway_idle_inhibitor_v1 { 19struct sway_idle_inhibitor_v1 {
24 struct sway_idle_inhibit_manager_v1 *manager;
25 struct wlr_idle_inhibitor_v1 *wlr_inhibitor; 20 struct wlr_idle_inhibitor_v1 *wlr_inhibitor;
26 struct sway_view *view; 21 struct sway_view *view;
27 enum sway_idle_inhibit_mode mode; 22 enum sway_idle_inhibit_mode mode;
@@ -33,8 +28,7 @@ struct sway_idle_inhibitor_v1 {
33bool sway_idle_inhibit_v1_is_active( 28bool sway_idle_inhibit_v1_is_active(
34 struct sway_idle_inhibitor_v1 *inhibitor); 29 struct sway_idle_inhibitor_v1 *inhibitor);
35 30
36void sway_idle_inhibit_v1_check_active( 31void sway_idle_inhibit_v1_check_active(void);
37 struct sway_idle_inhibit_manager_v1 *manager);
38 32
39void sway_idle_inhibit_v1_user_inhibitor_register(struct sway_view *view, 33void sway_idle_inhibit_v1_user_inhibitor_register(struct sway_view *view,
40 enum sway_idle_inhibit_mode mode); 34 enum sway_idle_inhibit_mode mode);
@@ -48,6 +42,6 @@ struct sway_idle_inhibitor_v1 *sway_idle_inhibit_v1_application_inhibitor_for_vi
48void sway_idle_inhibit_v1_user_inhibitor_destroy( 42void sway_idle_inhibit_v1_user_inhibitor_destroy(
49 struct sway_idle_inhibitor_v1 *inhibitor); 43 struct sway_idle_inhibitor_v1 *inhibitor);
50 44
51struct sway_idle_inhibit_manager_v1 *sway_idle_inhibit_manager_v1_create( 45bool sway_idle_inhibit_manager_v1_init(void);
52 struct wl_display *wl_display, struct wlr_idle *idle); 46
53#endif 47#endif
diff --git a/include/sway/desktop/launcher.h b/include/sway/desktop/launcher.h
new file mode 100644
index 00000000..412068a9
--- /dev/null
+++ b/include/sway/desktop/launcher.h
@@ -0,0 +1,40 @@
1#ifndef _SWAY_LAUNCHER_H
2#define _SWAY_LAUNCHER_H
3
4#include <stdlib.h>
5#include <wayland-server-core.h>
6#include "sway/input/seat.h"
7
8struct launcher_ctx {
9 pid_t pid;
10 char *fallback_name;
11 struct wlr_xdg_activation_token_v1 *token;
12 struct wl_listener token_destroy;
13 struct sway_seat *seat;
14 struct wl_listener seat_destroy;
15
16 bool activated;
17 bool had_focused_surface;
18
19 struct sway_node *node;
20 struct wl_listener node_destroy;
21
22 struct wl_list link; // sway_server::pending_launcher_ctxs
23};
24
25struct launcher_ctx *launcher_ctx_find_pid(pid_t pid);
26
27struct sway_workspace *launcher_ctx_get_workspace(struct launcher_ctx *ctx);
28
29void launcher_ctx_consume(struct launcher_ctx *ctx);
30
31void launcher_ctx_destroy(struct launcher_ctx *ctx);
32
33struct launcher_ctx *launcher_ctx_create_internal(void);
34
35struct launcher_ctx *launcher_ctx_create(
36 struct wlr_xdg_activation_token_v1 *token, struct sway_node *node);
37
38const char *launcher_ctx_get_token_name(struct launcher_ctx *ctx);
39
40#endif
diff --git a/include/sway/desktop/transaction.h b/include/sway/desktop/transaction.h
index 7dd58ba8..dd7edb7a 100644
--- a/include/sway/desktop/transaction.h
+++ b/include/sway/desktop/transaction.h
@@ -1,6 +1,8 @@
1#ifndef _SWAY_TRANSACTION_H 1#ifndef _SWAY_TRANSACTION_H
2#define _SWAY_TRANSACTION_H 2#define _SWAY_TRANSACTION_H
3#include <stdint.h> 3#include <stdint.h>
4#include <stdbool.h>
5#include <wlr/types/wlr_scene.h>
4 6
5/** 7/**
6 * Transactions enable us to perform atomic layout updates. 8 * Transactions enable us to perform atomic layout updates.
@@ -38,8 +40,11 @@ void transaction_commit_dirty_client(void);
38 * Notify the transaction system that a view is ready for the new layout. 40 * Notify the transaction system that a view is ready for the new layout.
39 * 41 *
40 * When all views in the transaction are ready, the layout will be applied. 42 * When all views in the transaction are ready, the layout will be applied.
43 *
44 * A success boolean is returned denoting that this part of the transaction is
45 * ready.
41 */ 46 */
42void transaction_notify_view_ready_by_serial(struct sway_view *view, 47bool transaction_notify_view_ready_by_serial(struct sway_view *view,
43 uint32_t serial); 48 uint32_t serial);
44 49
45/** 50/**
@@ -47,8 +52,13 @@ void transaction_notify_view_ready_by_serial(struct sway_view *view,
47 * identifying the instruction by geometry rather than by serial. 52 * identifying the instruction by geometry rather than by serial.
48 * 53 *
49 * This is used by xwayland views, as they don't have serials. 54 * This is used by xwayland views, as they don't have serials.
55 *
56 * A success boolean is returned denoting that this part of the transaction is
57 * ready.
50 */ 58 */
51void transaction_notify_view_ready_by_geometry(struct sway_view *view, 59bool transaction_notify_view_ready_by_geometry(struct sway_view *view,
52 double x, double y, int width, int height); 60 double x, double y, int width, int height);
53 61
62void arrange_popups(struct wlr_scene_tree *popups);
63
54#endif 64#endif