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" #include "layouts/floating.h"
/* extern */ /* extern */
extern int sx, sy; /* screen geometry */
extern int wax, way, wah, waw; /* windowarea geometry */ extern int wax, way, wah, waw; /* windowarea geometry */
extern Client *clients, *sel, *stack; /* global client list and stack */ extern Client *clients, *sel, *stack; /* global client list and stack */
extern Atom wmatom[WMLast], netatom[NetLast]; 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)) if(c->w == DisplayWidth(disp, DefaultScreen(disp))
&& c->h == DisplayHeight(disp, DefaultScreen(disp))) && c->h == DisplayHeight(disp, DefaultScreen(disp)))
{ {
c->x = sx; c->x = 0;
c->y = sy; c->y = 0;
c->border = wa->border_width; c->border = wa->border_width;
} }
else 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; x = DisplayWidth(c->display, DefaultScreen(c->display)) - w - 2 * c->border;
if(y > DisplayHeight(c->display, DefaultScreen(c->display))) if(y > DisplayHeight(c->display, DefaultScreen(c->display)))
y = DisplayHeight(c->display, DefaultScreen(c->display)) - h - 2 * c->border; y = DisplayHeight(c->display, DefaultScreen(c->display)) - h - 2 * c->border;
if(x + w + 2 * c->border < sx) if(x + w + 2 * c->border < 0)
x = sx; x = 0;
if(y + h + 2 * c->border < sy) if(y + h + 2 * c->border < 0)
y = sy; y = 0;
if(c->x != x || c->y != y || c->w != w || c->h != h) if(c->x != x || c->y != y || c->w != w || c->h != h)
{ {
c->x = wc.x = x; c->x = wc.x = x;

16
jdwm.c
View File

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