clementine-player / Clementine

:tangerine: Clementine Music Player
https://www.clementine-player.org/
GNU General Public License v3.0
3.72k stars 671 forks source link

HiDPI display support #5338

Open umpirsky opened 8 years ago

umpirsky commented 8 years ago

On HiDPI displays artist tags and left sidebar are not displayed correctly, see screenshot below:

clementine

System information

Chocobozzz commented 8 years ago

Can you test the Qt5 branch with Qt 5.6 and make another screenshot?

narunlifescience commented 8 years ago

I think this happens because of hard coded font size values.. QT5 may not fix it i guess..

umpirsky commented 8 years ago

@Chocobozzz Following compiling from source from readme.

Failed to cmake:

$ cmake ..
-- The C compiler identification is GNU 5.2.1
-- The CXX compiler identification is GNU 5.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") 
CMake Error at CMakeLists.txt:37 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5" (requested
  version 5.6.0) with any of the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred!
See also "/home/umpirsky/Projects/Clementine/bin/CMakeFiles/CMakeOutput.log".

CMakeOutput.log

Brli commented 8 years ago

screenshot_20160420_080308 The Qt5 f182562 version still the same

ermolaev commented 8 years ago

info about hidpi in qt http://blog.davidedmundson.co.uk/blog/kde_apps_high_dpi

I use qBittorrent and if run as QT_DEVICE_PIXEL_RATIO=2 qbittorrent it work fine on 4k display

umpirsky commented 8 years ago

@ermolaev I tried QT_DEVICE_PIXEL_RATIO=2 clementine, same result.

ermolaev commented 8 years ago

@umpirsky it will be work after porting clementine to qt 5.6 waiting... or download qt 5.6 and build from source

umpirsky commented 8 years ago

@ermolaev Oh, ok, thanks for the info.

sbrl commented 7 years ago

I'm experiencing interface scaling issues on my Dell Inspiron 5567. My screen is 1920 by 1080 pixels, with a physical size of 508mm by 285mm, according to xdpyinfo | grep 'dimensions:'.

The text is really small, and the all the interface icons are equally so.

langston-barrett commented 7 years ago

@sbrl The quickest way to get better HiDPI support would be to pitch in on issue https://github.com/clementine-player/Clementine/issues/5334 (if you've got a Windows or OSX computer).

sbrl commented 7 years ago

@siddharthist No, sorry! I don't have a Windows or a Mac machine. My laptop is currently running Linux - more specifically Ubuntu 16.04.1.

Eventually I'll be setting up a Windows VM though.

ghost commented 6 years ago

For me, I haven't had hidpi issues except for the fact that the control buttons icons (e.g. repeat, shuffle, play, skip) are really tiny, even smaller than a single digit of the track length number.

opennomad commented 6 years ago

It's not a fix, but seems to work as workaround for me on Ubuntu: https://superuser.com/questions/950794/per-application-window-scaling-in-xorg-for-high-dpi-display/1189909#1189909

sbrl commented 6 years ago

Hey @opennomad, that works rather well, actually! The only thing is that it makes clementine look like it's running on Windows 95, and it looks rather blurry.

So while it's not a solution, it works well enough that it could be used as a temporary workaround.

ghost commented 5 years ago

A workaround is not ideal, especially in this case where, at least on my system, some parts of Clementine are scaled correctly. Still, if the newer version of QT fixes the problem, then I suppose we can wait for that version to reach us (or compile it from source).

sbrl commented 5 years ago

run_scaled has some stability issues, unfortunately. What's the status of this?

axelsimon commented 4 years ago

As this is the issue with most work on it, i've marked the other related issues as duplicates of this one (even if they all predate this one).

PowerSnail commented 4 years ago

I compiled Clementine with Qt 5.14, while adding the following lines:

  QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
  QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

The result seems pretty promising:

Screenshot from 2020-02-20 22-15-33@2x

I haven't found any placement problem or scaling problem yet.

sbrl commented 4 years ago

I compiled Clementine with Qt 5.14, while adding the following lines:

QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

@PowerSnail PR? :P

PowerSnail commented 4 years ago

PR?

Just made one. #6592

sbrl commented 4 years ago

Awesome <3

Can't wait for the next release!

northnose commented 4 years ago

I see that these lines are merged, but when I build from source (2020-03-24 a22af31e6eaa5195f63717163c09e25d765e1fb5), I don't see any difference. This is on Fedora 31, KDE 5.67, Qt 5.13.2, with "Force font DPI" set to 192.

Screenshot_20200327_215536

PowerSnail commented 4 years ago

I was using scale = 2 for monitor setting.

My guess is that under the hood, Qt auto-scale widgets/layouts/pixmaps based on device pixel ratio, whose calculation isn't affected by font DPI. As a result, when you set "Force font DPI", some widgets are resized because their sizes are calculated with regard to text. Others are not resized, because they are not aware of the scaling.

But you can try setting the scale for monitor and not forcing font DPI; if that works, then my guess would be confirmed.

northnose commented 4 years ago

Ah, my bad. I didn't realize that the font DPI and the display scaling are different things altogether. Thanks for the pointer. Would it make sense to file a separate issue about font DPI?

In the meantime, if anyone else has this issue, I can work around it (albeit with small text in Clementine) with a simple patch to clementine.desktop:

-Exec=clementine %U
+Exec=env QT_FONT_DPI=96 clementine %U
duncanawoods commented 4 years ago

@northnose

Does this work with a snap install? I can't see a clementine.desktop in /home/xxx/.local/share and if I create one or just use this command line then I don't see any change.

endlisnis commented 3 years ago

I still see this issue running v1.4 rc1 on Linux Mint 20.1.