-
Notifications
You must be signed in to change notification settings - Fork 192
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 prompt for restart on zoom change when not rescaling at runtime #2126
Only prompt for restart on zoom change when not rescaling at runtime #2126
Conversation
7a09bad
to
d7a16e1
Compare
Looks good to me. I tested it on Windows and it works as expected for me, having the flag activated or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested yet but I have 2 points to consider:
- As briefly discussed in our daily, if activating the "auto scale on runtime" fails then the method
Display::isRescalingAtRuntime
should returnfalse
otherwise the restart dialog will not be shown even though the application is still running in "the old mode" i.e. not rescaling at runtime. Different PR though, this code is fine here. - What would happen if one changes the mode programmatically via
Display::setRescalingAtRuntime
? Would the user be prompted again if one deactivates the rescaling at runtime (i.e. "would the old mode be completely restored, with prompt and everything")?
EDIT: 2. What would happen if one changes the mode programmatically via |
Thank you for the comments!
Yes, makes sense. I will provide an according PR to SWT.
Then one has broken the contract of |
See eclipse-platform/eclipse.platform.swt#1363 for the first mentioned issue. |
You mean that part about the undefined behavior? (excerpt from the Javadoc of
In that case, wouldn't it be better to make |
Ignore it, we spoke about it already. |
d7a16e1
to
2bc7198
Compare
When the zoom of the primary monitor changes, the workbench asks for a restart to adapt the workbench windows to the changed zoom. With the runtime rescaling functionality recently introduced to SWT, this behavior is only desired if that rescaling functionality is not activated. This change adapts the functionality for showing the restart prompt to only come up if the rescaling functionality is deactivated.
2bc7198
to
bfaf2b0
Compare
Let's proceed with the discussion about the SWT API at SWT. I made the workbench behavior more "resilient" by always having the zoom change listener attached and make it check for the runtime rescaling behavior every time. In constrast to the efforts for actually rescaling the UI, this single check is irrelevant (performance-wise). This way the workbench implementation is able to adapt the restart behavior even if someone changes the rescaling mode at runtime (given that this will be possible at some point in time in the future). |
When the zoom of the primary monitor changes, the workbench asks for a restart to adapt the workbench windows to the changed zoom. With the runtime rescaling functionality recently introduced to SWT, this behavior is only desired if that rescaling functionality is not activated. This change adapts the functionality for showing the restart prompt to only come up if the rescaling functionality is deactivated.