-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fixed: Properties window opens behind main app window #9973
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
Fixed: Properties window opens behind main app window #9973
Conversation
To be noted that there is also a simpler alternative: // Workaround for #9926
propertiesWindow.IsAlwaysOnTop = true;
propertiesWindow.DispatcherQueue.CreateTimer().Debounce(() =>
{
if (propertiesWindow.Visible)
{
propertiesWindow.Activate();
propertiesWindow.IsAlwaysOnTop = false;
}
}, TimeSpan.FromSeconds(1)); Adding the above in OpenPropertiesWindowAsync() (@ line 82) appears to be enough to fix the issue. It's a bit hacky though. |
I took into account a solution like this, but there are two drawbacks: if, for any reason, the flyout context menu takes more than a second to close, the bug would remain unfixed (it would be a one-in-a-million case). The second problem is that the program might seem not optimized or inefficient because of that delay. I know it's only a second, but I'm obsessed with optimization. |
For "optimization" the simple solution is actually better since you don't wait for the menu to close before opening the properties window. But I agree it might not cover all cases. |
Using the hwnd, can we force the new window to the foreground? |
With my solution I set it always on top for 1 second. It appears in front but it's not active. Not sure if we can force it to be active. |
You can't really do that the way we'd want to. |
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.
LGTM
@ferrariofilippo does this work for the drives widget as well? |
Yes, it does |
@ferrariofilippo solution looks good to me. I just find it annoying that it has to be done in each place we have a context menu and each has slightly different code, but no biggie. |
Likewise but this is still a good solution |
Resolved / Related Issues
Items resolved / related issues by this PR.
Comments
Validation
How did you test these changes?