diff options
author | Simon Ser <contact@emersion.fr> | 2021-03-23 11:31:18 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-06-02 19:39:40 +0200 |
commit | 9755684fb0fd665a65be2a3cbabc5d502244c459 (patch) | |
tree | 7fbe0b1149314b9d902d328c74bbc7cba6c05004 /sway/xdg_activation_v1.c | |
parent | details-gackground typo fix (diff) | |
download | sway-9755684fb0fd665a65be2a3cbabc5d502244c459.tar.gz sway-9755684fb0fd665a65be2a3cbabc5d502244c459.tar.zst sway-9755684fb0fd665a65be2a3cbabc5d502244c459.zip |
Implement xdg-activation-v1
See https://github.com/swaywm/wlroots/pull/2718.
Diffstat (limited to 'sway/xdg_activation_v1.c')
-rw-r--r-- | sway/xdg_activation_v1.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sway/xdg_activation_v1.c b/sway/xdg_activation_v1.c new file mode 100644 index 00000000..6c70c785 --- /dev/null +++ b/sway/xdg_activation_v1.c | |||
@@ -0,0 +1,20 @@ | |||
1 | #include <wlr/types/wlr_xdg_activation_v1.h> | ||
2 | #include "sway/tree/view.h" | ||
3 | |||
4 | void xdg_activation_v1_handle_request_activate(struct wl_listener *listener, | ||
5 | void *data) { | ||
6 | const struct wlr_xdg_activation_v1_request_activate_event *event = data; | ||
7 | |||
8 | if (!wlr_surface_is_xdg_surface(event->surface)) { | ||
9 | return; | ||
10 | } | ||
11 | |||
12 | struct wlr_xdg_surface *xdg_surface = | ||
13 | wlr_xdg_surface_from_wlr_surface(event->surface); | ||
14 | struct sway_view *view = xdg_surface->data; | ||
15 | if (!xdg_surface->mapped || view == NULL) { | ||
16 | return; | ||
17 | } | ||
18 | |||
19 | view_request_activate(view); | ||
20 | } | ||