mirror of
https://github.com/0intro/wmii
synced 2024-11-22 13:52:17 +03:00
Fix resizing issue, focus issue. Minor cleanup.
This commit is contained in:
parent
4ec3dc80e6
commit
0928b860bf
@ -76,7 +76,6 @@ wi_events() {
|
||||
_sed="s/^$2//"
|
||||
shift 2
|
||||
fi
|
||||
#cho "$(_wi_text | awk "$(_wi_script)")"
|
||||
eval "$(_wi_text | awk "$(_wi_script)")"
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user