QT uses incorrect theme when GNOME_DESKTOP_SESSION_ID is unset

Bug #1305294 reported by Øyvind Stegard on 2014-04-09
68
This bug affects 14 people
Affects Status Importance Assigned to Milestone
upstart (Ubuntu)
Medium
Unassigned
Trusty
Undecided
Dimitri John Ledkov

Bug Description

[ Description ]

When launching Qt applications from indicators under Unity, the theme isn't right.

[ Fix ]

It's because GNOME_DESKTOP_SESSION_ID is unset due to problems in upstart scripts. Qt uses this to decide whether to apply the GTK theme. Fix is to set this as early as possible, in Upstart's xsession-init job.

[ Regression potential ]

We're setting the environment variable ~all the time in the session. Maybe something could be expecting it not to be set?

[ QA ]

This is a bit racy, so you might not see it all the time. Install vlc, restart your session (or the sound indicator), then click the indicator and launch vlc. You might see the wrong theme before and should always see the right theme after.

[ Original description ]

Bug discovered when launching VLC from the sound indicator applet: the QT UI theme is wrong. The theme is correct when launched from Unity launcher or terminal. Please see the attached screenshots.

I've tracked it down to a difference in environment in the VLC process: When launched from indicator-sound, the variable GNOME_DESKTOP_SESSION_ID is unset, and this causes VLC to become themed incorrectly. (If the variable is given any value, then VLC looks correct.)

To reproduce, either:
1) Launch VLC from indicator-sound (make sure it's not already running and has been started from somewhere else)
2) Or just start VLC like this from terminal:
$ GNOME_DESKTOP_SESSION_ID= vlc

Looks like a bug in qt4, which seems to depend on GNOME_DESKTOP_SESSION_ID being set [to anything] to pick up the correct theme. (The variable is deprecated, according to its default value in Ubuntu 14.04.)

Try:
$ GNOME_DESKTOP_SESSION_ID= qtconfig

Observe theme not picked up from "Desktop settings" in qtconfig.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: qt4-qtconfig 4:4.8.5+git192-g085f851+dfsg-2ubuntu4
ProcVersionSignature: Ubuntu 3.13.0-23.45-generic 3.13.8
Uname: Linux 3.13.0-23-generic x86_64
ApportVersion: 2.14.1-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Apr 9 22:15:27 2014
InstallationDate: Installed on 2014-04-01 (8 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Beta amd64 (20140326)
SourcePackage: qt4-x11
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Øyvind Stegard (oyvinst) wrote :
Øyvind Stegard (oyvinst) wrote :
no longer affects: qt
no longer affects: vlc (Ubuntu)
summary: - VLC incorrectly themed when launched from indicator-sound
+ QT incorrectly themed when GNOME_DESKTOP_SESSION_ID unset
summary: - QT incorrectly themed when GNOME_DESKTOP_SESSION_ID unset
+ QT incorrectly themed when GNOME_DESKTOP_SESSION_ID is unset
description: updated
description: updated
summary: - QT incorrectly themed when GNOME_DESKTOP_SESSION_ID is unset
+ QT uses incorrect theme when GNOME_DESKTOP_SESSION_ID is unset
Øyvind Stegard (oyvinst) wrote :

Or bug is in indicator-sound for not providing a value for GNOME_DESKTOP_SESSION_ID in the environment of processes it spawns.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qt4-x11 (Ubuntu):
status: New → Confirmed
Daniel San (danielsanfr) wrote :

This bug also happens when the clementine is initiated by sound-indicator

Venetin Konstantinov (venetin) wrote :

I can confirm this bug.Affects Clementine,vlc,qutim(all are qt applications).

Adolfo Jayme (fitojb) on 2014-06-15
Changed in qt4-x11 (Ubuntu):
importance: Undecided → Medium
Iain Lane (laney) wrote :

We've fixed this in upstart in utopic (14.10), and will soon update 14.04 with the same fix. Thanks for the report & investigation.

affects: qt4-x11 (Ubuntu) → upstart (Ubuntu)
Changed in upstart (Ubuntu Trusty):
status: New → In Progress
assignee: nobody → Dimitri John Ledkov (xnox)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package upstart - 1.12.1-0ubuntu9

---------------
upstart (1.12.1-0ubuntu9) utopic; urgency=medium

  [ Dimitri John Ledkov ]
  * Add libcgmanager-dev build-dependency.

  [ Iain Lane ]
  * xsession-init: Set $GNOME_DESKTOP_SESSION_ID if we are launching a
    gnome-session session. Some applications (Qt4) require this to be set to
    any value to detect the environment in use. It was historically set by
    gnome-session but now this is no longer the root of the session so not all
    user processes are guaranteed to have it. (LP: #1305294)
 -- Dimitri John Ledkov <email address hidden> Fri, 20 Jun 2014 11:13:27 +0100

Changed in upstart (Ubuntu):
status: Confirmed → Fix Released
Iain Lane (laney) on 2014-06-20
description: updated

Hello Øyvind, or anyone else affected,

Accepted upstart into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/upstart/1.12.1-0ubuntu4.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in upstart (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Øyvind Stegard (oyvinst) wrote :

Confirming that issue is fixed in upstart 1.12.1-0ubuntu4.1.

tags: added: verification-done
removed: verification-needed
Colin Watson (cjwatson) wrote :

Hello Øyvind, or anyone else affected,

Accepted upstart into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/upstart/1.12.1-0ubuntu4.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: removed: verification-done
tags: added: verification-needed
Rabotyahoff (rabotyahoff) wrote :

Upstart 1.12.1-0ubuntu4.1
QutIM, skype, clementine are work fine.
Thank you.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package upstart - 1.12.1-0ubuntu4.2

---------------
upstart (1.12.1-0ubuntu4.2) trusty; urgency=medium

  * Safe guard against SESSIONTYPE-less sessions. (LP: #1343905)

upstart (1.12.1-0ubuntu4.1) trusty; urgency=medium

  [ James Hunt ] LP: #1317727
  * debian/manpages/upstart-events.7: Correction for 'rotate-logs'.
  * debian/upstart.cron.daily: Specify full path to initctl.
  * init/man/init.8: Add missing information on '--chroot-sessions'.
  * debian/upstart.apport: Sort system and session jobs.

  [ Iain Lane ]
  * xsession-init: Set $GNOME_DESKTOP_SESSION_ID if we are launching a
    gnome-session session. Some applications (Qt4) require this to be set to
    any value to detect the environment in use. It was historically set by
    gnome-session but now this is no longer the root of the session so not all
    user processes are guaranteed to have it. (LP: #1305294)

  [ Dimitri John Ledkov ]
  * Cherrypick reboot command fix to not process REBOOTCOMMAND argument
    when in runlevels 2-5 and without using force flag. (LP: #1174272)
 -- Dimitri John Ledkov <email address hidden> Fri, 18 Jul 2014 10:27:27 +0100

Changed in upstart (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for upstart has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers