libwm

library for X windows manipulations
git clone git://z3bra.org/libwm
Log | Files | Refs | LICENSE

commit be6ff33c3bd346fb2dcf3e725e23b92d6aa129ee
parent dad211ee2e2ce35cd08778c1142efb2a753668cc
Author: z3bra <willyatmailoodotorg>
Date:   Sat Nov 14 22:24:02 2015

Fix wm_move / wm_resize absolute handling

Diffstat:
 libwm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libwm.c b/libwm.c @@ -243,12 +243,12 @@ wm_move(xcb_window_t wid, int mode, int x, int y) curw = wm_get_attribute(wid, ATTR_W); curh = wm_get_attribute(wid, ATTR_H); - if (mode == ABSOLUTE) { - x -= curx + curw /2; - y -= cury + curh /2; - } else { + if (mode == RELATIVE) { x += curx; y += cury; + } else { + x -= curw; + y -= curh; } /* the following prevent windows from moving off the screen */ @@ -301,12 +301,12 @@ wm_resize(xcb_window_t wid, int mode, int w, int h) curw = wm_get_attribute(wid, ATTR_W); curh = wm_get_attribute(wid, ATTR_H); - if (mode == ABSOLUTE) { - w -= curx + 2*curb; - h -= cury + 2*curb; - } else { + if (mode == RELATIVE) { w += curw; h += curh; + } else { + w -= curx; + h -= cury; } /*