Skip to content

fix: mem/net proportions different after fixing min net size / mem border#1518

Merged
aristocratos merged 1 commit intoaristocratos:mainfrom
vandabbin:fix-mem-smaller-than-net-gpu-build
Feb 7, 2026
Merged

fix: mem/net proportions different after fixing min net size / mem border#1518
aristocratos merged 1 commit intoaristocratos:mainfrom
vandabbin:fix-mem-smaller-than-net-gpu-build

Conversation

@vandabbin
Copy link
Copy Markdown
Contributor

@vandabbin vandabbin commented Jan 28, 2026

Fixes: #1517

I have fixed this by changing Net::height_p from 32 to 28. This compensates for the difference caused by using floor instead of ceil (and not adding 1 in the non-gpu build) and gets the mem and net box proportions in all possible configurations and window sizes for the gpu support build as close as I can to how it was before without breaking the net box minimum size or causing the mem box bottom border to disappear. I compared this with the gpu build box size proportions from before the min net box size fix.

I have fixed this by adding 1 to the height if the cpu box is shown, the net box is shown, and no gpu boxes are shown. In doing so it looks correct with no gpus shown, it looks correct with a gpu shown, it looks correct with no cpu shown and when only the mem and net boxes are shown the minimum net box size is still obeyed. The reason it checks for the net box being shown before adding 1 to the height is because if the net box is not shown then the mem bottom border will disappear like it did in the non-gpu build.


Edit: It would appear that for the Non-gpu builds that while using floor instead of ceil and not adding +1 does fix the net box minimum size and the mem bottom border when the net box is not shown, it also makes the mem box a tiny bit smaller and the net box a tiny bit bigger then it was before the change at various different window sizes for the no-gpu builds. Perhaps I should try to figure out a better fix that keeps the proportions of the boxes the exact same as they were before while still fixing the net box minimum size and mem bottom border. Thoughts? Personally I think it still looks fine even with the the net box closer in size to the mem box. When the cpu box isn't shown the mem box is still much bigger then the net box. And minimum sizes are obeyed. All the alternatives I have tried to keep the proportions the same while still fixing the issues with the mem bottom border and net box minimum size have resulted in inconsistent sizing of the net box when shrinking the height of the window past a certain size, breaking the net box minimum size again, or breaking the mem box bottom border with the net box not shown.

Edit 2: I have now fixed this problem in the non-gpu-support build as well with the same change. In testing the net and mem boxes now match the original proportions from before the mem border and net min size fix in almost every single window size that I have tested. The only times that it is slightly different is when the window is very short (right around at the minimum height without proc box shown) and it is not really noticeable.


Screenshots of it fixed

GPU not shown (mem box is same size as net box and mem graphs are same size as when gpu is shown)
Screenshot_20260127_190004


GPU shown
Screenshot_20260127_190026

My apologies for missing this

@vandabbin vandabbin changed the title fix: mem box size after min net size fix fix: mem box size after min net size fix for gpu build Jan 28, 2026
@vandabbin vandabbin marked this pull request as draft January 28, 2026 18:57
@vandabbin vandabbin changed the title fix: mem box size after min net size fix for gpu build fix: mem box size after min net size fix. Jan 28, 2026
@vandabbin vandabbin marked this pull request as ready for review January 28, 2026 19:23
@vandabbin vandabbin changed the title fix: mem box size after min net size fix. fix: mem box size after min net size fix for gpu build Jan 28, 2026
@vandabbin vandabbin marked this pull request as draft January 28, 2026 20:19
@vandabbin vandabbin force-pushed the fix-mem-smaller-than-net-gpu-build branch 3 times, most recently from 388e2ae to c8f4c96 Compare January 28, 2026 20:59
@vandabbin vandabbin changed the title fix: mem box size after min net size fix for gpu build fix: mem box size after min net size fix Jan 28, 2026
@vandabbin vandabbin force-pushed the fix-mem-smaller-than-net-gpu-build branch from c8f4c96 to d5acb6c Compare January 28, 2026 21:17
@vandabbin vandabbin marked this pull request as ready for review January 28, 2026 21:21
@vandabbin vandabbin changed the title fix: mem box size after min net size fix fix: mem/net proportions different after fixing min net size Jan 29, 2026
@vandabbin vandabbin changed the title fix: mem/net proportions different after fixing min net size fix: mem/net proportions different after fixing min net size / mem border Jan 29, 2026
@vandabbin vandabbin force-pushed the fix-mem-smaller-than-net-gpu-build branch 3 times, most recently from 8829c6b to 7871b43 Compare January 29, 2026 19:43
@vandabbin vandabbin force-pushed the fix-mem-smaller-than-net-gpu-build branch from 7871b43 to dbf4d05 Compare January 29, 2026 20:17
Comment thread src/btop_draw.cpp
@aristocratos aristocratos merged commit c59a9ff into aristocratos:main Feb 7, 2026
43 checks passed
@vandabbin vandabbin deleted the fix-mem-smaller-than-net-gpu-build branch February 7, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mem / Net box proportions changed after min net size and mem bottom border fixes

2 participants