-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix issues with positioning of non-overlay popups #7071
Fix issues with positioning of non-overlay popups #7071
Conversation
When a native popup window is positioned relative to a placement target on the root window and the root window is moved or resized, the popup position should update to reflect the new position of the placement target. If a native popup window is positioned relative to another popup, as in the case of sub-menus, and the parent popup is moved due to a change in the position of its placement target, the child popup should also update relative to the new position of the parent popup.
Tested with my small project to reproduce old issue (you can find here #4630) But there is still couple of issues:
I guess both issues are related to the fact that on windows for some reason this popup is configured as topmost anyway. Probably unrelated to this PR, because it's platform specific. |
@simonhaines I think this PR can be merged as is. It looks good to me, but I will ask for additional review. |
Couple of more observations.
I haven't tested this PR with macOS. But I remember it doesn't have this zindex/topmost problem, but has position syncronization problem (which expected to be fixed with this PR). No idea about linux. |
Thanks @maxkatz6, I agree that platform-specific changes should be resolved in a separate PR. I can confirm the z-order issue occurs on Linux as well. As for Windows, it looks like the
I'm pretty sure this is not the intended behaviour and it was added in error. I'll take it out and submit a new PR with the Linux fix in it as well for review, and see how it goes. |
@simonhaines I tested it with macos, and apparently I was wrong. There also a problem with ZIndex. Created PR for that #7076 |
Fix issues with positioning of non-overlay popups
This seems to have broken positioning of |
Was broken by #7071 - `DatePicker` was doing a manual position configuration by calling `ConfigurePosition`. When the popup is shown, `Popup` gets a position change, and then re-calls `ConfigurePosition` with the settings in the popup, which are different to those passed during the manual configuration. Change this to set properties on the `Popup` so that when the popup position is changed, the correct parameters are passed to `ConfigurePosition` by `Popup`. Fixes #7633
What does the pull request do?
Native popup windows appear 'detached' when anchored to a placement target on the main window and the main window is moved or resized. This change repositions open popups to correctly align with their expected placement.
What is the current behavior?
Native popups don't 'follow' the placement target. Similarly, popups that are anchored to other popups (sub-menus) don't follow the parent popup when it moves.
What is the updated/expected behavior with this PR?
This fix adds listeners for events that change the screen coordinates of popups and re-positions them accordingly. Window mode changes (minimize/maximize) are handled the same as window position changes.
Checklist
Breaking changes
None
Obsoletions / Deprecations
None
Fixed issues
Fixes #5890
Fixes #4225