changeset: 1875:6403f4afb78f
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Thu Feb 15 02:43:33 2007 -0500
summary: Stack fullscreen windows over the bar. Fullscreen mode needs work.
diff -r 2ee108e37906 -r 6403f4afb78f client.c
--- a/client.c Thu Feb 15 00:01:56 2007 -0500
+++ b/client.c Thu Feb 15 02:43:33 2007 -0500
@@ -39,6 +39,9 @@ create_client(Window w, XWindowAttribute
&& c->size.min_width == c->size.max_width
&& c->size.min_height == c->size.max_height)
c->fixedsize = True;
+ if(c->rect.width == screen->rect.width
+ && c->rect.height == screen->rect.height)
+ c->fullscreen = True;
XSetWindowBorderWidth(blz.dpy, c->win, 0);
XAddToSaveSet(blz.dpy, c->win);
@@ -573,7 +576,7 @@ resize_client(Client *c, XRectangle *r)
return;
}
- c->rect = f->crect;
+ c->rect = f->rect;
if(f->area->mode == Colmax
&& f->area->sel != f) {
unmap_frame(c);
@@ -583,12 +586,12 @@ resize_client(Client *c, XRectangle *r)
unmap_client(c, IconicState);
}else {
XMoveResizeWindow(blz.dpy, c->win,
- c->rect.x, c->rect.y,
- c->rect.width, c->rect.height);
+ f->crect.x, f->crect.y,
+ f->crect.width, f->crect.height);
map_client(c);
map_frame(c);
- }
- configure_client(c);
+ configure_client(c);
+ }
}
void
diff -r 2ee108e37906 -r 6403f4afb78f event.c
--- a/event.c Thu Feb 15 00:01:56 2007 -0500
+++ b/event.c Thu Feb 15 02:43:33 2007 -0500
@@ -90,53 +90,52 @@ configurerequest(XEvent *e) {
XWindowChanges wc;
XRectangle *frect;
Client *c;
-
- c = client_of_win(ev->window);
- wc.x = ev->x;
- wc.y = ev->y;
- wc.width = ev->width;
- wc.height = ev->height;
-
- ev->value_mask &= ~(CWSibling|CWStackMode);
+ Frame *f;
+
+ c = client_of_win(ev->window);
+
if(c) {
+ f = c->sel;
gravitate_client(c, True);
if(ev->value_mask & CWX)
c->rect.x = ev->x;
if(ev->value_mask & CWY)
- c->rect.y = ev->y;
+ f->rect.y = ev->y;
if(ev->value_mask & CWWidth)
- c->rect.width = ev->width;
+ f->rect.width = ev->width;
if(ev->value_mask & CWHeight)
- c->rect.height = ev->height;
+ f->rect.height = ev->height;
if(ev->value_mask & CWBorderWidth)
c->border = ev->border_width;
gravitate_client(c, False);
- if(c->frame) {
- if(c->sel->area->floating)
- frect=&c->sel->rect;
- else
- frect=&c->sel->revert;
-
- frect->y = -labelh(&def.font);
- frect->x = -def.border;
- frect->width = c->rect.width + 2 * def.border;
- frect->height = c->rect.height + def.border + labelh(&def.font);
-
- wc.border_width = 1;
- wc.stack_mode = ev->detail;
- if(c->sel->area->floating)
- resize_client(c, frect);
- wc.x = frect->x + labelh(&def.font);
- wc.y = frect->y + def.border;
- wc.width = frect->width - 2 * def.border;
- wc.height = frect->height - def.border - labelh(&def.font);
- }
- }
-
- ev->value_mask &= ~CWStackMode;
- ev->value_mask |= CWBorderWidth;
- XConfigureWindow(blz.dpy, ev->window, ev->value_mask, &wc);
- XSync(blz.dpy, False);
+
+ if(c->sel->area->floating)
+ frect=&c->sel->rect;
+ else
+ frect=&c->sel->revert;
+
+ *frect = c->rect;
+ frect->y = -labelh(&def.font);
+ frect->x = -def.border;
+ frect->width += 2 * def.border;
+ frect->height += frame_delta_h();
+ c->rect = f->crect;
+
+ if(c->sel->area->floating)
+ resize_client(c, frect);
+ else
+ configure_client(c);
+ }else{
+ wc.x = ev->x;
+ wc.y = ev->y;
+ wc.width = ev->width;
+ wc.height = ev->height;
+ wc.border_width = ev->border_width;
+ wc.sibling = ev->above;
+ wc.stack_mode = ev->detail;
+ XConfigureWindow(blz.dpy, ev->window, ev->value_mask, &wc);
+ XSync(blz.dpy, False);
+ }
}
static void
diff -r 2ee108e37906 -r 6403f4afb78f frame.c
--- a/frame.c Thu Feb 15 00:01:56 2007 -0500
+++ b/frame.c Thu Feb 15 02:43:33 2007 -0500
@@ -100,10 +100,11 @@ resize_frame(Frame *f, XRectangle *r) {
f->rect.height = labelh(&def.font);
if(f->area->floating) {
- if((f->crect.width == screen->rect.width) &&
- (f->crect.height == screen->rect.height)) {
+ if(c->fullscreen) {
f->rect.x = -def.border;
f->rect.y = -labelh(&def.font);
+ f->rect.width = screen->rect.width + 2 * def.border;
+ f->rect.height = screen->rect.height + frame_delta_h();
}else
check_frame_constraints(&f->rect);
}
diff -r 2ee108e37906 -r 6403f4afb78f view.c
--- a/view.c Thu Feb 15 00:01:56 2007 -0500
+++ b/view.c Thu Feb 15 02:43:33 2007 -0500
@@ -169,7 +169,7 @@ restack_view(View *v) {
static uint winssz = 0;
i = 0;
- n = 1;
+ n = 0;
for(c=client; c; c=c->next, i++);
if(i >= winssz) {
@@ -177,9 +177,13 @@ restack_view(View *v) {
wins = erealloc(wins, sizeof(Window) * winssz);
}
- wins[0] = screen->barwin;
for(f=v->area->stack; f; f=f->snext)
- wins[n++] = f->client->framewin;;
+ if(f->client->fullscreen)
+ wins[n++] = f->client->framewin;;
+ wins[n++] = screen->barwin;
+ for(f=v->area->stack; f; f=f->snext)
+ if(!f->client->fullscreen)
+ wins[n++] = f->client->framewin;;
for(a=v->area->next; a; a=a->next) {
if(a->frame) {
wins[n++] = a->sel->client->framewin;
diff -r 2ee108e37906 -r 6403f4afb78f wmii.h
--- a/wmii.h Thu Feb 15 00:01:56 2007 -0500
+++ b/wmii.h Thu Feb 15 02:43:33 2007 -0500
@@ -158,6 +158,7 @@ struct Client {
int proto;
Bool floating;
Bool fixedsize;
+ Bool fullscreen;
Bool urgent;
Bool mapped;
Bool frame_mapped;
Received on Thu Feb 15 2007 - 08:45:28 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:19 UTC