From a3a73837401ad9dcc0e4ba513972dc55e1e24a8a Mon Sep 17 00:00:00 2001 From: phillbush Date: Mon, 29 Jun 2020 12:25:59 -0300 Subject: [PATCH] Moving XSetWMProtocols to setupmenu() --- xmenu.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/xmenu.c b/xmenu.c index 310b17d..8a7d511 100644 --- a/xmenu.c +++ b/xmenu.c @@ -300,7 +300,7 @@ allocitem(const char *label, const char *output, char *file) return item; } -/* allocate a menu */ +/* allocate a menu and create its window */ static struct Menu * allocmenu(struct Menu *parent, struct Item *list, unsigned level) { @@ -333,8 +333,6 @@ allocmenu(struct Menu *parent, struct Item *list, unsigned level) CWBorderPixel | CWEventMask | CWSaveUnder, &swa); - XSetWMProtocols(dpy, menu->win, &wmdelete, 1); - return menu; } @@ -568,10 +566,10 @@ setupmenu(struct Menu *menu, XClassHint *classh) DefaultDepth(dpy, screen)); menu->draw = XftDrawCreate(dpy, menu->pixmap, visual, colormap); - /* set ewmh window properties */ + /* set WM protocols and ewmh window properties */ + XSetWMProtocols(dpy, menu->win, &wmdelete, 1); XChangeProperty(dpy, menu->win, netatom[NetWMName], utf8string, 8, - PropModeReplace, - (unsigned char *)title, strlen(title)); + PropModeReplace, (unsigned char *)title, strlen(title)); XChangeProperty(dpy, menu->win, netatom[NetWMWindowType], XA_ATOM, 32, PropModeReplace, (unsigned char *)&netatom[NetWMWindowTypePopupMenu], 1); -- 2.20.1