wrong working directory on autostart .desktop files

Bug #1787402 reported by Adrian Eduardo Rolla
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Xfce4 Session
Confirmed
Medium
xfce4-session (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

Using Xubuntu 16.04
At desktop startup, .desktop files located at ~/.config/autostart are started with wrong working directory.

How to reproduce the bug:
Foo.desktop contents
[Desktop Entry]
Version=1.0
Type=Application
Name=Foo
Comment=
Path=/home/adrian/Downloads
Exec=bash -c "pwd && while true; do sleep 100; done"
Icon=
Terminal=true
StartupNotify=false

When destop starts up, ~/.config/autostart/Foo.desktop is launched.
Output in terminal of pwd command is:
/home/adrian

It should be instead:
/home/adrian/Downloads

Bug does not happen if after desktop is up and running, you manually launch foo.desktop, which shows:
/home/adrian/Downloads

as it should be.

Any other Exec=command that is depending on working directory shows the same issue, just used this simplest example to enable anyone to reproduce the bug. Hope it helps.

Thanks.

Tags: bot-comment
Revision history for this message
In , V-chgis-g (v-chgis-g) wrote :

I've symlinked a .desktop file into ~/.config/autostart.

The program executes fine when it's menu item is clicked, but it does't work on log-on.

This is because xfce4-session is ignoring the Path entry in the .desktop file that should set the working directory for the executable - and the app is broken enough to fail if it's started in the wrong directory.

I'm using xfce4-session as packaged for Fedora 16: xfce4-session-4.8.3-1.fc16.x86_64.

Revision history for this message
In , Robby Workman (rworkman) wrote :

Perhaps something similar to 8f89ae4bb60fe6b15e0a8eb5b31135fbdd6ca182 in xfdesktop is needed here - Eric?

Revision history for this message
In , Eric Koegel (eric-koegel) wrote :

Oh yeah, makes sense. I don't have time to write a patch today.

Revision history for this message
In , Robby Workman (rworkman) wrote :

xfce_spawn_command_line_on_screen() is used there, and it doesn't allow a working directory passed to that function. There are some others in libxfce4ui/libxfce4ui/xfce-spawn.c that look plausible to use here, but I'm going to defer this one to someone more experienced. Thanks, Eric! :-)

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1787402/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → xubuntu-meta (Ubuntu)
affects: xubuntu-meta (Ubuntu) → xfce4-session (Ubuntu)
Changed in xfce4-session:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Carl F Karsten (carl-g) wrote :

bump. me too.

Sean Davis (bluesabre)
Changed in xfce4-session (Ubuntu):
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.