mirror of
https://github.com/swaywm/sway.git
synced 2026-03-21 05:33:56 -04:00
add kill command
This commit is contained in:
parent
cc3c713889
commit
c353e01c85
11 changed files with 77 additions and 3 deletions
|
|
@ -57,6 +57,16 @@ static void set_activated(struct sway_view *view, bool activated) {
|
|||
}
|
||||
}
|
||||
|
||||
static void close(struct sway_view *view) {
|
||||
if (!assert_xdg(view)) {
|
||||
return;
|
||||
}
|
||||
struct wlr_xdg_surface_v6 *surface = view->wlr_xdg_surface_v6;
|
||||
if (surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL) {
|
||||
wlr_xdg_toplevel_v6_send_close(surface);
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_commit(struct wl_listener *listener, void *data) {
|
||||
struct sway_xdg_surface_v6 *sway_surface =
|
||||
wl_container_of(listener, sway_surface, commit);
|
||||
|
|
@ -107,6 +117,7 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
|
|||
sway_view->iface.set_size = set_size;
|
||||
sway_view->iface.set_position = set_position;
|
||||
sway_view->iface.set_activated = set_activated;
|
||||
sway_view->iface.close = close;
|
||||
sway_view->wlr_xdg_surface_v6 = xdg_surface;
|
||||
sway_view->sway_xdg_surface_v6 = sway_surface;
|
||||
sway_view->surface = xdg_surface->surface;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue