aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2020-07-23 15:24:01 -0500
committerGitHub <noreply@github.com>2020-07-23 15:24:01 -0500
commit73992a874ae01b87ebed5cf23f0e4cf2840af27d (patch)
tree49440d7eda6b700de842d6957b18e0db37faa04a /dwl.c
parent4a4a26111107d5f2827606cd630873d798bc8bf6 (diff)
parentea73221b45ea7bc1536cd8cc5896652919e06b2b (diff)
Merge pull request #16 from guidocella/killclient
Add killclient
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index 36795c2..c471614 100644
--- a/dwl.c
+++ b/dwl.c
@@ -171,6 +171,7 @@ static void inputdevice(struct wl_listener *listener, void *data);
static int keybinding(uint32_t mods, xkb_keysym_t sym);
static void keypress(struct wl_listener *listener, void *data);
static void keypressmod(struct wl_listener *listener, void *data);
+static void killclient(const Arg *arg);
static Client *lastfocused(void);
static void maprequest(struct wl_listener *listener, void *data);
static void motionabsolute(struct wl_listener *listener, void *data);
@@ -812,6 +813,19 @@ keypressmod(struct wl_listener *listener, void *data)
&kb->device->keyboard->modifiers);
}
+void
+killclient(const Arg *arg)
+{
+ Client *sel = selclient();
+ if (!sel)
+ return;
+
+ if (sel->isx11)
+ wlr_xwayland_surface_close(sel->xwayland_surface);
+ else
+ wlr_xdg_toplevel_send_close(sel->xdg_surface);
+}
+
Client *
lastfocused(void)
{