[Qt] Unity ignores application's attempt to disable menu item.

Bug #787946 reported by Nathan Osman on 2011-05-25
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Fix Released
unity (Ubuntu)

Bug Description

Binary package hint: unity

No clue if this is the right place to file this bug, but it does seem to be limited to Unity.

I have an application that creates a menu. There is a menu item in the menu that frequently gets enabled / disabled. When the application enables the menu item, everything works fine. However, disabling the menu item isn't working. This seems to be limited to Unity since it works in the Classic session.

Here is a simple Qt source file that demonstrates the problem: http://pastebin.com/DF9CHps5

To compile this brief demo:

1. Make sure that the Qt development files are installed.
2. Create a new folder and stick the code in 'main.cpp'
3. Create another file in that folder named 'demo.pro' and put this in it: http://pastebin.com/Z7GRFW8t
4. Open a terminal in that directory and run 'qmake demo.pro ; make'
5. You can then run the demo with './demo'

The expected behavior is that the menu item's state matches that of the checkbox. However, this does not seem to be the case on Unity - although the menu item enables itself when the checkbox is checked, it fails to disable itself when the checkbox is unchecked.


Ubuntu 11.04 64-bit
Qt 4.7.2

summary: - Unity ignores application's attempt to disable menu item.
+ [Qt] Unity ignores application's attempt to disable menu item.
Bilal Akhtar (bilalakhtar) wrote :

I managed to reproduce this one successfully. The appmenu in Unity doesn't update itself when a menuitem is disabled.

Changed in unity:
status: New → Confirmed
Changed in unity (Ubuntu):
status: New → Confirmed
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qt4-x11 (Ubuntu):
status: New → Confirmed
Filipe Roque (flip-roque) wrote :

I have upgraded to 12.04 and the bug still exists.

A workaround for this bug is to add and remove a dummy menu item after disabling the item. This seems to force an update.

The bug also occurs when enabling/disabling entire menus in the menu bar, but the above workaround doesn't seem to work in that case.

enz (markus-enzenberger) wrote :

For me, this works now in Ubuntu 12.04 (packages updated as of today, proprietary ATI driver). I definitely had seen this bug in 11.10. i don't remember if it worked in 12.04 from the beginning or after some packages were updated.

enz (markus-enzenberger) wrote :

Forgot to say: I tested your example in both Unity and Unity 2D and it works on both for me.

Omer Akram (om26er) on 2012-07-22
no longer affects: qt4-x11 (Ubuntu)
affects: unity (Ubuntu) → appmenu-qt
Albert Astals Cid (aacid) wrote :

I'm with enz, works here on 12.04 as of today

Are you still experiencing this bug in any current supported Ubuntu release? (https://wiki.ubuntu.com/Releases)

If so please execute the following command in a terminal, as it will automatically gather debugging information:
apport-collect 787946

Changed in unity:
status: Confirmed → Incomplete
Changed in appmenu-qt:
status: Confirmed → Incomplete
Nathan Osman (george-edison55) wrote :

I just ran the demo again in Raring and it seems to have gone away. I guess this was fixed recently.

Changed in unity:
status: Incomplete → Fix Released
Changed in appmenu-qt:
status: Incomplete → Fix Released
Changed in unity (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers