wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit de5d8772194160e8b216c6dd4de24595ee842c07
parent dcbabb274f7176f8b32af318b00cfb111329f6d7
Author: Kris Maglione <jg@suckless.org>
Date:   Tue,  6 Mar 2007 02:04:19 -0500

Fix some bugs with floating clients tagged with multiple views.

Diffstat:
area.c | 23+++++++++++++++++------
client.c | 2+-
view.c | 4++++
3 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/area.c b/area.c @@ -9,7 +9,7 @@ #include <math.h> #include "wmii.h" -static void place_client(Area *a, Client *c); +static void place_frame(Frame *f); Client * sel_client_of_area(Area *a) { @@ -144,11 +144,19 @@ attach_to_area(Area *a, Frame *f, Bool send) { insert_frame(a->sel, f, False); - if(a->floating) - place_client(a, c); + if(a->floating) { + fprintf(stderr, "a: f=%p (%s) %d,%d %dx%d\n", + f, f->client->name, + f->rect.x, f->rect.y, f->rect.width, f->rect.height); + place_frame(f); + fprintf(stderr, "b: f=%p (%s) %d,%d %dx%d\n", + f, f->client->name, + f->rect.x, f->rect.y, f->rect.width, f->rect.height); + } focus_frame(f, False); resize_frame(f, &f->rect); + restack_view(a->view); if(!a->floating) arrange_column(a, False); else @@ -241,7 +249,7 @@ bit_get(uint *field, uint width, uint x, uint y) { } static void -place_client(Area *a, Client *c) { +place_frame(Frame *f) { enum { devisor = sizeof(uint) * 8 }; enum { dx = 8, dy = 8 }; static uint mwidth, mx, my; @@ -250,7 +258,9 @@ place_client(Area *a, Client *c) { XPoint p1 = {0, 0}; XPoint p2 = {0, 0}; XRectangle *rects; - Frame *f, *fr; + Frame *fr; + Client *c; + Area *a; Bool fit; uint i, j, x, y, cx, cy, maxx, maxy, diff, num; int snap; @@ -260,7 +270,8 @@ place_client(Area *a, Client *c) { fit = False; align = CENTER; - f = c->sel; + a = f->area; + c = f->client; if(c->trans) return; diff --git a/client.c b/client.c @@ -182,7 +182,7 @@ frame_of_win(Window w) { for(c=client; c; c=c->next) if(c->framewin == w) break; if(c) - return c->frame; + return c->sel; return nil; } diff --git a/view.c b/view.c @@ -125,6 +125,7 @@ focus_view(WMScreen *s, View *v) { unmap_client(c, IconicState); } } + restack_view(v); focus_area(v->sel); draw_frames(); XSync(blz.dpy, False); @@ -166,6 +167,9 @@ restack_view(View *v) { uint n, i; static Window *wins = nil; static uint winssz = 0; + + if(v != screen->sel) + return; i = 0; n = 0;