-
Notifications
You must be signed in to change notification settings - Fork 187
Only redraw once after scaling every widget #62 #2474
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
Only redraw once after scaling every widget #62 #2474
Conversation
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
Outdated
Show resolved
Hide resolved
75ebdf5 to
c48a23f
Compare
|
@amartya4256 that means the redraw that we triggered for every composite so far was just redundant? Can you shortly explain why the redraw does still happen at the end of processing the DPI change handlers? I tested the change and at a first glance it works fine for me. In particular, it already improves performance and the visual experience when doing the rescaling as everything is just redrawn at once and not every composite/control independently, which looks much better. |
On a second look, the widgets are implemented in such a way that they implicitly redraw upon being resized or moved. There are multiple reasons. Some call layout which triggers it, some send Resize or Redraw event and the handler does it for them. But in the end, most of the widgets seem to be dealing with repainting using layout, which already aligns them and paints them and then the loop control is passed to the parent, who then resize and repaint themselves. So, internally, it is handling repaints the moment we change their bounds, hence, we can also remove shell resize and shell layout from the dpi change handler for Shell and Control's handleMonitorSpecificDPIChange. |
This commit contributes to reducing the number of redraws and only draw once all the widgets have performed scaling using their Widget:handleDpiChange handlers. contributes to eclipse-platform#62 and eclipse-platform#128
c48a23f to
ea39b0e
Compare
|
Sounds good. Thank you for the explanation! Let's keep potential further improvements for follow-up PRs. |
This PR contributes to reducing the number of redraws and only draw once all the widgets have performed scaling using their Widget:handleDpiChange handlers.
contributes to
#62 and #128