Skip to content

Commit

Permalink
Option to have different modes set for each desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
moetunes committed Dec 25, 2014
1 parent 117922d commit 94cfcda
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,3 +1,6 @@
8/12/14
Added option to set a different mode for each desktop in config.h

10/4/14
Add locale so fonts in firefox and maybe others work

Expand Down
4 changes: 3 additions & 1 deletion config.h.def
Expand Up @@ -15,7 +15,9 @@
#define BORDER_WIDTH 2
#define ATTACH_ASIDE 1 /* 0=TRUE, 1=New window is master */
#define TOP_STACK 1 /* 0=TRUE, 1=New window added to bottom of stack when using ATTACH_ASIDE */
#define DEFAULT_MODE 0 /* 0=Vertical, 1=Fullscreen 2=Horizontal 3=grid*/
#define DEFAULT_MODE 1 /* 1=Vertical 2=Fullscreen 3=Horizontal 4=grid 5=stacking */
/* Set mode for each desktop - defaults to DEFAULT_MODE */
const unsigned int MODES[] = {1, 2, 3, 4, 5};
/* Only one of FOLLOW_MOUSE and CLICK_TO_FOCUS should be zero */
#define FOLLOW_MOUSE 1 /* 1=Don't 0=Focus the window the mouse just entered */
#define CLICK_TO_FOCUS 0 /* 1=Don't 0=Focus an unfocused window when clicked */
Expand Down
8 changes: 4 additions & 4 deletions dminiwm.c
Expand Up @@ -1005,7 +1005,6 @@ void setup() {
screen = DefaultScreen(dis);
root = RootWindow(dis,screen);

XSelectInput(dis,root,SubstructureRedirectMask);
bdw = BORDER_WIDTH;
panel_size = PANEL_HEIGHT;
// Screen width and height
Expand All @@ -1029,19 +1028,20 @@ void setup() {
grabkeys();

// Master size
master_size = (mode == 2) ? sh*MASTER_SIZE : sw*MASTER_SIZE;

// Set up all desktop
for(i=0;i<TABLENGTH(desktops);++i) {
desktops[i].master_size = master_size;
//desktops[i].master_size = master_size;
desktops[i].nmaster = 0;
desktops[i].mode = DEFAULT_MODE;
desktops[i].growth = 0;
desktops[i].showbar = showbar;
desktops[i].numwins = 0;
desktops[i].head = NULL;
desktops[i].current = NULL;
desktops[i].transient = NULL;
if(MODES[i] > 0 && MODES[i] < 6) desktops[i].mode = MODES[i]-1;
else desktops[i].mode = DEFAULT_MODE-1;
desktops[i].master_size = (desktops[i].mode == 2) ? sh*MASTER_SIZE : sw*MASTER_SIZE;
}

// Select first desktop by default
Expand Down

0 comments on commit 94cfcda

Please sign in to comment.