Skip to content

Show 'Recent' in save mode#132

Merged
lah7 merged 4 commits intolah7:masterfrom
reswild:master
Oct 11, 2025
Merged

Show 'Recent' in save mode#132
lah7 merged 4 commits intolah7:masterfrom
reswild:master

Conversation

@reswild
Copy link
Contributor

@reswild reswild commented Sep 7, 2025

This PR bring back the 'Recent' option in save dialogs in the File Chooser by reverting commit fe128b5 from 2015.

@lah7 lah7 added the patch new Adds a new enhancement or feature label Sep 13, 2025
Copy link
Owner

@lah7 lah7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Seems like a good one to reinstate. Can confirm "Recents" now appears in save dialogs.

I observed one crash under ghex 3.41.1 by selecting "Recents" in the Save As dialog if another item on the sidebar isn't selected first. Because that risks data loss, I won't merge it just yet.

(ghex:5661): Gtk-CRITICAL **: 18:24:58.952: gtk_tree_model_get: assertion 'GTK_IS_TREE_MODEL (tree_model)' failed
Segmentation fault         (core dumped) ghex

This video shows opening a file in ghex, doing a "Save As" and clicking "Recents" (window disappear = crash). Then repeated, but by selecting an item in the sidebar first, which doesn't crash.

Peek.2025-09-13.18-33.mp4

Other GTK apps I tried (Firefox, Meld, Disks) don't crash, but can't risk instability if someone accidentally clicks on it for any other random GTK 3 program.

@lah7 lah7 added the needs investigating More details required on what needs to be done label Sep 13, 2025
@reswild
Copy link
Contributor Author

reswild commented Sep 14, 2025

I can have a look at this, but so far, I haven't been able to reproduce this error. I tried installing ghex 3.41.1 from the Ubuntu repos, but everything worked as expected.

What distro are you using, and how did you install GHex?

@lah7
Copy link
Owner

lah7 commented Sep 14, 2025

I'm using Arch Linux. Despite being a rolling release, I downgraded (and ignore updates) to an old package version of ghex 3.41.1.

I'm not sure if the error is specific to me in that case because it's an old build (Dec 2021) despite working fine. I would try rebuilding the package (via its PKGBUILD) to see if compiling a fresh package under new stuff helps, but GNOME's GitLab is throwing 502 errors right now! I'll try again later.

@lah7
Copy link
Owner

lah7 commented Sep 14, 2025

Despite GNOME GitLab down, I was able to take ghex_3.41.1.orig.tar.xz from the Ubuntu 22.04 ghex package and use that to build a fresh package for Arch Linux - same result, it crashes. Not sure why the same program version wouldn't crash under Ubuntu.

@reswild
Copy link
Contributor Author

reswild commented Sep 14, 2025

It might be because you are running a newer version of GTK than I am. I can try to do some testing with different versions.

@reswild
Copy link
Contributor Author

reswild commented Oct 6, 2025

I've updated my patch to remove all the code that was causing errors. According to the inline comments, this code was supposed to 'take the folder stored in a row in the recent_model, and put it in the pathbar', but the pathbar is in any case hidden when you are in 'recent' mode, and saving files seems to work fine without it.

I did notice that saving files from 'recent' mode works different than when you are in regular mode: In 'recent' mode, if you mark a directory and press save, the file is saved immediately to that directory, while in regular mode you enter the directory instead of saving the file. This can be a bit confusing, so it should maybe be looked at, but I'm not sure what the intended behaviour is here.

@lah7 lah7 removed the needs investigating More details required on what needs to be done label Oct 11, 2025
@lah7
Copy link
Owner

lah7 commented Oct 11, 2025

I see what you mean by the behaviour when a directory is selected in Recents while in save mode. It seems a minor inconsistency, but I think it's OK. Users like myself would naturally double click the folder.

From looking at a GTK 2 application (GIMP), it's actually the same behaviour as you've described - clicking on a directory via Recents then "Save" doesn't enter the folder, but it would if browsing then selecting a folder → "Save".

You're welcome to (or anyone can) improve upon the patch later if it feels unusual. We can also wait and see if anybody raises an issue about it. I'm happy for the behaviour to lean either way.

Copy link
Owner

@lah7 lah7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing! Can confirm: no more crashes.

@lah7 lah7 merged commit 5b5d22b into lah7:master Oct 11, 2025
4 checks passed
@reswild
Copy link
Contributor Author

reswild commented Oct 12, 2025

I'm thinking that the 'save directly' behaviour is the most intuitive: When you click on a button saying 'Save', it's natural to assume that this will actually save the file, and not open a directory, and this also saves you an extra click. On the other hand, I guess people are used to the old behaviour, and may be confused by a change, so I'm not sure what is best.

I checked the behaviour in GTK 2, and I can see that the pathbar is shown here after you select a directory in 'Recent' mode, which I think is nice as it makes it clearer where the files are saved to.

Another thing that work better for me in GTK 2 is that the recent folders are sorted by Modified date instead of Accessed date as is the case in GTK 3. I use noatime in my file system, so access time for my directories never change, and sorting them by Accessed date therefore doesn't make any sense. There should maybe be an option for this, so you can switch between Modified and Accessed time based on your preferences and file system settings.

I can try to make some updated patches for these issues, but I don't know when I'll find time for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch new Adds a new enhancement or feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments