From 94cfcda85e3e53948152a1b58a2ef8c1dca55ca6 Mon Sep 17 00:00:00 2001 From: moetunes Date: Thu, 25 Dec 2014 11:48:10 +1000 Subject: [PATCH] Option to have different modes set for each desktop --- ChangeLog | 3 +++ config.h.def | 4 +++- dminiwm.c | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 975f25c..e7f2d9c 100644 --- a/ChangeLog +++ b/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 diff --git a/config.h.def b/config.h.def index 8edd2bf..674c44f 100644 --- a/config.h.def +++ b/config.h.def @@ -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 */ diff --git a/dminiwm.c b/dminiwm.c index aab365e..d1b0a0d 100644 --- a/dminiwm.c +++ b/dminiwm.c @@ -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 @@ -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 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