Summary: | GDK_SCALE and GDK_DPI_SCALE are hard coded and overwrite user config | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Liu Zhe <cruise.pas> |
Component: | Startup process | Assignee: | Nate Graham <nate> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | charickov, dimitriy.b, dpbasti, florian, heri+kde, imbearchild, kde, maciej.stanczew, nate, notz76, plasma-bugs |
Priority: | NOR | ||
Version: | master | ||
Target Milestone: | 1.0 | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-workspace/commit/20c7e8826ca846b5155f17d628143e4546998c1c | Version Fixed In: | 5.27.1 |
Sentry Crash Report: | |||
Attachments: |
gtk unusable with wayland
gtk app unusable with wayland |
Description
Liu Zhe
2021-10-02 05:38:23 UTC
They are hardcoded to fix a bug. On wayland scaling is set via the wayland protocol and there is no need for this. (In reply to David Edmundson from comment #1) > They are hardcoded to fix a bug. > > On wayland scaling is set via the wayland protocol and there is no need for > this. Frankly speaking wayland scaling is unusably blur. And for small factor like 125% it's way better to scale font only, which is not supported by wayland protocol to my knowledge. I understand the bug it fixes but I believe a properly scaled browser is also a must-have feature. Can we make this behavior configurable? Via system settings or... dirty workaround like PLASMA_GDK_DPI_SCALE. I have the same problem. KDE wayland display scaling (i need 110%-120%) is unusable because of heavy blurring. QT apps are working ok with increasing the font, but GTK apps are too small because of GDK_SCALE set to 1. I think we are not the only users, because all full hd screens on 13"/14" laptops need a small display scaling. (In reply to David Edmundson from comment #1) > They are hardcoded to fix a bug. > > On wayland scaling is set via the wayland protocol and there is no need for > this. Actually, hard-coding GDK_DPI_SCALE will make GTK applications not scaled when using DPI settings of "Font" KCM. Under this case, QT applications will scale normally, while GTK applications won't. So Firefox is affected by this, and an improperly scaled browser should considered a bug too. Created attachment 146713 [details]
gtk unusable with wayland
Created attachment 146714 [details]
gtk app unusable with wayland
Maybe its a different case but might be related I attached screenshots of Eclipse IDE and DBeaver apps. BOth are unusable on my setup : - plasma 5.24 on Opensuse Tumbleweed - 4k screen - 200%scaling the issues you see on the screenshots are : - decomposition of icons/menus - unusable tables - some scroll areas only take a quarter of the space available leaving remaining canvas unused/wasted I found a workaround $ cat ~/.bash_profile export GDK_DPI_SCALE=0 export GDK_BACKEND=x11 export GDK_SCALE=1 With variable GDK_BACKEND=x11 apps show up fine See: https://wiki.archlinux.org/title/Wayland#XWayland GTK The gtk3 and gtk4 packages have the Wayland backend enabled. GTK will default to the Wayland backend, but it is possible to override it to Xwayland by modifying an environment variable: GDK_BACKEND=x11. (In reply to Vladislav Charickov from comment #8) > I found a workaround > > $ cat ~/.bash_profile > export GDK_DPI_SCALE=0 > export GDK_BACKEND=x11 > export GDK_SCALE=1 > > With variable GDK_BACKEND=x11 apps show up fine > > See: https://wiki.archlinux.org/title/Wayland#XWayland > GTK > The gtk3 and gtk4 packages have the Wayland backend enabled. GTK will > default to the Wayland backend, but it is possible to override it to > Xwayland by modifying an environment variable: GDK_BACKEND=x11. not working Operating System: Arch Linux KDE Plasma Version: 5.26.0 KDE Frameworks Version: 5.99.0 Qt Version: 5.15.6 Kernel Version: 6.0.1-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 8 × Intel® Core™ i7-6820HK CPU @ 2.70GHz Memory: 62.8 ГиБ of RAM Graphics Processor: NVIDIA GeForce GTX 980M/PCIe/SSE2 Manufacturer: Micro-Star International Co., Ltd. Product Name: GT72S 6QE System Version: REV:1.0 I just updated to Plasma 5.26, and I wanted to use the new "Legacy Applications (X11) scale by themselves" feature to get crisp scaling (instead of blurry system-wide one) in Steam (I'm running Wayland). According to discussion[1], Steam will use GDK_SCALE if it's set, or determine correct scaling itself if GDK_SCALE is not set. I can confirm that: running either "GDK_SCALE=2; steam" or "unset GDK_SCALE; steam" produces correctly scaled UI (200% in my case). However because Plasma overrides GDK_SCALE to 1, running just "steam" – or using the .desktop file – will result in UI scaled to 100%, which is definitely not what I would expect as a user. [1] https://github.com/ValveSoftware/steam-for-linux/issues/4924 A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2279 I've found small workaround to use GDK_SCALE and GDK_DPI_SCALE. Editing desktop entry files (*.desktop) helps. For example: [Desktop Entry] Name=FileZilla GenericName=FTP client GenericName[da]=FTP-klient GenericName[de]=FTP-Client GenericName[fr]=Client FTP Comment=Download and upload files via FTP, FTPS and SFTP Comment[da]=Download og upload filer via FTP, FTPS og SFTP Comment[de]=Dateien über FTP, FTPS und SFTP übertragen Comment[fr]=Transférer des fichiers via FTP, FTPS et SFTP Exec=env GDK_DPI_SCALE=1.26 filezilla Terminal=false Icon=filezilla Type=Application Categories=Network;FileTransfer; Version=1.0 Git commit 63de3d6f1716a6924fa5924b5a57af4abaa4460f by Nate Graham. Committed on 02/11/2022 at 17:29. Pushed by ngraham into branch 'master'. startplasma-wayland: Don't set GDK_SCALE and GDK_DPI_SCALE We did this to work around a bug whereby envars would be inappropriately propagated when going from X11 to Wayland, causing GTK apps to be scaled to too large a size However this no longer appears to be an issue with any of the GTK apps I tested (Blanket, Bustle, Cheese, Chromium, Firefox, Gedit, GIMP, GNOME Sudoku, Inkscape, Peek, Video Downloader), and keeping it causes a bug whereby non-GTK XWayland apps that perhaps inappropriately look at these envars to determine their scale are scaled too small. This hack has outlived its usefulness; let's kill it. FIXED-IN: 5.26.3 M +0 -3 startkde/startplasma-wayland.cpp https://invent.kde.org/plasma/plasma-workspace/commit/63de3d6f1716a6924fa5924b5a57af4abaa4460f Git commit 9ec6cf47a30fbdc4c64b7b0a0b4fb446f9d2904c by Nate Graham. Committed on 02/11/2022 at 18:01. Pushed by ngraham into branch 'Plasma/5.26'. startplasma-wayland: Don't set GDK_SCALE and GDK_DPI_SCALE We did this to work around a bug whereby envars would be inappropriately propagated when going from X11 to Wayland, causing GTK apps to be scaled to too large a size However this no longer appears to be an issue with any of the GTK apps I tested (Blanket, Bustle, Cheese, Chromium, Firefox, Gedit, GIMP, GNOME Sudoku, Inkscape, Peek, Video Downloader), and keeping it causes a bug whereby non-GTK XWayland apps that perhaps inappropriately look at these envars to determine their scale are scaled too small. This hack has outlived its usefulness; let's kill it. FIXED-IN: 5.26.3 (cherry picked from commit 63de3d6f1716a6924fa5924b5a57af4abaa4460f) M +0 -3 startkde/startplasma-wayland.cpp https://invent.kde.org/plasma/plasma-workspace/commit/9ec6cf47a30fbdc4c64b7b0a0b4fb446f9d2904c A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2635 Git commit 34e3efd85252182977178ab99435b99a1ba987b9 by Nate Graham. Committed on 16/02/2023 at 21:43. Pushed by ngraham into branch 'master'. Revert "startplasma-wayland: Don't set GDK_SCALE and GDK_DPI_SCALE" This reverts commit 63de3d6f1716a6924fa5924b5a57af4abaa4460f. This change was incorrect and the original logic for it was backwards; it was stated that keeping it causes non-GTK XWayland (e.g. Electron) apps to be scaled incorrectly. But in fact the opposite was true; getting rid of it was what causes them to be scaled incorrectly! This mistake was made due to due to the presence of a loca workaround on my system that inverted the behavior. Related: bug 465733 FIXED-IN: 5.27.1 M +6 -0 startkde/startplasma-wayland.cpp https://invent.kde.org/plasma/plasma-workspace/commit/34e3efd85252182977178ab99435b99a1ba987b9 Git commit ba49bb121d7d6752b61aec29ae01a13e7978bd26 by Nate Graham. Committed on 16/02/2023 at 21:47. Pushed by ngraham into branch 'Plasma/5.27'. Revert "startplasma-wayland: Don't set GDK_SCALE and GDK_DPI_SCALE" This reverts commit 63de3d6f1716a6924fa5924b5a57af4abaa4460f. This change was incorrect and the original logic for it was backwards; it was stated that keeping it causes non-GTK XWayland (e.g. Electron) apps to be scaled incorrectly. But in fact the opposite was true; getting rid of it was what causes them to be scaled incorrectly! This mistake was made due to due to the presence of a loca workaround on my system that inverted the behavior. Related: bug 465733 FIXED-IN: 5.27.1 (cherry picked from commit 34e3efd85252182977178ab99435b99a1ba987b9) M +6 -0 startkde/startplasma-wayland.cpp https://invent.kde.org/plasma/plasma-workspace/commit/ba49bb121d7d6752b61aec29ae01a13e7978bd26 The change to fix this had to be reverted. Re-opening. Will find a better way to do it. A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2636 Will there be a possibility to leave those variables unset, or to have them be automatically synchronized with KScreen's scale setting? Steam correctly determines what scaling should it use when GDK_SCALE is not set. Having GDK_SCALE=1 breaks this, and Steam will be always scaled to 100%. I could of course set GDK_SCALE=2 globally, but then it adds another place of maintenance -- if at any time I change the scaling in KScreen, I'll need to remember to also change it in GDK_SCALE. I don't use any Electron apps, so I'd prefer to go with the simplest approach of unsetting GDK_SCALE. But now it seems it will be impossible, since those overrides are done after all the other variable-setting places are processed (e.g. /etc/profile or ~/.config/plasma-workspace/env). With https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2636, you'll be able to override it yourself. You can also manually set it in the desktop files of apps that need it. Git commit bd9c257dcdf050f74a691c31663cbca68ce8d8e7 by Nate Graham. Committed on 17/02/2023 at 00:31. Pushed by ngraham into branch 'master'. startplasma-wayland: allow people to override GDK_* envars Now that we're setting these ourselves again, we need to add the ability to override them if needed. This commit does that. FIXED-IN: 5.27.1 M +8 -2 startkde/startplasma-wayland.cpp https://invent.kde.org/plasma/plasma-workspace/commit/bd9c257dcdf050f74a691c31663cbca68ce8d8e7 Git commit 20c7e8826ca846b5155f17d628143e4546998c1c by Nate Graham. Committed on 17/02/2023 at 01:12. Pushed by ngraham into branch 'Plasma/5.27'. startplasma-wayland: allow people to override GDK_* envars Now that we're setting these ourselves again, we need to add the ability to override them if needed. This commit does that. FIXED-IN: 5.27.1 (cherry picked from commit bd9c257dcdf050f74a691c31663cbca68ce8d8e7) M +8 -2 startkde/startplasma-wayland.cpp https://invent.kde.org/plasma/plasma-workspace/commit/20c7e8826ca846b5155f17d628143e4546998c1c > With https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2636, you'll be able to override it yourself. I'm looking for a way to unset the variables completely, not set them to a different value. > You can also manually set it in the desktop files of apps that need it. True, but very inelegant, to now have to manually edit .desktop files to revert a hack made for another application. It looks like the only sensible solution is to recompile plasma-workspace with this change removed :/ Anyway, I'll go and submit a new bug report specifically for my use case with Steam, it'll be easier to handle it in isolation. A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2643 Git commit cdf2e1a9abf7cdee24828f59aa7cc2295dee4877 by Fushan Wen. Committed on 18/02/2023 at 09:28. Pushed by fusionfuture into branch 'master'. Revert "Revert "startplasma-wayland: Don't set GDK_SCALE and GDK_DPI_SCALE"" This reverts commit 34e3efd85252182977178ab99435b99a1ba987b9 and bd9c257dcdf050f74a691c31663cbca68ce8d8e7 Related: bug 465733 M +0 -12 startkde/startplasma-wayland.cpp https://invent.kde.org/plasma/plasma-workspace/commit/cdf2e1a9abf7cdee24828f59aa7cc2295dee4877 Git commit 14c5b464f41f2b858453fd102ed57397755f9c26 by Fushan Wen. Committed on 18/02/2023 at 09:50. Pushed by fusionfuture into branch 'cherry-pick-cdf2e1a9'. Revert "Revert "startplasma-wayland: Don't set GDK_SCALE and GDK_DPI_SCALE"" This reverts commit 34e3efd85252182977178ab99435b99a1ba987b9 and bd9c257dcdf050f74a691c31663cbca68ce8d8e7 Related: bug 465733 (cherry picked from commit cdf2e1a9abf7cdee24828f59aa7cc2295dee4877) M +0 -12 startkde/startplasma-wayland.cpp https://invent.kde.org/plasma/plasma-workspace/commit/14c5b464f41f2b858453fd102ed57397755f9c26 A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2644 |