QT apps are too wide and not sized properly

I've been curious about tiling window managers, and over the past month, have been trying to use hyprland as much as possible. Today, I tried to fixe a long-standing issue that I had, which was that qt apps were not respecting the sweetified or kvantum-dark theme, and so after some researching, installed qt5ct and followed the instructions on this Reddit Post. I added the lines

env = QT_AUTO_SCREEN_SCALE_FACTOR,0
env = QT_SCALE_FACTOR,1
env = QT_QPA_PLATFORM,wayland;xcb
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = QT_QPA_PLATFORMTHEME,qt5ct
env = SDL_VIDEODRIVER,wayland
env = CLUTTER_BACKEND,wayland

to my hyprland.conf. These lines basically set the environment variables. Below here is my list of current environment variables active on hyprland.

SHLVL=2
PWD=/home/mab
GTK_IM_MODULE=fcitx
ALACRITTY_LOG=/tmp/Alacritty-229182.log
ALACRITTY_SOCKET=/run/user/1000/Alacritty-wayland-1-229182.sock
AMD_VULKAN_ICD=RADV
CSF_TObjDefaults=/usr/share/opencascade/resources/StdResource
BROWSER=vivaldi-stable
CLUTTER_BACKEND=wayland
CLUTTER_PAINT=disable-dynamic-max-render-time
CSF_DrawPluginDefaults=/usr/share/opencascade/resources/DrawResources
CSF_MDTVTexturesDirectory=/usr/share/opencascade/resources/Textures
CSF_PluginDefaults=/usr/share/opencascade/resources/StdResource
GTK_USE_PORTAL=0
CSF_ShadersDirectory=/usr/share/opencascade/resources/Shaders
CSF_XSMessage=/usr/share/opencascade/resources/XSMessage
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
COLORTERM=truecolor
DEBUGINFOD_URLS=https://debuginfod.archlinux.org
DRAWDEFAULT=/usr/share/opencascade/resources/DrawResources/DrawDefault
CSF_EXCEPTION_PROMPT=1
CSF_OCCTResourcePath=/usr/share/opencascade/resources
DRAWHOME=/usr/share/opencascade/resources/DrawResources
EDITOR=/usr/bin/vim
QT_QPA_PLATFORM=wayland;xcb
ALACRITTY_WINDOW_ID=94658643970736
SDL_IM_MODULE=fcitx
USER=mab
PATH=/home/mab/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/share/mycroft-core/bin:/usr/share/mycroft-core:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin:/home/mab/Applications/Mycroft/mycroft-core/bin
SDL_VIDEODRIVER=wayland
XDG_SESSION_DESKTOP=
CSF_XmlOcafResource=/usr/share/opencascade/resources/XmlOcafResource
XDG_CURRENT_DESKTOP=Hyprland
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
GTK2_RC_FILES=/home/mab/.gtkrc-2.0
QT_IM_MODULE=fcitx
SHELL=/bin/fish
WINDOWID=94658643970736
QT_QPA_PLATFORMTHEME=qt5ct
XDG_RUNTIME_DIR=/run/user/1000
MANPAGER=sh -c 'col -bx | bat -l man -p'
HG=/usr/bin/hg
XDG_SESSION_ID=15
MOZ_ENABLE_WAYLAND=1
LC_TIME=en_US.UTF-8
CSF_TObjMessage=/usr/share/opencascade/resources/TObj
MUTTER_DEBUG_ENABLE_ATOMIC_KMS=0
LC_PAPER=en_US.UTF-8
CASROOT=/usr
STARSHIP_SESSION_KEY=1[censored just in case]
CSF_LANGUAGE=us
STARSHIP_SHELL=fish
CSF_MIGRATION_TYPES=/usr/share/opencascade/resources/StdResource/MigrationSheet.txt
INPUT_METHOD=fcitx
HYPRLAND_CMD=Hyprland
CSF_IGESDefaults=/usr/share/opencascade/resources/XSTEPResource
XDG_SESSION_CLASS=user
LC_NUMERIC=en_US.UTF-8
QT_WAYLAND_DISABLE_WINDOWDECORATION=1
HOME=/home/mab
HYPRLAND_INSTANCE_SIGNATURE=[censored just in case]
FONTCONFIG_PATH=/etc/fonts
LC_MEASUREMENT=en_US.UTF-8
GDK_BACKEND=wayland
TERM=xterm-256color
CSF_StandardDefaults=/usr/share/opencascade/resources/StdResource
XDG_SEAT=seat0
WAYLAND_DISPLAY=wayland-1
LC_IDENTIFICATION=en_US.UTF-8
LC_NAME=en_US.UTF-8
MOTD_SHOWN=pam
_JAVA_AWT_WM_NONREPARENTING=1
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session13
XDG_DATA_DIRS=/home/mab/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_SESSION_TYPE=wayland
XDG_VTNR=1
LOGNAME=mab
MMGT_CLEAR=1
LC_ADDRESS=en_US.UTF-8
XDG_BACKEND=wayland
LC_TELEPHONE=en_US.UTF-8
XMODIFIERS=@im=fcitx
DISPLAY=:1
MAIL=thunderbird
CSF_SHMessage=/usr/share/opencascade/resources/SHMessage
QT_SCALE_FACTOR=1
XCURSOR_THEME=LyraG_Cursors
CSF_XCAFDefaults=/usr/share/opencascade/resources/StdResource
VISUAL=kate
PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket
CSF_STEPDefaults=/usr/share/opencascade/resources/XSTEPResource
XCURSOR_SIZE=24
DESKTOP_SESSION=hyprland
LC_MONETARY=en_US.UTF-8
QT_AUTO_SCREEN_SCALE_FACTOR=0
CSF_StandardLiteDefaults=/usr/share/opencascade/resources/StdResource
LANG=en_US.UTF-8

After adding the lines to hyprland.conf from earlier though, and logging out and back in to see the changes, all qt apps became too wide. A screenshot is attached below (I know it's not using hyprland and using Plasma instead, but couldn't get screenshots to work yet on hyprland, but the issue also persists on Plasma).


I have no idea why all the apps have a wider than normal aspect ratio. I tried removing the environment variables from hyprland.conf, and searching online, to no avail. If anyone knows anything about what could cause this issue, it would be well appreciated. This only affects qt apps it seems to me, other gtk based apps work just fine.

garuda-inxi:

System:
  Kernel: 6.3.9-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.1.1
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=2886e1d2-1f51-401c-9a54-77b069ecd400 rw rootflags=subvol=@
    rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3 splash
    ibt=off
  Desktop: Hyprland info: waybar dm: SDDM Distro: Garuda Linux
    base: Arch Linux
Machine:
  Type: Convertible System: LENOVO product: 20R5A000US v: ThinkPad L13 Yoga
    serial: <filter> Chassis: type: 31 serial: <filter>
  Mobo: LENOVO model: 20R5A000US v: SDK0J40700 WIN serial: <filter>
    UEFI: LENOVO v: R15ET47W (1.28 ) date: 01/12/2021
Battery:
  ID-1: BAT0 charge: 9.1 Wh (20.1%) condition: 45.2/46.0 Wh (98.3%)
    volts: 14.8 min: 15.4 model: SMP 5B10W13933 type: Li-poly serial: <filter>
    status: discharging cycles: 216
CPU:
  Info: model: Intel Core i5-10210U socket: BGA1528 (U3E1) note: check
    bits: 64 type: MT MCP arch: Comet/Whiskey Lake note: check gen: core 10
    level: v3 note: check built: 2018 process: Intel 14nm family: 6
    model-id: 0x8E (142) stepping: 0xC (12) microcode: 0xF6
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 6 MiB desc: 1x6 MiB
  Speed (MHz): avg: 1275 high: 2100 min/max: 400/4200 base/boost: 1600/2100
    scaling: driver: intel_pstate governor: powersave volts: 0.7 V
    ext-clock: 100 MHz cores: 1: 1000 2: 1000 3: 1000 4: 2100 5: 2100 6: 1000
    7: 1000 8: 1000 bogomips: 33599
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities: <filter>
Graphics:
  Device-1: Intel CometLake-U GT2 [UHD Graphics] vendor: Lenovo driver: i915
    v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports:
    active: eDP-1 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2 bus-ID: 00:02.0
    chip-ID: 8086:9b41 class-ID: 0300
  Device-2: IMC Networks Integrated Camera driver: uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-5:2 chip-ID: 13d3:56a6
    class-ID: 0e02 serial: <filter>
  Display: server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.2
    compositor: Hyprland driver: X: loaded: modesetting
    alternate: fbdev,intel,vesa dri: iris gpu: i915 display-ID: :1
  Monitor-1: eDP-1 model: LG Display 0x05ea built: 2018 res: 1920x1080
    dpi: 166 gamma: 1.2 size: 294x165mm (11.57x6.5") diag: 337mm (13.3")
    ratio: 16:9 modes: 1920x1080
  API: OpenGL Message: GL data unavailable for root.
Audio:
  Device-1: Intel Comet Lake PCH-LP cAVS vendor: Lenovo driver: snd_hda_intel
    v: kernel alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3
    chip-ID: 8086:02c8 class-ID: 0403
  API: ALSA v: k6.3.9-zen1-1-zen status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
  Server-2: PipeWire v: 0.3.72 status: n/a (root, process) with:
    1: pipewire-pulse status: active 2: wireplumber status: active
    3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Comet Lake PCH-LP CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:02f0 class-ID: 0280
  IF: wlp0s20f3 state: up mac: <filter>
  Device-2: Intel Ethernet I219-V vendor: Lenovo driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6 chip-ID: 8086:0d4f class-ID: 0200
  IF: enp0s31f6 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) driver: btusb
    v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-10:4
    chip-ID: 8087:0aaa class-ID: e001
  Report: bt-adapter ID: hci0 rfk-id: 1 state: up address: <filter>
Drives:
  Local Storage: total: 238.47 GiB used: 197.25 GiB (82.7%)
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
    model: MZVLB256HBHQ-000L7 size: 238.47 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 5M2QEXH7 temp: 37.9 C scheme: GPT
  SMART: yes health: PASSED on: 165d 21h cycles: 5,246
    read-units: 148,125,265 [75.8 TB] written-units: 70,934,036 [36.3 TB]
Partition:
  ID-1: / raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 197.25 GiB (82.8%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p2
    maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 576 KiB (0.2%) fs: vfat block-size: 512 B dev: /dev/nvme0n1p1
    maj-min: 259:1
  ID-3: /home raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 197.25 GiB (82.8%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p2
    maj-min: 259:2
  ID-4: /var/log raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 197.25 GiB (82.8%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p2
    maj-min: 259:2
  ID-5: /var/tmp raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 197.25 GiB (82.8%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p2
    maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 7.35 GiB used: 550.9 MiB (7.3%)
    priority: 100 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 17.0 C pch: 50.0 C mobo: N/A
  Fan Speeds (RPM): fan-1: 0 fan-2: 0
Info:
  Processes: 268 Uptime: 6h 18m wakeups: 20 Memory: available: 7.35 GiB
  used: 3.14 GiB (42.8%) Init: systemd v: 253 default: graphical
  tool: systemctl Compilers: gcc: 13.1.1 clang: 15.0.7 Packages: 2405
  pm: pacman pkgs: 2373 libs: 604 tools: gnome-software,octopi,paru
  pm: flatpak pkgs: 32 Shell: garuda-inxi (sudo) default: Bash v: 5.1.16
  running-in: alacritty inxi: 3.3.27
Garuda (2.6.16-1):
  System install date:     2023-05-07
  Last full system update: 2023-07-03 ↻
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager mkinitcpio
  Windows dual boot:       No/Undetected
  Failed units:

Try removing these environment variables one by one until you find the one that has introduced the problem (my guess would be QT_AUTO_SCREEN_SCALE_FACTOR,0, or QT_SCALE_FACTOR,1).

Once you have determined which is the problematic environment variable, find out what other values you can set and test them until you find one that doesn’t cause the scaling issue.

2 Likes

I tried removing all of them, but the issue still persists. Even switching back to plasma, I still have the same issue. It seems like putting in those flags made the change permanent.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.