diff options
| -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; } |
