New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows: On Windows (inside VirtualBox), repaint performance is horrendous. #184
Comments
The algorithm to do layout and sizing is not optimal. Optimizing this is a long term goal; I would need a native Windows box to be absolutely sure of the performance. |
Well its not bad on osx. I would guess the perf is at least 20 times faster than on windows. its quite ok. So, what i am wondering is if its a Windows specific perf thing or VBox thing. So, if anyone has a Windows box, please try this out. |
Yes, it's specific to Windows, because of how the resizes work on Windows. I have to do it manually, and it's using a very poor algorithm right now. I'm not sure if VBox is making the performance any worse, though. |
It's the same on native Windows. I recently "upgraded" from W7 to W10 and have the impression it got a bit better, but still very slow. |
Right. I have several ideas for optimizations, but until I can get a physical machine set up again (I have one; I just have to back up my files and remove the Linux partition) I can't tell, and I'd rather not throw darts at the wall that involve massive restructurings again — this time I have to be sure. |
thanks all for the feedback. I used to use a 200 euro Intel nice for this type of testing. Cheap and easy |
Actually it's not a layout problem. Some profiling suggests Commenting out the |
Hm, thanks for finding that! Not sure how to fix that, though... |
Hey all. @lxn I am guessing this is the fix: thanks allot. I will be trying it out asap ! |
No, that's another issue. Fixing #184 won't be that simple. |
@lxn i am thinking if i can help with compiling them so i can help and move forward. |
@joeblew99 This repo won't be updated until a new libui version is published. At ProtonMail we maintain a fork with latest builds and fixes (https://github.com/ProtonMail/ui). I'll test this patch and probably update builds on our repo this afternoon. |
That is awesome - thanks. I will try it out this afternoon. I wish I could help with it, but I might be more of a time drain asking too many question I fear. |
thanks. i changed over to using your repo (https://github.com/ProtonMail/ui) I will look out for your commits, so i can try out doing cross builds for linux and windows, and also new UX combinations of things. If you manage to fix this issues (slow UI on Windows), i can also try from my side too. If you want me to try anything out, feel free to buzz me.. |
Looked at this again without much success, but maybe this helps: It seems those controls are painted correctly, if they are direct children of a tab page. I then modified container to be a dialog, but couldn't make it look right... |
Oh, so the controls know how to paint themselves properly in a themed dialog texture dialog window? Flattening the container hierarchy would be the correct solution to the problem if that's the case, but would make things much more complicated (in fact, early package ui did exactly this!). (Indeed, groupboxes should not themselves be parents either!) You get a heart for that anyway; theme dialog textures are super fun voodoo magic including for a variety of other reasons that are outside the scope of this post... |
It seems whether or not calling Going the windowless container route should be tough, but maybe the right approach. For my walk package, I had considered trying to do grid layouts which could span an arbitrary amount of containers, think contents of group boxes on a complex dialog, to improve overall alignment of controls. Probably not worth the trouble though. |
You could try doing it the GTK+ way: GtkSizeGroup. It constrains arbitrary widgets to have the same width or height, regardless of their location in the widget hierarchy, and with their containers cooperating. Of course, it's that last part that'll make things a bit tougher... |
I'd like to note that I experience the same problem on my Windows 7 PC using noliar/DevZH.UI. |
please with high properties,or any patch |
Fixing this without making things ugly would be a major undertaking; a simple patch will not suffice, and it might be pushed to after the Alpha 4 release (which might be called 0.4.0). A simple patch would suffice if you didn't mind things looking bad, but that would still wait for after I gain copyright clearance from my new employer. |
Thanks @andlabs I will wait |
#184 (comment) works for me fine. |
Right, but you now see the blotches of gray in the themed controls? That was what the code I had written tried to address, and what lxn says will be fixed by flattening the control hierarchy. However, doing this would require me to rework uiControl and uiWindowsControl again, which would not be a quick fix. It will happen, but it will take time. If more people now are willing to deal with the ugly UI, that's fine; I am concerned about new people who don't know about this issue, though. |
@andlabs You actually don't need to flatten the control hierarchy. In walk I was faced with the same problem and somehow got to a workable solution which also allows for arbitrary control backgrounds including gradients using good old GDI only. Performance is good also. This should be all the code that's needed: Fix for this tab control issue: |
So what, what are you doing differently? Using WM_ERASEBKGND instead of WM_CTLCOLORSTATIC? And what is the |
The main difference seems to be that in
In walk I had to paint the free area not occupied by tab items so it doesn't paint gray over the parent's background. That's probably taken care of by the bitmap + WM_PRINTCLIENT + pattern brush combo in libui. |
Moving this to andlabs/libui#311. |
On Windows (inside VirtualBox), repaint performance is horrendous.
Video is here:
https://www.youtube.com/watch?v=TjIqIA7EV14
Test Harness is here:
https://bitbucket.org/gedw99/md-desktopnative-x
It could be because i am inside Virtual box.
If anyone else is on windows i would like to know how it performs for you.
The text was updated successfully, but these errors were encountered: