summaryrefslogtreecommitdiff
path: root/src/icons.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/icons.c')
-rw-r--r--src/icons.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/icons.c b/src/icons.c
index f4fde40..296d3e3 100644
--- a/src/icons.c
+++ b/src/icons.c
@@ -173,12 +173,15 @@ IconUp(TwmWindow *tmp_win)
return;
if (tmp_win->icon_moved) {
+ unsigned width = 0;
+ unsigned height = 0;
+
if (!XGetGeometry(dpy, tmp_win->icon_w, &JunkRoot, &defx, &defy,
- &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth))
+ &width, &height, &JunkBW, &JunkDepth))
return;
- x = defx + ((int) JunkWidth) / 2;
- y = defy + ((int) JunkHeight) / 2;
+ x = defx + ((int) width) / 2;
+ y = defy + ((int) height) / 2;
for (ir = Scr->FirstRegion; ir; ir = ir->next) {
if (x >= ir->x && x < (ir->x + ir->w) &&