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

eframe: persistence stores "inner_pos" #1737

Closed
Barugon opened this issue Jun 14, 2022 · 1 comment
Closed

eframe: persistence stores "inner_pos" #1737

Barugon opened this issue Jun 14, 2022 · 1 comment
Labels
bug Something is broken

Comments

@Barugon
Copy link
Contributor

Barugon commented Jun 14, 2022

Describe the bug
Enabling persistence will cause the window's "inner_pos" to be stored. When this position is read on the next launch, it appears to be applied to the window's outer position, resulting in the window being moved down 37 pixels each launch.

To Reproduce
Steps to reproduce the behavior:

  1. Enable persistence feature
  2. Launch app
  3. Note window's position
  4. Close and launch app again
  5. Note window's position

Expected behavior
Window is initialized in the same place each launch.

Desktop (please complete the following information):

  • OS: Fedora 36 (Gnome)
@Barugon Barugon added the bug Something is broken label Jun 14, 2022
@Barugon
Copy link
Contributor Author

Barugon commented Jun 16, 2022

From the winit documentation:

  • macOS: The top left corner position of the window content, the window’s “inner” position. The window title bar will be placed above it. The window will be positioned such that it fits on screen, maintaining set inner_size if any. If you need to precisely position the top left corner of the whole window you have to use Window::set_outer_position after creating the window.
  • Windows: The top left corner position of the window title bar, the window’s “outer” position. There may be a small gap between this position and the window due to the specifics of the Window Manager.
  • X11: The top left corner of the window, the window’s “outer” position.

So the only platform that uses inner_pos to set the window position is MacOS, other platforms use the outer window position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant