! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Use the new Gtk3 bookmarks location
Status:
RESOLVED: FIXED

Comments

Description Alistair Buxton 2014-01-12 18:34:17 CET
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.
Comment 1 Unit 193 2014-02-07 21:16:07 CET
Added that in on several computers, works nicely, just what I was looking for.
Comment 2 Alistair Buxton 2014-03-12 21:21:46 CET
Created attachment 5384 
Updated patch

Updated patch ensures the config directory exists before writing bookmarks.
Comment 3 Sylvain 2014-06-13 14:37:09 CEST
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
Comment 4 Alistair Buxton 2014-06-13 14:58:07 CEST
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).
Comment 5 Sylvain 2014-06-13 15:38:36 CEST
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.
Comment 6 Alistair Buxton 2014-06-13 15:43:19 CEST
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.
Comment 7 Jannis Pohlmann editbugs 2014-07-25 15:24:22 CEST
Pushed to master. Slightly reworded the commit message and fixed the coding style (missing spaces before function call parentheses).

commit 6a63d7bd8ff0d937cb30f112c3fd080a5a107053
Author: Alistair Buxton <a.j.buxton@gmail.com>
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.

Bug #10627

Reported by:
Alistair Buxton
Reported on: 2014-01-12
Last modified on: 2014-07-25

People

Assignee:
Jannis Pohlmann
CC List:
2 users

Version

Attachments

patch (1.63 KB, patch)
2014-01-12 18:34 CET , Alistair Buxton
no flags
Updated patch (2.96 KB, patch)
2014-03-12 21:21 CET , Alistair Buxton
no flags

Additional information