Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fine tune file parsing, order clients better when in center stacking …

…mode
  • Loading branch information...
commit 48182666e57c40d09373b1c6a1f45615342b2905 1 parent 05e8f11
@moetunes authored
Showing with 16 additions and 13 deletions.
  1. +2 −3 readkeysapps.c
  2. +1 −1  readrc.c
  3. +13 −9 snapwm.c
View
5 readkeysapps.c
@@ -104,9 +104,8 @@ void read_keys_file() {
break;
}
}
- }
+ } else continue;
++keycount;
- continue;
}
}
}
@@ -120,7 +119,7 @@ void read_apps_file() {
char *dummy2;
dtcount = pcount = 0;
- appsfile = fopen( APPS_FILE, "r" ) ;
+ appsfile = fopen( APPS_FILE, "rb" ) ;
if ( appsfile == NULL ) {
fprintf(stderr, "\033[0;34m snapwm : \033[0;31m Couldn't find %s\033[0m \n" ,APPS_FILE);
return;
View
2  readrc.c
@@ -8,7 +8,7 @@ void read_rcfile() {
char *dummy2, *dummy3;
unsigned int i;
- rcfile = fopen( RC_FILE, "r" ) ;
+ rcfile = fopen( RC_FILE, "rb" ) ;
if ( rcfile == NULL ) {
fprintf(stderr, "\033[0;34m:: snapwm : \033[0;31m Couldn't find %s\033[0m \n" ,RC_FILE);
set_defaults();
View
22 snapwm.c
@@ -34,9 +34,8 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
-#include <signal.h>
+// #include <signal.h>
#include <sys/wait.h>
-#include <locale.h>
#include <string.h>
#define MAX(a, b) ((a) > (b) ? (a) : (b))
@@ -44,7 +43,7 @@
#define TABLENGTH(X) (sizeof(X)/sizeof(*X))
typedef union {
- char *com[256];
+ char *com[15];
int i;
} Arg;
@@ -100,8 +99,8 @@ typedef struct {
typedef struct {
Window sb_win;
char *label;
- int width;
- int labelwidth;
+ unsigned int width;
+ unsigned int labelwidth;
} Barwin;
typedef struct {
@@ -112,7 +111,7 @@ typedef struct {
typedef struct {
char *name;
- char *list[100];
+ char *list[15];
} Commands;
// Functions
@@ -269,7 +268,7 @@ void add_window(Window w, int tw) {
c->height = attr.height;
}
- c->win = w; c->order = 0;
+ c->win = w;
dummy = (tw == 1) ? transient : head;
for(t=dummy;t;t=t->next)
++t->order;
@@ -300,6 +299,7 @@ void add_window(Window w, int tw) {
return;
} else head = dummy;
current = c;
+ c->order = 0;
desktops[current_desktop].numwins += 1;
if(growth > 0) growth = growth*(desktops[current_desktop].numwins-1)/desktops[current_desktop].numwins;
else growth = 0;
@@ -682,8 +682,12 @@ void tile() {
}
break;
case 4: // Stacking
- for(c=head;c;c=c->next)
- XMoveResizeWindow(dis,c->win,c->x,c->y,c->width,c->height);
+ for(n=desktops[current_desktop].numwins-1;n>=0;--n) {
+ for(c=head;c;c=c->next) {
+ if(c->order == n)
+ XMoveResizeWindow(dis,c->win,c->x,c->y,c->width,c->height);
+ }
+ }
break;
}
default:
Please sign in to comment.
Something went wrong with that request. Please try again.