summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2011-11-02 12:01:28 +0000
committerChristoph Lohmann <20h@r-36.net>2011-11-02 12:01:28 +0000
commit8262d9e663a98ab74b938bb5cdf0ddfd733bc5df (patch)
treefdbe1fddc6452654b0913ef061fe967bf0085cd1 /dwm.c
parentallow 0 nmaster (diff)
downloaddwm-8262d9e663a98ab74b938bb5cdf0ddfd733bc5df.tar.gz
dwm-8262d9e663a98ab74b938bb5cdf0ddfd733bc5df.zip
make ewmh dialog windows float
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/dwm.c b/dwm.c
index 344966b..f753bfe 100644
--- a/dwm.c
+++ b/dwm.c
@@ -58,7 +58,8 @@
58enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 58enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
59enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ 59enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
60enum { NetSupported, NetWMName, NetWMState, 60enum { NetSupported, NetWMName, NetWMState,
61 NetWMFullscreen, NetActiveWindow, NetLast }; /* EWMH atoms */ 61 NetWMFullscreen, NetActiveWindow, NetWMWindowType,
62 NetWMWindowTypeDialog, NetLast }; /* EWMH atoms */
62enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 63enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
63enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 64enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
64 ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ 65 ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
@@ -237,6 +238,7 @@ static void updatebars(void);
237static void updatenumlockmask(void); 238static void updatenumlockmask(void);
238static void updatesizehints(Client *c); 239static void updatesizehints(Client *c);
239static void updatestatus(void); 240static void updatestatus(void);
241static void updatewindowtype(Client *c);
240static void updatetitle(Client *c); 242static void updatetitle(Client *c);
241static void updatewmhints(Client *c); 243static void updatewmhints(Client *c);
242static void view(const Arg *arg); 244static 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
1969void 1976void
1977updatewindowtype(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
1995void
1970updatewmhints(Client *c) { 1996updatewmhints(Client *c) {
1971 XWMHints *wmh; 1997 XWMHints *wmh;
1972 1998