Mr-Technician / BorderlessMinecraft

Application to run Minecraft as a borderless window.
GNU General Public License v3.0
129 stars 20 forks source link

Advanced mode doesn't work properly #13

Open OrionDB opened 3 years ago

OrionDB commented 3 years ago

Hello,

On my monitor (lg 34wk95u-w), the Advanced mode doesn't format the window correctly.

I have tried with three different definition in advanced mode, and the three are wrong.

cap1 1920 1080 0 0

On this test, I have setup the Advanced mode to show the window in Full HD on my monitor, so, it should use half the height, and between the third and the half in width, but not as width as is it.

cap 2 3840 2160 0 0

In these capture, the AM is set to 3840 by 2160, like a 16/9 4K monitor, so it should be the exact height of my monitor and almost 2 third in width.

cap 3 5120 2160 0 0

In these, the AM is set to 5120 by 2160, so the exact definition of my monitor, and as you can see, when the window should be perfect, we can see that she is too width and too height.

I am on disposal for further informations if needed.

Good day,

Orion

OrionDB commented 3 years ago

Hello,

I just test winExplorer from nirsoft, so I don't know if you have recovered some code from it, but I have the exact same problem with it.

I will during the week-end setup a test scenario with a 16/9 4K monitor and a FullHD one, to see if the problem persist or if the issue is due to my 21/9 5K monitor.

Also, in case you have taken some code from nirsoft winExplorer, this soft is so old that such high resolution monitor doesn't exist, so you can check the type of the variable, maybe they just can't hold the required value.

Mr-Technician commented 3 years ago

Hi, I didn't borrow any code from Winexplorer. When I have the time (hopefully this weekend) I will look into this issue and see what I can do. I hope to rebuild this project in the near future and make some much needed improvements.

Mr-Technician commented 3 years ago

Brief update: I tried setting MC to 5120 x 1440 (so it covered my left and main monitor) and it behaved normally. At 7680x1440 I noticed something similar to your issue except the hotbar was switched to the left, but this could be because my right monitor is in portrait mode. Here's a screenshot from 5120 x 1440: image

At this point, I think the issue is related to how Windows handles windows.

OrionDB commented 3 years ago

Hello,

So, if you didn't take any code from nirsoft and the two soft make the same behavior, that's probably a problem with Windows.

For the moment, I have found that if a setup the AM as if my monitor is a 1440p monitor, it works, so for having my minecraft in 38402160, I need to setup the AM like that it was a 25601440, I don't know why this work, but it works, so at least, I can use Minecraft in borderless like I want.

So, my issue is not solved (but has seen, it seems that is more a Windows problem than this software issue), but the workaround works good enough for me, so I close this issue.

Glad to hear that you are working on a new version, this software has such a great potential.

Good Week-end.

Mr-Technician commented 3 years ago

So, if you didn't take any code from nirsoft and the two soft make the same behavior, that's probably a problem with Windows.

Seems like it. Feel free to reopen this issue if you figure out exactly what's happening.

Glad to hear that you are working on a new version, this software has such a great potential.

Thanks! I'm debating forking this into a dedicated window manager for all windows, not just MC.

OrionDB commented 3 years ago

Ok, I finally have some time to search the source of the problem, and I have confirmed the fact that that is an "issue" with Windows itself.

I have marked issue with "" because it is more a feature, as the output resolution is based on the real resolution and on the scaled one defined in Windows Settings.

For exemple, I have defined a scaled of 150%, so for some parts of Windows, my resolution is 3840/1.5 = 2560 and 2160/1.5 = 1440, so exactly the value I need to enter in the software to have Minecraft in full screen.

So I searched deeper in the WMI and Powershell to find some command.

1) PS> Add-Type -AssemblyName System.Windows.Forms PS> [System.Windows.Forms.Screen]::AllScreens

This output my correct resolution when I have the scaling on 100%, and the "incorrect" when I am on 150%.

2) (Get-WmiObject -Class Win32_VideoController).VideoModeDescription;

This output my correct resolution in both case, but for now, I only managed to get my primary monitor to show his value, but I didn't have time to make more research.

I don't know if any of this could be useful for the V2, so I share it in case of it might be.

I reopen the issue to be sure you can see this message, when you have read it, you can close it again.

Orion

P.S. : Sorry for my poor english, this is not my primary language

Mr-Technician commented 3 years ago

Thanks for looking into this! I should be able to get the scale and then scale the resolution accordingly. I've done a little bit of looking on Google and don't see a simple way of doing it yet, but I'm sure it's possible. Handling multiple monitors and DPI scaling are important features, I think.

If you want to contribute to the code feel free to make a pull request! @OrionDB