PCManFM bookmarks are not being respected by other applications due to GTK 3.0

Bug #1208681 reported by ibere fernandes on 2013-08-06
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
thunar
Fix Released
Medium
pcmanfm (Ubuntu)
Low
Unassigned
thunar (Ubuntu)
Low
Unassigned

Bug Description

Steps to reproduce:

1) do a fresh install in a VM or in a real hardware;
2) open PCManFM and create a bookmark to any folder, for instance, Downloads;
3) note that the file .gtk-bookmarks will be created at /home/.gtk-bookmarks due to step 2);
4) note that there's no folder /home/username/.config/gtk-3.0 at this point;
5) in order to create gtk-3.0 folder, let's open Startup Disk Creator and play a little with it until you see the folder gtk-3.0 created at /home/username/.config/

now let's goto the bug itself:
1) at this point, you'll have 2 bookmarks files for PCManFM that look the same.
one at
/home/username/.gtk-bookmarks

the other at
 /home/username/.config/gtk-3.0/bookmarks

2) on PCManFM, let's create another bookmark, for instance, Templates. goto Templates folder, ctrl+D and confirm bookmark creation.

3) open any other application except PCManFM. Leafpad, Firefox, Abiword are ok.
I'll open Leafpad, choose File>Save and note on the "Save as" window that there's no bookmark for the Templates folder that we created before. Only the boomark for the Downloads folder will be there. From now on, every new folder that we boomark via PCManFM will not be available when trying to access that bookmark from other applications.

More details here:
http://askubuntu.com/questions/328914/pcmanfm-bookmarks-not-being-respected-by-other-applications

4) check also the thread below:
https://lists.ubuntu.com/archives/lubuntu-users/2013-August/005280.html

and note the following comment from PCMan:
"It reads and writes ~/.config/gtk-3.0/bookmarks instead of ~/.gtk-bookmarks as in gtk+ 2."

5) so rename the ~/.config/gtk-3.0/bookmarks to ~/.config/gtk-3.0/bookmarks.old or delete it and make the symlink manually;

6) Thanks to PCMan himself, I managed to manually fix as a workaround on my test machine:
ln -s /home/username/.gtk-bookmarks /home/username/.config/gtk-3.0/bookmarks

What's the best solution to have it fixed automatically for Saucy?

tks,
Iberê

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: pcmanfm 1.1.0-0ubuntu2
ProcVersionSignature: Ubuntu 3.10.0-6.17-generic 3.10.3
Uname: Linux 3.10.0-6-generic i686
ApportVersion: 2.12-0ubuntu2
Architecture: i386
Config_pcmanfm_System_Lubuntu: Error: [Errno 2] No such file or directory: '/etc/xdg/pcmanfm/lubuntu.conf'
Date: Tue Aug 6 01:07:16 2013
ExecutablePath: /usr/bin/pcmanfm
InstallationDate: Installed on 2013-08-06 (0 days ago)
InstallationMedia: Lubuntu 13.10 "Saucy Salamander" - Alpha i386 (20130805)
MarkForUpload: True
Pref_Config_System_Lubuntu:
 [Preferred Applications]
 WebBrowser=firefox.desktop
 MailClient=
SourcePackage: pcmanfm
UpgradeStatus: No upgrade log present (probably fresh install)

Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1208681

tags: added: iso-testing

more info:
the symlink did not survive a reboot on my laptop so the bug is alive again.

there's a thread at the lubuntu users list informing that:
https://lists.ubuntu.com/archives/lubuntu-users/2013-August/005299.html

thank you Augustine for catching that.

Launchpad Janitor (janitor) wrote :

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

Changed in pcmanfm (Ubuntu):
status: New → Confirmed

more info 2:

the symlink survive reboots if the symlink is made like this, with a period before the file name:

ln -s /home/username/.gtk-bookmarks /home/username/.config/gtk-3.0/.bookmarks

kind of odd though that the symlink did not survive without the period:

ln -s /home/username/.gtk-bookmarks /home/username/.config/gtk-3.0/bookmarks

cheers,
iberê

btw, thank you to Bucky Ball from UF for making the "period" suggestion:

http://ubuntuforums.org/showthread.php?t=2165583&p=12755198#post12755198

Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu Package testing tracker.

A list of all reports related to this bug can be found here:
http://packages.qa.ubuntu.com/qatracker/reports/bugs/1208681

tags: added: package-qa-testing
LStranger (andrej-rep) wrote :

This was a change in gtk-2.24.12 for gtk2.0. That change wasn't adopted by pcmanfm yet. It will be fixed in libfm-1.2.0 which is planned for beta release later this month. Thank you very much for noticing this.

Phill Whiteside (phillw) wrote :

what else would you expect from the qa / testing team? Can you assign the the bug and also change the flag to 'fix-commited' so that others seeing the bug know it it is being addressed?
Regards,
Phillw.

Phill Whiteside (phillw) wrote :

darn these smart phones... that is -1 the and -1 it :/

Julien Lavergne (gilir) wrote :

Upstream patch : http://git.lxde.org/gitweb/?p=lxde/libfm.git;a=commit;h=114676c7cf6482f68c25314972c5d4d7206600fd
It's in 1.2.0 (alpha), not sure it can be backported to 1.1.2

