Skip to content

Bookmarks show wrong icons for XDG directories (Documents, Music, etc.) #3805

Description

@sporteka2

Description

Icons for the same XDG directories (Documents, Downloads, Music, Pictures, etc.) appear differently in the Bookmarks menu vs the Places sidebar, although they should be identical.

Both places use GTK_ICON_SIZE_MENU (16×16 px) — the size is the same.

Root cause

Icon source

Built-in places in the sidebar (Home, Documents, etc.) get their specific symbolic icon via nemo_file_get_control_icon_name()get_symbolic_icon_name_for_file():

  • user-home-symbolic
  • folder-documents-symbolic
  • folder-music-symbolic
  • etc.

User bookmarks (both in the menu and in the sidebar) get their icon via nemo_bookmark_get_icon_name().

The bug in get_default_folder_icon_name()

In libnemo-private/nemo-bookmark.c, function get_default_folder_icon_name() (line 139-157) does not check for XDG special directories. For all local folders it returns plain folder-symbolic instead of the specific icon:

if (g_file_is_native (bookmark->details->location)) {
    ret = g_strdup (NEMO_ICON_SYMBOLIC_FOLDER); // always "folder-symbolic"
}

Meanwhile, get_symbolic_icon_name_for_file() in nemo-file.c:4680-4724 correctly identifies XDG directories and returns proper symbolic icons, but this function is not used in the bookmark fallback path.

Expected behavior

A bookmark pointing to ~/Documents should show folder-documents-symbolic, ~/Musicfolder-music-symbolic, etc., not folder-symbolic for all.

Files involved

  • libnemo-private/nemo-bookmark.cget_default_folder_icon_name() line 139
  • libnemo-private/nemo-file.cget_symbolic_icon_name_for_file() line 4680
  • libnemo-private/nemo-icon-names.h — icon name definitions
  • src/nemo-window-bookmarks.c — bookmarks menu
  • src/nemo-places-sidebar.c — places sidebar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions