Atom adelete;
Atom takefocus;
volatile sig_atomic_t running = 1;
+volatile sig_atomic_t restart_wm = 0;
int outputs = 0;
int last_focus_event = FocusOut;
int (*xerrorxlib)(Display *, XErrorEvent *);
int title_name_enabled = 0;
int title_class_enabled = 0;
int focus_mode = SWM_FOCUS_DEFAULT;
+int disable_border = 0;
pid_t bar_pid;
GC bar_gc;
XGCValues bar_gcv;
break;
}
break;
+ case SIGHUP:
+ restart_wm = 1;
+ break;
case SIGINT:
case SIGTERM:
- case SIGHUP:
case SIGQUIT:
running = 0;
break;
int i, x;
size_t len;
char s[SWM_BAR_MAX];
+ char cn[SWM_BAR_MAX];
char loc[SWM_BAR_MAX];
char *b;
char *stack = "";
for (i = 0; i < ScreenCount(display); i++) {
x = 1;
TAILQ_FOREACH(r, &screens[i].rl, entry) {
+ strlcpy(cn, "", sizeof cn);
if (r && r->ws)
- bar_class_name(s, sizeof s, r->ws->focus);
+ bar_class_name(cn, sizeof cn, r->ws->focus);
if (stack_enabled)
stack = r->ws->cur_layout->name;
- snprintf(loc, sizeof loc, "%d:%d %s %s %s %s",
- x++, r->ws->idx + 1, stack, s, bar_ext,
+ snprintf(loc, sizeof loc, "%d:%d %s %s%s %s %s",
+ x++, r->ws->idx + 1, stack, s, cn, bar_ext,
bar_vertext);
bar_print(r, loc);
}
win_g.y += last_h + 2;
bzero(&wc, sizeof wc);
- wc.border_width = 1;
+ if (disable_border && bar_enabled == 0 && winno == 1){
+ wc.border_width = 0;
+ win_g.w += 2;
+ win_g.h += 2;
+ } else
+ wc.border_width = 1;
reconfigure = 0;
if (rot) {
if (win->g.x != win_g.y || win->g.y != win_g.x ||
if (win->g.x != gg.x || win->g.y != gg.y || win->g.w != gg.w ||
win->g.h != gg.h) {
bzero(&wc, sizeof wc);
- wc.border_width = 1;
win->g.x = wc.x = gg.x;
win->g.y = wc.y = gg.y;
- win->g.w = wc.width = gg.w;
- win->g.h = wc.height = gg.h;
+ if (bar_enabled){
+ wc.border_width = 1;
+ win->g.w = wc.width = gg.w;
+ win->g.h = wc.height = gg.h;
+ } else {
+ wc.border_width = 0;
+ win->g.w = wc.width = gg.w + 2;
+ win->g.h = wc.height = gg.h + 2;
+ }
mask = CWX | CWY | CWWidth | CWHeight | CWBorderWidth;
XConfigureWindow(display, win->id, mask, &wc);
configreq_win(win);
SWM_S_CLOCK_ENABLED, SWM_S_CLOCK_FORMAT, SWM_S_CYCLE_EMPTY,
SWM_S_CYCLE_VISIBLE, SWM_S_SS_ENABLED, SWM_S_TERM_WIDTH,
SWM_S_TITLE_CLASS_ENABLED, SWM_S_TITLE_NAME_ENABLED,
- SWM_S_FOCUS_MODE, SWM_S_BAR_FONT, SWM_S_BAR_ACTION, SWM_S_SPAWN_TERM,
- SWM_S_SS_APP, SWM_S_DIALOG_RATIO
+ SWM_S_FOCUS_MODE, SWM_S_DISABLE_BORDER, SWM_S_BAR_FONT,
+ SWM_S_BAR_ACTION, SWM_S_SPAWN_TERM, SWM_S_SS_APP, SWM_S_DIALOG_RATIO
};
int
else
err(1, "focus_mode");
break;
+ case SWM_S_DISABLE_BORDER:
+ disable_border = atoi(value);
+ break;
case SWM_S_BAR_FONT:
free(bar_fonts[0]);
if ((bar_fonts[0] = strdup(value)) == NULL)
{ "title_class_enabled", setconfvalue, SWM_S_TITLE_CLASS_ENABLED },
{ "title_name_enabled", setconfvalue, SWM_S_TITLE_NAME_ENABLED },
{ "focus_mode", setconfvalue, SWM_S_FOCUS_MODE },
+ { "disable_border", setconfvalue, SWM_S_DISABLE_BORDER },
};
void
focusevent(XEvent *e)
{
- DNPRINTF(SWM_D_EVENT, "focusevent: %s window: %lu mode %d detail %d\n",
- ev->type == FocusIn ? "entering" : "leaving",
- ev->window, ev->mode, ev->detail);
#if 0
struct ws_win *win;
u_int32_t mode_detail;
(X(r) + WIDTH(r)) > x &&
Y(r) < (y + h) &&
(Y(r) + HEIGHT(r)) > y) {
+ if (r->ws->r != NULL)
+ r->ws->old_r = r->ws->r;
+ r->ws->r = NULL;
XDestroyWindow(display, r->bar_window);
TAILQ_REMOVE(&s->rl, r, entry);
TAILQ_INSERT_TAIL(&s->orl, r, entry);
if (select(xfd + 1, &rd, NULL, NULL, &tv) == -1)
if (errno != EINTR)
DNPRINTF(SWM_D_MISC, "select failed");
+ if (restart_wm == 1)
+ restart(NULL, NULL);
if (running == 0)
goto done;
if (bar_alarm) {