mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
[GH-ISSUE #322] IDE CodeEditor stuttering #98
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/ultimatepp#98
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yecate on GitHub (Nov 18, 2025).
Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/322
The latest version of the IDE has stuttering/lag issues when scrolling with the mouse in the code area on Windows.
After testing, the issue started appearing after this commit was submitted.
CtrlCore: Win32 now using BITMAPV5HEADER
@ortman commented on GitHub (Dec 17, 2025):
I agree with you. BITMAPV5HEADER is indeed slower (and BITMAPV4HEADER as well).
If you replace:
bi.bV5Size = sizeof(BITMAPV5HEADER);with:
bi.bV5Size = sizeof(BITMAPINFOHEADER);(This is certainly incorrect, but) the lag disappears because the structure is now processed by Windows libraries like the older version. This may be related to alpha channel processing in v5.
@mirek-fidler commented on GitHub (Dec 17, 2025):
That would be unfortunate as I have made the change to process alpha correctly...
What Win is that BTW? (10 or 11?)
@mirek-fidler commented on GitHub (Dec 17, 2025):
For the record, I see no stuttering at all...
There are some situations where theide stutters because of background processes (mostly libclang indexer running) which might look like something new (as it only happens once in a while), but it really is not.
@ortman commented on GitHub (Dec 17, 2025):
I tested it in Windows 10.
I can test it on Windows 11 later.
@ortman commented on GitHub (Dec 17, 2025):
The lag is slight, but noticeable. When scrolling down in the IDE with the mouse wheel, the bottom few lines render with a slight delay, as if there's no double buffering during rendering. When scrolling up, the effect is visible at the top of the window. I built two variants of the IDE from the master branch and ran them simultaneously, and the difference is noticeable.
@mirek-fidler commented on GitHub (Dec 17, 2025):
OK, let me know about Win11...
@ortman commented on GitHub (Dec 18, 2025):
Yesterday I tested it on Windows 11 Pro. Both versions work identically, no stuttering.
So, the problem is either with Windows 10 or hardware related.
@ortman commented on GitHub (Dec 18, 2025):
@yecate, On which OS did you observe the problem?
@yecate commented on GitHub (Dec 18, 2025):
windows 11 Pro, Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (3.60 GHz)
@mirek-fidler commented on GitHub (Dec 18, 2025):
This is definitely the most weird issue this year :)
yecate, can you confirm that
bi.bV5Size = sizeof(BITMAPINFOHEADER);
changes the the situation? (If yes, then that still is not a fix, but gives more clues...)
@yecate commented on GitHub (Dec 18, 2025):
After making these changes, the tests turned out really well.
GDI takes a more complex path, validating and processing V5-specific fields (color space, ICC profiles, alpha mask, etc.), which adds overhead.
@mirek-fidler commented on GitHub (Dec 18, 2025):
What about adding
?
@ortman commented on GitHub (Dec 18, 2025):
It didn't help.
@ortman commented on GitHub (Dec 18, 2025):
I uncommented timing logger
#define LTIMING(x) RTIMING(x)AlphaBlend isn't running in hardware?
@ortman commented on GitHub (Dec 18, 2025):
If set
bi.bV5Size = sizeof(BITMAPINFOHEADER);then
@mirek-fidler commented on GitHub (Dec 18, 2025):
This is when color is not null (meaning only alpha is used, all pixels have the same color). I do not think that can be easily solved using GDI, but I guess it would be better to simply cache adjusted image and use regular blit anyway (will do soon).
In any case it looks like the problem is V5 and DrawSurface, right? Which makes sense IMO...
@mirek-fidler commented on GitHub (Dec 18, 2025):
Attempted fix at master...
76ed3e4583@ortman commented on GitHub (Dec 18, 2025):
It works, no stuttering. Thank you very much.
@yecate commented on GitHub (Dec 18, 2025):
Well done, thank you.