diff options
| author | Quentin Carbonneaux | 2021-04-05 09:31:44 +0200 |
|---|---|---|
| committer | Quentin Carbonneaux | 2021-04-05 09:31:44 +0200 |
| commit | 3879d17f3bd0bd1c32a18ab393185f923c04d31a (patch) | |
| tree | 5d7a19d03dc398289049e8c668f5afed2183536e | |
| parent | 77d96145b163d79186c722a7ffccfff57601157c (diff) | |
support delete wm events
Thanks to shepard47@protonmail.com for the patch.
| -rw-r--r-- | x11.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -12,7 +12,7 @@ void die(char *); -#define FONTNAME "Monaco:pixelsize=10" +#define FONTNAME "noto mono:pixelsize=14" enum { HMargin = 16, @@ -35,6 +35,7 @@ XftDraw *xft; static int w, h; static XIC xic; static XIM xim; +static Atom del; static int init() @@ -93,6 +94,9 @@ init() gui_x11.actionr.w = HMargin - 3; gui_x11.actionr.h = VMargin + font->height; + del = XInternAtom(d, "WM_DELETE_WINDOW", False); + XSetWMProtocols(d, win, &del, 1); + return XConnectionNumber(d); } @@ -354,6 +358,11 @@ nextevent(GEvent *gev) break; } + case ClientMessage: + if (e.xclient.data.l[0] == del) + exit(0); + break; + default: continue; } |
