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

GLFW breaks with larger primary monitor with display scaling #8

Closed
gregCubed opened this issue Jan 15, 2021 · 2 comments
Closed

GLFW breaks with larger primary monitor with display scaling #8

gregCubed opened this issue Jan 15, 2021 · 2 comments
Labels
bug from hell what wontfix This will not be worked on

Comments

@gregCubed
Copy link

Hi, I've got two monitors that are different sizes.

My main monitor is 3840x2160 while my second monitor is 1920x1080. If I choose either Current or Monitor 0 (primary 4K monitor) as the display monitor, it shows up in the top left of my 4K screen, as I expect it to. However, when I choose to have MC display on the second monitor at its native resolution, it instead appears in the top-right quadrant on my first monitor at a much smaller resolution (probably around 480p resolution).

The only way for it to show properly on my second monitor (game takes up whole screen on Monitor 1) is to have:
Custom dimensions (3840w 2160h)
Monitor-relative coordinates (3840x 1080y)
But, doing so causes my computer to render it in 4K despite it only being a 1080p screen. This defeats the purpose of having MC render on the lower-res monitor in the first place (my gfx card can't consistently handle 60fps on a 4K screen, plus my 1080p monitor is larger anyway).

I can attach images as needed, but for now I'll stick to going into my Windows settings and changing the primary monitor every time I want to play. This itself wouldn't be an issue, either, except that Windows eats my Discord notifications every fucking time I do that. To fix this, I have to restart Windows Explorer, which in turn eats up my tray notifications for Spotify and my graphics card... it's all just one massive slippery slope. 😂🔫

@comp500 comp500 added the bug from hell what label Jan 15, 2021
@comp500
Copy link
Owner

comp500 commented Jan 16, 2021

Wow, this bug is horrible... I managed to reproduce it, but I have no idea how it could be fixed. The issue seems to occur somewhere between GLFW and Windows, as if Windows thinks GLFW isn't DPI-aware? I don't think I will be able to fix this in Borderless Mining. If you don't mind having smaller GUIs you could try setting your first monitor to 100% display scale... but if it's not that big a monitor you probably don't want to do that.

To reproduce it on my system (I have an internal 1080p monitor and external 1080p monitor) I set the GPU to do display scaling and added 2160p as a custom resolution for the external 1080p monitor. Then I set the external monitor as the primary monitor, and arranged them as follows:
image

My observations:

  • My laptop appears to have vastly different performance characteristics depending on which monitor is the primary monitor? Eh, probably a hybrid graphics thing.
  • For some reason, GLFW.glfwGetWindowMonitor always returns the 2160p monitor in this setup, regardless of which screen the window is actually on (so Vanilla won't even let you do normal fullscreen on the second monitor)
  • GLFW reports the correct size and position of the monitors: Monitor 0 at (0, 0) with size 3840x2160 and Monitor 1 at (3840, 1080) with size 1920x1080, however:
    • GLFW reports garbage values for Monitor 1's content scale, like 3.4267972E7 (2.0 as expected for Monitor 0)
    • As you have observed, the actual framebuffer and window size reported by GLFW for the window when properly placed on Monitor 1 is 3840x2160, even though external tools report it as having a 1920x1080 window size
      • This suggests that Windows is assuming that the window isn't DPI-aware... but I presume it's getting DPI change events? I'd probably have to set up C debugging to troubleshoot this
      • GLFW also thinks that the window has 2.0 content scale regardless of which monitor it's on
    • When offsetting the window to (3840, 1080) with size 1920x1080 the window gets scaled and placed as if it were on the first monitor?
    • When offsetting the window to (7680, 2160) with size 3840x2160 the window gets placed on the second monitor, but scaling as if it were on the first monitor

image

I did find a bug in Borderless Mining where custom coordinates containing 0 weren't applied properly, but that wasn't causing this issue anyway...

@comp500 comp500 changed the title not properly recognizing second monitor of different size than primary monitor GLFW breaks with larger primary monitor with display scaling Jan 16, 2021
@comp500 comp500 added the wontfix This will not be worked on label Jan 16, 2021
@comp500
Copy link
Owner

comp500 commented Dec 22, 2023

Closing: either I won't be able to fix this, or the other solutions I'm considering to improve fullscreen compat (inc #19) will fix it at the same time :)

@comp500 comp500 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug from hell what wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants