diff --git a/src/client.c b/src/client.c index 34b97c3..f8e6d1d 100644 --- a/src/client.c +++ b/src/client.c @@ -380,11 +380,9 @@ client_hide(Client *c) Bool ishide(Client *c, int screen) { - screen_get_sel(); - - if(c->tag == seltag[screen] - && c->screen == screen) + if(c->tag == seltag[screen] && c->screen == screen) return False; + return True; } diff --git a/src/event.c b/src/event.c index bd31e5a..f98bc3c 100644 --- a/src/event.c +++ b/src/event.c @@ -84,7 +84,6 @@ buttonpress(XButtonEvent *ev) if(conf.root.mouse[i].func) conf.root.mouse[i].func(conf.root.mouse[i].cmd); - /* Infobars */ for(i = 0; i < screen_count(); ++i) if(ev->window == infobar[i].bar->win) @@ -561,7 +560,7 @@ getevent(XEvent ev) for(; argv_global[0] && argv_global[0] == ' '; ++argv_global); execlp(argv_global, argv_global, NULL); } -#endif +#endif /* HAVE_XRANDR */ break; } diff --git a/src/mouse.c b/src/mouse.c index 835ec43..a0a0a9b 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -102,11 +102,11 @@ mouse_move(Client *c) || (sclient = client_gb_frame(sw)) || (sclient = client_gb_titlebar(sw))) { - if(c != sclient) + if(c->win != sclient->win) { - client_swap(c, sclient); + client_swap(sclient, c); client_focus(sclient); - break; + swap_ptr((void**)&c, (void**)&sclient); } } diff --git a/src/screen.c b/src/screen.c index 6846729..2e157d7 100644 --- a/src/screen.c +++ b/src/screen.c @@ -45,7 +45,7 @@ screen_count(void) #ifdef HAVE_XINERAMA if(XineramaIsActive(dpy)) XineramaQueryScreens(dpy, &n); -#endif +#endif /* HAVE_XINERAMA */ /* Set _WMFS_SCREEN_COUNT */ XChangeProperty(dpy, ROOT, net_atom[wmfs_screen_count], XA_CARDINAL, 32, @@ -90,7 +90,7 @@ screen_get_geo(int s) XFree(xsi); } -#endif +#endif /* HAVE_XINERAMA */ return geo; } @@ -150,7 +150,7 @@ screen_get_sel(void) selscreen = screen_get_with_geo(x, y); } -#endif +#endif /* HAVE_XINERAMA */ /* Set _WMFS_CURRENT_SCREEN */ XChangeProperty(dpy, ROOT, net_atom[wmfs_current_screen], XA_CARDINAL, 32, @@ -193,7 +193,7 @@ screen_init_geo(void) } XFree(xsi); } -#endif +#endif /* HAVE_XINERAMA */ #ifdef HAVE_XRANDR /* Init xrandr stuff */ @@ -201,7 +201,7 @@ screen_init_geo(void) XRRSelectInput(dpy, ROOT, 1); XRRQueryExtension(dpy, &xrandr_event, &d); -#endif +#endif /* HAVE_XRANDR */ ewmh_set_desktop_geometry(); ewmh_set_workarea(); diff --git a/src/structs.h b/src/structs.h index fc814d8..eb48ab7 100644 --- a/src/structs.h +++ b/src/structs.h @@ -141,7 +141,7 @@ struct Client /* Client title */ char *title; /* Tag num */ - int tag; + uint tag; /* Screen */ int screen; /* Window attribute */ diff --git a/src/wmfs.h b/src/wmfs.h index a9c71d8..d1ca1e5 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -59,47 +59,45 @@ /* Optional dependences */ #ifdef HAVE_XINERAMA #include -#endif +#endif /* HAVE_XINERAMA */ #ifdef HAVE_XRANDR #include -#endif - +#endif /* HAVE_XINERAMA */ /* MACRO */ #define ButtonMask (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask) #define MouseMask (ButtonMask | PointerMotionMask) #define KeyMask (KeyPressMask | KeyReleaseMask) - -#define CWIN(win, parent, x, y, w, h, b, mask, col, at) \ - do { \ - win = XCreateWindow(dpy, (parent), (x), (y), (w), (h), (b), CopyFromParent, \ - InputOutput, CopyFromParent, (mask), (at)); \ - XSetWindowBackground(dpy, win, (col)); \ - } while (/*CONSTCOND*/0) - #define SCREEN DefaultScreen(dpy) #define ROOT RootWindow(dpy, SCREEN) #define MAXH DisplayHeight(dpy, DefaultScreen(dpy)) #define MAXW DisplayWidth(dpy, DefaultScreen(dpy)) -#define ATOM(a) XInternAtom(dpy, (a), False) #define INFOBARH ((conf.bars.height > 0) ? conf.bars.height : (font->height * 1.5)) #define FHINFOBAR ((font->height - font->descent) + (INFOBARH - font->height) / 2) #define SHADH (1) #define SHADC (0x000000) /* 'Cause i don't know how darken a color yet */ #define BORDH conf.client.borderheight #define TBARH ((conf.titlebar.height < BORDH) ? BORDH : conf.titlebar.height) +#define RESHW (6 * BORDH) +#define BUTTONWH (TBARH / 2) +#define DEF_CONF ".config/wmfs/wmfsrc" +#define PAD conf.pad + +#define CWIN(win, parent, x, y, w, h, b, mask, col, at) \ + do { \ + win = XCreateWindow(dpy, (parent), (x), (y), (w), (h), (b), CopyFromParent, \ + InputOutput, CopyFromParent, (mask), (at)); \ + XSetWindowBackground(dpy, win, (col)); \ + } while (/* CONSTCOND */ 0) + +#define ATOM(a) XInternAtom(dpy, (a), False) #define FRAMEW(w) ((w) + BORDH * 2) #define FRAMEH(h) ((h) + (BORDH + TBARH)) #define ROUND(x) (float)((x > 0) ? x + (float)0.5 : x - (float)0.5) -#define RESHW (6 * BORDH) -#define BUTTONWH (TBARH / 2) #define CHECK(x) if(!(x)) return #define IFREE(x) if(x) free(x) #define LEN(x) (sizeof(x) / sizeof((x)[0])) -#define deb(p) fprintf(stderr, "debug: %d\n", (p)) -#define DEF_CONF ".config/wmfs/wmfsrc" -#define PAD conf.pad /* barwin.c */ BarWindow *barwin_create(Window parent,