Never export the menu bar through DBus, it crashes on Mate.

[GB.QT4]
* BUG: Never export the menu bar through DBus, it crashes on Mate.

[GB.QT5]
* BUG: Never export the menu bar through DBus, it crashes on Mate.
* BUG: Better support of popups when run on Wayland.
This commit is contained in:
gambas 2020-08-21 01:31:19 +02:00
parent 362e6ce64d
commit e2eabcdb29

View file

@ -27,6 +27,7 @@
#include <QMenu> #include <QMenu>
#include <QKeyEvent> #include <QKeyEvent>
#include <QActionGroup> #include <QActionGroup>
#include <QWindow>
#include "gambas.h" #include "gambas.h"
#include "gb_common.h" #include "gb_common.h"
@ -396,6 +397,7 @@ BEGIN_METHOD(Menu_new, GB_OBJECT parent; GB_BOOLEAN hidden)
#else #else
menu->menu = new QMenu(); menu->menu = new QMenu();
#endif #endif
menu->menu->setSeparatorsCollapsible(true); menu->menu->setSeparatorsCollapsible(true);
((QAction *)(menu->widget.widget))->setMenu(menu->menu); ((QAction *)(menu->widget.widget))->setMenu(menu->menu);
@ -422,6 +424,7 @@ BEGIN_METHOD(Menu_new, GB_OBJECT parent; GB_BOOLEAN hidden)
if (!menuBar) if (!menuBar)
{ {
menuBar = new QMenuBar(topLevel); menuBar = new QMenuBar(topLevel);
menuBar->setNativeMenuBar(false);
//menuBar->setAutoFillBackground(true); //menuBar->setAutoFillBackground(true);
window->menuBar = menuBar; window->menuBar = menuBar;
} }
@ -1030,6 +1033,11 @@ void CMenu::slotShown(void)
GET_MENU_SENDER(menu); GET_MENU_SENDER(menu);
HANDLE_PROXY(menu); HANDLE_PROXY(menu);
#ifdef QT5
if (menu->menu->windowHandle())
menu->menu->windowHandle()->setTransientParent(menu->toplevel->windowHandle());
#endif
GB.Ref(menu); GB.Ref(menu);
menu->opened = TRUE; menu->opened = TRUE;