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 171424 - Empty menus behaviour
Empty menus behaviour
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Class: UIManager / Actions
2.6.x
Other Linux
: Normal normal
: Small feature
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 353560
 
 
Reported: 2005-03-23 22:56 UTC by Bastien Nocera
Modified: 2013-11-10 18:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk-demo-empty-menu.patch (1.67 KB, patch)
2006-02-08 19:26 UTC, Bastien Nocera
none Details | Review
gtk-ui-manager-make-empty-menu-insensitive.patch (3.65 KB, patch)
2006-02-09 09:37 UTC, Bastien Nocera
none Details | Review
Refreshed patch for svn trunk (3.12 KB, patch)
2007-03-18 20:23 UTC, Kalle Vahlman
none Details | Review

Description Bastien Nocera 2005-03-23 22:56:58 UTC
From the API docs:
<snip>
GtkUIManager offers two ways to treat empty submenus:
    * make them disappear by hiding the menu item they're attached to
    * add an insensitive "Empty" item 

The insensitive "Empty" item isn't the best behaviour, for non-toplevel menu
items, as it requires the user to go inside the submenu to discover that a
function isn't available. It would be more straight-forward to make the parent
of the submenu insensitive, while retaining its label. For example, from Totem
(insensitive items in between []):
Before:
Movie Edit Sound
           Languages -> [No language selection available]
After:
Movie Edit Sound
           [Languages]
Comment 1 Bastien Nocera 2006-02-08 19:26:01 UTC
Created attachment 58955 [details] [review]
gtk-demo-empty-menu.patch

Patch to gtk-demo to test the changes.
Comment 2 Bastien Nocera 2006-02-09 08:12:16 UTC
The code to looks at would be update_smart_separators() in gtk/gtkuimanager.c and _gtk_action_sync_menu_visible() in gtk/gtkaction.c
Comment 3 Bastien Nocera 2006-02-09 09:37:59 UTC
Created attachment 58986 [details] [review]
gtk-ui-manager-make-empty-menu-insensitive.patch

This makes the menu itself insensitive.
As the "Empty" menu item is not shown anymore, I removed the string for translation. Should we completely get rid of the submenu item, and replace it with a boolean instead?
Comment 4 Bastien Nocera 2006-02-09 09:42:49 UTC
Nope, can't easily get rid of the filler, as it does show up in the list of children.
Comment 5 Matthias Clasen 2006-02-10 06:35:39 UTC
I would like to see this being done as an additional property "insensitive-if-empty" instead of simply changing the meaning of 
"hide-if-empty"
Comment 6 Bastien Nocera 2006-02-10 09:59:50 UTC
I'm really not sure it's worth it. The change in behaviour is minimal, and would get rid of an unused submenu, improving discoverability (no need to go into the submenu to see there's no items). It's a usability change more than anything else.
Comment 7 Matthias Clasen 2006-02-10 15:21:37 UTC
I don't know if the change can be described as minimal.

The description of GtkAction::hide-if-empty is pretty explicit about the behaviour: When TRUE, empty menu proxies for this action are hidden

Suddenly not making them invisible, but insensitive will render the documentation 
incorrect.
Comment 8 Bastien Nocera 2006-02-10 15:31:55 UTC
But GtkAction::hide-if-empty is TRUE by default. What I'm changing is the behaviour when it's FALSE. The behaviour when hide-if-empty is TRUE doesn't change.

Adapted from comment #1 (there's not even a way to set the label of the filler):
For example, from Totem
(insensitive items in between []):
Before:
Movie Edit Sound
           Languages -> [Empty]
After:
Movie Edit Sound
           [Languages]
Comment 9 Kalle Vahlman 2007-03-18 19:39:02 UTC
I raised this on Usability mailing list to get things moving again:

http://mail.gnome.org/archives/usability/2007-March/msg00033.html
Comment 10 Kalle Vahlman 2007-03-18 20:23:47 UTC
Created attachment 84846 [details] [review]
Refreshed patch for svn trunk

Here's a remade patch against svn trunk, the previous one didn't apply cleanly (for some reason the untranslated string change wasn't accepted as-is).
Comment 11 Matthias Clasen 2007-03-18 22:13:30 UTC
I think that making the parent menuitem insensitive is making the menus less usable. You are taking the information that the submenu is empty away from the user - he just sees a disabled item and has no chance to open the submenu and
check if it is empty of if some large sets of features are inaccessible to him
because some configuration has disabled them.
Comment 12 Bastien Nocera 2007-03-18 23:54:22 UTC
(In reply to comment #11)
> I think that making the parent menuitem insensitive is making the menus less
> usable. You are taking the information that the submenu is empty away from the
> user - he just sees a disabled item and has no chance to open the submenu and
> check if it is empty of if some large sets of features are inaccessible to him
> because some configuration has disabled them.

It's true, there wouldn't be any difference between an empty sub-menus, and a disabled "parent" menu item. But the user wouldn't be able to see the submenu items in the case of disabled/unaccessible features.
I'd argue that for disabled features, it should be the individual menu items in the submenu that should be disabled, otherwise, there's no way to know what is in the submenu (and thus, which features aren't available).
Comment 13 Kalle Vahlman 2007-03-20 20:28:27 UTC
(In reply to comment #11)
> I think that making the parent menuitem insensitive is making the menus less
> usable. You are taking the information that the submenu is empty away from the
> user - he just sees a disabled item and has no chance to open the submenu and
> check if it is empty of if some large sets of features are inaccessible to him
> because some configuration has disabled them.

I guess it boils down to functionality vs. features. From feature POV, yes you want to show "no features here" (to differentiate from "these features here").

But from functionality POV, you gain nothing from showing "you cant do anything with this menu" vs disabling the menuitem and indicating it a click earlier.

My vote is with the functionality POV.

I wouldn't argue against a separate property though, if the change feels uncomfortable.
Comment 14 Philip Withnall 2007-05-26 15:55:52 UTC
Patch 84846 applies cleanly. Reviewing it would take little time.

(Working on http://mail.gnome.org/archives/gtk-devel-list/2007-March/msg00148.html)
Comment 15 Björn Lindqvist 2008-07-01 13:11:40 UTC
What's the status of this three year old bug? If Matthias still isn't convinced that making the GtkMenuItem insensitive when hide-if-empty=FALSE, then shouldn't this bug be closed? Let's get some closure.
Comment 16 Matthias Clasen 2008-08-20 18:09:18 UTC
Whats the pressing need to close this bug (other than collecting bugzilla points :-) ? 

And yes, I'm still not convinced.
Comment 17 Björn Lindqvist 2008-08-20 18:43:06 UTC
There is no pressing need, but if you aren't convinced, then I don't see how this bug is ever going to get resolved. If there *is* a way to convince you, then it would be good if you documented that procedure. :) 
Comment 18 Bastien Nocera 2008-08-27 16:21:47 UTC
(In reply to comment #16)
> Whats the pressing need to close this bug (other than collecting bugzilla
> points :-) ? 
> 
> And yes, I'm still not convinced.

Would it be acceptable to have a separate option that only takes effect with hide-if-empty=FALSE?
Comment 19 Matthias Clasen 2008-08-27 18:14:35 UTC
I think that is essentially what I proposed in comment #5
Comment 20 Matthias Clasen 2013-11-10 18:21:22 UTC
not going to happen at this point, I think