changeset: 2393:dfe0d9631049
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sat Oct 18 21:27:53 2008 -0400
files: cmd/wmii/bar.c cmd/wmii/dat.h cmd/wmii/fs.c cmd/wmii/mouse.c
description:
Use the physical screen rectangle when calculating window movement
diff -r 6b25b0dd46cd -r dfe0d9631049 cmd/wmii/bar.c
--- a/cmd/wmii/bar.c Sat Oct 18 20:03:59 2008 -0400
+++ b/cmd/wmii/bar.c Sat Oct 18 21:27:53 2008 -0400
@@ -86,12 +86,13 @@
utflcpy(b->name, name, sizeof b->name);
b->col = def.normcolor;
- /* FIXME: Kludge. */
for(sp=screens; (s = *sp); sp++) {
i = bp - s->bar;
if(i < nelem(s->bar))
- b->bar = i;
+ break;
}
+ b->bar = i;
+ b->screen = s;
for(; *bp; bp = &bp[0]->next)
if(strcmp(bp[0]->name, name) >= 0)
@@ -167,6 +168,7 @@
r = rectsubpt(s->brect, s->brect.min);
fill(disp.ibuf, r, def.normcolor.bg);
+ border(disp.ibuf, r, 1, def.normcolor.border);
foreach_bar(s, b) {
align = Center;
if(b == s->bar[BRight])
diff -r 6b25b0dd46cd -r dfe0d9631049 cmd/wmii/dat.h
--- a/cmd/wmii/dat.h Sat Oct 18 20:03:59 2008 -0400
+++ b/cmd/wmii/dat.h Sat Oct 18 21:27:53 2008 -0400
@@ -150,8 +150,9 @@
char name[256];
int bar;
ushort id;
- Rectangle r;
CTuple col;
+ Rectangle r;
+ WMScreen* screen;
};
struct Regex {
diff -r 6b25b0dd46cd -r dfe0d9631049 cmd/wmii/fs.c
--- a/cmd/wmii/fs.c Sat Oct 18 20:03:59 2008 -0400
+++ b/cmd/wmii/fs.c Sat Oct 18 21:27:53 2008 -0400
@@ -633,6 +633,7 @@
void
fs_remove(Ixp9Req *r) {
IxpFileId *f;
+ WMScreen *s;
f = r->fid->aux;
if(!ixp_srv_verifyfile(f, lookup_file)) {
@@ -646,8 +647,9 @@
respond(r, Enoperm);
return;
case FsFBar:
+ s = f->p.bar->screen;
bar_destroy(f->next->p.bar_p, f->p.bar);
- bar_draw(screen);
+ bar_draw(s);
respond(r, nil);
break;
}
@@ -701,7 +703,7 @@
q = f->p.bar->text;
utflcpy(q, (char*)m.pos, sizeof ((Bar*)0)->text);
- bar_draw(screen);
+ bar_draw(f->p.bar->screen);
break;
}
respond(r, nil);
diff -r 6b25b0dd46cd -r dfe0d9631049 cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Sat Oct 18 20:03:59 2008 -0400
+++ b/cmd/wmii/mouse.c Sat Oct 18 21:27:53 2008 -0400
@@ -403,14 +403,14 @@
pt = addpt(d, f->r.min);
warppointer(pt);
}else {
- hrx = (double)(Dx(screen->r)
+ hrx = (double)(Dx(scr.rect)
+ Dx(frect)
- 2 * labelh(def.font))
- / Dx(screen->r);
- hry = (double)(Dy(screen->r)
+ / Dx(scr.rect);
+ hry = (double)(Dy(scr.rect)
+ Dy(frect)
- 3 * labelh(def.font))
- / Dy(screen->r);
+ / Dy(scr.rect);
pt.x = frect.max.x - labelh(def.font);
pt.y = frect.max.y - labelh(def.font);
Received on Sun Oct 19 2008 - 01:27:54 UTC
This archive was generated by hypermail 2.2.0 : Sun Oct 19 2008 - 01:36:05 UTC