Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From: zackattackz
- Subject: [PATCH] systray: fix icon overflow when systray_icon_size < panel height
- systray_get_geometry() uses a chain assignment to set both the local
- variable icon_size and systray.icon_size to the raw available height.
- It then caps icon_size with MIN(icon_size, systray_max_icon_size*scale)
- but forgets to propagate the cap back to systray.icon_size.
- This causes a mismatch:
- - the width formula uses the capped icon_size (e.g. 32 px)
- - on_change_systray() reads systray.icon_size (e.g. 42 px) for both
- traywin->width/height and the per-icon step (pos)
- With systray_icon_size=32 and a 42 px panel the step is 44 px instead
- of 34 px, so each extra icon pushes 10 px more than the width formula
- reserves. With n icons the last one overflows the tray area by
- (n-1)*10 px and gets clipped on the right.
- Fix: write the capped value back to systray.icon_size so the width
- formula and the placement loop stay in sync.
- Also fixes the icon size advertised to docked clients via
- _NET_SYSTEM_TRAY_ICON_SIZE and the size of the parent windows created
- in add_icon(), both of which read systray.icon_size.
- ---
- src/systray/systraybar.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/src/systray/systraybar.c b/src/systray/systraybar.c
- --- a/src/systray/systraybar.c
- +++ b/src/systray/systraybar.c
- @@ -152,7 +152,7 @@ void systray_get_geometry(int *size)
- - 2 * systray.area.paddingy * scale;
- if (systray_max_icon_size)
- - icon_size = MIN( icon_size, systray_max_icon_size * scale);
- + icon_size = systray.icon_size = MIN( icon_size, systray_max_icon_size * scale);
- int count = 0;
Advertisement
Add Comment
Please, Sign In to add comment