Julien Lavergne (gilir) wrote :

Confirmed with upstream that the fix can't be in 1.1.2, so it will be available when 1.2.0 will be stable.

Created attachment 5310
patch

The file ~/.gtk-bookmarks has moved in recent Gtk2 and Gtk3 bookmarks. It is now stored at ~/.config/gtk-3.0/bookmarks

This patch updates default location to the new one, and adds a fallback which will load the old bookmarks. A watch is set on the new file location, not the legacy location. In this way the new file always overrides the legacy file even if the new file doesn't exist at startup. This should mimic the new gtk behaviour.

Added that in on several computers, works nicely, just what I was looking for.

This bug affects Thunar 1.6.3 at Xubuntu 13.10, default i386 install.

Workarounds from comments #0 together with #5 worked for me.

Caveats: if you create a new bookmark at Thunar, you'll need to redo the symlink in order to changes propagate to /home/username/.config/gtk-3.0/bookmarks.

best regards,
ibere

affects: pcmanfm (Ubuntu) → thunar (Ubuntu)
affects: thunar (Ubuntu) → pcmanfm (Ubuntu)
Alistair Buxton (a-j-buxton) wrote :

This bug does also affect Thunar, and in fact Thunar has a patch waiting to be approved upstream. The fix should be very easy to port over.

Julien Lavergne (gilir) wrote :

Fix committed for pcmanfm (included in pcmanfm / libfm 1.2.0)

Changed in pcmanfm (Ubuntu):
status: Confirmed → Fix Committed

bug is still alive at today's image. pls, check bug1.txt file attached.

according to apt-cache show, libfm version should be correct as per comment #15.

excerpt from terminal:
ibslub1404@ibslub1404-Latitude-D630:~$ apt-cache show libfm4
Package: libfm4
Priority: optional
Section: universe/libs
Installed-Size: 352
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian LXDE Maintainers <email address hidden>
Architecture: i386
Source: libfm
Version: 1.2.0-1ubuntu1
Depends: libc6 (>= 2.7), libdbus-glib-1-2 (>= 0.78), libexif12, libglib2.0-0 (>= 2.37.3), libmenu-cache3 (>= 0.5.0), libfm-data (>= 1.2.0~), lxmenu-data
Pre-Depends: multiarch-support
Recommends: libfm-modules
Filename: pool/universe/libf/libfm/libfm4_1.2.0-1ubuntu1_i386.deb
Size: 114918

Adolfo Jayme (fitojb) on 2014-03-10
Changed in pcmanfm (Ubuntu):
importance: Undecided → Low
Changed in thunar (Ubuntu):
importance: Undecided → Low

Created attachment 5384
Updated patch

Updated patch ensures the config directory exists before writing bookmarks.

Changed in thunar (Ubuntu):
status: New → Fix Released
In , Xfce4 (xfce4) wrote :

During xubuntu upgrade it is not obvious why bookmarks stop working.

As some default places are already put in the new bookmark, legacy bookmark is ignored by Thunar and xfce4-places-plugin-1.6.0.

This command corrected my issue:

cd ~/.config/gtk-3.0
cp ~/.gtk-bookmarks bookmarks

There is nothing we at Xfce can do about that. It happens because Gtk3 itself creates the new file as soon as you open any file requester. The only thing we can do is make sure Xfce is using the same file as Gtk, but that is already too late for many users.

Gtk does not provide any API to query the correct bookmarks location, and according to the developers, bookmarks are an entirely private API which should not be used by any software (except Nautilus, because apparently that is special).

In , Xfce4 (xfce4) wrote :

Thank you Alistair.

> There is nothing we at Xfce can do about that[…]

Sorry I'm not aware about API design and where role/project starts/stops. I just noticed it stops working after an update and I decided to correct it myself today, as following updates didn't seem to fix it automagically.

My feeling is that the migration process should have been handled automatically at some point. As the upgrade worked to upgrade xfce4-places-plugin and thunar, the softwares I'm using which seem to depend this bookmark file.

Especially if the bookmarks file format is exactly the same.
I just posted here because I found this ticket by searching .gtk-bookmarks.

Your first reply helped me to fix my issue. I hope it can help someone else.

Thunar seems also to have lost its "send to" bookmark right click feature… (Shortcuts Pane ?)
That how I created my bookmark at first. But it's probably another issue.

The migration already is handled automatically by Gtk3 and that is the problem. Gtk3 migrated you years ago without you knowing about it. Since then you have had two bookmark files with different contents. The only effect you would see is that file requesters would show different bookmarks to thunar.

There is nothing Xfce can do about this because we have no way of knowing which one you want to delete and which one you want to keep, in order to bring them in sync.

Changed in thunar:
importance: Unknown → Medium
status: Unknown → Confirmed

Pushed to master. Slightly reworded the commit message and fixed the coding style (missing spaces before function call parentheses).

commit 6a63d7bd8ff0d937cb30f112c3fd080a5a107053
Author: Alistair Buxton <email address hidden>
Date: Wed Mar 12 20:20:05 2014 +0000

    Add support for the GTK 3 bookmarks file (bug #10627)

    The changes ensure that the config directory exists before attempting to
    write bookmarks. It falls back to the old location to support both GTK 2
    and 3.

Changed in thunar:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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