commit d8e827bc2175dd7abd9b95a7583fdfccf8901500
parent ea55c5d3f770f76343b36ebb2823142885404a52
Author: Kris Maglione <jg@suckless.org>
Date: Thu, 15 Feb 2007 16:46:31 -0500
Renamed selcolors back to focuscolors. Fixed an early free().
Diffstat:
8 files changed, 18 insertions(+), 29 deletions(-)
diff --git a/frame.c b/frame.c
@@ -227,7 +227,7 @@ frame_delta_h() {
void
update_frame_widget_colors(Frame *f) {
if(sel_screen && (f->client == sel_client()))
- f->grabbox.color = f->tile.color = f->titlebar.color = def.selcolor;
+ f->grabbox.color = f->tile.color = f->titlebar.color = def.focuscolor;
else
f->grabbox.color = f->tile.color = f->titlebar.color = def.normcolor;
if(f->client->urgent)
diff --git a/fs.c b/fs.c
@@ -238,9 +238,12 @@ message_root(char *message)
else if(!strncmp(message, "view ", 5))
select_view(&message[5]);
else if(!strncmp(message, "selcolors ", 10)) {
+ fprintf(stderr, "wmiiwm: warning: selcolors have been removed\n");
+ return Ebadcmd;
+ }else if(!strncmp(message, "focuscolors ", 10)) {
message += 10;
n = strlen(message);
- return parse_colors(&message, (int *)&n, &def.selcolor);
+ return parse_colors(&message, (int *)&n, &def.focuscolor);
}
else if(!strncmp(message, "normcolors ", 11)) {
message += 11;
@@ -282,7 +285,7 @@ read_root_ctl() {
uint i = 0;
if(screen->sel)
i += snprintf(&buffer[i], (BUFFER_SIZE - i), "view %s\n", screen->sel->name);
- i += snprintf(&buffer[i], (BUFFER_SIZE - i), "selcolors %s\n", def.selcolor.colstr);
+ i += snprintf(&buffer[i], (BUFFER_SIZE - i), "focuscolors %s\n", def.focuscolor.colstr);
i += snprintf(&buffer[i], (BUFFER_SIZE - i), "normcolors %s\n", def.normcolor.colstr);
i += snprintf(&buffer[i], (BUFFER_SIZE - i), "font %s\n", def.font.fontstr);
i += snprintf(&buffer[i], (BUFFER_SIZE - i), "grabmod %s\n", def.grabmod);
diff --git a/main.c b/main.c
@@ -307,8 +307,8 @@ main(int argc, char *argv[]) {
def.font.fontstr = estrdup(BLITZ_FONT);
def.border = 1;
def.colmode = Coldefault;
- strncpy(def.selcolor.colstr, BLITZ_SELCOLORS, sizeof(def.selcolor.colstr));
- loadcolor(&blz, &def.selcolor);
+ strncpy(def.focuscolor.colstr, BLITZ_FOCUSCOLORS, sizeof(def.focuscolor.colstr));
+ loadcolor(&blz, &def.focuscolor);
strncpy(def.normcolor.colstr, BLITZ_NORMCOLORS, sizeof(def.normcolor.colstr));
loadcolor(&blz, &def.normcolor);
strncpy(def.grabmod, "Mod1", sizeof(def.grabmod));
diff --git a/mouse.c b/mouse.c
@@ -413,10 +413,8 @@ do_mouse_resize(Client *c, Bool grabbox, BlitzAlign align) {
}else
map_client(c);
- if(rects) {
+ if(rects)
free(rects);
- rects = nil;
- }
XUngrabPointer(blz.dpy, CurrentTime);
XSync(blz.dpy, False);
diff --git a/rc/wmiirc b/rc/wmiirc
@@ -21,7 +21,6 @@ RIGHT=l
WMII_FONT='-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*'
# Colors tuples are "<text> <background> <border>"
WMII_NORMCOLORS='#222222 #eeeeee #666666'
-WMII_SELCOLORS='#444444 #bbbbbb #556088'
WMII_FOCUSCOLORS='#ffffff #335577 #447799'
WMII_BACKGROUND='#333333'
@@ -34,7 +33,6 @@ export DMENU WMII_FONT WMII_FOCUSCOLORS WMII_SELCOLORS WMII_NORMCOLORS WMII_TERM
wmiir write /ctl << EOF
font $WMII_FONT
focuscolors $WMII_FOCUSCOLORS
-selcolors $WMII_SELCOLORS
normcolors $WMII_NORMCOLORS
grabmod $MODKEY
border 1
diff --git a/view.c b/view.c
@@ -77,7 +77,7 @@ create_view(const char *name) {
void
destroy_view(View *v) {
Area *a;
- View **i;
+ View **i, *tv;
while((a = v->area)) {
v->area = a->next;
@@ -87,13 +87,13 @@ destroy_view(View *v) {
if(*i == v) break;
*i = v->next;
write_event("DestroyTag %s\n", v->name);
- free(v);
if(v == screen->sel) {
- for(v=view; v && v->next; v=v->next)
- if(v->next == *i) break;
- if(v)
- focus_view(screen, v);
+ for(tv=view; tv && tv->next; tv=tv->next)
+ if(tv->next == *i) break;
+ if(tv)
+ focus_view(screen, tv);
}
+ free(v);
}
static void
diff --git a/wmii.h b/wmii.h
@@ -27,7 +27,7 @@ typedef unsigned long long uvlong;
typedef long long vlong;
#define BLITZ_FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
-#define BLITZ_SELCOLORS "#ffffff #335577 #447799"
+#define BLITZ_FOCUSCOLORS "#ffffff #335577 #447799"
#define BLITZ_NORMCOLORS "#222222 #eeeeee #666666"
typedef struct Blitz Blitz;
@@ -204,7 +204,7 @@ struct Ruleset {
/* global variables */
struct {
- BlitzColor selcolor;
+ BlitzColor focuscolor;
BlitzColor normcolor;
BlitzFont font;
uint border;
diff --git a/wmiir b/wmiir
@@ -1,12 +1,2 @@
#!/bin/sh
-export IXP_ADDRESS="$WMII_ADDRESS"
-flag=
-if [ "$1" = -v ]; then
- flag=-v; shift
-fi
-if [ "$1" = xwrite ]; then
- file="$2"; shift 2
- echo "$@" | ixpc $flag write $file
-else
- exec ixpc $flag $@
-fi
+exec ixpc -a "$WMII_ADDRESS" $@