GNOME Bugzilla – Bug 766952
Selecting Show Hidden Files makes the menu popover disappear
Last modified: 2021-06-18 15:53:51 UTC
As discussed here https://bugzilla.gnome.org/show_bug.cgi?id=764632#c45, the desired behaviour is for the popover to stay open. It happens because toggling the option causes a full load_directory (files-view.c), which ultimately calls gtk_widget_grab_focus(window) (via view_started_loading in windows-slot.c). Commenting out the grab_focus call stops the popover from disappearing, but the menu items flicker when the option is toggled - so this isn't just a straightforward fix. Need to a) consider how best to avoid the grab_focus call without affecting anything else (probably not trivial), and b) stop the menu flickering.
Yeah, it's a hard problem :( I think the only way to do is to check whether things really changed, so that we really need to grab focus on the view or that we need to change the view menu.
Created attachment 341721 [details] [review] window-slot: prevent menu disappearing when Hidden Files toggled When the user toggled the Show Hidden Files option on the toolbar menu, previously the menu disappeared - which isn't the correct behaviour. This commit changes it so that the menu doesn't disappear.
I've went with your approach (which is a good idea btw). Can't simply check if the window has focus before we try to grab it though, because the window never has focus when the menu is visible anyway. Part of me thinks there's maybe a better way than how I've done it, e.g. does gtk provide a way to tell if menus are currently open?
Review of attachment 341721 [details] [review]: Hey Neil!! Glad to see you around here :) The patch looks good, I think it's the most correct approach. Can you commit to both 3.22 and master? Thanks!
The only way to know if the menu is showing is with checking whether the button is pressed or not (this is the way we activate or not the menu), but checking visibility sounds right too. Also, I think the menu flickering is a small bug we can consider on how to fix afterwards, so no worries. Btw we are going to have a videocall to discuss some technical details (mostly a excuse to gather all of us together and chat tbh :)) https://etherpad.gnome.org/p/nautilus most probably next week. Wanna join? Just join IRC and we can talk about that if you want. Take care!
Comment on attachment 341721 [details] [review] window-slot: prevent menu disappearing when Hidden Files toggled Attachment 341721 [details] pushed as acff418 - window-slot: prevent menu disappearing when Hidden Files toggled
Done. It's nice to be submitting patches again :) I'm going to look into the flickering. I notice it doesn't happen for the list view, so presumably the canvas view is disabling the actions (which is maybe sensible while the view is reloading?) I would join if I had a headset/webcam, but I think I got rid of my headset. Will see if I can find it though
(In reply to Neil Herald from comment #7) > I'm going to look into the flickering. Can you open a new issue for that and close this one when you’re done?
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of Files (nautilus), then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/nautilus/-/issues/ Thank you for your understanding and your help.