diff options
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 28 |
1 files changed, 27 insertions, 1 deletions
| @@ -58,7 +58,8 @@ | |||
| 58 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ | 58 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ |
| 59 | enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ | 59 | enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ |
| 60 | enum { NetSupported, NetWMName, NetWMState, | 60 | enum { NetSupported, NetWMName, NetWMState, |
| 61 | NetWMFullscreen, NetActiveWindow, NetLast }; /* EWMH atoms */ | 61 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, |
| 62 | NetWMWindowTypeDialog, NetLast }; /* EWMH atoms */ | ||
| 62 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ | 63 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ |
| 63 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, | 64 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, |
| 64 | ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ | 65 | ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ |
| @@ -237,6 +238,7 @@ static void updatebars(void); | |||
| 237 | static void updatenumlockmask(void); | 238 | static void updatenumlockmask(void); |
| 238 | static void updatesizehints(Client *c); | 239 | static void updatesizehints(Client *c); |
| 239 | static void updatestatus(void); | 240 | static void updatestatus(void); |
| 241 | static void updatewindowtype(Client *c); | ||
| 240 | static void updatetitle(Client *c); | 242 | static void updatetitle(Client *c); |
| 241 | static void updatewmhints(Client *c); | 243 | static void updatewmhints(Client *c); |
| 242 | static void view(const Arg *arg); | 244 | static void view(const Arg *arg); |
| @@ -1152,6 +1154,7 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 1152 | XConfigureWindow(dpy, w, CWBorderWidth, &wc); | 1154 | XConfigureWindow(dpy, w, CWBorderWidth, &wc); |
| 1153 | XSetWindowBorder(dpy, w, dc.norm[ColBorder]); | 1155 | XSetWindowBorder(dpy, w, dc.norm[ColBorder]); |
| 1154 | configure(c); /* propagates border_width, if size doesn't change */ | 1156 | configure(c); /* propagates border_width, if size doesn't change */ |
| 1157 | updatewindowtype(c); | ||
| 1155 | updatesizehints(c); | 1158 | updatesizehints(c); |
| 1156 | updatewmhints(c); | 1159 | updatewmhints(c); |
| 1157 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); | 1160 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); |
| @@ -1308,6 +1311,8 @@ propertynotify(XEvent *e) { | |||
| 1308 | if(c == c->mon->sel) | 1311 | if(c == c->mon->sel) |
| 1309 | drawbar(c->mon); | 1312 | drawbar(c->mon); |
| 1310 | } | 1313 | } |
| 1314 | if(ev->atom == netatom[NetWMWindowType]) | ||
| 1315 | updatewindowtype(c); | ||
| 1311 | } | 1316 | } |
| 1312 | } | 1317 | } |
| 1313 | 1318 | ||
| @@ -1562,6 +1567,8 @@ setup(void) { | |||
| 1562 | netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); | 1567 | netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); |
| 1563 | netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); | 1568 | netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); |
| 1564 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); | 1569 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); |
| 1570 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); | ||
| 1571 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); | ||
| 1565 | /* init cursors */ | 1572 | /* init cursors */ |
| 1566 | cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); | 1573 | cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); |
| 1567 | cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); | 1574 | cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); |
| @@ -1967,6 +1974,25 @@ updatestatus(void) { | |||
| 1967 | } | 1974 | } |
| 1968 | 1975 | ||
| 1969 | void | 1976 | void |
| 1977 | updatewindowtype(Client *c) | ||
| 1978 | { | ||
| 1979 | Atom wtype, real; | ||
| 1980 | int format; | ||
| 1981 | unsigned long n, extra; | ||
| 1982 | unsigned char *p = NULL; | ||
| 1983 | |||
| 1984 | if(XGetWindowProperty(dpy, c->win, netatom[NetWMWindowType], 0L, | ||
| 1985 | sizeof(Atom), False, XA_ATOM, &real, &format, | ||
| 1986 | &n, &extra, (unsigned char **)&p) == Success && p) { | ||
| 1987 | wtype = *(Atom *)p; | ||
| 1988 | XFree(p); | ||
| 1989 | |||
| 1990 | if(wtype == netatom[NetWMWindowTypeDialog]) | ||
| 1991 | c->isfloating = True; | ||
| 1992 | } | ||
| 1993 | } | ||
| 1994 | |||
| 1995 | void | ||
| 1970 | updatewmhints(Client *c) { | 1996 | updatewmhints(Client *c) { |
| 1971 | XWMHints *wmh; | 1997 | XWMHints *wmh; |
| 1972 | 1998 | ||
