After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766952 - Selecting Show Hidden Files makes the menu popover disappear
Selecting Show Hidden Files makes the menu popover disappear
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: Main Toolbar
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-27 22:07 UTC by Neil Herald
Modified: 2021-06-18 15:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window-slot: prevent menu disappearing when Hidden Files toggled (2.99 KB, patch)
2016-12-10 14:43 UTC, Neil Herald
committed Details | Review

Description Neil Herald 2016-05-27 22:07:21 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.
Comment 1 Carlos Soriano 2016-05-30 08:36:57 UTC
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.
Comment 2 Neil Herald 2016-12-10 14:43:55 UTC
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.
Comment 3 Neil Herald 2016-12-10 14:49:38 UTC
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?
Comment 4 Carlos Soriano 2016-12-10 14:53:07 UTC
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!
Comment 5 Carlos Soriano 2016-12-10 14:57:54 UTC
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 6 Neil Herald 2016-12-10 20:47:25 UTC
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
Comment 7 Neil Herald 2016-12-10 20:56:38 UTC
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
Comment 8 Alexandre Franke 2017-12-19 22:09:02 UTC
(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?
Comment 9 André Klapper 2021-06-18 15:53:51 UTC
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.