diff options
author | Russ Cox <rsc@swtch.com> | 2008-01-30 13:26:00 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-01-30 13:26:00 -0500 |
commit | 0f897f99ef576ae80a1e2d7cee29c498e3449b36 (patch) | |
tree | b029217aeb89ee3fa7819f3f3f8d9b66a49b6174 /src/cmd/rio | |
parent | c155dcfeb74766db97c08d7a09cca4b42ba45f0f (diff) | |
download | plan9port-0f897f99ef576ae80a1e2d7cee29c498e3449b36.tar.gz plan9port-0f897f99ef576ae80a1e2d7cee29c498e3449b36.tar.bz2 plan9port-0f897f99ef576ae80a1e2d7cee29c498e3449b36.zip |
devdraw, rio: more full-screen nonsense
Diffstat (limited to 'src/cmd/rio')
-rw-r--r-- | src/cmd/rio/event.c | 39 | ||||
-rw-r--r-- | src/cmd/rio/main.c | 1 | ||||
-rw-r--r-- | src/cmd/rio/manage.c | 68 |
3 files changed, 13 insertions, 95 deletions
diff --git a/src/cmd/rio/event.c b/src/cmd/rio/event.c index b237cd1d..c7ae135c 100644 --- a/src/cmd/rio/event.c +++ b/src/cmd/rio/event.c @@ -124,9 +124,6 @@ configurereq(XConfigureRequestEvent *e) e->value_mask &= ~CWSibling; if(c){ - c->x -= c->border; - c->y -= c->border; - if(e->value_mask & CWX) c->x = e->x; if(e->value_mask & CWY) @@ -138,31 +135,19 @@ configurereq(XConfigureRequestEvent *e) if(e->value_mask & CWBorderWidth) c->border = e->border_width; - if(!(e->value_mask & (CWX|CWY))){ - e->x = 0; - e->y = 0; - } - - if((e->value_mask & (CWWidth|CWHeight)) == (CWWidth|CWHeight) - && c->dx >= c->screen->width && c->dy >= c->screen->height - && e->x == 0 && e->y == 0){ + if(c->dx >= c->screen->width && c->dy >= c->screen->height) c->border = 0; - e->value_mask |= CWX|CWY; - }else + else c->border = BORDER; - c->x += c->border; - c->y += c->border; - - e->x = c->x; - e->y = c->y; - if(e->value_mask & CWStackMode){ if(e->detail == Above) top(c); else e->value_mask &= ~CWStackMode; } + e->value_mask |= CWX|CWY|CWHeight|CWWidth; + if(c->parent != c->screen->root && c->window == e->window){ wc.x = c->x - c->border; wc.y = c->y - c->border; @@ -172,6 +157,7 @@ configurereq(XConfigureRequestEvent *e) wc.sibling = None; wc.stack_mode = e->detail; XConfigureWindow(dpy, c->parent, e->value_mask, &wc); + if(e->value_mask & CWStackMode){ top(c); active(c); @@ -179,22 +165,21 @@ configurereq(XConfigureRequestEvent *e) } } - if(c && c->init){ + if(c && c->parent != c->screen->root){ wc.x = c->border; wc.y = c->border; + }else { + wc.x = c->x; + wc.y = c->y; } - else { - wc.x = e->x; - wc.y = e->y; - } - wc.width = e->width; - wc.height = e->height; + wc.width = c->dx; + wc.height = c->dy; wc.border_width = 0; wc.sibling = None; wc.stack_mode = Above; e->value_mask &= ~CWStackMode; e->value_mask |= CWBorderWidth; - XConfigureWindow(dpy, e->window, e->value_mask, &wc); + XConfigureWindow(dpy, c->window, e->value_mask, &wc); } void diff --git a/src/cmd/rio/main.c b/src/cmd/rio/main.c index afb2bb8b..a7f3162a 100644 --- a/src/cmd/rio/main.c +++ b/src/cmd/rio/main.c @@ -523,7 +523,6 @@ cleanup(void) for(i = 0; i < 2; i++){ for(c = cc[i]; c; c = c->next){ if(!withdrawn(c)){ - gravitate(c, 1); XReparentWindow(dpy, c->window, c->screen->root, c->x, c->y); } diff --git a/src/cmd/rio/manage.c b/src/cmd/rio/manage.c index 6900b47c..33951151 100644 --- a/src/cmd/rio/manage.c +++ b/src/cmd/rio/manage.c @@ -122,9 +122,7 @@ manage(Client *c, int mapped) cmapfocus(current); return 0; } - } else - gravitate(c, 0); - + } attrs.border_pixel = c->screen->black; attrs.background_pixel = c->screen->white; @@ -243,9 +241,7 @@ void withdraw(Client *c) { XUnmapWindow(dpy, c->parent); - gravitate(c, 1); XReparentWindow(dpy, c->window, c->screen->root, c->x, c->y); - gravitate(c, 0); XRemoveFromSaveSet(dpy, c->window); setstate(c, WithdrawnState); @@ -255,68 +251,6 @@ withdraw(Client *c) ignore_badwindow = 0; } -void -gravitate(Client *c, int invert) -{ - int gravity, dx, dy, delta; - - gravity = NorthWestGravity; - if(c->size.flags & PWinGravity) - gravity = c->size.win_gravity; - - delta = c->border-BORDER; - switch (gravity){ - case NorthWestGravity: - dx = 0; - dy = 0; - break; - case NorthGravity: - dx = delta; - dy = 0; - break; - case NorthEastGravity: - dx = 2*delta; - dy = 0; - break; - case WestGravity: - dx = 0; - dy = delta; - break; - case CenterGravity: - case StaticGravity: - dx = delta; - dy = delta; - break; - case EastGravity: - dx = 2*delta; - dy = delta; - break; - case SouthWestGravity: - dx = 0; - dy = 2*delta; - break; - case SouthGravity: - dx = delta; - dy = 2*delta; - break; - case SouthEastGravity: - dx = 2*delta; - dy = 2*delta; - break; - default: - fprintf(stderr, "rio: bad window gravity %d for 0x%x\n", gravity, (int)c->window); - return; - } - dx += BORDER; - dy += BORDER; - if(invert){ - dx = -dx; - dy = -dy; - } - c->x += dx; - c->y += dy; -} - static void installcmap(ScreenInfo *s, Colormap cmap) { |