Permalink
Browse files

Bar is toggled on a per desktop basis

  • Loading branch information...
1 parent 76c674a commit 3acac06969ca024fa18eae58b291dbf6afa60203 @moetunes committed Sep 24, 2012
Showing with 11 additions and 3 deletions.
  1. +1 −0 ChangeLog
  2. +3 −1 bar.c
  3. +7 −2 snapwm.c
View
@@ -1,6 +1,7 @@
24/9/12
Fix for existing window/s not being unmapped in
fullscreen mode when new window added
+ Bar is toggled on a per desktop basis
22/9/12
Added AltSuper for Mod key combo
View
@@ -59,16 +59,18 @@ void toggle_bar() {
unsigned int i;
if(STATUS_BAR == 0) {
- if(show_bar == 0) {
+ if(has_bar == 0) {
show_bar = 1;
sh += sb_height+4;
for(i=0;i<DESKTOPS;++i) XUnmapWindow(dis,sb_bar[i].sb_win);
XUnmapWindow(dis, sb_area);
+ has_bar = 1;
} else {
show_bar = 0;
sh -= sb_height+4;
for(i=0;i<DESKTOPS;++i) XMapWindow(dis, sb_bar[i].sb_win);
XMapWindow(dis, sb_area);
+ has_bar = 0;
}
tile();
View
@@ -69,7 +69,7 @@ struct client{
typedef struct desktop desktop;
struct desktop{
unsigned int master_size;
- unsigned int mode, growth, numwins, nmaster;
+ unsigned int mode, growth, numwins, nmaster, showbar;
client *head;
client *current;
client *transient;
@@ -189,7 +189,7 @@ static unsigned int attachaside, bdw, bool_quit, clicktofocus, current_desktop,
static unsigned int followmouse, mode, msize, previous_desktop, DESKTOPS;
static int growth, sh, sw, master_size, nmaster;
static unsigned int sb_desks; // width of the desktop switcher
-static unsigned int sb_height, sb_width, screen, show_bar, wnamebg;
+static unsigned int sb_height, sb_width, screen, show_bar, has_bar, wnamebg;
static unsigned int showopen; // whether the desktop switcher shows number of open windows
static unsigned int topbar, top_stack, windownamelength, keycount, cmdcount, dtcount, pcount, LA_WINDOWNAME;
static int ufalpha;
@@ -490,6 +490,8 @@ void change_desktop(const Arg arg) {
// Take "properties" from the new desktop
select_desktop(arg.i);
+ if(has_bar == 0 && show_bar == 1) toggle_bar();
+ if(has_bar == 1 && show_bar == 0) toggle_bar();
// Map all windows
if(head != NULL) {
if(mode != 1) {
@@ -552,6 +554,7 @@ void save_desktop(int i) {
desktops[i].nmaster = nmaster;
desktops[i].mode = mode;
desktops[i].growth = growth;
+ desktops[i].showbar = show_bar;
desktops[i].head = head;
desktops[i].current = current;
desktops[i].transient = transient;
@@ -562,6 +565,7 @@ void select_desktop(int i) {
nmaster = desktops[i].nmaster;
mode = desktops[i].mode;
growth = desktops[i].growth;
+ show_bar = desktops[i].showbar;
head = desktops[i].head;
current = desktops[i].current;
transient = desktops[i].transient;
@@ -1227,6 +1231,7 @@ void init_desks(unsigned int ws) {
desktops[ws].nmaster = 0;
desktops[ws].mode = mode;
desktops[ws].growth = 0;
+ desktops[ws].showbar = show_bar;
desktops[ws].numwins = 0;
desktops[ws].head = NULL;
desktops[ws].current = NULL;

0 comments on commit 3acac06

Please sign in to comment.