commit 0928b860bfafe3ec49cf647c24945d2b54dfc0bf
parent 4ec3dc80e6c7ea2da42f735351a0ba6c0fb88a52
Author: Kris Maglione <jg@suckless.org>
Date: Wed, 21 May 2008 12:21:56 -0400
Fix resizing issue, focus issue. Minor cleanup.
Diffstat:
6 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/cmd/wmii.sh.sh b/cmd/wmii.sh.sh
@@ -76,7 +76,6 @@ wi_events() {
_sed="s/^$2//"
shift 2
fi
- #cho "$(_wi_text | awk "$(_wi_script)")"
eval "$(_wi_text | awk "$(_wi_script)")"
}
diff --git a/cmd/wmii/client.c b/cmd/wmii/client.c
@@ -221,7 +221,6 @@ client_manage(Client *c) {
if(newgroup) {
if(f->area != f->view->sel)
f->view->oldsel = f->view->sel;
- frame_focus(f);
}else {
frame_restack(c->sel, c->sel->area->sel);
view_restack(c->sel->view);
diff --git a/cmd/wmii/column.c b/cmd/wmii/column.c
@@ -149,7 +149,7 @@ column_scale(Area *a) {
return;
/* Kludge. This should be idempotent, but the algorithm is
- * flawed, so it's not. Well, with this, it is.
+ * flawed, so it's not. This is far from perfect.
*/
if(eqrect(a->r, a->r_old) && a->frame == a->frame_old) {
for(f=a->frame; f; f=f->anext)
diff --git a/cmd/wmii/float.c b/cmd/wmii/float.c
@@ -114,7 +114,11 @@ float_placeframe(Frame *f) {
*/
vector_rpush(vp, a->r);
for(ff=a->frame; ff; ff=ff->anext) {
- if(ff == f)
+ /* TODO: Find out why this is needed.
+ * The frame hasn't been inserted yet, but somehow,
+ * its old rectangle winds up in the list.
+ */
+ if(ff->client == f->client)
continue;
fr = ff->r;
vp2->n = 0;
diff --git a/cmd/wmii/view.c b/cmd/wmii/view.c
@@ -217,8 +217,8 @@ view_focus(WMScreen *s, View *v) {
XGrabServer(display);
_view_select(v);
- view_arrange(v);
update_frame_selectors(v);
+ view_arrange(v);
div_update_all();
fscrn = false;
for(a=v->area; a; a=an) {
@@ -294,8 +294,8 @@ view_attach(View *v, Frame *f) {
a = v->area->next;
area_attach(a, f);
-
/* TODO: Decide whether to focus this frame */
+ frame_focus(f);
if(c->sel == nil)
c->sel = f;
diff --git a/libwmii_hack/hack.c b/libwmii_hack/hack.c
@@ -3,6 +3,7 @@
*/
#include "hack.h"
#include <dlfcn.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
@@ -17,6 +18,8 @@ enum {
Timeout = 10,
};
+typedef int (*XErrorHandler)(Display*, XErrorEvent*);
+
static void* xlib;
static long lastwin;
@@ -65,7 +68,7 @@ init(Display *d) { /* Hrm... assumes one display... */
*p += 'A' - 'a';
toks[i] = smprint("_NET_WM_WINDOW_TYPE_%s", toks[i]);
}
- XInternAtoms(d, toks, n, False, types);
+ XInternAtoms(d, toks, n, false, types);
ntypes = n;
for(i=0; i < n; i++)
free(toks[i]);
@@ -88,6 +91,12 @@ init(Display *d) { /* Hrm... assumes one display... */
gethostname(hostname, sizeof hostname);
}
+static int /* Temporary Xlib error handler */
+ignoreerrors(Display *d, XErrorEvent *e) {
+ //USED(d, e);
+ return 0;
+}
+
static void
setprops(Display *d, Window w) {
long *l;
@@ -108,10 +117,6 @@ setprops(Display *d, Window w) {
else if(time(0) > nsec + Timeout)
return;
- if(lastwin)
- changeprop_long(d, lastwin, "_WMII_AFFINE", "WINDOW", &lastwin, 1);
- lastwin = w;
-
if(transient)
changeprop_long(d, w, "WM_TRANSIENT_FOR", "WINDOW", &transient, 1);
if(ntypes)