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

Fix window restoring on opening with Hyprland #481

Merged
merged 1 commit into from
Aug 27, 2023

Conversation

KrisVos130
Copy link
Contributor

Follow-up PR for #478.

@zjeffer reported that #478 broke JMP on Hyprland, a Wayland tiling window manager. This PR is an attempt to fix this, and make sure #245 remains fixed.

In the previous PR, #245 was fixed by using the previous screen geometry rather than the previously saved window geometry when restoring the window geometry. The screen geometry would always be the full width/height of that monitor, e.g. 1920x1080.

In this PR, that change is reverted, so it will restore the previously saved geometry again.
In addition, it will now save the window geometry, regardless of whether the window is maximized or not.
Previously, the window geometry would not be saved if the window was maximized. It would just save that the window was maximized or not (not saving what monitor the window was on). This was the reason JMP would show up on a different monitor when exiting fullscreen.

For Hyprland specifically, I was able to see a similar issue as @zjeffer reported. For me, Waybar never appeared on top of JMP though, with the standard config for both Hyprland and Waybar.
I was not able to figure out the exact reason/conditions for problems with JMP on Hyprland, but I had success in reproducing the reported issue if the previous monitor was the most left one, and the window matched the full width/height. When that happened, it appeared as if Hyprland didn't attempt to resize the window. Maybe Hyprland thinks that it's meant to be fullscreen, and then doesn't try to resize? I'm not sure.
But some combination of the height, width, x and y of the window appeared to matter.

@zjeffer would you be able to test if this PR fixes the issue on Hyprland for you?

@zjeffer
Copy link

zjeffer commented Aug 27, 2023

I don't seem to have the issue on the current master or with your PR, but maybe that's because I only have 1 monitor connected at the moment. I'll try testing again in a couple hours when I have access to my other monitors.

Copy link

@zjeffer zjeffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes the problem! 👍

@iwalton3 iwalton3 marked this pull request as ready for review August 27, 2023 15:22
@iwalton3 iwalton3 merged commit 5391553 into jellyfin:master Aug 27, 2023
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.

3 participants