mirror of
https://github.com/0intro/wmii
synced 2025-02-10 19:34:37 +03:00
fixed issues reported by DenisG and ality
This commit is contained in:
parent
c0cf389d84
commit
a8d3c69f03
@ -305,7 +305,8 @@ mouse_move(Client *c)
|
||||
int snaph = rect.height * def.snap / 1000;
|
||||
unsigned int num;
|
||||
unsigned int dmask;
|
||||
XRectangle *rects = rectangles(&num);
|
||||
XRectangle *rects = rectangles(c->frame[c->sel]->area->tag,
|
||||
area2index(c->frame[c->sel]->area) == 0, &num);
|
||||
XRectangle frect = c->frame[c->sel]->rect;
|
||||
XPoint pt;
|
||||
|
||||
@ -550,7 +551,8 @@ mouse_resize(Client *c, Align align)
|
||||
int snaph = rect.height * def.snap / 1000;
|
||||
unsigned int dmask;
|
||||
unsigned int num;
|
||||
XRectangle *rects = rectangles(&num);
|
||||
XRectangle *rects = rectangles(c->frame[c->sel]->area->tag,
|
||||
area2index(c->frame[c->sel]->area) == 0, &num);
|
||||
XRectangle frect = c->frame[c->sel]->rect;
|
||||
XRectangle origin = frect;
|
||||
|
||||
|
@ -122,11 +122,16 @@ match_tags(Client *c)
|
||||
rules = parse(def.rules, &n);
|
||||
c->tags[0] = 0;
|
||||
tags = match(rules, n, c->name);
|
||||
if(strlen(tags))
|
||||
if(strlen(tags)) {
|
||||
if(strlen(c->tags))
|
||||
cext_strlcat(c->tags, " ", sizeof(c->tags));
|
||||
cext_strlcat(c->tags, tags, sizeof(c->tags));
|
||||
}
|
||||
tags = match(rules, n, c->classinst);
|
||||
if(strlen(tags))
|
||||
if(strlen(tags)) {
|
||||
if(strlen(c->tags))
|
||||
cext_strlcat(c->tags, " ", sizeof(c->tags));
|
||||
cext_strlcat(c->tags, tags, sizeof(c->tags));
|
||||
|
||||
}
|
||||
free(rules);
|
||||
}
|
||||
|
47
cmd/wm/tag.c
47
cmd/wm/tag.c
@ -95,32 +95,33 @@ focus_tag(Tag *t)
|
||||
}
|
||||
|
||||
XRectangle *
|
||||
rectangles(unsigned int *num)
|
||||
rectangles(Tag *t, Bool isfloat, unsigned int *num)
|
||||
{
|
||||
XRectangle *result = 0;
|
||||
int i, j = 0;
|
||||
Window d1, d2;
|
||||
Window *wins;
|
||||
XWindowAttributes wa;
|
||||
XRectangle r;
|
||||
XRectangle *result = nil;
|
||||
unsigned int i;
|
||||
|
||||
*num = 0;
|
||||
if(isfloat)
|
||||
*num = t->area[0]->nframe;
|
||||
else {
|
||||
for(i = 1; i < t->narea; i++)
|
||||
*num += t->area[i]->nframe;
|
||||
}
|
||||
|
||||
if(XQueryTree(dpy, root, &d1, &d2, &wins, num)) {
|
||||
if(*num) {
|
||||
result = cext_emallocz(*num * sizeof(XRectangle));
|
||||
for(i = 0; i < *num; i++) {
|
||||
if(!XGetWindowAttributes(dpy, wins[i], &wa))
|
||||
continue;
|
||||
if(wa.override_redirect && (wa.map_state == IsViewable)) {
|
||||
r.x = wa.x;
|
||||
r.y = wa.y;
|
||||
r.width = wa.width;
|
||||
r.height = wa.height;
|
||||
result[j++] = r;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(wins)
|
||||
XFree(wins);
|
||||
*num = j;
|
||||
if(isfloat) {
|
||||
for(i = 0; i < *num; i++)
|
||||
result[i] = t->area[0]->frame[0]->rect;
|
||||
}
|
||||
else {
|
||||
unsigned int j, n = 0;
|
||||
for(i = 1; i < t->narea; i++) {
|
||||
for(j = 0; j < t->area[i]->nframe; j++)
|
||||
result[n++] = t->area[i]->frame[j]->rect;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,7 @@ void match_tags(Client *c);
|
||||
Tag *alloc_tag(char *name);
|
||||
char *destroy_tag(Tag *t);
|
||||
void focus_tag(Tag *t);
|
||||
XRectangle *rectangles(unsigned int *num);
|
||||
XRectangle *rectangles(Tag *t, Bool isfloat, unsigned int *num);
|
||||
int tid2index(unsigned short id);
|
||||
void select_tag(char *arg);
|
||||
int tag2index(Tag *t);
|
||||
|
@ -8,9 +8,6 @@ PATH=$HOME/.wmii-3:CONFPREFIX/wmii-3:$PATH export PATH
|
||||
WMII_ADDRESS=unix!/tmp/ns.$USER.$DISPLAY/wmii export WMII_ADDRESS
|
||||
|
||||
mkdir -m 700 /tmp/ns.$USER.$DISPLAY 2>/dev/null
|
||||
wmiiwm -a $WMII_ADDRESS &
|
||||
wmiiwmpid=$!
|
||||
mkdir $HOME/.wmii-3 2>/dev/null && welcome &
|
||||
sleep 1
|
||||
wmiirc &
|
||||
wait $wmiiwmpid
|
||||
exec wmiiwm -a $WMII_ADDRESS
|
||||
|
Loading…
x
Reference in New Issue
Block a user