summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorarg@10ksloc.org <unknown>2006-08-02 16:32:05 +0200
committerarg@10ksloc.org <unknown>2006-08-02 16:32:05 +0200
commit95e8d12b7189d4cd01b8ae8ecebfa5835a1809e6 (patch)
tree98283068f4576b8b2e825dd5eff0eb6e94ddbdc0 /main.c
parentnew stuff (diff)
downloaddwm-95e8d12b7189d4cd01b8ae8ecebfa5835a1809e6.tar.gz
dwm-95e8d12b7189d4cd01b8ae8ecebfa5835a1809e6.zip
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/main.c b/main.c
index 86d72fa..33a2a9a 100644
--- a/main.c
+++ b/main.c
@@ -4,7 +4,6 @@
4 */ 4 */
5 5
6#include "dwm.h" 6#include "dwm.h"
7
8#include <errno.h> 7#include <errno.h>
9#include <stdio.h> 8#include <stdio.h>
10#include <stdlib.h> 9#include <stdlib.h>
@@ -15,7 +14,6 @@
15#include <X11/Xatom.h> 14#include <X11/Xatom.h>
16#include <X11/Xproto.h> 15#include <X11/Xproto.h>
17 16
18
19/* static */ 17/* static */
20 18
21static int (*xerrorxlib)(Display *, XErrorEvent *); 19static int (*xerrorxlib)(Display *, XErrorEvent *);
@@ -165,6 +163,7 @@ main(int argc, char *argv[])
165 int i; 163 int i;
166 unsigned int mask; 164 unsigned int mask;
167 fd_set rd; 165 fd_set rd;
166 Bool readin = True;
168 Window w; 167 Window w;
169 XEvent ev; 168 XEvent ev;
170 XSetWindowAttributes wa; 169 XSetWindowAttributes wa;
@@ -251,7 +250,8 @@ main(int argc, char *argv[])
251 /* main event loop, reads status text from stdin as well */ 250 /* main event loop, reads status text from stdin as well */
252 while(running) { 251 while(running) {
253 FD_ZERO(&rd); 252 FD_ZERO(&rd);
254 FD_SET(STDIN_FILENO, &rd); 253 if(readin)
254 FD_SET(STDIN_FILENO, &rd);
255 FD_SET(ConnectionNumber(dpy), &rd); 255 FD_SET(ConnectionNumber(dpy), &rd);
256 256
257 i = select(ConnectionNumber(dpy) + 1, &rd, 0, 0, 0); 257 i = select(ConnectionNumber(dpy) + 1, &rd, 0, 0, 0);
@@ -267,11 +267,12 @@ main(int argc, char *argv[])
267 (handler[ev.type])(&ev); /* call handler */ 267 (handler[ev.type])(&ev); /* call handler */
268 } 268 }
269 } 269 }
270 if(FD_ISSET(STDIN_FILENO, &rd)) { 270 if(readin && FD_ISSET(STDIN_FILENO, &rd)) {
271 if(!fgets(stext, sizeof(stext), stdin)) 271 readin = NULL != fgets(stext, sizeof(stext), stdin);
272 break; 272 if(readin)
273 else
274 stext[strlen(stext) - 1] = 0; 273 stext[strlen(stext) - 1] = 0;
274 else
275 strcpy(stext, "broken pipe");
275 drawstatus(); 276 drawstatus();
276 } 277 }
277 } 278 }