diff --git a/configure b/configure index 7a89d41..27b83e0 100755 --- a/configure +++ b/configure @@ -79,6 +79,8 @@ fi [ -n "$USE_XRANDR" ] && CFLAGS="$CFLAGS -DHAVE_XRANDR" [ -n "$USE_IMLIB2" ] && CFLAGS="$CFLAGS -DHAVE_IMLIB" +LDFLAGS="$LDFLAGS -lpthread" + cat > Makefile << EOF PREFIX=$PREFIX XDG_CONFIG_DIR=$XDG_CONFIG_DIR diff --git a/src/client.c b/src/client.c index 1448a72..40ee9ec 100644 --- a/src/client.c +++ b/src/client.c @@ -370,6 +370,9 @@ client_focus(Client *c) if(sel->flags & AboveFlag) sel->flags &= ~AboveFlag; + XChangeProperty(dpy, sel->frame, net_atom[net_wm_window_opacity], XA_CARDINAL, + 32, PropModeReplace, (uchar *)&conf.opacity, 1); + frame_update(sel); mouse_grabbuttons(sel, !conf.focus_pclick); @@ -390,6 +393,9 @@ client_focus(Client *c) if(TBARH - BORDH && c->titlebar->stipple) c->titlebar->stipple_color = conf.titlebar.stipple.colors.focus; + + XDeleteProperty(dpy, c->frame, net_atom[net_wm_window_opacity]); + frame_update(c); mouse_grabbuttons(c, True); @@ -407,11 +413,7 @@ client_focus(Client *c) client_above(sel); if(c->flags & UrgentFlag) - { - c->flags &= ~UrgentFlag; - tags[c->screen][c->tag].urgent = False; - infobar_draw_taglist(c->screen); - } + client_urgent(c, False); XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); @@ -428,6 +430,22 @@ client_focus(Client *c) return; } +/** Set urgency flag of the client + * \param c Client pointer + * \param u Bool +*/ +void +client_urgent(Client *c, Bool u) +{ + if(u) + c->flags |= UrgentFlag; + else + c->flags &= ~UrgentFlag; + + tags[c->screen][c->tag].urgent = u; + infobar_draw_taglist(c->screen); +} + /* The following functions have the same point : * find a client member with a Window {{{ */ @@ -706,7 +724,16 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar) mx += spgeo[selscreen].x; my += spgeo[selscreen].y; } + + if(conf.client_auto_center) + { + XRectangle tmp; + tmp = screen_get_geo(selscreen); + mx = (tmp.width + mx - wa->width) / 2; + my = (tmp.height + my - wa->height) / 2; + } } + c->ogeo.x = c->geo.x = mx; c->ogeo.y = c->geo.y = my; c->ogeo.width = c->geo.width = wa->width; @@ -752,7 +779,6 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar) client_update_attributes(c); client_map(c); ewmh_manage_window_type(c); - client_focus(c); if(ar) arrange(c->screen, True); @@ -760,6 +786,9 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar) if(!conf.client.set_new_win_master) layout_set_client_master(c); + if(c->tag == (uint)seltag[selscreen]) + client_focus(c); + return c; } @@ -878,7 +907,7 @@ client_maximize(Client *c) c->geo.width = sgeo[c->screen].width - BORDH * 2; c->geo.height = sgeo[c->screen].height - BORDH; - client_moveresize(c, c->geo, True); + client_moveresize(c, c->geo, False); return; } @@ -1056,12 +1085,9 @@ client_set_rules(Client *c) c->tag = j; if(c->tag != (uint)seltag[selscreen]) - { tags[c->screen][c->tag].request_update = True; - client_focus(NULL); - } - - tags[c->screen][c->tag].layout.func(c->screen); + else + tags[c->screen][c->tag].layout.func(c->screen); /* Deprecated but still in use */ applied_tag_rule = True; @@ -1114,20 +1140,20 @@ client_set_rules(Client *c) } } - if(!applied_tag_rule && conf.client.default_open_tag > 0 + if(!applied_tag_rule && conf.client.default_open_tag > 0 && conf.client.default_open_tag < (uint)conf.ntag[selscreen]) { c->tag = conf.client.default_open_tag; - + client_focus_next(c); tags[c->screen][c->tag].request_update = True; } - - if(!applied_screen_rule && conf.client.default_open_screen > -1 + + if(!applied_screen_rule && conf.client.default_open_screen > -1 && conf.client.default_open_screen < screen_count()) { c->screen = conf.client.default_open_screen; - + client_focus_next(c); tags[c->screen][c->tag].request_update = True; } @@ -1240,7 +1266,7 @@ client_unmanage(Client *c) client_focus(NULL); if(c->flags & UrgentFlag) - tags[c->screen][c->tag].urgent = False; + client_urgent(c, False); client_detach(c); XUngrabButton(dpy, AnyButton, AnyModifier, c->win); @@ -1250,20 +1276,33 @@ client_unmanage(Client *c) XUngrabServer(dpy); ewmh_get_client_list(); - /* Arrange */ - for(i = 0; i < screen_count() && !b; ++i) - if(c->tag == (uint)seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag)) - b = True; - if(b) - tags[c->screen][c->tag].layout.func(c->screen); + if(c->tag == MAXTAG + 1) + { + for(i = 0; i < conf.ntag[c->screen]; i++) + tags[c->screen][i].request_update = True; + tags[c->screen][seltag[c->screen]].layout.func(c->screen); + } else { - tags[c->screen][c->tag].request_update = True; - infobar_draw(c->screen); + /* Arrange */ + for(i = 0; i < screen_count() && !b; ++i) + if(c->tag == (uint)seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag)) + b = True; + + if(b) + { + tags[c->screen][c->tag].layout.func(c->screen); + } + else + { + tags[c->screen][c->tag].request_update = True; + infobar_draw(c->screen); + } } + /*XFree(c->title);*/ client_focus_next(c); diff --git a/src/config.c b/src/config.c index 5b45b93..87358b8 100644 --- a/src/config.c +++ b/src/config.c @@ -126,9 +126,10 @@ name_to_uint_t mouse_button_list[] = {"3", Button3 }, {"4", Button4 }, {"5", Button5 }, + {NULL, NoSymbol} }; -void +static void mouse_section(MouseBinding mb[], struct conf_sec **sec) { int n; @@ -143,10 +144,11 @@ mouse_section(MouseBinding mb[], struct conf_sec **sec) } } -void +static void conf_misc_section(void) { int pad = 12; + uint opacity = 255; struct conf_sec *sec; sec = fetch_section_first(NULL, "misc"); @@ -161,6 +163,12 @@ conf_misc_section(void) conf.autostart_path = fetch_opt_first(sec, "", "autostart_path").str; conf.autostart_command = fetch_opt_first(sec, "", "autostart_command").str; pad = fetch_opt_first(sec, "12", "pad").num; + opacity = fetch_opt_first(sec, "255", "opacity").num; + + if(opacity > 255) + opacity = 255; + + conf.opacity = opacity << 24; if(pad > 24 || pad < 1) { @@ -180,7 +188,7 @@ conf_misc_section(void) return; } -void +static void conf_bar_section(void) { struct conf_sec *bar, **mouse, *selbar, *systray; @@ -238,7 +246,7 @@ conf_bar_section(void) return; } -void +static void conf_root_section(void) { struct conf_sec *root, **mouse; @@ -260,7 +268,7 @@ conf_root_section(void) return; } -void +static void conf_client_section(void) { int i, j; @@ -271,6 +279,7 @@ conf_client_section(void) sec = fetch_section_first(NULL, "client"); conf.client_round = fetch_opt_first(sec, "true", "client_round").bool; + conf.client_auto_center = fetch_opt_first(sec, "false", "client_auto_center").bool; if ((conf.client.borderheight = fetch_opt_first(sec, "1", "border_height").num) < 1) conf.client.borderheight = 1; @@ -382,7 +391,7 @@ conf_client_section(void) return; } -void +static void conf_layout_section(void) { int i; @@ -460,7 +469,7 @@ conf_layout_section(void) return; } -void +static void conf_tag_section(void) { int i, j, k, l = 0, m, n, sc, count, bar_pos; @@ -612,7 +621,7 @@ conf_tag_section(void) return; } -void +static void conf_rule_section(void) { int i; @@ -644,7 +653,7 @@ conf_rule_section(void) return; } -void +static void conf_menu_section(void) { char *tmp2; @@ -705,7 +714,7 @@ conf_menu_section(void) return; } -void +static void conf_launcher_section(void) { int i; @@ -731,7 +740,7 @@ conf_launcher_section(void) return; } -void +static void conf_keybind_section(void) { int i; diff --git a/src/draw.c b/src/draw.c index 4fa3b3f..8cf8a5d 100644 --- a/src/draw.c +++ b/src/draw.c @@ -100,7 +100,7 @@ draw_image_ofset_text(Drawable d, int x, int y, char* fg, char *str, int x_image if(strstr(ostr, "i[")) strncpy(str, ostr, textlen); - IFREE(ostr); + free(ostr); #endif /* HAVE_IMLIB */ return; @@ -226,7 +226,7 @@ textw(char *text) if(strstr(ostr, "i[")) strncpy(text, ostr, textlen); - IFREE(ostr); + free(ostr); #endif /* HAVE_IMLIB */ return gl.width + font->descent; diff --git a/src/event.c b/src/event.c index c391521..29ce6f9 100644 --- a/src/event.c +++ b/src/event.c @@ -577,11 +577,7 @@ propertynotify(XPropertyEvent *ev) case XA_WM_HINTS: if((h = XGetWMHints(dpy, c->win)) && (h->flags & XUrgencyHint) && c != sel) { - c->flags |= UrgentFlag; - - tags[c->screen][c->tag].urgent = True; - infobar_draw_taglist(c->screen); - + client_urgent(c, True); XFree(h); } break; diff --git a/src/ewmh.c b/src/ewmh.c index 7fe04d8..e9f6787 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -69,6 +69,7 @@ ewmh_init_hints(void) net_atom[net_wm_icon_name] = ATOM("_NET_WM_ICON_NAME"); net_atom[net_wm_window_type] = ATOM("_NET_WM_WINDOW_TYPE"); net_atom[net_supporting_wm_check] = ATOM("_NET_SUPPORTING_WM_CHECK"); + net_atom[net_wm_window_opacity] = ATOM("_NET_WM_WINDOW_OPACITY"); net_atom[net_wm_window_type_normal] = ATOM("_NET_WM_WINDOW_TYPE_NORMAL"); net_atom[net_wm_window_type_dock] = ATOM("_NET_WM_WINDOW_TYPE_DOCK"); net_atom[net_wm_window_type_splash] = ATOM("_NET_WM_WINDOW_TYPE_SPLASH"); @@ -370,7 +371,7 @@ ewmh_manage_net_wm_state(long data_l[], Client *c) else if(data_l[1] == (long)net_atom[net_wm_state_demands_attention]) { if(data_l[0] == _NET_WM_STATE_ADD) - client_focus(c); + client_urgent(c, True); if(data_l[0] == _NET_WM_STATE_REMOVE) if(c == sel) client_focus(NULL); diff --git a/src/getinfo.c b/src/getinfo.c index b4e2928..46d3ce8 100644 --- a/src/getinfo.c +++ b/src/getinfo.c @@ -42,7 +42,7 @@ uchar *ret; /** Get information about tag (current, list, names) */ -void +static void getinfo_tag(void) { int tag = 0; @@ -74,15 +74,15 @@ getinfo_tag(void) printf("Current tag: %d - %s\n", tag, tag_name); printf("Tag list: %s\n", tag_list); - IFREE(tag_name); - IFREE(tag_list); + free(tag_name); + free(tag_list); return; } /** Get information about screens */ -void +static void getinfo_screen(void) { int screen = 1; @@ -108,7 +108,7 @@ getinfo_screen(void) /** Get current layout name */ -void +static void getinfo_layout(void) { char *layout = NULL; @@ -122,14 +122,14 @@ getinfo_layout(void) printf("Current layout: %s\n", layout); - IFREE(layout); + free(layout); return; } /** Get information about current mwfact */ -void +static void getinfo_mwfact(void) { char *mwfact = NULL; @@ -143,14 +143,14 @@ getinfo_mwfact(void) printf("Current mwfact: %s\n", mwfact); - IFREE(mwfact); + free(mwfact); return; } /** Get information about current nmaster */ -void +static void getinfo_nmaster(void) { int nmaster = 1; diff --git a/src/infobar.c b/src/infobar.c index 390eb39..0928953 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -209,7 +209,7 @@ infobar_draw_selbar(int sc) barwin_refresh(infobar[sc].selbar); - IFREE(str); + free(str); return; } diff --git a/src/init.c b/src/init.c index 21b01e0..436f1d0 100644 --- a/src/init.c +++ b/src/init.c @@ -55,32 +55,9 @@ const func_name_list_t layout_list[] = { NULL, NULL } }; -/** Init WMFS -*/ -void -init(void) -{ - /* First init */ - ewmh_init_hints(); - init_conf(); - init_gc(); - init_font(); - init_cursor(); - init_key(); - init_root(); - screen_init_geo(); - infobar_init(); - systray_acquire(); - init_status(); - ewmh_update_current_tag_prop(); - grabkeys(); - - return; -} - /** Init the font */ -void +static void init_font(void) { font = XftFontOpenName(dpy, SCREEN, conf.font); @@ -100,7 +77,7 @@ init_font(void) /** Init the graphic context */ -void +static void init_gc(void) { XGCValues gcv; @@ -127,7 +104,7 @@ init_gc(void) /** Init WMFS cursor */ -void +static void init_cursor(void) { cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); @@ -141,7 +118,7 @@ init_cursor(void) /** Init key modifier */ -void +static void init_key(void) { int i, j; @@ -160,7 +137,7 @@ init_key(void) /** Init root Window */ -void +static void init_root(void) { XSetWindowAttributes at; @@ -183,7 +160,7 @@ init_root(void) /** Init statustext shell script */ -void +static void init_status(void) { struct stat st; @@ -218,3 +195,26 @@ init_status(void) return; } +/** Init WMFS +*/ +void +init(void) +{ + /* First init */ + ewmh_init_hints(); + init_conf(); + init_gc(); + init_font(); + init_cursor(); + init_key(); + init_root(); + screen_init_geo(); + infobar_init(); + systray_acquire(); + init_status(); + ewmh_update_current_tag_prop(); + grabkeys(); + + return; +} + diff --git a/src/launcher.c b/src/launcher.c index 6690080..3aa32f3 100644 --- a/src/launcher.c +++ b/src/launcher.c @@ -370,7 +370,7 @@ complete_on_files(char *start, size_t hits) else warn("%s", filepath); - IFREE(filepath); + free(filepath); break; } @@ -378,8 +378,8 @@ complete_on_files(char *start, size_t hits) closedir(dir); } - IFREE(dirname); - IFREE(path); + free(dirname); + free(path); return ret; } diff --git a/src/layout.c b/src/layout.c index fcd92ac..debbfc5 100644 --- a/src/layout.c +++ b/src/layout.c @@ -443,8 +443,7 @@ mirror(int screen, Bool horizontal) int pa, imp; Bool isp = 0; - memset(&nextg[0], 0, sizeof(nextg[0])); - memset(&nextg[1], 0, sizeof(nextg[2])); + memset(nextg, 0, sizeof(nextg)); for(n = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++n); CHECK(n); @@ -850,7 +849,6 @@ layout_set_client_master(Client *c) client_detach(c); client_attach(c); - client_focus(c); tags[selscreen][seltag[selscreen]].layout.func(selscreen); diff --git a/src/menu.c b/src/menu.c index c90cedc..c8c8160 100644 --- a/src/menu.c +++ b/src/menu.c @@ -345,7 +345,7 @@ uicb_menu(uicb_t cmd) void menu_clear(Menu *menu) { - IFREE(menu->item); + free(menu->item); menu->nitem = 0; return; diff --git a/src/parse.c b/src/parse.c index f649dac..289fe91 100644 --- a/src/parse.c +++ b/src/parse.c @@ -307,6 +307,7 @@ parse_keywords(const char *filename) free(buf); free(bufname); + close(fd); warnx("%s read", file->name); return (error ? NULL: head); @@ -388,8 +389,7 @@ include(struct keyword *head) static void * free_opt(struct conf_opt *o) { - if (o) - free(o); + free(o); return NULL; } @@ -563,8 +563,7 @@ free_conf(void) while (kw) { nkw = kw->next; - if (kw->name) - free(kw->name); + free(kw->name); for (i = 0; i < nf; i++) { if (f[i] == kw->file) { diff --git a/src/structs.h b/src/structs.h index 27807d0..a93d98a 100644 --- a/src/structs.h +++ b/src/structs.h @@ -115,6 +115,7 @@ enum net_wm_pid, net_showing_desktop, net_supporting_wm_check, + net_wm_window_opacity, net_wm_window_type_normal, net_wm_window_type_dock, net_wm_window_type_splash, @@ -376,6 +377,7 @@ typedef struct /* Misc option */ char *font; + uint opacity; Bool raisefocus; Bool raiseswitch; Bool focus_fmouse; @@ -485,6 +487,7 @@ typedef struct Bool tag_round; Bool tag_auto_prev; Bool client_round; + Bool client_auto_center; Bool layout_system; /* Switch: False, Menu: True. */ Bool layout_placement; /* Right (normal): False, Left: True. */ Bool keep_layout_geo; diff --git a/src/systray.c b/src/systray.c index abc8e53..ecda7bb 100644 --- a/src/systray.c +++ b/src/systray.c @@ -85,7 +85,7 @@ systray_add(Window win) if(!conf.systray.active) return; - s = zcalloc(sizeof(Systray)); + s = xcalloc(1, sizeof(Systray)); s->win = win; s->geo.height = infobar[conf.systray.screen].bar->geo.height; @@ -118,7 +118,7 @@ systray_del(Systray *s) for(ss = &trayicons; *ss && *ss != s; ss = &(*ss)->next); *ss = s->next; - IFREE(s); + free(s); return; } @@ -162,7 +162,7 @@ systray_freeicons(void) { XUnmapWindow(dpy, i->win); XReparentWindow(dpy, i->win, ROOT, 0, 0); - IFREE(i); + free(i); } XSetSelectionOwner(dpy, net_atom[net_system_tray_s], None, CurrentTime); diff --git a/src/util.c b/src/util.c index 961b92a..2b21e33 100644 --- a/src/util.c +++ b/src/util.c @@ -253,14 +253,15 @@ alias_to_str(char *conf_choice) * \param cmd Command * \return child pid */ -pid_t +int spawn(const char *format, ...) { char *sh = NULL; char cmd[512]; va_list ap; + pid_t pid, ret; + int p[2]; size_t len; - pid_t pid; va_start(ap, format); len = vsnprintf(cmd, sizeof(cmd), format, ap); @@ -275,18 +276,48 @@ spawn(const char *format, ...) if(!(sh = getenv("SHELL"))) sh = "/bin/sh"; + if (pipe(p) == -1) + { + warn("pipe"); + return -1; + } + if((pid = fork()) == 0) { - if(dpy) - close(ConnectionNumber(dpy)); - setsid(); - execl(sh, sh, "-c", cmd, (char*)NULL); - err(1, "execl(%s)", cmd); - } - if (pid == -1) - warn("fork()"); + close(p[0]); + if((pid = fork()) == 0) + { + if(dpy) + close(ConnectionNumber(dpy)); + setsid(); + execl(sh, sh, "-c", cmd, (char*)NULL); + exit(EXIT_FAILURE); + } - return pid; + if (sizeof(pid_t) != write(p[1], &pid, sizeof(pid_t))) + warn("write"); + + close(p[1]); + exit(EXIT_SUCCESS); + } + else if (pid != -1) + { + close(p[1]); + if (sizeof(pid_t) != read(p[0], &ret, sizeof(pid_t))) + { + warn("read"); + ret = -1; + } + close(p[0]); + waitpid(pid, NULL, 0); + } + else + { + warn("fork"); + ret = -1; + } + + return ret; } /** Swap two pointer. diff --git a/src/wmfs.c b/src/wmfs.c index 172bbd4..632c7e5 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -92,8 +92,8 @@ quit(void) XReparentWindow(dpy, c->win, ROOT, c->geo.x, c->geo.y); } - IFREE(tags); - IFREE(seltag); + free(tags); + free(seltag); systray_freeicons(); @@ -103,31 +103,31 @@ quit(void) XFreeGC(dpy, gc_stipple); infobar_destroy(); - IFREE(sgeo); - IFREE(spgeo); - IFREE(infobar); - IFREE(keys); - IFREE(net_atom); + free(sgeo); + free(spgeo); + free(infobar); + free(keys); + free(net_atom); /* Clean conf alloced thing */ - IFREE(menulayout.item); + free(menulayout.item); if(conf.menu) { len = LEN(conf.menu); for(i = 0; i < len; ++i) - IFREE(conf.menu[i].item); - IFREE(conf.menu); + free(conf.menu[i].item); + free(conf.menu); } - IFREE(conf.launcher); - IFREE(conf.rule); + free(conf.launcher); + free(conf.rule); - IFREE(conf.bars.mouse); - IFREE(conf.selbar.mouse); - IFREE(conf.titlebar.button); - IFREE(conf.client.mouse); - IFREE(conf.root.mouse); + free(conf.bars.mouse); + free(conf.selbar.mouse); + free(conf.titlebar.button); + free(conf.client.mouse); + free(conf.root.mouse); free_conf(); @@ -135,25 +135,55 @@ quit(void) XCloseDisplay(dpy); /* kill status script */ - if (conf.status_pid != -1) + if (conf.status_pid != (pid_t)-1) kill(conf.status_pid, SIGTERM); return; } +void * +thread_process(void *arg) +{ + XEvent ev; + + /* X event loop */ + if(arg) + { + while(!exiting && !XNextEvent(dpy, &ev)) + getevent(ev); + } + /* Status checking loop with timing */ + else + { + pthread_detach(pthread_self()); + do + { + conf.status_pid = spawn(conf.status_path); + sleep(conf.status_timing); + } while (!exiting && conf.status_timing != 0); + } + pthread_exit(NULL); +} + /** WMFS main loop. */ void mainloop(void) { XEvent ev; + pthread_t evloop, evstatus; + void *ret; - /* launch status loop */ - if (estatus) - signal_handle(SIGALRM); + if(!estatus) + while(!exiting && !XNextEvent(dpy, &ev)) + getevent(ev); + else + { + pthread_create(&evloop, NULL, thread_process, "1"); + pthread_create(&evstatus, NULL, thread_process, NULL); - while(!exiting && !XNextEvent(dpy, &ev)) - getevent(ev); + (void)pthread_join(evloop, &ret); + } return; } @@ -253,11 +283,11 @@ void uicb_reload(uicb_t cmd) { (void)cmd; - signal(SIGALRM, SIG_IGN); quit(); for(; argv_global[0] && argv_global[0] == ' '; ++argv_global); + /* add -C to always load the same config file */ execvp(argv_global, all_argv); return; @@ -374,8 +404,6 @@ update_status(void) static void signal_handle(int sig) { - pid_t pid; - switch (sig) { case SIGQUIT: @@ -388,20 +416,7 @@ signal_handle(int sig) /* re-set signal handler and wait childs */ if (signal(SIGCHLD, &signal_handle) == SIG_ERR) warn("signal(%d)", SIGCHLD); - while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) - if (pid == conf.status_pid) - conf.status_pid = -1; - break; - case SIGALRM: - /* re-set signal handler */ - if (signal(SIGALRM, &signal_handle) == SIG_ERR) - warn("signal(%d)", SIGALRM); - /* exec status script (only if still not running) */ - if (conf.status_pid == (pid_t)-1) - conf.status_pid = spawn(conf.status_path); - /* re-set timer */ - if (conf.status_timing > 0) - alarm(conf.status_timing); + while (waitpid(-1, NULL, WNOHANG) > 0); break; } @@ -424,7 +439,6 @@ main(int argc, char **argv) argv_global = xstrdup(argv[0]); all_argv = argv; - sprintf(conf.confpath, "%s/"DEF_CONF, getenv("HOME")); while((i = getopt(argc, argv, "hviSc:s:g:C:V:")) != -1) @@ -446,7 +460,7 @@ main(int argc, char **argv) " -V Manage WMFS with vi-like command\n" " -S Update status script\n" " -h Show this page\n" - " -i Show information\n" + " -i Show informations\n" " -v Show WMFS version\n", argv[0]); exit(EXIT_SUCCESS); break; @@ -504,7 +518,7 @@ main(int argc, char **argv) errx(EXIT_FAILURE, "cannot open X server."); /* Set signal handler */ - for (i = 0; i < (int)LEN(sigs); i++) + for (i = sigs[0]; i < (int)LEN(sigs); i++) if (signal(sigs[i], &signal_handle) == SIG_ERR) warn("signal(%d)", sigs[i]); diff --git a/src/wmfs.h b/src/wmfs.h index 039ae50..108eacc 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -107,7 +108,6 @@ #define FRAMEH(h) ((h) + (BORDH + TBARH)) #define ROUND(x) (float)((x > 0) ? x + (float)0.5 : x - (float)0.5) #define CHECK(x) if(!(x)) return -#define IFREE(x) if(x) free(x) #define LEN(x) (sizeof(x) / sizeof((x)[0])) #define MAXCLIST (64) @@ -190,6 +190,7 @@ void client_unmanage(Client *c); void client_unmap(Client *c); void client_set_rules(Client *c); void client_update_attributes(Client *c); +void client_urgent(Client *c, Bool u); void uicb_client_raise(uicb_t); void uicb_client_next(uicb_t); void uicb_client_prev(uicb_t); @@ -399,20 +400,8 @@ Bool uicb_checklayout(uicb_t); /* init.c */ void init(void); -void init_root(void); -void init_font(void); -void init_gc(void); -void init_cursor(void); -void init_key(void); -void init_geometry(void); -void init_status(void); /* getinfo.c */ -void getinfo_tag(void); -void getinfo_screen(void); -void getinfo_layout(void); -void getinfo_mwfact(void); -void getinfo_nmaster(void); void getinfo(char *info); /* viwmfs.c */ diff --git a/wmfsrc b/wmfsrc index 748a865..18317ef 100644 --- a/wmfsrc +++ b/wmfsrc @@ -10,6 +10,7 @@ font = "dejavu-10" raisefocus = false focus_follow_mouse = true + opacity = 255 # focus_pointer_click: click on unfocused client area: # true -- default, set focus # false -- click go to client; including dockapps @@ -157,6 +158,7 @@ [client] client_round = true + client_auto_center = false border_height = 3 border_shadow = true border_normal = "#191919"