Bug 352999 - dolphin starts applications with a strange set of environment variables
Summary: dolphin starts applications with a strange set of environment variables
Status: RESOLVED WORKSFORME
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-21 17:16 UTC by Michał
Modified: 2015-12-03 23:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Wrong Qt style in Okular (228.88 KB, image/png)
2015-09-21 17:16 UTC, Michał
Details
Environment when ran from Dolphin (1.70 KB, text/plain)
2015-10-04 20:58 UTC, Michał
Details
Environment when ran from Yakuake (3.37 KB, text/plain)
2015-10-04 20:59 UTC, Michał
Details
File dialog in Kdenlive 15.08.1 (256.68 KB, image/png)
2015-10-08 19:48 UTC, Michał
Details
File dialog in KTorrent 4.3.1 (290.59 KB, image/png)
2015-10-08 19:49 UTC, Michał
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał 2015-09-21 17:16:28 UTC
Okular ignores Qt style set in systemsettings.
Attached screenshot of two windows open: Dolphin - styled correctly (QtCurve) and Okular - wrong style (is it Oxygen?).

Reproducible: Always
Comment 1 Michał 2015-09-21 17:16:50 UTC
Created attachment 94666 [details]
Wrong Qt style in Okular
Comment 2 Michał 2015-09-21 17:18:11 UTC
Interesting thing to notice is that when I run Okular from terminal (yakuake) it uses QtCurve - correct. But when run from Dolphin, wrong style is used.
Comment 3 Luigi Toscano 2015-09-21 17:23:07 UTC
Do you use Dolphin 15.08, under Plasma 5? If so, they use the Qt5 theme, but Okular is a kdelibs4 application and it requires you to set the theme for Qt4 applications.
Comment 4 Albert Astals Cid 2015-09-22 23:02:30 UTC
Luigi needs answers
Comment 5 Michał 2015-09-23 06:00:36 UTC
Luigi: I'm using Plasma 4 on Arch Linux. I have both themes in Qt 4 and Qt 5 set to QtCurve. They look very similar on both libs (only the Qt 5 is a bit darker, since I didn't configure the color palette there). For Qt5 I used qt5ct to set the theme. It works well in my Qt5 app. Dolphin is 15.08.

Okular uses completely different style, when run from Dolphin, but the correct one (QtCurve) when run from terminal (Konsole or Yakuake). There must be some difference here…

Albert: Do you think I should file a bug that bugs.kde.org doesn't always send out notifications? ;-)
Comment 6 Albert Astals Cid 2015-09-23 22:52:49 UTC
I'm going to assume you rebooted since you chagned the theme?
Comment 7 Michał 2015-09-24 05:54:35 UTC
Yes, I at least relogin after that and I always reboot after system upgrade.

I tried to see if there are any significant env differences when run from konsole and from Dolphin and I found out that when I create a script:

#!/bin/sh
gwenview "file.jpg"

and run it from Dolphin, Gwenview uses correct theme. When run by clicking on an image - not. I just found another Dolphin bug that I can't edit "file type options" from within Properties dialog and I wonder if this bug isn't actually Dolphin's fault…

BTW, do you know any method of dumping env variables of a running process?
Comment 8 Michał 2015-09-24 05:57:29 UTC
Ah, wrong bug. I was actually trying to debug similar problem in Gwenview

https://bugs.kde.org/show_bug.cgi?id=352754

(which doesn't use Oxygen theme but goes further - loses all icons, uses wrong fonts, etc.) I guess those two might be related.

Nevertheless, my question about env variables still stands. ;-)
Comment 9 Albert Astals Cid 2015-09-24 11:19:39 UTC
Find the pid of the process, then cd /proc/THEPID/

xargs -n 1 -0 < environ
Comment 10 Michał 2015-10-04 20:57:18 UTC
Sorry for the delay, but again I didn't get any mail from bugs.kde.org.
I ran the command and I'm going to attach the diff.

I see that when run from Dolphin, there are missing some important variables.
I ran gwenview like this:

KDE_FULL_SESSION= KDE_SESSION_UID= KDE_SESSION_VERSION= gwenview freecad-1.png

and got reproduction.

So I made this test.sh:

#!/bin/sh
konsole -e "/bin/sh -c 'read'"

Ran it from dolphin and I do have those variables in konsole process:

22:53 /proc/7845 % xargs -n 1 -0 < environ|grep KDE
KDE_MULTIHEAD=false
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSION=4
XDG_CURRENT_DESKTOP=KDE
Comment 11 Michał 2015-10-04 20:58:58 UTC
Created attachment 94844 [details]
Environment when ran from Dolphin
Comment 12 Michał 2015-10-04 20:59:48 UTC
Created attachment 94845 [details]
Environment when ran from Yakuake
Comment 13 Albert Astals Cid 2015-10-04 22:38:44 UTC
Which dolphin version is that?
Comment 14 Michał 2015-10-07 21:20:00 UTC
It's Dolphin 15.08.0.
Comment 15 Albert Astals Cid 2015-10-07 21:31:25 UTC
Dolphin people see comments 11 and 12, okular receives a very different set of environment variables when run through dolphin or through yakuake which influences the theme and some other things.
Comment 16 Emmanuel Pescosta 2015-10-08 08:31:44 UTC
We use KRun to open files with their associated applications, maybe the problem is there?

@Michał:
Can you please try to open the same file in Gwenview via the open/save dialog (e.g. in Kate) and check the environment variables again? If there is the same problem, we know that the problem must be somewhere lower in the stack. Thanks for your help!
Comment 17 Michał 2015-10-08 19:47:43 UTC
How can I open an image from an Open dialog? When I double-click a file in Kate it gets opened… in Kate as a text file.  But Kate's "Open file" dialog doesn't look like KDE, it's more like generic Qt dialog.

Seems that some new programs (from the 15.08 line) show this generic Qt dialog, but KTorrent (4.3.1) shows the correct one. I'll attach two example screenshots.

Nevertheless, I pasted a path to an image into KRunner (the thing that's usually bound to Alt+F2) and Gwenview opened in a "healthy" state.
Comment 18 Michał 2015-10-08 19:48:29 UTC
Created attachment 94899 [details]
File dialog in Kdenlive 15.08.1
Comment 19 Michał 2015-10-08 19:49:17 UTC
Created attachment 94900 [details]
File dialog in KTorrent 4.3.1
Comment 20 Albert Astals Cid 2015-11-04 23:11:09 UTC
I can not reproduce this. Two questions:
 * How do you start dolphin?
 * Which kde frameworks version do you have installed?
Comment 21 Michał 2015-11-05 06:29:29 UTC
I was starting it from krunner or a keyboard shortcut.
But since my last system upgrade, the bug doesn't reproduce anymore. Also the original problem with Gwenview (https://bugs.kde.org/show_bug.cgi?id=352754) is gone. I didn't see any KDE programs being upgraded, but Qt was, from 5.5.0 to 5.5.1…
Comment 22 Albert Astals Cid 2015-11-05 20:56:10 UTC
Setting to needsinfo, since with no way to reproduce it's hard to fix.
Comment 23 Christoph Feck 2015-12-03 23:15:51 UTC
Thanks for the update. If you see this issue again, please add a comment, or file a new ticket.