Duplicate Home bookmark when pressing Ctrl+D multiple times
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.6k
- Forks
- 368
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 2
Description
Summary
Pressing Ctrl+D to bookmark the Home folder multiple times creates duplicate entries in ~/.config/gtk-3.0/bookmarks.
Steps to reproduce
- Open Nemo and navigate to your home directory (
/home/$USER) - Press Ctrl+D (Add Bookmark)
- Press Ctrl+D again
- Open
~/.config/gtk-3.0/bookmarks— you will see multiple lines for the same location
Example file content:
file:///home/r Home
file:///home/r Home
file:///home/r Home
file:///home/r r
Root cause
The duplicate check in nemo_bookmark_list_contains() (src/nemo-bookmark-list.c:421-424) uses nemo_bookmark_compare_with(), which compares both the URI and the display name.
When a bookmark is first created by nemo_window_add_bookmark_for_current_location(), its initial name is the basename of the path (e.g. "r" for /home/r). Shortly after, bookmark_set_name_from_ready_file() asynchronously renames it to "Home" because nemo_file_is_home() returns TRUE.
On the next Ctrl+D:
- The existing bookmark has name
"Home" - The new bookmark has name
"r"(not yet renamed) nemo_bookmark_compare_with()sees"r"≠"Home"→ reports not duplicate- A second entry is appended
Proposed fix
In src/nemo-bookmark-list.c:423, change:
g_list_find_custom (bookmarks->list, (gpointer) bookmark, nemo_bookmark_compare_with)
to:
g_list_find_custom (bookmarks->list, (gpointer) bookmark, nemo_bookmark_compare_uris)
The function nemo_bookmark_compare_uris() already exists in libnemo-private/nemo-bookmark.c and compares only the URI. Bookmark identity should be based on location, not label.
Version
Nemo 6.6.3 (source 6.0.2 contains the same logic)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/nemo-bookmark-list.c at nemo_bookmark_list_contains(), especially the g_list_find_custom call around lines 421-424. Read nemo_bookmark_compare_uris() in libnemo-private/nemo-bookmark.c, then verify that pressing Ctrl+D repeatedly for the Home folder leaves only one URI entry in ~/.config/gtk-3.0/bookmarks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100