wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit e620aa3e45d3de7f417ab657106623540fca4cb7
parent 83654ad78fc38c5348a95db583997eac9a2f8575
Author: garbeam <garbeam@mmv.wmii.de>
Date:   Sun,  1 Jan 2006 22:35:11 +0200

removed unnecessary stuff from frame'fs


Diffstat:
cmd/wm/client.c | 12++++++------
cmd/wm/frame.c | 46++++++++--------------------------------------
cmd/wm/wm.h | 10----------
rc/wmiirc | 31+++++++++++++++----------------
4 files changed, 29 insertions(+), 70 deletions(-)

diff --git a/cmd/wm/client.c b/cmd/wm/client.c @@ -228,23 +228,23 @@ draw_client(Client * client) if((f == sel_frame()) && (c == f->sel)) { d.bg = blitz_loadcolor(dpy, screen_num, - f->file[F_SEL_BG_COLOR]->content); + def[WM_SEL_BG_COLOR]->content); d.fg = blitz_loadcolor(dpy, screen_num, - f->file[F_SEL_FG_COLOR]->content); + def[WM_SEL_FG_COLOR]->content); d.border = blitz_loadcolor(dpy, screen_num, - f->file[F_SEL_BORDER_COLOR]->content); + def[WM_SEL_BORDER_COLOR]->content); } else { d.bg = blitz_loadcolor(dpy, screen_num, - f->file[F_NORM_BG_COLOR]->content); + def[WM_NORM_BG_COLOR]->content); d.fg = blitz_loadcolor(dpy, screen_num, - f->file[F_NORM_FG_COLOR]->content); + def[WM_NORM_FG_COLOR]->content); d.border = blitz_loadcolor(dpy, screen_num, - f->file[F_NORM_BORDER_COLOR]->content); + def[WM_NORM_BORDER_COLOR]->content); } blitz_drawlabel(dpy, &d); XSync(dpy, False); diff --git a/cmd/wm/frame.c b/cmd/wm/frame.c @@ -60,36 +60,6 @@ alloc_frame(XRectangle * r) snprintf(buf, MAX_BUF, "/detached/frame/%d/locked", id); f->file[F_LOCKED] = wmii_create_ixpfile(ixps, buf, def[WM_LOCKED]->content); - snprintf(buf, MAX_BUF, "/detached/frame/%d/sstyle/bgcolor", id); - f->file[F_SEL_BG_COLOR] = - wmii_create_ixpfile(ixps, buf, def[WM_SEL_BG_COLOR]->content); - snprintf(buf, MAX_BUF, "/detached/frame/%d/sstyle/fgcolor", id); - f->file[F_SEL_FG_COLOR] = - wmii_create_ixpfile(ixps, buf, def[WM_SEL_FG_COLOR]->content); - snprintf(buf, MAX_BUF, "/detached/frame/%d/sstyle/bordercolor", id); - f->file[F_SEL_BORDER_COLOR] = - wmii_create_ixpfile(ixps, buf, def[WM_SEL_BORDER_COLOR]->content); - snprintf(buf, MAX_BUF, "/detached/frame/%d/nstyle/bgcolor", id); - f->file[F_NORM_BG_COLOR] = - wmii_create_ixpfile(ixps, buf, def[WM_NORM_BG_COLOR]->content); - snprintf(buf, MAX_BUF, "/detached/frame/%d/nstyle/fgcolor", id); - f->file[F_NORM_FG_COLOR] = - wmii_create_ixpfile(ixps, buf, def[WM_NORM_FG_COLOR]->content); - snprintf(buf, MAX_BUF, "/detached/frame/%d/nstyle/bordercolor", id); - f->file[F_NORM_BORDER_COLOR] = - wmii_create_ixpfile(ixps, buf, def[WM_NORM_BORDER_COLOR]->content); - snprintf(buf, MAX_BUF, "/detached/frame/%d/event/b2press", id); - f->file[F_EVENT_B2PRESS] = - wmii_create_ixpfile(ixps, buf, def[WM_EVENT_B2PRESS]->content); - snprintf(buf, MAX_BUF, "/detached/frame/%d/event/b3press", id); - f->file[F_EVENT_B3PRESS] = - wmii_create_ixpfile(ixps, buf, def[WM_EVENT_B3PRESS]->content); - snprintf(buf, MAX_BUF, "/detached/frame/%d/event/b4press", id); - f->file[F_EVENT_B4PRESS] = - wmii_create_ixpfile(ixps, buf, def[WM_EVENT_B4PRESS]->content); - snprintf(buf, MAX_BUF, "/detached/frame/%d/event/b5press", id); - f->file[F_EVENT_B5PRESS] = - wmii_create_ixpfile(ixps, buf, def[WM_EVENT_B5PRESS]->content); id++; wa.override_redirect = 1; @@ -271,23 +241,23 @@ draw_frame(Frame * f) if(f == sel_frame()) { d.bg = blitz_loadcolor(dpy, screen_num, - f->file[F_SEL_BG_COLOR]->content); + def[WM_SEL_BG_COLOR]->content); d.fg = blitz_loadcolor(dpy, screen_num, - f->file[F_SEL_FG_COLOR]->content); + def[WM_SEL_FG_COLOR]->content); d.border = blitz_loadcolor(dpy, screen_num, - f->file[F_SEL_BORDER_COLOR]->content); + def[WM_SEL_BORDER_COLOR]->content); } else { d.bg = blitz_loadcolor(dpy, screen_num, - f->file[F_NORM_BG_COLOR]->content); + def[WM_NORM_BG_COLOR]->content); d.fg = blitz_loadcolor(dpy, screen_num, - f->file[F_NORM_FG_COLOR]->content); + def[WM_NORM_FG_COLOR]->content); d.border = blitz_loadcolor(dpy, screen_num, - f->file[F_NORM_BORDER_COLOR]->content); + def[WM_NORM_BORDER_COLOR]->content); } d.rect = f->rect; d.rect.x = d.rect.y = 0; @@ -315,7 +285,7 @@ handle_frame_buttonpress(XButtonEvent * e, Frame * f) return; } f->area->layout->focus(f, False); - bindex = F_EVENT_B2PRESS - 2 + e->button; + bindex = WM_EVENT_B2PRESS - 2 + e->button; /* frame mouse handling */ if(f->file[bindex]->content) wmii_spawn(dpy, f->file[bindex]->content); @@ -342,7 +312,7 @@ attach_client_to_frame(Frame * f, Client * client) resize_frame(f, &f->rect, 0); reparent_client(client, f->win, client->rect.x, client->rect.y); show_client(client); - sel_client(client); + focus_client(client); } void diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h @@ -39,16 +39,6 @@ enum { F_TAB, F_HANDLE_INC, F_LOCKED, - F_SEL_BG_COLOR, - F_SEL_FG_COLOR, - F_SEL_BORDER_COLOR, - F_NORM_BG_COLOR, - F_NORM_FG_COLOR, - F_NORM_BORDER_COLOR, - F_EVENT_B2PRESS, - F_EVENT_B3PRESS, - F_EVENT_B4PRESS, - F_EVENT_B5PRESS, F_LAST }; diff --git a/rc/wmiirc b/rc/wmiirc @@ -53,22 +53,14 @@ fn items { } | sort | wmiir -f & } -fn frameconf { - wmiir write $1/event/b2press 'wmiir write /wm/ctl close' - normstyle $1/nstyle - selstyle $1/sstyle - wmiir write $1/tab $TAB - wmiir write $1/handleinc $HANDLEINC - if(~ $2 refresh) - wmiir write $1/geometry +0,+0,+0,+0 # causes refresh -} - fn framesconf { - for(frame in `{wmiir read $1 | grep '^[0-9]'}) - frameconf $1/$frame $2 + for(frame in `{wmiir read $1 | grep '^[0-9]'}) { + wmiir write $1/$frame/tab $TAB + wmiir write $1/$frame/handleinc $HANDLEINC + wmiir write $1/$frame/geometry +0,+0,+0,+0 # causes refresh + } } - # WMIIBAR CONFIGURATION fn barsucks { @@ -120,10 +112,17 @@ wmiir write /wm/event/pageupdate \ 'wmiir write /bar/'^$plab^'/data `{wmiir read /wm/sel/name} &&' ^ \ 'wmiir write /bar/'^$llab^'/data `{wmiir read /wm/sel/layout/sel/name}' -for(layout in /wm/sel/layout/float /wm/sel/layout/managed) - framesconf /wm/sel/layout/$layout/frame refresh -frameconf /wm/default norefresh +for(layout in /wm/sel/layout/float /wm/sel/layout/managed) { + framesconf $layout +} +wmiir write /wm/default/sstyle/fgcolor $SEL_FG_COLOR +wmiir write /wm/default/sstyle/bgcolor $SEL_BG_COLOR +wmiir write /wm/default/sstyle/bordercolor $SEL_BORDER_COLOR +wmiir write /wm/default/nstyle/fgcolor $NORM_FG_COLOR +wmiir write /wm/default/nstyle/bgcolor $NORM_BG_COLOR +wmiir write /wm/default/nstyle/bordercolor $NORM_BORDER_COLOR +wmiir write /wm/default/event/b2press 'wmiir write /wm/ctl close' # WMIIKEYS CONFIGURATION