MalloyDelacroix / DownloaderForReddit

The Downloader for Reddit is a GUI application with some advanced features to extract and download submitted content from reddit.
GNU General Public License v3.0
498 stars 47 forks source link

HDPI still needs more love #264

Open thany opened 2 years ago

thany commented 2 years ago

Describe the bug On my setup, the application looks a bit odd, albeit not entirely broken, on my HDPI screen.

It might help to know that for me the only way to run this program is through remote desktop, which shouldn't make a difference, but it does. This might indicate the application is doing something non-standard to render itself, which is emphasized (but not neccesarily confirmed) by the screenshots below.

Environment Information

To Reproduce (optional) Steps to reproduce the behavior:

  1. Don't purchase a 4K monitor if you don't have one - simulate the effect instead.
    1. Make sure you bump the resolution of your monitor high enough
    2. Set the display zoom factor to around 200%
  2. Connect to any pc (which could be a VM) on this 4K pc through remote desktop (official client!) and have it retain zoom factor / DPI settings.
  3. Start the application.

To clarify: the pc where the remote desktop client runs, needs to be in HDPI. I'm not sure if the server also needs to be - for me, it's LDPI at 100% zoom on its local console.

Observe the great difference in font-sizes: image

This is how the About screen opens: image

And the Settings screen: image

Again, it's usable, but it could be better. I get that this application hasn't been fully tested on HDPI, and that's fine, but you have to admit the difference in font-sizes is weird, isn't it? I would at least expect all text to be too small, or all correct, definitely not a mix.

Please note, the above screenshots may look absolutely huge to you - it's your browser not knowing at which pixel density these screenshots were taken. These screenshots were taken at 250% zoom, so reducing their size visually by a factor of 2.5 (40%) will give you the same view as I do.

For all but the most trivial of issues, please attach the latest log file. DownloaderForReddit.log

MalloyDelacroix commented 2 years ago

Are you by any chance accessing a Windows remote desktop from MacOS?

thany commented 2 years ago

Windows all the way.

Even if, it wouldn't explain the difference in font-sizes regardless of their actual tinyness, not to mention the fact that many text just kind of don't fit - I expect this is not intentional, and they do fit on 100% zoom.

zacker150 commented 2 years ago

Here is a test build with DPI scaling enabled: https://github.com/zacker150/DownloaderForReddit/actions/runs/1716231411

Please test it and let us know if you have any issues.

MalloyDelacroix commented 2 years ago

I use 4k monitors on all of my development rigs, and I have not encountered this issue. A MacBook Pro with a retina display is the only place that I've seen any kind of display issues. But even then, they're still not quite what is shown in the screenshots above.

I tested setting the DPI scaling flag as you have in the test build before I released version 3.0. In my opinion, it does not display well on a 4k screen. Every GUI element appears far too large.

I can almost reproduce what is shown above if I open the app, then change the scaling of the monitor to 225%. But, if I then move the app window to another monitor with normal scaling everything is displayed correctly again, even when the window is moved back to the monitor with the higher scaling. This leads me to believe the issue is related to the way Qt interacts with the system graphics on a level that we will not be able to adjust. I am not familiar with any adjustment, except for the high DPI flag.

zacker150 commented 2 years ago

@thany What monitor size are you using?

@MalloyDelacroix Everything looks too large with high scaling levels because we have a lot of hard-coded size values. For an example, the CoreSettingsWidget is hard-coded to 906x760. According to the QT manual, we need to

This would require updating our gui python files to use calculated values.

thany commented 2 years ago

@zacker150 In my case three different settings are at play:

  1. The local console: 1024x768 (something like that, doesn't even matter) @ 100%
  2. The secondary screen, where RDP run on: 4K @ 200%
  3. The primary screen of the client: 4K @ 250%

Some applications (inlcuding DFR) have a really hard time figuring out the the screen they run on, might have a different DPI from the primary screen. And on top of that, the local console is at play, possibly adding more confusion for Qt. I'm not sure if this is a universal problem with Qt, but I can say I've seen other applications work really inappropriately across my monitors.

It does seem like a problem with Qt specifically, because native programs (i.e. without a cross-platform-like toolkit behind them) and programs with a better toolkit (Firefox, for example) work flawlessly. Dragging them around willy-nilly works just fine, and starting them the way I do, through RDP doesn't make anything look oddly-zoomed.

zacker150 commented 2 years ago

@thany Let's isolate variables a bit by taking RDP out of the equation. What does it look like when you're running DFR in a local session? Provide screenshots if possible.

Also, if possible, please provide the physical screen size in inches.

thany commented 2 years ago

Alright, I'm trying it on a different computer with some more options.

I downloaded the latest version as a portable zip package, extracted it to my desktop, and started it from there. Theoretically this should give me a blank/initial/default configuration. (on a sidenote: the portable version isn't really portable, because it saves its configuration outside its contained directory - user profile probably, but I promise this computer has never had the joy of running DFR 😉)

On local primary 27 inch, 4K UHD 3840x2160, 200% zoom:

image

The differences in font sizes are clear to me, right off the bat, as they say. Let's have a look at the About screen:

image

It's a bit better, but I don't think this is how it's intended to look.

And as for the Settings, the differences in font sizes are minimal, but things just sort of "don't fit", it feels like the whole window has been made too small for its contents. But again, this is a totally blank config, so this is the default size:

image

On secondary 19 inch, SXGA 1280x1024, 100% zoom:

image

I had to drag it over. It automatically became this size. I didn't do this. Somehow it managed to become so big that it doesn't even fit that screen anymore.

Let's see about About:

image

Yes. That looks like intentional.

Now to the Settings. Again, I had to drag it over (it'd make sense to open a secondary window on the same monitor as the primary application window - the About screen actually did that correctly, Settings did not). Likely it did that incorrect reiszing thing again, just like the main window.

image

Oof. Lots of things are mismatched in size. Looks like almost everything is too big except font size 😄

On a general note, none of this explains why it's acting so differently-different over RDP. Unless the GUI toolkit is doing way more custom scaling, fighting against the fact that every OS can do this automatically (given that things are rendered correctly), and they didn't bother testing on mostly anything other than local singlescreen @ 100% zoom. That would be really unfortunate, if true.

Edit: looking back and comparing by eye, it's almost as if RDP amplifies scaling errors, which is really weird but also kind of useful.

thany commented 1 year ago

@MalloyDelacroix @zacker150 I love this program, and I'd love it to look right 😘 Any chance things may have gotten better since January?

MalloyDelacroix commented 1 year ago

No updates at the moment.