After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762681 - main: tell Qt applications to look like GNOME
main: tell Qt applications to look like GNOME
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-25 15:05 UTC by Ray Strode [halfline]
Modified: 2016-10-24 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main: tell Qt applications to look like GNOME (3.02 KB, patch)
2016-02-25 15:05 UTC, Ray Strode [halfline]
committed Details | Review
main: allow users to override QT_QPA_PLATFORMTHEME (3.13 KB, patch)
2016-04-01 01:58 UTC, Ray Strode [halfline]
committed Details | Review
Revert "main: tell Qt applications to look like GNOME" (3.05 KB, patch)
2016-10-24 13:59 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2016-02-25 15:05:26 UTC
If the user is logging into GNOME then QT applications run in the
session should integrate as good as possible.

According to KDE folks, the best way to achieve that is to set

QT_QPA_PLATFORMTHEME="qgnomeplatform"

This commit does that.
Comment 1 Ray Strode [halfline] 2016-02-25 15:05:38 UTC
Created attachment 322379 [details] [review]
main: tell Qt applications to look like GNOME
Comment 2 Ray Strode [halfline] 2016-02-25 15:05:55 UTC
Attachment 322379 [details] pushed as 971baf2 - main: tell Qt applications to look like GNOME
Comment 3 Ivan Shapovalov 2016-03-31 22:13:13 UTC
(In reply to Ray Strode [halfline] from comment #2)
> Attachment 322379 [details] pushed as 971baf2 - main: tell Qt applications
> to look like GNOME

Is it possible to override that environment variable?

Exporting it from ~/.profile (in X11 session) does not work, neither does pam_env.so + ~/.pam_environment.
Comment 4 Ray Strode [halfline] 2016-04-01 01:54:52 UTC
you'd have to run org.gnome.SessionManager.SetEnv over the session bus from an autostart file (with gdbus or qdbus or whatever).

i'll just add a if (g_getenv ("QT_QPA_PLATFORMTHEME") == NULL) over the call so your ~/.pam_environment change will work.
Comment 5 Ray Strode [halfline] 2016-04-01 01:58:50 UTC
Created attachment 325119 [details] [review]
main: allow users to override QT_QPA_PLATFORMTHEME

commit 971baf2e225abc5a67bd0c149f4cbfdb0ef8c549 added
code to make Qt applications look like GNOME ones.

That makes it impossible for users to use custom
platform themes though.

This commit addresses the problem by only setting
QT_QPA_PLATFORMTHEME if it isn't already set.
Comment 6 Ray Strode [halfline] 2016-04-01 01:59:08 UTC
Attachment 325119 [details] pushed as ce4208a - main: allow users to override QT_QPA_PLATFORMTHEME
Comment 7 Jan Grulich 2016-10-24 09:07:42 UTC
Can this be please reverted? We changed this in qgnomeplatform itself and now when Qt detects a gtk based desktop, it tries to load either gtk3 or gnome theme, which will be qgnomeplatform when installed. There is no need to override QT_QPA_PLATFORMTHEME anymore, this even breaks KDE/Plasma when someone logs in from GDM.
Comment 8 Ray Strode [halfline] 2016-10-24 13:55:14 UTC
okay
Comment 9 Ray Strode [halfline] 2016-10-24 13:59:53 UTC
Created attachment 338345 [details] [review]
Revert "main: tell Qt applications to look like GNOME"

This reverts commits:

971baf2e225abc5a67bd0c149f4cbfdb0ef8c549
e833cd1b88ca2107d9ff41f452518934556a5427
ce4208add3b49d440e0c418229774dd802ee6b87
Comment 10 Ray Strode [halfline] 2016-10-24 14:00:39 UTC
Attachment 338345 [details] pushed as d4b0699 - Revert "main: tell Qt applications to look like GNOME"