mirror of https://github.com/0intro/wmii
Send orphaned clients to the "orphans" tag.
This commit is contained in:
parent
fac54ad57d
commit
0deae5eaff
|
@ -12,14 +12,12 @@
|
||||||
static Handlers handlers;
|
static Handlers handlers;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ClientMask =
|
ClientMask = StructureNotifyMask
|
||||||
StructureNotifyMask
|
| PropertyChangeMask
|
||||||
| PropertyChangeMask
|
| EnterWindowMask
|
||||||
| EnterWindowMask
|
| FocusChangeMask,
|
||||||
| FocusChangeMask,
|
ButtonMask = ButtonPressMask
|
||||||
ButtonMask =
|
| ButtonReleaseMask
|
||||||
ButtonPressMask
|
|
||||||
| ButtonReleaseMask
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static Group* group;
|
static Group* group;
|
||||||
|
@ -117,20 +115,19 @@ client_create(XWindow w, XWindowAttributes *wa) {
|
||||||
XAddToSaveSet(display, w);
|
XAddToSaveSet(display, w);
|
||||||
XSelectInput(display, c->w.w, ClientMask);
|
XSelectInput(display, c->w.w, ClientMask);
|
||||||
|
|
||||||
fwa.override_redirect = True;
|
fwa.override_redirect = true;
|
||||||
fwa.background_pixmap = None;
|
fwa.background_pixmap = None;
|
||||||
fwa.event_mask =
|
fwa.event_mask = SubstructureRedirectMask
|
||||||
SubstructureRedirectMask
|
| SubstructureNotifyMask
|
||||||
| SubstructureNotifyMask
|
| ExposureMask
|
||||||
| ExposureMask
|
| EnterWindowMask
|
||||||
| EnterWindowMask
|
| PointerMotionMask
|
||||||
| PointerMotionMask
|
| ButtonPressMask
|
||||||
| ButtonPressMask
|
| ButtonReleaseMask;
|
||||||
| ButtonReleaseMask;
|
c->framewin = createwindow(&scr.root, c->r, scr.depth, InputOutput,
|
||||||
c->framewin = createwindow(&scr.root, c->r, scr.depth, InputOutput, &fwa,
|
&fwa, CWOverrideRedirect
|
||||||
CWOverrideRedirect
|
| CWEventMask
|
||||||
| CWEventMask
|
| CWBackPixmap);
|
||||||
| CWBackPixmap);
|
|
||||||
c->framewin->aux = c;
|
c->framewin->aux = c;
|
||||||
c->w.aux = c;
|
c->w.aux = c;
|
||||||
sethandler(c->framewin, &framehandler);
|
sethandler(c->framewin, &framehandler);
|
||||||
|
@ -1043,25 +1040,32 @@ apply_tags(Client *c, const char *tags) {
|
||||||
qsort(toks, j, sizeof *toks, strpcmp);
|
qsort(toks, j, sizeof *toks, strpcmp);
|
||||||
uniq(toks);
|
uniq(toks);
|
||||||
|
|
||||||
|
/* I'm setting a new convention here by putting free calls on
|
||||||
|
* the same line as the list processing calls which obselete
|
||||||
|
* their variables. It may be odd, but it makes the code
|
||||||
|
* flow much clearer;
|
||||||
|
*/
|
||||||
|
|
||||||
s = join(toks, "+");
|
s = join(toks, "+");
|
||||||
utflcpy(c->tags, s, sizeof c->tags);
|
utflcpy(c->tags, s, sizeof c->tags); free(s);
|
||||||
free(s);
|
changeprop_string(&c->w, "_WMII_TAGS", c->tags);
|
||||||
|
|
||||||
free(c->retags);
|
free(c->retags);
|
||||||
|
|
||||||
p = view_names();
|
p = view_names();
|
||||||
q = grep(p, c->tagre.regc, 0);
|
q = grep(p, c->tagre.regc, 0); free(p);
|
||||||
free(p);
|
p = grep(q, c->tagvre.regc, GInvert); free(q);
|
||||||
p = grep(q, c->tagvre.regc, GInvert);
|
c->retags = comm(CRight, toks, p); free(p);
|
||||||
free(q);
|
|
||||||
c->retags = comm(CRight, toks, p);
|
if(c->retags[0] == nil && toks[0] == nil) {
|
||||||
free(p);
|
if(c->tagre.regex)
|
||||||
|
toks[0] = "orphans";
|
||||||
|
else
|
||||||
|
toks[0] = screen->sel->name;
|
||||||
|
toks[1] = nil;
|
||||||
|
}
|
||||||
|
|
||||||
p = comm(~0, c->retags, toks);
|
p = comm(~0, c->retags, toks);
|
||||||
client_setviews(c, p);
|
client_setviews(c, p); free(p);
|
||||||
free(p);
|
|
||||||
|
|
||||||
changeprop_string(&c->w, "_WMII_TAGS", c->tags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue