mirror of
https://github.com/0intro/wmii
synced 2024-11-22 22:02:30 +03:00
fixed serious bug in /wm/default/area/
This commit is contained in:
parent
829191aa19
commit
01caae7040
@ -29,12 +29,13 @@ void
|
||||
focus_client(Client * c)
|
||||
{
|
||||
Frame *f = 0;
|
||||
/*
|
||||
static Client *old = nil;
|
||||
|
||||
if(old && (old != c)) {
|
||||
ungrab_client(old, AnyModifier, AnyButton);
|
||||
grab_client(old, AnyModifier, AnyButton);
|
||||
}
|
||||
}*/
|
||||
|
||||
/* sel client */
|
||||
ungrab_client(c, AnyModifier, AnyButton);
|
||||
@ -46,7 +47,7 @@ focus_client(Client * c)
|
||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||
XSync(dpy, False);
|
||||
invoke_wm_event(def[WM_EVENT_CLIENT_UPDATE]);
|
||||
old = c;
|
||||
/*old = c;*/
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -41,7 +41,7 @@ alloc_layout(Page * p, char *layout)
|
||||
l->file[L_NAME]->after_write = handle_after_write_layout;
|
||||
l->def = match_layout_def(layout);
|
||||
l->def->init(l, nil);
|
||||
p->file[P_SEL_AREA]->content = l->file[L_PREFIX]->content;
|
||||
p->file[P_SEL_LAYOUT]->content = l->file[L_PREFIX]->content;
|
||||
return l;
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ focus_layout(Layout *l)
|
||||
Page *p = l->page;
|
||||
Frame *f;
|
||||
p->sel = l;
|
||||
p->file[P_SEL_AREA]->content = l->file[L_PREFIX]->content;
|
||||
p->file[P_SEL_LAYOUT]->content = l->file[L_PREFIX]->content;
|
||||
if((f = l->def->sel(l)))
|
||||
l->def->focus(f, False);
|
||||
}
|
||||
|
@ -34,10 +34,10 @@ alloc_page()
|
||||
snprintf(buf, sizeof(buf), "/%d/name", (int)npages);
|
||||
new->file[P_NAME] = wmii_create_ixpfile(ixps, buf, buf2);
|
||||
snprintf(buf, sizeof(buf), "/%d/layout/", (int)npages);
|
||||
new->file[P_AREA_PREFIX] = ixp_create(ixps, buf);
|
||||
new->file[P_LAYOUT_PREFIX] = ixp_create(ixps, buf);
|
||||
snprintf(buf, sizeof(buf), "/%d/layout/sel", (int)npages);
|
||||
new->file[P_SEL_AREA] = ixp_create(ixps, buf);
|
||||
new->file[P_SEL_AREA]->bind = 1; /* mount point */
|
||||
new->file[P_SEL_LAYOUT] = ixp_create(ixps, buf);
|
||||
new->file[P_SEL_LAYOUT]->bind = 1; /* mount point */
|
||||
snprintf(buf, sizeof(buf), "/%d/ctl", (int)npages);
|
||||
new->file[P_CTL] = ixp_create(ixps, buf);
|
||||
new->file[P_CTL]->after_write = handle_after_write_page;
|
||||
|
17
cmd/wm/wm.c
17
cmd/wm/wm.c
@ -603,7 +603,7 @@ void
|
||||
handle_before_read(IXPServer * s, File * f)
|
||||
{
|
||||
char buf[64];
|
||||
if(f == def[WM_AREA_GEOMETRY]) {
|
||||
if(f == def[WM_MANAGED_GEOMETRY]) {
|
||||
snprintf(buf, 64, "%d %d %d %d", layout_rect.x, layout_rect.y,
|
||||
layout_rect.width, layout_rect.height);
|
||||
if(f->content)
|
||||
@ -629,8 +629,8 @@ handle_after_write(IXPServer * s, File * f)
|
||||
} else if(f == def[WM_FONT]) {
|
||||
XFreeFont(dpy, font);
|
||||
font = blitz_getfont(dpy, def[WM_FONT]->content);
|
||||
} else if(f == def[WM_AREA_GEOMETRY]) {
|
||||
char *geom = def[WM_AREA_GEOMETRY]->content;
|
||||
} else if(f == def[WM_MANAGED_GEOMETRY]) {
|
||||
char *geom = def[WM_MANAGED_GEOMETRY]->content;
|
||||
if(geom && strrchr(geom, ' ')) {
|
||||
layout_rect = rect;
|
||||
blitz_strtorect(&rect, &layout_rect, geom);
|
||||
@ -674,17 +674,16 @@ init_cursors()
|
||||
static void
|
||||
init_default()
|
||||
{
|
||||
def[WM_DETACHED_FRAME] = ixp_create(ixps, "/detached/frame");
|
||||
def[WM_DETACHED_CLIENT] = ixp_create(ixps, "/detached/client");
|
||||
def[WM_DETACHED_FRAME] = ixp_create(ixps, "/detached");
|
||||
def[WM_TRANS_COLOR] =
|
||||
wmii_create_ixpfile(ixps, "/default/transcolor",
|
||||
BLITZ_SEL_FG_COLOR);
|
||||
def[WM_TRANS_COLOR]->after_write = handle_after_write;
|
||||
def[WM_AREA_GEOMETRY] =
|
||||
wmii_create_ixpfile(ixps, "/default/layout/geometry",
|
||||
def[WM_MANAGED_GEOMETRY] =
|
||||
wmii_create_ixpfile(ixps, "/default/geometry",
|
||||
BLITZ_SEL_FG_COLOR);
|
||||
def[WM_AREA_GEOMETRY]->after_write = handle_after_write;
|
||||
def[WM_AREA_GEOMETRY]->before_read = handle_before_read;
|
||||
def[WM_MANAGED_GEOMETRY]->after_write = handle_after_write;
|
||||
def[WM_MANAGED_GEOMETRY]->before_read = handle_before_read;
|
||||
def[WM_SEL_BG_COLOR] =
|
||||
wmii_create_ixpfile(ixps, "/default/sstyle/bgcolor",
|
||||
BLITZ_SEL_BG_COLOR);
|
||||
|
@ -12,8 +12,8 @@
|
||||
enum {
|
||||
P_PREFIX,
|
||||
P_NAME,
|
||||
P_AREA_PREFIX,
|
||||
P_SEL_AREA,
|
||||
P_LAYOUT_PREFIX,
|
||||
P_SEL_LAYOUT,
|
||||
P_CTL,
|
||||
P_LAST
|
||||
};
|
||||
@ -43,9 +43,8 @@ enum {
|
||||
enum {
|
||||
WM_CTL,
|
||||
WM_DETACHED_FRAME,
|
||||
WM_DETACHED_CLIENT,
|
||||
WM_TRANS_COLOR,
|
||||
WM_AREA_GEOMETRY,
|
||||
WM_MANAGED_GEOMETRY,
|
||||
WM_SEL_BG_COLOR,
|
||||
WM_SEL_BORDER_COLOR,
|
||||
WM_SEL_FG_COLOR,
|
||||
|
@ -71,9 +71,9 @@ fn barsucks {
|
||||
|
||||
wmiir write /bar/geometry $BAR_ALIGN
|
||||
if (~ $BAR_ALIGN south)
|
||||
wmiir write /bar/event/resize 'val=`{wmiir read /bar/geometry|awk ''{print "+0 +0 +0 -"$4}''} wmiir write /wm/default/area/geometry $"val'
|
||||
wmiir write /bar/event/resize 'val=`{wmiir read /bar/geometry|awk ''{print "+0 +0 +0 -"$4}''} wmiir write /wm/default/geometry $"val'
|
||||
if not
|
||||
wmiir write /bar/event/resize 'val=`{wmiir read /bar/geometry|awk ''{print "+0 +"$4" +0 -"$4}''} wmiir write /wm/default/area/geometry $"val'
|
||||
wmiir write /bar/event/resize 'val=`{wmiir read /bar/geometry|awk ''{print "+0 +"$4" +0 -"$4}''} wmiir write /wm/default/geometry $"val'
|
||||
|
||||
wmiir write /bar/ctl reset
|
||||
wmiir write /bar/font $FONT
|
||||
|
Loading…
Reference in New Issue
Block a user