commit e491a637fec5905a04cd4fe932eb51ce8a2660a4
parent 21a35be86357f8ac7b1e74d6c1157a8d42dd8bc5
Author: Dylan Araps <dylan.araps@gmail.com>
Date: Thu, 20 Feb 2020 16:08:47 +0200
sowm: Changes for easier patching
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git 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));