allow building without title bars
This commit is contained in:
3
client.c
3
client.c
@@ -71,6 +71,7 @@ client* window_build_client(Window win)
|
||||
? 1:0;
|
||||
|
||||
// detect our own title bars
|
||||
if (TITLE)
|
||||
for_monitors(i, m) for_spots(j)
|
||||
if (m->bars[j] && m->bars[j]->window == c->window)
|
||||
{ c->ours = 1; c->manage = 0; break; }
|
||||
@@ -272,7 +273,7 @@ void client_raise_family(client *c)
|
||||
|
||||
client_stack_family(c, &raise);
|
||||
|
||||
if (!c->full)
|
||||
if (!c->full && TITLE)
|
||||
{
|
||||
// raise spot's title bar in case some other fullscreen or max v/h window has obscured
|
||||
monitor *m = &monitors[c->monitor];
|
||||
|
||||
6
config.h
6
config.h
@@ -6,8 +6,12 @@
|
||||
#define BORDER_URGENT "Red"
|
||||
#define GAP 2
|
||||
|
||||
// Title bar xft font
|
||||
// Title bar xft font.
|
||||
// Setting this to NULL will disable title bars
|
||||
//#define TITLE NULL
|
||||
#define TITLE "sans:size=8"
|
||||
|
||||
// Title bar style
|
||||
#define TITLE_BLUR "Black"
|
||||
#define TITLE_FOCUS "White"
|
||||
#define TITLE_ELLIPSIS 32
|
||||
|
||||
1
event.c
1
event.c
@@ -144,6 +144,7 @@ void button_press(XEvent *ev)
|
||||
if (c && c->manage)
|
||||
client_activate(c);
|
||||
else
|
||||
if (TITLE)
|
||||
for_monitors(i, m) for_spots(j)
|
||||
if (m->bars[j]->window == e->subwindow)
|
||||
spot_focus_top_window(j, i, None);
|
||||
|
||||
3
setup.c
3
setup.c
@@ -185,6 +185,8 @@ void setup()
|
||||
XGrabButton(display, Button3, AnyModifier, root, True, ButtonPressMask, GrabModeSync, GrabModeSync, None, None);
|
||||
|
||||
// create title bars
|
||||
if (TITLE)
|
||||
{
|
||||
STACK_FREE(&windows);
|
||||
for_monitors(i, m) for_spots(j)
|
||||
{
|
||||
@@ -196,6 +198,7 @@ void setup()
|
||||
m->spots[j].h -= m->bars[j]->h;
|
||||
spot_update_bar(j, i);
|
||||
}
|
||||
}
|
||||
|
||||
// setup existing managable windows
|
||||
STACK_FREE(&windows);
|
||||
|
||||
6
spot.c
6
spot.c
@@ -51,6 +51,8 @@ void spot_update_bar(int spot, int mon)
|
||||
}
|
||||
if (tmp) XFree(tmp);
|
||||
}
|
||||
if (TITLE)
|
||||
{
|
||||
if (c && !c->full && *title && m->bars[spot])
|
||||
{
|
||||
int focus = c->window == current || (spot == current_spot && mon == current_mon);
|
||||
@@ -64,12 +66,14 @@ void spot_update_bar(int spot, int mon)
|
||||
else
|
||||
if (m->bars[spot])
|
||||
textbox_hide(m->bars[spot]);
|
||||
}
|
||||
}
|
||||
|
||||
void update_bars()
|
||||
{
|
||||
int i, j; monitor *m;
|
||||
for_monitors(i, m) for_spots(j) spot_update_bar(j, i);
|
||||
if (TITLE) for_monitors(i, m) for_spots(j)
|
||||
spot_update_bar(j, i);
|
||||
}
|
||||
|
||||
Window spot_focus_top_window(int spot, int mon, Window except)
|
||||
|
||||
Reference in New Issue
Block a user