}
};
-static const char dmenu_normal_bg[] = "#ffffff";
-static const char dmenu_normal_fg[] = "#000000";
-static const char dmenu_sel_bg[] = "#bb2323";
-static const char dmenu_sel_fg[] = "#ffffff";
-
-static const unsigned int borderpx = 1; /* border pixel of windows */
-static const unsigned int snap = 32; /* snap pixel */
-static const Bool topbar = True; /* False means bottom bar */
-static const Bool statusmarkup = True; /* True means use pango markup in status message */
+static const char dmenu_normal_bg[] = "#ffffff";
+static const char dmenu_normal_fg[] = "#000000";
+static const char dmenu_sel_bg[] = "#bb2323";
+static const char dmenu_sel_fg[] = "#ffffff";
+
+static const unsigned int borderpx = 1; /* border pixel of windows */
+static const unsigned int snap = 32; /* snap pixel */
+static const unsigned int bar_padding = 4; /* vertical padding of the bar */
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" };
unsigned int tagset[2];
struct workspace *workspace;
struct workspace *previous_workspace;
- Bool topbar;
struct monitor *next;
Window barwin;
const struct layout *lt[2];
static void configurerequest(XEvent *e);
static struct monitor *createmon(void);
static void destroynotify(XEvent *e);
-static void detach(struct client *c);
static void die(const char *errstr, ...);
static struct monitor *dirtomon(int dir);
static void drawbar(struct monitor *m);
static void resizemouse(const union arg *arg);
static void setlayout(const union arg *arg);
-
static const char broken[] = "broken";
static char stext[512];
static int screen;
m->tagset[0] = 1;
m->tagset[1] = 1;
- m->topbar = topbar;
m->lt[0] = &layouts[0];
m->lt[1] = &layouts[1 % LENGTH(layouts)];
return(selmon->workspace);
}
-static void detach(struct client *client)
-{
- workspace_remove_client(client->workspace, client);
- return;
-}
-
void die(const char *errstr, ...)
{
va_list ap;
struct monitor *m = NULL;
if(dir > 0) {
- if(!(m = selmon->next))
- m = mons;
+ m = selmon->next ? selmon->next : mons;
} else if(selmon == mons) {
for(m = mons; m->next; m = m->next);
} else {
for(i = len; i && i > len - 3; buf[--i] = '.');
}
- /* FIXME: Remove statusmarkup */
- if(text == stext && statusmarkup) { /* FIXME: stext? */
- pango_layout_set_markup(dc.font.layout, buf, len);
- } else {
- pango_layout_set_text(dc.font.layout, buf, len);
- }
-
+ pango_layout_set_markup(dc.font.layout, buf, len);
pango_xft_render_layout(dc.draw, &dc.palette[pal].xcolor[invert ? ColBG : ColFG],
dc.font.layout, x * PANGO_SCALE, y * PANGO_SCALE);
-
- if(text == stext && statusmarkup) {
- /* clear markup attributes */
- pango_layout_set_attributes(dc.font.layout, NULL);
- }
+ pango_layout_set_attributes(dc.font.layout, NULL);
return;
}
client_update_title(c);
if(XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
- c->workspace->viewer = t->workspace->viewer;
+ c->workspace = t->workspace;
} else {
client_apply_rules(c);
}
initfont(font);
screen_width = DisplayWidth(dpy, screen);
screen_height = DisplayHeight(dpy, screen);
- bar_height = dc.geom.h = dc.font.height + 2;
+ bar_height = dc.geom.h = dc.font.height + 2 * bar_padding;
updategeom();
/* init atoms */
{
PangoRectangle r;
- if(text == stext && statusmarkup) {
- pango_layout_set_markup(dc.font.layout, text, len);
- } else {
- pango_layout_set_text(dc.font.layout, text, len);
- }
-
+ pango_layout_set_markup(dc.font.layout, text, len);
pango_layout_get_extents(dc.font.layout, 0, &r);
-
- if(text == stext && statusmarkup) {
- /* clear markup attributes */
- pango_layout_set_attributes(dc.font.layout, NULL);
- }
+ pango_layout_set_attributes(dc.font.layout, NULL);
return(r.width / PANGO_SCALE);
}
monitor = client->workspace->viewer;
/* The server grab construct avoids race conditions. */
- detach(client);
+ workspace_remove_client(client->workspace, client);
if(!destroyed) {
wc.border_width = client->border.oldw;
monitor->win_geom.y = monitor->geom.y;
monitor->win_geom.h = monitor->geom.h;
monitor->win_geom.h -= bar_height;
- monitor->by = monitor->topbar ? monitor->win_geom.y : monitor->win_geom.y + monitor->win_geom.h;
- monitor->win_geom.y = monitor->topbar ? monitor->win_geom.y + bar_height : monitor->win_geom.y;
+ monitor->by = monitor->win_geom.y;
+ monitor->win_geom.y = monitor->win_geom.y + bar_height;
return;
}