lxqt / lxqt-sudo

GUI frontend for sudo/su
https://lxqt.github.io
GNU Lesser General Public License v2.1
37 stars 26 forks source link

Preserve more env vars #216

Closed sergwish closed 4 months ago

sergwish commented 5 months ago

Any program started with lxqt-sudo does not receive information about current HiDPI scaling settings. So its interface is not scaled properly.

Expected Behavior

Interface scaling settings are applied to all applications.

Current Behavior

Interface of any application run with lxqt-sudo is not scaled.

Possible Solution

Add "GDK_SCALE", "GDK_DPI_SCALE" and "QT_SCALE_FACTOR" to the list of preserved environment variables ALLOWED_VARS in sudo.cpp (lines 100 - 105). Maybe also add "GTK_OVERLAY_SCROLLING" and "GTK_CSD".

Steps to Reproduce (for bugs)
  1. Login as non-root user. Open lxqt-config-session.
  2. If global interface scale is set to 1, then set it to 1.5 or more and re-login as the same user
  3. Run any GUI app using lxqt-sudo. It's interface is not scaled.
  4. Run the same app without lxqt-sudo. See the difference in appearance, which should not exist.
Context

It is very inconvenient on 15" 1920x1080 screen to use Managing Software Sources, Synaptic package manager, PCManFM-qt as root, QTerminal as root, FeatherPad as root... Basically any GUI application that requires root privileges to function properly in some situation is barely usable with lxqt-sudo.

System Information
palinek commented 4 months ago

Sounds reasonable. @tsujan @luis-pereira @stefonarch What do you think?

stefonarch commented 4 months ago

For what my understanding is this should be safe to implement.

tsujan commented 4 months ago

I also think this makes perfect sense.

tsujan commented 4 months ago

It is very inconvenient ... to use ... PCManFM-qt as root, QTerminal as root, FeatherPad as root... Basically any GUI application that requires root privileges

IMO, that's absolutely not a good idea, although it's your system and you could do anything with it.

However, I agree on preserving more EVs when it's safe.

EDIT: I mean that it isn't just inconvenient but wrong to use so many apps as root.

palinek commented 4 months ago

Done in #217