remove sx and sy since they are always 0, LOL

This commit is contained in:
Julien Danjou 2007-09-07 17:36:21 +02:00
parent 20a599c07e
commit 2de4fd3fec
2 changed files with 13 additions and 16 deletions

View File

@ -13,7 +13,6 @@
#include "layouts/floating.h"
/* extern */
extern int sx, sy; /* screen geometry */
extern int wax, way, wah, waw; /* windowarea geometry */
extern Client *clients, *sel, *stack; /* global client list and stack */
extern Atom wmatom[WMLast], netatom[NetLast];
@ -349,8 +348,8 @@ manage(Display * disp, DC *drawcontext, Window w, XWindowAttributes * wa, jdwm_c
if(c->w == DisplayWidth(disp, DefaultScreen(disp))
&& c->h == DisplayHeight(disp, DefaultScreen(disp)))
{
c->x = sx;
c->y = sy;
c->x = 0;
c->y = 0;
c->border = wa->border_width;
}
else
@ -443,10 +442,10 @@ resize(Client * c, int x, int y, int w, int h, Bool sizehints)
x = DisplayWidth(c->display, DefaultScreen(c->display)) - w - 2 * c->border;
if(y > DisplayHeight(c->display, DefaultScreen(c->display)))
y = DisplayHeight(c->display, DefaultScreen(c->display)) - h - 2 * c->border;
if(x + w + 2 * c->border < sx)
x = sx;
if(y + h + 2 * c->border < sy)
y = sy;
if(x + w + 2 * c->border < 0)
x = 0;
if(y + h + 2 * c->border < 0)
y = 0;
if(c->x != x || c->y != y || c->w != w || c->h != h)
{
c->x = wc.x = x;

16
jdwm.c
View File

@ -18,7 +18,7 @@
#include "layout.h"
#include "tag.h"
int sx, sy, wax, way, waw, wah;
int wax, way, waw, wah;
Atom wmatom[WMLast], netatom[NetLast];
Client *clients = NULL;
Client *sel = NULL;
@ -167,14 +167,12 @@ setup(Display *disp, jdwm_config *jdwmconf)
XSelectInput(disp, DefaultRootWindow(disp), wa.event_mask);
grabkeys(disp, jdwmconf);
compileregs(jdwmconf);
/* geometry */
sx = sy = 0;
/* bar */
dc.h = jdwmconf->statusbar.height = dc.font.height + 2;
wa.override_redirect = 1;
wa.background_pixmap = ParentRelative;
wa.event_mask = ButtonPressMask | ExposureMask;
jdwmconf->statusbar.window = XCreateWindow(disp, DefaultRootWindow(disp), sx, sy, DisplayWidth(disp, DefaultScreen(disp)), jdwmconf->statusbar.height, 0,
jdwmconf->statusbar.window = XCreateWindow(disp, DefaultRootWindow(disp), 0, 0, DisplayWidth(disp, DefaultScreen(disp)), jdwmconf->statusbar.height, 0,
DefaultDepth(disp, DefaultScreen(disp)), CopyFromParent,
DefaultVisual(disp, DefaultScreen(disp)),
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
@ -216,8 +214,8 @@ updatebarpos(Display *disp, Statusbar statusbar)
{
XEvent ev;
wax = sx;
way = sy;
wax = 0;
way = 0;
wah = DisplayHeight(disp, DefaultScreen(disp));
waw = DisplayWidth(disp, DefaultScreen(disp));
switch (statusbar.position)
@ -225,14 +223,14 @@ updatebarpos(Display *disp, Statusbar statusbar)
default:
wah -= statusbar.height;
way += statusbar.height;
XMoveWindow(disp, statusbar.window, sx, sy);
XMoveWindow(disp, statusbar.window, 0, 0);
break;
case BarBot:
wah -= statusbar.height;
XMoveWindow(disp, statusbar.window, sx, sy + wah);
XMoveWindow(disp, statusbar.window, 0, wah);
break;
case BarOff:
XMoveWindow(disp, statusbar.window, sx, sy - statusbar.height);
XMoveWindow(disp, statusbar.window, 0, 0 - statusbar.height);
break;
}
XSync(disp, False);