Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSETTINGS not applied correctly #1022

Open
sledgehammer999 opened this issue Aug 10, 2024 · 2 comments
Open

XSETTINGS not applied correctly #1022

sledgehammer999 opened this issue Aug 10, 2024 · 2 comments

Comments

@sledgehammer999
Copy link

I have been evaluating LxQt in a VM for a possible future migration of my main pc to it.
I noticed a few pain points and started to investigate. Luckily the code is hosted on github and it's online viewer/browser does wonders into researching the codebase without needing to clone the repos locally.
I am also knowledgeable with Qt and C++ and I am willing to implement solutions if there is agreement to the direction.
Enough chit chat, let me write about what I noticed.

Expected Behavior

Settings from lxqt-config-appearance should be applied consistently for Qt and Gtk apps. Settings should restore on session start.
Available mechanisms for realtime "settings change" signaling to running apps should be used effectively.

Current Behavior

Some options from lxqt-config-appearance are applied inconsistently between Qt and Gtk. I can't remember all the stuff but I focused on the Font settings. All these settings are directly written to fontconfig files but they aren't saved into an lxqt config file.
Qt/Gtk apps seem to pick up the font family from fontconfig but not the DPI setting. They pickup the DPI settings if I shoehorn it into the config file of xsettingsd. Same for Firefox.
For whatever reason, writing the gtk-xft-dpi setting into settings.ini doesn't work for Gtk apps. Did Gtk deprecate it without notice?

For Qt apps, they can pickup a lot of those settings from the qplatformtheme plugin. Even though lxqt-qtplugin has code to inform the Qt apps about the normal and fixed fonts, the variables are initialized from non-existent config settings (lxqt-config-appearance writes the value only to fontconfig).

Currently, lxqt-config-appearance runs xsettingsd upon start with a temp file as config file. The temp file on each run has a random filename and is autoremoved when lxqt-config-appearance is closed. The xsettingsd deamon is also killed when lxqt-config-appearance is closed. This presents problems because when the deamon dies the XSETTINGS get wiped out. New (gtk?) apps can't get info about many of the settings configured by lxqt-config-appearance. It's common practice of all other DEs to have an xsettings deamon running.

Possible Solution
  1. All configurable settings should be written to lxqt specific config file first. From there they should be mirrored to their equivalent settings for Gtk* and system (fontconfig)*.
  2. Upon lxqt-session start it should start xsettingsd with a non-temp config file. Upon settings change it should SIGHUP the running deamon to pickup the new settings.
  3. Maybe transfer the responsibility of the settings mirroring to lxqt-session?
  4. If step 3 is true, then should the session re-mirror the settings upon session start to ensure that they are synced with the saved lxqt settings?
  5. lxqt-qtplugin should read the settings from the lxqt specific config file.
  6. On Wayland I think gtk prioritizes the settings portal. What if xdg-desktop-portal-lxqt exposed the interface gtk expects and responded with the values saved in our own config file, without needing to fiddle with gsettings?

*Maybe we shouldn't fiddle with non-lxqt config files? What if we use xsettingds and a settings portal to propagate settings to Gtk apps and lxqt-qtplugin to propagate settings to Qt apps? We avoid writing to gsettings/settings.ini/gtkrc and leave them vanilla for other DEs the user might be running concurrently.
This last thing is just a suggestion.

My main concern is about having an xsettings daemon running and what architecture changes are needed to do that.
As a secondary importance, some configurable settings aren't mirrored to their xsettings and gtk equivalents currently.

Steps to Reproduce (for bugs)
Context
System Information
  • Distribution & Version: Endeavour OS
  • Kernel: 6.6.44
  • Qt Version: 6.7.2
  • liblxqt Version: 2.0.0
  • lxqt-build-tools Version:
  • Package version: 2.0.0
@palinek
Copy link
Contributor

palinek commented Aug 12, 2024

Your proposed solution sounds reasonable for me.

sledgehammer999 added a commit to sledgehammer999/lxqt-config that referenced this issue Aug 16, 2024
@sledgehammer999
Copy link
Author

@palinek I partially implemented this in PR #1023. If you're interested please take a look.

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

No branches or pull requests

2 participants