mirror of https://github.com/0intro/wmii
Fix annoyance with window placement. Cleanup.
This commit is contained in:
parent
449df09d6b
commit
7a91559743
|
@ -321,7 +321,7 @@ place_frame(Frame *f) {
|
|||
if(c->trans)
|
||||
return;
|
||||
if(c->fullscreen || c->w.hints->position || starting) {
|
||||
f->r = gravclient(c, c->w.r);
|
||||
f->r = gravclient(c, c->r);
|
||||
return;
|
||||
}
|
||||
if(!field) {
|
||||
|
|
|
@ -92,7 +92,9 @@ manage_client(Client *c) {
|
|||
Client *trans;
|
||||
char *tags;
|
||||
|
||||
tags = gettextproperty(&c->w, "_WIN_TAGS");
|
||||
tags = gettextproperty(&c->w, "_WMII_TAGS");
|
||||
if(tags == nil)
|
||||
tags = gettextproperty(&c->w, "_WIN_TAGS");
|
||||
|
||||
if((trans = win2client(c->trans)))
|
||||
strncpy(c->tags, trans->tags, sizeof(c->tags));
|
||||
|
@ -119,7 +121,7 @@ manage_client(Client *c) {
|
|||
flushevents(EnterWindowMask, False);
|
||||
}
|
||||
|
||||
static int
|
||||
static int /* Temporary Xlib error handler */
|
||||
ignoreerrors(Display *d, XErrorEvent *e) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -268,7 +270,8 @@ frame_hints(Frame *f, Rectangle r, Align sticky) {
|
|||
static void
|
||||
set_client_state(Client * c, int state) {
|
||||
long data[] = { state, None };
|
||||
changeprop(&c->w, "WM_STATE", "WM_STATE", data, nelem(data));
|
||||
|
||||
changeprop_long(&c->w, "WM_STATE", "WM_STATE", data, nelem(data));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -913,7 +916,7 @@ apply_tags(Client *c, const char *tags) {
|
|||
|
||||
update_client_views(c, toks);
|
||||
|
||||
changeprop(&c->w, "_WIN_TAGS", "UTF8_STRING", c->tags, strlen(c->tags));
|
||||
changeprop_char(&c->w, "_WMII_TAGS", "UTF8_STRING", c->tags, strlen(c->tags));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -217,6 +217,9 @@ ulong getproperty(Window *w, char *prop, char *type, Atom *actual, ulong offset,
|
|||
char *gettextproperty(Window*, char*);
|
||||
int gettextlistproperty(Window *w, char *name, char **ret[]);
|
||||
void changeproperty(Window*, char *prop, char *type, int width, uchar *data, int n);
|
||||
void changeprop_char(Window *w, char *prop, char *type, char data[], int len);
|
||||
void changeprop_short(Window *w, char *prop, char *type, short data[], int len);
|
||||
void changeprop_long(Window *w, char *prop, char *type, long data[], int len);
|
||||
void setfocus(Window*, int mode);
|
||||
Point querypointer(Window*);
|
||||
void warppointer(Point);
|
||||
|
|
|
@ -147,7 +147,7 @@ static void
|
|||
init_atoms(void) {
|
||||
Atom net[] = { xatom("_NET_SUPPORTED"), xatom("_NET_WM_NAME") };
|
||||
|
||||
changeprop(&scr.root, "_NET_SUPPORTED", "ATOM", net, nelem(net));
|
||||
changeprop_long(&scr.root, "_NET_SUPPORTED", "ATOM", net, nelem(net));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -546,10 +546,25 @@ xatom(char *name) {
|
|||
}
|
||||
|
||||
void
|
||||
changeproperty(Window *w, char *prop, char *type, int width, uchar *data, int n) {
|
||||
changeproperty(Window *w, char *prop, char *type, int width, uchar data[], int n) {
|
||||
XChangeProperty(display, w->w, xatom(prop), xatom(type), width, PropModeReplace, data, n);
|
||||
}
|
||||
|
||||
void
|
||||
changeprop_char(Window *w, char *prop, char *type, char data[], int len) {
|
||||
changeproperty(w, prop, type, 8, (uchar*)data, len);
|
||||
}
|
||||
|
||||
void
|
||||
changeprop_short(Window *w, char *prop, char *type, short data[], int len) {
|
||||
changeproperty(w, prop, type, 16, (uchar*)data, len);
|
||||
}
|
||||
|
||||
void
|
||||
changeprop_long(Window *w, char *prop, char *type, long data[], int len) {
|
||||
changeproperty(w, prop, type, 32, (uchar*)data, len);
|
||||
}
|
||||
|
||||
void
|
||||
freestringlist(char *list[]) {
|
||||
XFreeStringList(list);
|
||||
|
|
Loading…
Reference in New Issue