baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.

Home Page:https://renderdoc.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Application won't detect proper DPI scaling

iOrange opened this issue · comments

Description

I'm working on a dual monitor setup.
Primary monitor is 4k, DPI scale is set to 200%
Secondary monitor is 1440p, DPI is set to 125%

When I move the app's window across monitors - it won't rescale itself properly resulting in unreadable text
image

Steps to reproduce

Have monitors with different DPI scale and drag the window from one to another.

It also seems to be random at times, depending on what monitor the app starts on.

Environment

  • RenderDoc version: 1.31
  • Operating System: Windows 11
  • Graphics API: Doesn't matter

Additional info

Maybe updating to the latest Qt6 will fix this? They seems to have added per-monitor DPI functionality over there.

This might just be a Qt5 issue, DPI stuff is largely out of our hands. I believe we should support per-monitor DPI at least but probably not switching from one to the other on the fly.

Does it work correctly if the layout is loaded with panels on their respective monitors - i.e. is it only broken when dragging from one to another?

There are no plans to ever switch to Qt6 FWIW.

Does it work correctly if the layout is loaded with panels on their respective monitors - i.e. is it only broken when dragging from one to another?

Unfortunately - no. As I mentioned - it can randomly happen right from start, depending on what monitor the app starts on.
I believe that it is picking up the DPI scale only from the main monitor, so if it starts on the secondary - it's screwed, and dragging it across makes it even worse.

I myself use Qt a lot for my tools, and this was my main thing to switch to Qt6.
I vaguely remember there was a workaround for this (detecting when the app is switching monitors and forcing qApp->SetFont() or something along those lines).
I might actually try to clone the repo and build myself to see if I can find a workaround.

To clarify - is it random or does it depend on the monitor the app starts on? If you close and reopen the program the location of all windows should be saved and be consistent and it should appear in the same monitor each time - does that ever change or does it always behave the same given a certain layout?

If you're able to find a workaround/fix that would be great. I'm somewhat unable to test this as I don't use DPI scaling on my system and can't really go very high with the scaling on my normal monitors without breaking the layout in a way that makes testing a little dubious.

To clarify - is it random or does it depend on the monitor the app starts on?

Yes sorry for being unclear - there's two variants of this issue.
1 - The app starts on the main monitor and then dragged onto the secondary (diff res and scale) - and rescales improperly.
2 - The app starts on the second monitor - the UI is already scaled improperly, and if you drag it to another monitor - it gets even worse.

The second scenario is a bit random, as sometimes it starts on the secondary monitor and looks fine. Still not sure why.

OK thanks for clarifying. I would definitely be interested in figuring out what is happening in the second variant when it breaks - the fact that it works sometimes suggests that the code in theory handles what I thought it did (i.e. everything except dragging/dynamic DPI change), but it sometimes not working is curious. I wonder if that is some kind of behaviour where the window opens on the wrong monitor long enough for the DPI to latch, before the layout is properly loaded and moves it to the second monitor.

Just to check, did you have any time to dig into the code with this, or find the pattern in when it shows up as improperly scaled on the second monitor when the application starts there?

I do still want to try and look into this if I find a way I'm able to, but as mentioned all of my monitors are normal monitors not high DPI so reproducing this will be challenging.

Sorry for the late reply, was quite busy.
So I think I managed to get why it was so "random" - because of my hybrid work model (WFH + office) I can Remote Desktop to my work PC from home for some stuff, and then when I come to the office - RenderDoc would go in this "weird scaling" mode, until I reboot my PC.

So it has something to do with Remote Desktop. I might debug it when I have spare time to better understand why it happens, but you can close this "bug" if you want, as this seems to be a specific case.

There are no plans to ever switch to Qt6 FWIW.

Why?

Thanks for looking into it iOrange, if you notice any more of a pattern to it or find something more specific that could be fixed please open a new issue.