diff options
author | Tim Wiederhake <twied@gmx.net> | 2024-01-20 16:07:00 +0100 |
---|---|---|
committer | Tim Wiederhake <twied@gmx.net> | 2024-01-20 16:07:00 +0100 |
commit | 9ad7b060e055f08ff39ee569f1cf40c7ac56e321 (patch) | |
tree | a09e8056385b196c9aee9ad8e206f8c30290f9fb /src | |
parent | b9f33162eaad31988e3595ddcd3efd97ee2da0aa (diff) |
Rework dummy variable usage in CreateIconManagers
twm defines several "junk" variables to use with functions like
XQueryPointer or XGetGeometry. In some instances, the returned
values are actually used, which makes the code confusing and hard
to reason about. Use dedicated variables in those cases.
Signed-off-by: Tim Wiederhake <twied@gmx.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/iconmgr.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/iconmgr.c b/src/iconmgr.c index 7cbc7a7..4aad8fd 100644 --- a/src/iconmgr.c +++ b/src/iconmgr.c @@ -73,26 +73,25 @@ CreateIconManagers(void) } for (p = &Scr->iconmgr; p != NULL; p = p->next) { - int mask = XParseGeometry(p->geometry, &JunkX, &JunkY, + int x = 0; + int y = 0; + int mask = XParseGeometry(p->geometry, &x, &y, (unsigned int *) &p->width, (unsigned int *) &p->height); if (mask & XNegative) - JunkX = Scr->MyDisplayWidth - p->width - - (2 * Scr->BorderWidth) + JunkX; + x += Scr->MyDisplayWidth - p->width - (2 * Scr->BorderWidth); if (mask & YNegative) - JunkY = Scr->MyDisplayHeight - p->height - - (2 * Scr->BorderWidth) + JunkY; + y += Scr->MyDisplayHeight - p->height - (2 * Scr->BorderWidth); background = Scr->IconManagerC.back; GetColorFromList(Scr->IconManagerBL, p->name, (XClassHint *) NULL, &background); - p->w = XCreateSimpleWindow(dpy, Scr->Root, - JunkX, JunkY, (unsigned) p->width, - (unsigned) p->height, 1, Scr->Black, - background); + p->w = XCreateSimpleWindow(dpy, Scr->Root, x, y, + (unsigned) p->width, (unsigned) p->height, + 1, Scr->Black, background); snprintf(str, sizeof(str), "%s Icon Manager", p->name); snprintf(str1, sizeof(str1), "%s Icons", p->name); |