tFix wm_move / wm_resize absolute handling - libwm - X windows manipulation library
(HTM) git clone git://z3bra.org/libwm
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit be6ff33c3bd346fb2dcf3e725e23b92d6aa129ee
(DIR) parent dad211ee2e2ce35cd08778c1142efb2a753668cc
(HTM) Author: z3bra <willyatmailoodotorg>
Date: Sat, 14 Nov 2015 22:24:02 +0100
Fix wm_move / wm_resize absolute handling
Diffstat:
M libwm.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
---
(DIR) diff --git a/libwm.c b/libwm.c
t@@ -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 */
t@@ -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;
}
/*