X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=scrotwm.c;h=9da5d15af9e081820d58627b23894752f1647b51;hb=bc00007fce763065c8618fab6bb2d21cc5f536a0;hp=92145c4facb165fb449364fa211b718779c9881a;hpb=4a043e85195b7337a6087d38d0c6c5c6817f187f;p=spectrwm.git diff --git a/scrotwm.c b/scrotwm.c index 92145c4..9da5d15 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -3692,12 +3692,12 @@ void constrain_window(struct ws_win *win, struct swm_region *r, int resizable) { if (win->g.x + win->g.w > r->g.x + r->g.w - border_width) { - if (resizable) + if (resizable) win->g.w = r->g.x + r->g.w - win->g.x - border_width; else win->g.x = r->g.x + r->g.w - win->g.w - border_width; } - + if (win->g.x < r->g.x - border_width) { if (resizable) win->g.w -= r->g.x - win->g.x - border_width; @@ -3711,7 +3711,7 @@ constrain_window(struct ws_win *win, struct swm_region *r, int resizable) else win->g.y = r->g.y + r->g.h - win->g.h - border_width; } - + if (win->g.y < r->g.y - border_width) { if (resizable) win->g.h -= r->g.y - win->g.y - border_width; @@ -3759,7 +3759,7 @@ resize(struct ws_win *win, union arg *args) unsigned int mask; struct swm_geometry g; int top = 0, left = 0; - int dx, dy; + int dx, dy; Cursor cursor; unsigned int shape; /* cursor style */ @@ -3819,7 +3819,7 @@ resize(struct ws_win *win, union arg *args) g = win->g; - if (wx < win->g.w / 2) + if (wx < win->g.w / 2) left = 1; if (wy < win->g.h / 2) @@ -3829,14 +3829,14 @@ resize(struct ws_win *win, union arg *args) shape = XC_sizing; else if (top) shape = (left) ? XC_top_left_corner : XC_top_right_corner; - else + else shape = (left) ? XC_bottom_left_corner : XC_bottom_right_corner; cursor = XCreateFontCursor(display, shape); if (XGrabPointer(display, win->id, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime) != GrabSuccess) { - XFreeCursor(display, cursor); + XFreeCursor(display, cursor); return; } @@ -3958,6 +3958,7 @@ move(struct ws_win *win, union arg *args) win->manual = 1; if (win->floating == 0 && !win->transient) { + store_float_geom(win,r); ewmh_update_win_state(win, ewmh[_NET_WM_STATE_ABOVE].atom, _NET_WM_STATE_ADD); } @@ -5509,12 +5510,12 @@ conf_load(char *filename, int keymapping) goto out; } - if(asprintf(&optsub, "%.*s", wordlen, cp) == + if (asprintf(&optsub, "%.*s", wordlen, cp) == -1) { warnx("%s: line %zd: unable to allocate" "memory for selector", filename, lineno); - return (1); + goto out; } } cp += wordlen;