diff --git a/sowm.c b/sowm.c index e228f01..509e28f 100644 --- a/sowm.c +++ b/sowm.c @@ -16,6 +16,7 @@ static unsigned int ww, wh; static Display *d; static XButtonEvent mouse; +static Window root; static void (*events[LASTEvent])(XEvent *e) = { [ButtonPress] = button_press, @@ -138,8 +139,9 @@ void win_fs(const Arg arg) { win_size(cur->w, &cur->wx, &cur->wy, &cur->ww, &cur->wh); XMoveResizeWindow(d, cur->w, 0, 0, sw, sh); - } else + } else { XMoveResizeWindow(d, cur->w, cur->wx, cur->wy, cur->ww, cur->wh); + } } void win_to_ws(const Arg arg) { @@ -261,10 +263,10 @@ int main(void) { signal(SIGCHLD, SIG_IGN); XSetErrorHandler(xerror); - int s = DefaultScreen(d); - Window root = RootWindow(d, s); - sw = XDisplayWidth(d, s); - sh = XDisplayHeight(d, s); + int s = DefaultScreen(d); + root = RootWindow(d, s); + sw = XDisplayWidth(d, s); + sh = XDisplayHeight(d, s); XSelectInput(d, root, SubstructureRedirectMask); XDefineCursor(d, root, XCreateFontCursor(d, 68));