From 9755684fb0fd665a65be2a3cbabc5d502244c459 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 23 Mar 2021 11:31:18 +0100 Subject: Implement xdg-activation-v1 See https://github.com/swaywm/wlroots/pull/2718. --- sway/xdg_activation_v1.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sway/xdg_activation_v1.c (limited to 'sway/xdg_activation_v1.c') 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 @@ +#include +#include "sway/tree/view.h" + +void xdg_activation_v1_handle_request_activate(struct wl_listener *listener, + void *data) { + const struct wlr_xdg_activation_v1_request_activate_event *event = data; + + if (!wlr_surface_is_xdg_surface(event->surface)) { + return; + } + + struct wlr_xdg_surface *xdg_surface = + wlr_xdg_surface_from_wlr_surface(event->surface); + struct sway_view *view = xdg_surface->data; + if (!xdg_surface->mapped || view == NULL) { + return; + } + + view_request_activate(view); +} -- cgit v1.2.3