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

Window resizing changed #81

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

WaywardHeart
Copy link

I decided to implement #65 and got a little carried away. In addition to allowing Graphics.scale to go beyond 4x, now all resize methods are capped to the display size and attempt to keep the center of the window's position on the screen without the top leaving the screen. I also fixed a little wonkiness with Graphics.center on Windows resulting from the title bar not being included in the height calculations.

I tested this on macOS and Windows, but not Linux.

Fixes #65

@WaywardHeart
Copy link
Author

I got around to booting up an Ubuntu VM and while I think mkxp-z was using X11 instead of Wayland, Ubuntu caps the window size to the size of the usable display area and doesn't let the top move above it, so this shouldn't introduce any bugs there.

@Splendide-Imaginarius
Copy link

+1 on concept, I was getting kind of annoyed when the window got larger than my resolution.

What's the behavior of this PR on systems with multiple monitors?

@WaywardHeart
Copy link
Author

SDL_GetWindowDisplayIndex will return the monitor the center of the window is on, so it'll use those dimensions.

@Splendide-Imaginarius
Copy link

SDL_GetWindowDisplayIndex will return the monitor the center of the window is on, so it'll use those dimensions.

No objection to this being the default. Can we accommodate users who want the mkxp-z window to span multiple monitors? E.g. by having a config option that makes it use the combined desktop space (i.e. the space of all monitors combined) instead of a single monitor?

Comment on lines +1636 to +1637
double maxWidth = displayRect.w;
double maxHeight = displayRect.h - top;

Choose a reason for hiding this comment

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

Why are you only using top rather than all four outputs of SDL_GetWindowBordersSize?

@Splendide-Imaginarius
Copy link

SDL_GetWindowDisplayIndex will return the monitor the center of the window is on, so it'll use those dimensions.

No objection to this being the default. Can we accommodate users who want the mkxp-z window to span multiple monitors? E.g. by having a config option that makes it use the combined desktop space (i.e. the space of all monitors combined) instead of a single monitor?

I thought about this some more, and I'm not going to block this PR on that, as I now think this is better-handled by the OS rather than the application.

I'm still confused by the maxWidth/maxHeight calculation as noted above, so I'd like to see some clarification on that before I merge this.

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.

Increase the scaling limit for modern monitor resolutions
2 participants