changeset: 2172:3a439a38ca71
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Wed Jun 27 21:47:55 2007 -0400
summary: Fix MWM hints. Fix ConfigureRequest botch.
diff -r ccdbf3e9bf10 -r 3a439a38ca71 cmd/wmii/client.c
--- a/cmd/wmii/client.c Wed Jun 27 13:35:08 2007 -0400
+++ b/cmd/wmii/client.c Wed Jun 27 21:47:55 2007 -0400
@@ -222,10 +222,10 @@ gravclient(Client *c, Rectangle rd) {
r = c->sel->r;
else
r = c->sel->revert;
- r = gravitate(c->w.r, r, h->grav);
+ r = gravitate(r, c->r, h->grav);
if(h->gravstatic)
r = rectaddpt(r, sp);
- return r;
+ return frame2client(c->sel, r);
}else {
r = client2frame(nil, rd);
r = gravitate(r, rd, h->grav);
@@ -528,35 +528,35 @@ updatemwm(Client *c) {
All = 0x1,
Border = 0x2,
Title = 0x8,
+ FlagDecor = 0x2,
+ Flags = 0,
+ Decor = 2,
};
Rectangle r;
- ulong *ret, decor;
+ ulong *ret;
Atom real;
int n;
n = getproperty(&c->w, "_MOTIF_WM_HINTS", "_MOTIF_WM_HINTS", &real,
- 2L, (void*)&ret, 1L);
-
- if(n == 0) {
+ 0L, (void*)&ret, 3L);
+
+ if(c->sel)
+ r = frame2client(c->sel, c->sel->r);
+ if(n >= 3 && (ret[Flags]&FlagDecor)) {
+ if(ret[Decor]&All)
+ ret[Decor] ^= ~0;
+ c->borderless = ((ret[Decor]&Border)==0);
+ c->titleless = ((ret[Decor]&Title)==0);
+ }else {
c->borderless = 0;
c->titleless = 0;
- }else {
- decor = *ret;
- free(ret);
-
- if(c->sel)
- r = frame2client(c->sel, c->sel->r);
-
- if(decor&All)
- decor ^= ~0;
- c->borderless = ((decor&Border)==0);
- c->titleless = ((decor&Title)==0);
-
- if(c->sel) {
- r = client2frame(c->sel, c->sel->r);
- resize_client(c, &r);
- draw_frame(c->sel);
- }
+ }
+ free(ret);
+
+ if(c->sel) {
+ r = client2frame(c->sel, r);
+ resize_client(c, &r);
+ draw_frame(c->sel);
}
}
diff -r ccdbf3e9bf10 -r 3a439a38ca71 cmd/wmii/utf.c
--- a/cmd/wmii/utf.c Wed Jun 27 13:35:08 2007 -0400
+++ b/cmd/wmii/utf.c Wed Jun 27 21:47:55 2007 -0400
@@ -320,6 +320,7 @@ utfutf(char *s1, char *s2)
return 0;
}
+/* This iconv crud is not by Ken or Rob. It is in the Public Domain. */
char*
toutf8n(char *str, size_t nstr) {
static iconv_t cd;
diff -r ccdbf3e9bf10 -r 3a439a38ca71 cmd/wmii/x11.c
--- a/cmd/wmii/x11.c Wed Jun 27 13:35:08 2007 -0400
+++ b/cmd/wmii/x11.c Wed Jun 27 21:47:55 2007 -0400
@@ -575,17 +575,21 @@ getproperty(Window *w, char *prop, char
Atom typea;
ulong n, extra;
int status, format;
-
+
typea = (type ? xatom(type) : 0L);
status = XGetWindowProperty(display, w->w,
xatom(prop), offset, length, False /* delete */,
typea, actual, &format, &n, &extra, ret);
- if(status != Success)
+ if(status != Success) {
+ *ret = nil;
return 0;
- if(n == 0)
+ }
+ if(n == 0) {
free(*ret);
+ *ret = nil;
+ }
return n;
}
@@ -801,5 +805,5 @@ gravitate(Rectangle rc, Rectangle rf, Po
d = divpt(d, Pt(2, 2));
d = mulpt(d, grav);
- return rectaddpt(rc, d);
-}
+ return rectsubpt(rc, d);
+}
Received on Thu Jun 28 2007 - 03:48:54 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:24 UTC