Empty menus in global app-menu in VirtualBox second window

Bug #1604009 reported by Michael Thayer
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libdbusmenu-qt (Ubuntu)
New
Undecided
Unassigned

Bug Description

Reporting this following this IRC discussion:

https://irclogs.ubuntu.com/2016/07/15/%23ubuntu-devel.html#t14:00

The basic summary: when I run a two-screen/two-window virtual machine with VirtualBox under Ubuntu 16.04 with Unity and the global app-menu, the menus are empty when the second screen window has the input focus. During start-up I get a number (55) of these messages on the console:

Qt WARNING: void DBusMenuExporterPrivate::fillLayoutItem(DBusMenuLayoutItem*, QMenu*, int, int, const QStringList&): No id for action

and a number (7) of these:

Qt WARNING: uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu

Then another 55 of the first and two of the second.

Looking at the interesting parts of the VirtualBox source code, I see that the menu items for the first window (menu displayed correctly) and the second (not displayed) share the same QAction objects. A very quick guess is that this might be triggering the condition in DBusMenuExporterPrivate::addMenu().

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libdbusmenu-qt5 0.9.3+16.04.20160218-0ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-24.43-generic 4.4.10
Uname: Linux 4.4.0-24-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Jul 18 15:44:00 2016
Dependencies:
 gcc-5-base 5.4.0-6ubuntu1~16.04.1
 gcc-6-base 6.0.1-0ubuntu1
 libc6 2.23-0ubuntu3
 libgcc1 1:6.0.1-0ubuntu1
 libstdc++6 5.4.0-6ubuntu1~16.04.1
InstallationDate: Installed on 2016-05-31 (48 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: libdbusmenu-qt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Michael Thayer (michael-thayer) wrote :
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Michael, thanks for the investigation!

That check looks related, and links to https://bugs.kde.org/show_bug.cgi?id=254066. Do you have any idea how to fix your issue and not introduce regressions for that bug?

I do not know if there is any active maintainer for libdbusmenu-qt, but I'm subscribing Nick and David who last touched the code — maybe they are still interested in this code.

Revision history for this message
Michael Thayer (michael-thayer) wrote :

By the way the commit which fixed that KDE bug is:

http://bazaar.launchpad.net/~dbusmenu-team/libdbusmenu-qt/trunk/revision/189

Revision history for this message
Michael Thayer (michael-thayer) wrote :

I got in touch with Aurélien, who wrote the original libdbusmenu-qt code, in case he has any ideas. This is a bit tricky for me, as I can only justify spending a limited time on it (my main area is graphics driver work), and while I could probably fix something up that would work for me, I don't understand the code well enough to be confident that I am not causing regressions - in particular I do not even have a test case for the original issue (the test in the commit just checks the fix, not the problem).

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

FWIW, I am going to get rid of appmenu-qt5 in 16.10, that work is tracked in bug 1612767.

We will be using upstream Qt code instead, which is not based on libdbusmenu-qt and so should not have this bug.

Revision history for this message
Michael Thayer (michael-thayer) wrote :

Just did a quick test after upgrading to 16.10. I (still) see double menus (both local and global) in a single window machine. Should I remove appmenu-qt* and try again?

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Yes, please remove appmenu-qt5 or unset QT_QPA_PLATFORMTHEME env variable.

This needs today’s qtbase 5.6.1+dfsg-3ubuntu3~3 which may be not yet available on your mirrors.

Revision history for this message
Michael Thayer (michael-thayer) wrote :

Removed appmenu-qt5 and checked that I am on 5.6.1+dfsg-3ubuntu3~3, but still no joy. I would not rule out user error though (and I have not yet rebooted since upgrading from 16.04, so there might be something stale in memory).

Revision history for this message
Michael Thayer (michael-thayer) wrote :

I can confirm though that the global menu now works for the second window.

Revision history for this message
Michael Thayer (michael-thayer) wrote :

Not sure if you want to include the double menu issue here or if you prefer to treat the bug as fixed. As a reminder, the double menu issue seemed to happen with appmenu-qt because it simply hid the local menus but did not intercept hide and show requests from the application.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

The remaining issue looks like https://bugreports.qt.io/browse/QTBUG-54793. It can be fixed by a simple two-line patch (maybe I’ll propose it for review soon).

Revision history for this message
Michael Thayer (michael-thayer) wrote :

I rebuilt Qt5 with that change but do not see any difference. Might be user error of course. I downloaded with apt-get source, made the change, rebuilt with debuild binary and (for simplicity) installed all resulting .deb files with dpkg -i.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

The patch fixes double menus for KDE apps for me (Quassel, Konsole).

I tried VirtualBox, and it looks like menu doesn't get exported at all (I only get local menu, not the global one).

Which exactly change did you apply? Was it removing the #if and #endif lines in QMenuBar::setVisible code (but not the code between them)?

Revision history for this message
Michael Thayer (michael-thayer) wrote :

User error indeed - I did #if 0 instead of #if 1. Rebuilding now, but because of my lack of experience with debuild I am stuck in a full build again.

By the way, lots of test cases fail after the change. I disabled them in debian/rules locally.

Revision history for this message
Michael Thayer (michael-thayer) wrote :

Sorry for the noise. After fixing my change the local menus are gone.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thanks for testing!

I'll try to get that patch included in the next Qt upload. Also submitted upstream: https://codereview.qt-project.org/170467.

Revision history for this message
Eric Longuemare (a-webmaster-b) wrote :
Download full text (7.8 KiB)

Hello,

I think there is a similar issue with Digikam 5.3 using Ubuntu Desktop 16.04 up to date with multiscreen (2 x 1920x1080).

libdbusmenu-qt5 0.9.3+16.04.20160218-0ubuntu1
Ubuntu 4.4.0-49-generic

Logs are :

--
0x48bc490 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x48bbe80 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x48bb960 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x476a8b0 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x48bb410 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4902c70 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4901b70 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4904550 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x46882c0 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x46e7a70 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4305560 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4613e80 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x44a0ab0 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x47d1d40 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4845280 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x487d700 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4790bc0 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x476a8b0 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4beb3e0 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4beae50 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4bea4a0 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4bec850 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1ee1d40) ): Attempt to set a screen on a child window.
0x4becd50 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1e...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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