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

Bug #787946 reported by Nathan Osman
48
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Unity
Fix Released
Undecided
Unassigned
appmenu-qt
Fix Released
Undecided
Unassigned
unity (Ubuntu)
Fix Released
Undecided
Unassigned

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.

Details:

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.
Revision history for this message
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
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in qt4-x11 (Ubuntu):
status: New → Confirmed
Revision history for this message
Filipe Roque (flip-roque) wrote :

I have upgraded to 12.04 and the bug still exists.

Revision history for this message
Lars Tandle Kyllingstad (kyllingstad) wrote :

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.

Revision history for this message
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.

Revision history for this message
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)
no longer affects: qt4-x11 (Ubuntu)
affects: unity (Ubuntu) → appmenu-qt
Revision history for this message
Albert Astals Cid (aacid) wrote :

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

Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

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
Revision history for this message
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  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.