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

OS X: Window position after fullscreen #4178

Closed
mercutiodesign opened this issue Feb 22, 2017 · 3 comments
Closed

OS X: Window position after fullscreen #4178

mercutiodesign opened this issue Feb 22, 2017 · 3 comments
Labels

Comments

@mercutiodesign
Copy link
Contributor

mpv version and platform

mpv git-992e582

Reproduction steps

  • Move window to the side of a screen so that part of it is out of bounds (Alternatively open a video which is larger than the screen)
  • Go into fullscreen
  • Exit fullscreen
  • The window position has now moved so that it is no longer out of bounds (If the video was larger than the screen the upper left corner is now visible)

Expected behavior

Window gets restored to original position.

Actual behavior

Window is moved.

Issue started appearing after the fullscreen refactoring of a8347eb.
The calculateWindowPositionForScreen function should only be called if the screen changed in my opinion. When I remove the calculations in this method the behavior is restored to what I would expect.

@mercutiodesign mercutiodesign changed the title OS X: OS X: Window position after fullscreen Feb 22, 2017
@Akemi Akemi added the os:mac label Feb 22, 2017
@Akemi
Copy link
Member

Akemi commented Feb 22, 2017

i think i had a reason why i did this. like a window ending up on a different screen in some circumstances. i will look into it.

Akemi added a commit to Akemi/mpv that referenced this issue Feb 23, 2017
when forcibly moving windows to a different screen with --screen or
--fs-screen we need to move the window into the screen bounds if the
window is out of bounds, otherwise it can end up on the wrong screen.
previously it always recalculated the bounds and moved the window when
toggling fullscreen, now it only does the bound calculation when
changing screens.

Fixes mpv-player#4178
@Akemi
Copy link
Member

Akemi commented Feb 23, 2017

okay there are a few cases where i need to force the window within the bounds, so i simplified it to always force it within the bounds. anyway i added a more sophisticated logic now that doesn't recalculate the bounds and won't move the window on the same screen if not necessary.

i took a bit longer since while i tried to fix your issue and get the wished behaviour i found a few errors in the recalculating code and a segfault. anyway if you want to test it try this branch.

Akemi added a commit to Akemi/mpv that referenced this issue Feb 23, 2017
when forcibly moving windows to a different screen with --screen or
--fs-screen we need to move the window into the screen bounds if the
window is out of bounds, otherwise it can end up on the wrong screen.
previously it always recalculated the bounds and moved the window when
toggling fullscreen, now it only does the bound calculation when
changing screens.

Fixes mpv-player#4178
@mercutiodesign
Copy link
Contributor Author

Thanks for your work! I used your branch and it has solved the problem for me.
As far as I can tell everything works as it should but I'm only using a single monitor.

@Akemi Akemi closed this as completed in 9d549e6 Feb 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants