mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
Implement xdg-activation-v1
See https://github.com/swaywm/wlroots/pull/2718.
This commit is contained in:
parent
92ba229094
commit
9755684fb0
4 changed files with 33 additions and 0 deletions
20
sway/xdg_activation_v1.c
Normal file
20
sway/xdg_activation_v1.c
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include <wlr/types/wlr_xdg_activation_v1.h>
|
||||
#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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue