JaGoLi / ytdl-gui

A simple-to-use, cross-platform graphical interface for youtube-dl.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Window Size Issue: Pop Os

SmokeShine opened this issue · comments

Pop OS 21.04. Installed flatpak from Pop Shop
Screenshot from 2021-08-17 01-32-55

I see something similar (not quite as bad) on Debian. Do you have your fonts scaled at all? HiDPI? Looks like Qt itself is scaling the UI components, but the size of the frame those components are being crammed into was hardcoded. in.

I am also seeing the same on Pop_OS! 21.04. My display is scaled to 200%. It would be great to fix this as it's not usable for me right now. The application looks great though! Thanks for making it

I will look into it. Has anyone tried setting the QT_SCALE_FACTOR variable to 2 in /etc/environment or in your shell's profile when using the application?

When I try it on the commandline on my computer it seems to work.
2021-08-19-102258_1366x768_scrot

(base) ubuntu@pop-os:~$ QT_SCALE_FACTOR=2 youtubedl-gui
youtubedl-gui: command not found
(base) ubuntu@pop-os:~$ youtubedl-gui
youtubedl-gui: command not found

From terminal, application is not launching.

(base) ubuntu@pop-os:~$ QT_SCALE_FACTOR=2 youtubedl-gui
youtubedl-gui: command not found
(base) ubuntu@pop-os:~$ youtubedl-gui
youtubedl-gui: command not found

From terminal, application is not launching.

You mentioned installing it as a flatpak, right? You will need to run it using the flatpak binary

I tried this env var with both the flatpak and the native package, but neither seemed to work in my case.

youtube-dl-scaling-issue

Thank you @marklabrecque so it's not just the scaling factor. I will check for other possible causes.

Thanks for your hard work on this, @JaGoLi !

I am not sure how to run the flatpak binary.
@marklabrecque can you tell the process?

I am not sure how to run the flatpak binary.
@marklabrecque can you tell the process?

Sure, so you need to know the flatpak Application ID, which you can find by running flatpak list. Then you can run flatpak run APP_ID - In this case, the command was flatpak run io.github.JaGoLi.ytdl_gui

Does that make sense?

ytdl-gui-scaled

It's still broken, it's just now bigly broken. 😃

FWIW, I do have Cinnamon set to scale fonts by 1.6 on account of blind as a bat.

After doing a lot of work to make the application scalable manually. I finally found the answer: you need to set the variable QT_AUTO_SCREEN_SCALE_FACTOR=1. In Pop OS, the simplest way to do this is to add the line export QT_AUTO_SCREEN_SCALE_FACTOR=1 to the .profile file in your home directory. Logout and log back in, it should work now.

I appreciate you looking into this, however I cannot call disabling HiDPI/text scaling more than a workaround, since Qt DOES support these things and failure to support 4k screens and accessibility in 2021 is ought to be considered bugs.

Specifically, citing https://doc.qt.io/qt-5/highdpi.html, I see:

In the long term, the application should be adapted to run unmodified:

  • Always use the qreal versions of the QPainter drawing API.
  • Size windows and dialogs in relation to the corresponding screen size.
  • Replace hard-coded sizes in layouts and drawing code with values calculated from font metrics or screen size.

I think the last of these is what's actually needed to resolve the issue long-term. Your .ui file is written using an assumed 96 DPI. You can scale those metrics in your code by the screen DPI / 96 to resize them.

@iKarith With all due respect, if you actually try to run the application on an HiDPI display with the variable I mention, it does not disable scaling. Rather, it enables it. Everything is handled by the Qt Framework and the app looks great. I can personally attest to this.

Added instructions on how to fix the issues in the readme.