summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Wiederhake <twied@gmx.net>2024-01-20 16:07:00 +0100
committerTim Wiederhake <twied@gmx.net>2024-01-20 16:07:00 +0100
commitf6fb5b536cd2a96ef1ac26599fd48ef89a628a77 (patch)
treea34b15e4d6453a31a5b6a357a7623e5cf9afb07f /src
parent895e0e6630eea3cea07d4e4f47f0264ea5263c8e (diff)
Rework dummy variable usage in SetHighlightPixmap
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/add_window.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/add_window.c b/src/add_window.c
index 9a526f7..1f5abe1 100644
--- a/src/add_window.c
+++ b/src/add_window.c
@@ -1347,15 +1347,18 @@ CreateWindowTitlebarButtons(TwmWindow *tmp_win)
void
SetHighlightPixmap(char *filename)
{
- Pixmap pm = GetBitmap(filename);
+ unsigned width = 0;
+ unsigned height = 0;
+
+ Pixmap pm = FindBitmap(filename, &width, &height);
if (pm) {
if (Scr->hilitePm) {
XFreePixmap(dpy, Scr->hilitePm);
}
Scr->hilitePm = pm;
- Scr->hilite_pm_width = (int) JunkWidth;
- Scr->hilite_pm_height = (int) JunkHeight;
+ Scr->hilite_pm_width = (int) width;
+ Scr->hilite_pm_height = (int) height;
}
}