mate-desktop / caja

Caja, the file manager for the MATE desktop
https://mate-desktop.org/
Other
271 stars 145 forks source link

Caja Window Size Determines Whether You Can Rename a File or Not #1444

Open machineghost opened 4 years ago

machineghost commented 4 years ago

Expected behaviour

I can rename a file, whatever the size of the Caja window

Actual behaviour

I try to rename a file with F2: nothing happens. I go to the menu and do rename: nothing happens. I right-click and rename: nothing happens.

I increase the width of the window ... suddenly it magically works

Steps to reproduce the behaviour

Basically just the above, but this thread has further details (NOTE: I didn't post in that thread, but it seems like the same core problem, and it helped me find the resize workaround):

https://forums.linuxmint.com/viewtopic.php?t=296934

MATE general version

I literally don't know how to check this: maybe leave a comment here saying what command to run?

Package version

See above.

Linux Distribution

Linux Mint 20 (not sure which subversion exactly, but I just installed it a month ago)

Link to downstream report of your Distribution

See above: I really think you'd get better info if you told people how to give you what you want.

phisigma commented 4 years ago

First of all, machineghost, thank you very much!

I finally have my workaround šŸ˜… I would never have thought of the window size. I use Mate/Caja 1.24.0 on Ubuntu 20.04.

Just a small hint how to reproduce this issue so you donā€™t have to read the forum thread: Create a folder with some subfolders or files, or use an existing folder (with about 5 to 15 objects). Then resize the window so that a vertical scroll bar just appears on the right. This scrollbar could be omitted and ā€œdoes not really make senseā€ as you can only scroll 2 or 5 pixels, so it uses nearly the whole space. Now you cannot rename objects anymore.

usb21 commented 3 years ago

Just installed Mint 20.1 64bit MATE w/ Caja File Mgr. I CANNOT rename any objects (directories,files) while in full screen, unless i right-click , then go down to "Properties", and then change the name in the "Name" box. I CAN rename objects, either using F2 or right-click and "Rename", when NOT in full screen. I hope they fix this; it's pretty annoying.

Amis commented 3 years ago

Link to downstream: https://bugs.launchpad.net/bugs/1771768

lukefromdc commented 3 years ago

I too have seen this, it can be fiddly at times though usually OK on my system.

thesquash commented 2 years ago

I might be wrong, but this sure smells like yet another GTK+ bug -- although not as much as I thought it did when I first replied to this issue.

This issue appears in Icon View and Compact View modes; it does not happen in List View mode. Since both Compact and Icon View modes use the GtkIconView widget [EDIT: No, actually they use a Caja-specific widget based around GtkLayout] (and List View mode uses GtkTreeView instead), the GtkIconView seems to be the common factor.

In all of the below screengrabs, I'm enthusiastically pressing the F2 key in an attempt to rename my .profile file. Only in List View mode do I get anywhere.

compact_view icon_view list_view

lukefromdc commented 2 years ago

I'm pretty sure the only place we use Gtk's own icon view widget is in mate-appearance-properties, showing the theme thumbnails.

While it is indeed possible to use GtkIconView for a file manager's icon display, Nautilus always used a custom widget, so Nemo and Caja also do. I am guessing the icon view widget in GTK was based originally on a simplification of this, it is known some other widgets first used in Nautilus found their way into GTK 2.

thesquash commented 2 years ago

You're right, @lukefromdc -- I started digging into the code and remembered that, sorry.

Anyway, I've made another interesting discovery. I can reproduce the odd behavior in Icon View only when both of the following are true:

  1. The vertical scrollbar is showing (i.e., the FMIconContainer is too large to fit entirely inside the window); and
  2. The FMIconContainer is allocated an area less than 16 pixels shorter than its minimum height (i.e., you can scroll the page by 15 pixels or less).

The 16 pixel "magic number" is not affected by the width / height of the scrollbar, as I tried this with themes with 13, 14, 15, and even 4 pixel scrollbars and the 16 pixel magic number did not change.

lukefromdc commented 2 years ago

I used mate-search-tool to look for the number or string "16" in all the files in caja's src directory and found nothing. Thus this is not a magic number set somewhere in our code with unexpected results

halfburnttoast commented 2 years ago

I'm having this issue too with v1.26.0 shipped with Linux Mint 21. Seems like almost randomly, file renaming stops working. But, if I slightly resize the window, renaming works again.

lukefromdc commented 2 years ago

I just confirmed this occurs when you have the scrollbar for the icon container showing but just barely needed. Didn't count the pixels but this can now be duplicated or avoided at will