Skip to content
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

pop-up window without a parent use config position #2259

Closed

Conversation

yim7
Copy link

@yim7 yim7 commented Sep 13, 2022

My app has only one pop-up window, but it always shows in top left corner of the screen.

The reason is that the parent window is not considered empty and the calculation of the relative position of the child window fails.

WindowDesc::new(app_ui())
    .window_size(size)
    .set_level(WindowLevel::Tooltip(WindowHandle::default()))

@jneem
Copy link
Collaborator

jneem commented Sep 18, 2022

Thanks for the PR! I'm not on windows to test right now, but is this correct in the presence of scaling? It seems like the code in question adds an offset of the parent origin and does some DPI scaling, and I think without the parent you still want the scaling...

@yim7
Copy link
Author

yim7 commented Sep 27, 2022

Thanks for the PR! I'm not on windows to test right now, but is this correct in the presence of scaling? It seems like the code in question adds an offset of the parent origin and does some DPI scaling, and I think without the parent you still want the scaling...

You're right, it would be better if the window without parents could be scaled correctly.
A popup window without the parent will be the same as the top-level window. And the position of the window without parents will not be scaled in current druid.
I hope to improve this, but I am not familiar with windows gui.

@xStrom
Copy link
Member

xStrom commented Dec 4, 2022

I'm not convinced that this is a valid premise. The primary window should definitely not be a tooltip. Use WindowLevel::AppWindow for your primary window. The Tooltip, DropDown, and Modal levels are meant for child windows.

Also, as it happens the code in question has been refactored in #2296 so we can't merge anyway.

@xStrom xStrom closed this Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants