Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Stuck in HDPI mode with GNOME #1073

Closed
benjamindaines opened this issue Aug 22, 2017 · 9 comments
Closed

Stuck in HDPI mode with GNOME #1073

benjamindaines opened this issue Aug 22, 2017 · 9 comments

Comments

@benjamindaines
Copy link

screenshot from 2017-08-22 01-40-49

Quite simply, as the title states newest version of Cantata displays incorrectly with HDPI scaling when launched under GNOME using qt5ct style plugin version 0.33-2.

@CDrummond
Copy link
Owner

CDrummond commented Aug 22, 2017

Well, works fine under GNOME shell in Ubuntu 17.04 - both in a VM, and my full HD (1080p) laptop. This issue looks similar to #1063

  • Which version of Qt5?
  • What is your screen size? Is it HighDPI
  • Which version of GNOME shell? (Probably irrelevant, but...)

Can you please try with the following variations, and let me know the results of each:

  • without qt5ct (I don't think this is the cause, but helps to reduce differences) Run QT_QPA_PLATFORMTHEME= cantata (This sets QT_QPA_PLATFORMTHEME to an empty string, so should disable qt5ct)

  • With fusion style cantata --style fusion

  • With QT_AUTO_SCREEN_SCALE_FACTOR=0, - e.g. QT_AUTO_SCREEN_SCALE_FACTOR=0 cantata This should disable Qt's auto scale setting.

If you don't mind compiling the code, please:

  • Try git/master? Probably no difference, but worth a check.

  • After the initial build, please edit the code and remove QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); from gui/main.cpp - then recompile, and try again. Works now?

@benjamindaines
Copy link
Author

Qt version 5.9.1-3
Screen size is 1920x1080, so not HDPI
Shell version is 3.24 (does it under 3.25.90 as well)

QT_AUTO_SCREEN_SCALE_FACTOR=0 cantata launches properly, however throwing QT_AUTO_SCREEN_SCALE_FACTOR=0 in /etc/enviornment does not.

Recompiled after commenting out QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); and scaling looks correct, however some icons do not display properly and opening the preferences window causes a crash ASSERT: "!qFuzzyIsNull(c)" in file /usr/include/qt/QtCore/qsize.h, line 196

Hopefully at least some of that is helpful.

@CDrummond
Copy link
Owner

Try also removing QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); from gui/main.cpp

@CDrummond
Copy link
Owner

When you built Cantata, did you install it? If not, then that is why some icons are missing.

CDrummond added a commit that referenced this issue Aug 22, 2017
QT_AUTO_SCREEN_SCALE_FACTOR is set and non-zero.
Issues #1063 #1073
@CDrummond
Copy link
Owner

I've updated git/master (for 2.2.0) to only set Qt::AA_EnableHighDpiScaling under Linux if QT_AUTO_SCREEN_SCALE_FACTOR is set and non-zero.

@benjamindaines
Copy link
Author

Same issue unfortunately. I can't see anywhere that any scaling is set on my system. I've even tried explicitly setting it to 0 in /etc/environment and still getting the massive UI.

@CDrummond
Copy link
Owner

CDrummond commented Aug 23, 2017

This looks like something in your system is setting 'QT_AUTO_SCREEN_SCALE_FACTOR=1' (or some other number).

If setting 'QT_AUTO_SCREEN_SCALE_FACTOR' before Cantata works, but not placing in /etc/environment then something must be setting this to a non-zero value.


If you revert to just removing the line from gui/main.cpp, rebuilding, and installing - is it now ok? Does the crash still happen when you have Cantata installed?

If the crash still happens please:

  1. Create a new build folder for Cantata
  2. When calling cmake, also pass -DCMAKE_BUILD_TYPE=Debug
  3. Perform a make install
  4. Run cantata from withing gdb, e.g. (assuming cantata is installed to /usr/local)
     > gdb /usr/local/bin/cantata
     (gdb) run
    
  5. When Cantata crashes gdb should trap this, and show some text. In the terminal with gdb type where - and paste the results here.

Thanks.

@benjamindaines
Copy link
Author

I'm going to be away for a few days where the internet connection is awful, but I'll set ya know what happens when I get back.

I can say though, that I have no idea where qt_scaling would have been set.

[ben@pluto ~]$ printenv
XDG_MENU_PREFIX=gnome-
LANG=en_US.utf8
GDM_LANG=en_US.utf8
DISPLAY=:0
COLORTERM=truecolor
DESKTOP_AUTOSTART_ID=10884813e8629d5691150339782276287700000309850008
USERNAME=ben
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
XDG_VTNR=2
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
XDG_SESSION_ID=c6
USER=ben
DESKTOP_SESSION=gnome-xorg
QT_QPA_PLATFORMTHEME=qt5ct
PWD=/home/ben
HOME=/home/ben
JOURNAL_STREAM=8:759436
XDG_SESSION_TYPE=x11
XDG_DATA_DIRS=/home/ben/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/
XDG_SESSION_DESKTOP=gnome-xorg
SAL_USE_VCLPLUGIN=gtk3
MAIL=/var/spool/mail/ben
WINDOWPATH=2
TERM=xterm-256color
SHELL=/bin/bash
VTE_VERSION=4901
XDG_CURRENT_DESKTOP=GNOME
XDG_SEAT=seat0
SHLVL=1
WINDOWID=67108870
GDMSESSION=gnome-xorg
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=ben
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/run/user/1000/gdm/Xauthority
QT_AUTO_SCREEN_SCALE_FACTOR=0 
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
SESSION_MANAGER=local/pluto:@/tmp/.ICE-unix/30985,unix/pluto:/tmp/.ICE-unix/30985
_=/usr/bin/printenv

@benjamindaines
Copy link
Author

Latest source works fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants