-
Notifications
You must be signed in to change notification settings - Fork 214
Sync maximized tag with application model also in case of a maximized shell #3055
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
base: master
Are you sure you want to change the base?
Sync maximized tag with application model also in case of a maximized shell #3055
Conversation
Will this not result in once maximized the maximized size will be persisted so one cant restore it anymore? |
The actual logic of restoring of size is done via a tag, so putting the size in the application does not affect the application behavior. |
How could a tag know the size BEFORE I maximized the shell? This seems impossible to me... can you maybe give some code hints? Just assume the following case:
With this change the size will be set to something different and stored at step (2) then step (3) will not restore it to the previous size... |
Did you look at https://bugs.eclipse.org/bugs/attachment.cgi?id=183776&action=diff? If the tag is present, shell.setMaximized() is called. |
The maximize / restore is not handed by the Shell, no application model logic is used here. Maybe that was the missing part? The tag is not involved in this handling. |
I understand that but as said this only work in the current session to restore the size of the shell. It does not work after a restart because then the Shell has no way to know a size. So how it works is:
|
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.
Looking at the model code I think the issue is more to be solved either by:
getWidth
/Height
must behave likeShell
, that is ask for the actual size instead of return what was set viasetWidth
/Height
(was has no effect on maximized windows)- One would need a new method
getSize()
that behaves different fromgetWidth
/Height
as described in (1)
So effectively reverting the previous added code seems not appropriate also given that there where no complains about the current behavior for a long time we should assume it was done for a purpose.
Before this change the WBWRenderer did not update the application model if the information that the shell was maximized, only during dispose this information was updated. This lead to outdated information in the application model and forces clients which are interested in the actual size of the Window to check in the Shell instead in the model. This was introduced by https://bugs.eclipse.org/bugs/attachment.cgi?id=183776&action=diff. The actual logic of restoring of size is done via a tag, so putting the size in the application should not affect the application behavior. This also supports the scenario in which the user re-starts the application in maximized state, as the user can still restore to the previous state from the application model. Fixes eclipse-platform#3054
c027314
to
607d41e
Compare
Thanks, that is a valid scenario which I did not see. Handling the maximized tag would allow the user to access this information, I updated the PR. |
I took a third approach, updating the maximized tag during runtime, please have a look if you see issue with that approach. |
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.
Sounds reasonable. It would still be impossible to know the "real" or "native" size of the window so a shell is still needed.
True, but at least the model data would indicate the maximized state of the Shell and we would have a trigger point to access it (or read the size of the screen. Also, AFAICS the WBWRenderer does currently not react to tag changes so setting the tag during runtime would not re-size the Shell again. |
Test Results 2 778 files ±0 2 778 suites ±0 1h 39m 8s ⏱️ +9s For more details on these failures, see this check. Results for commit 607d41e. ± Comparison against base commit ca63f41. |
Before this change the WBWRenderer did not update the size of the application in the application model if the shell was maximized, only if the shell got re-sized.
This lead to outdated information in the application model and forces clients which are interested in the actual size of the Window to check in the Shell instead in the model.
This was introduced by
https://bugs.eclipse.org/bugs/attachment.cgi?id=183776&action=diff. The actual logic of restoring of size is done via a tag, so putting the size in the application should not affect the application behavior.
Fixes #3054