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

Fixed the maximized option on the newer Minecraft versions #1894

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Trial97
Copy link
Member

@Trial97 Trial97 commented Nov 25, 2023

fixes #181
closes #292
Works on my machine but I would want to test it against other platforms
This doesn't really start it in maximized mode but just sets the game width and height to the maximum possible value.
Warning I'm entirely sure that java.awt stuff is in the default java installation(I haven't worked with java for a long time)

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@Trial97 Trial97 added bug Something isn't working simple change needs-testing PRs that should be tested a bit more before being merged changelog:fixed A PR that appears under "Fixed" in the changelog labels Nov 25, 2023
@TayouVR
Copy link
Member

TayouVR commented Nov 25, 2023

at least on my windows this makes it the right size, but the window title is outside of my monitor. :/
image

@Trial97
Copy link
Member Author

Trial97 commented Nov 25, 2023

Do you have more than one monitor?
The gap at the bottom is for the taskbar I think.

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@Trial97
Copy link
Member Author

Trial97 commented Nov 25, 2023

With the latest commit the decoration size should also be taken into consideration.
Small warning the position of the window can't be controlled.

@TayouVR
Copy link
Member

TayouVR commented Nov 25, 2023

Do you have more than one monitor? The gap at the bottom is for the taskbar I think.

I have 3 monitors, though the size of the gap is the size of the window title bar. The task bar is about twice that size.
I will have a look at the latest build ^^

@TayouVR
Copy link
Member

TayouVR commented Nov 25, 2023

image
Can we set the window position somehow?
If so; then we could fix this, by just shifting it down.
But at least I can reach the titlebar now, so its not too bad. Better than not changing the size at all.

Though changing the window position would reach into ugly platform specific APIs and code.. :/

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@Trial97
Copy link
Member Author

Trial97 commented Nov 25, 2023

I can't control the window at all (size being the exception as we have some arguments for it) so the position change I believe is something not for this PR(maybe possible but I will not worry about it).
Also just to make sure that this is treated as a hack I added a big yellow warning(permanent on global settings; conditional on the instance settings)

@TheKodeToad
Copy link
Member

TheKodeToad commented Nov 29, 2023

Warning I'm entirely sure that java.awt stuff is in the default java installation(I haven't worked with java for a long time)

I assume you mean you're not entirely sure. It should be available, but in newer Minecraft versions (with LWJGL3) I'm pretty sure it causes some big problems!

@Trial97
Copy link
Member Author

Trial97 commented Nov 29, 2023

Do not worry I removed that in favor of some c++ code that does the same thing but a little better: 0cab57c
I just forgot to update the original PR message.
Right now all I do on this PR is as follows:

  • using QT try to determine the size of the screen( this is not guaranteed to get me the right values)
  • pass the calculated size to java launcher
  • in the launcher just pass that to Minecraft

The only reason I opted to also add a warning on the checkbox is because in theory even if the surface of the game is expanded at maximum(similar to how maximized would work) is not maximized.
The only change to the java code is the removal of maximized check for newer version(and passing the dimensions directly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog:fixed A PR that appears under "Fixed" in the changelog needs-testing PRs that should be tested a bit more before being merged simple change
Projects
None yet
3 participants