From 2edbb203c18217e2c947ce5d40b2a2b6bb44ad2a Mon Sep 17 00:00:00 2001 From: EdCordata Date: Fri, 17 Apr 2026 10:16:41 +0300 Subject: [PATCH 1/2] feat: add option to show real filenames --- libnemo-private/nemo-file.c | 8 ++++++++ libnemo-private/nemo-global-preferences.h | 1 + libnemo-private/org.nemo.gschema.xml | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/libnemo-private/nemo-file.c b/libnemo-private/nemo-file.c index 72a8a6011..9db8e9a51 100644 --- a/libnemo-private/nemo-file.c +++ b/libnemo-private/nemo-file.c @@ -230,6 +230,14 @@ nemo_file_set_display_name (NemoFile *file, { gboolean changed; + /* When enabled, always show the actual filename instead of any custom + * display name (e.g. the Name field inside .desktop files). */ + if (custom && + file->details->name != NULL && + g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_REAL_FILENAME)) { + return FALSE; + } + if (custom && display_name == NULL) { /* We're re-setting a custom display name, invalidate it if we already set it so that the old one is re-read */ diff --git a/libnemo-private/nemo-global-preferences.h b/libnemo-private/nemo-global-preferences.h index 91f404854..6465b48c6 100644 --- a/libnemo-private/nemo-global-preferences.h +++ b/libnemo-private/nemo-global-preferences.h @@ -41,6 +41,7 @@ G_BEGIN_DECLS /* Display */ #define NEMO_PREFERENCES_SHOW_HIDDEN_FILES "show-hidden-files" +#define NEMO_PREFERENCES_SHOW_REAL_FILENAME "show-real-filename" #define NEMO_PREFERENCES_SHOW_ADVANCED_PERMISSIONS "show-advanced-permissions" #define NEMO_PREFERENCES_DATE_FORMAT "date-format" #define NEMO_PREFERENCES_DATE_FONT_CHOICE "date-font-choice" diff --git a/libnemo-private/org.nemo.gschema.xml b/libnemo-private/org.nemo.gschema.xml index abc2814d4..b5af42de3 100644 --- a/libnemo-private/org.nemo.gschema.xml +++ b/libnemo-private/org.nemo.gschema.xml @@ -321,6 +321,11 @@ Whether to show hidden files If set to true, then hidden files are shown by default in the file manager. Hidden files are either dotfiles, listed in the folder's .hidden file or backup files ending with a tilde (~). + + false + Whether to show files by their actual filename + If set to true, all files will be displayed using their actual filename instead of any custom display name (such as the Name field inside .desktop files). + false Whether to show the full path of the current view in the title bar and tab bars From bb391100ceaab0d3fd03bc26645114eb37fd97b8 Mon Sep 17 00:00:00 2001 From: EdCordata Date: Fri, 17 Apr 2026 10:57:23 +0300 Subject: [PATCH 2/2] Move check to a better place --- libnemo-private/nemo-file.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libnemo-private/nemo-file.c b/libnemo-private/nemo-file.c index 9db8e9a51..39aee16cf 100644 --- a/libnemo-private/nemo-file.c +++ b/libnemo-private/nemo-file.c @@ -230,14 +230,6 @@ nemo_file_set_display_name (NemoFile *file, { gboolean changed; - /* When enabled, always show the actual filename instead of any custom - * display name (e.g. the Name field inside .desktop files). */ - if (custom && - file->details->name != NULL && - g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_REAL_FILENAME)) { - return FALSE; - } - if (custom && display_name == NULL) { /* We're re-setting a custom display name, invalidate it if we already set it so that the old one is re-read */ @@ -4164,6 +4156,13 @@ nemo_file_peek_display_name (NemoFile *file) } } + /* When enabled, always show the actual filename instead of any custom + * display name (e.g. the Name field inside .desktop files). */ + if (file->details->name != NULL && + g_settings_get_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_REAL_FILENAME)) { + return file->details->name; + } + return file->details->display_name; }