Workaround that opens the popup menus at the expected place.
[GB.QT5] * BUG: Workaround that opens the popup menus at the expected place.
This commit is contained in:
parent
7d63a282f8
commit
5abdab140d
1 changed files with 14 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
|||
#include <QMenu>
|
||||
#include <QKeyEvent>
|
||||
#include <QActionGroup>
|
||||
#include <QWindow>
|
||||
|
||||
#include "gambas.h"
|
||||
#include "gb_common.h"
|
||||
|
@ -1030,6 +1031,19 @@ void CMenu::slotShown(void)
|
|||
GET_MENU_SENDER(menu);
|
||||
HANDLE_PROXY(menu);
|
||||
|
||||
#ifdef QT5
|
||||
if (menu->menu->windowHandle())
|
||||
{
|
||||
QWidget *parent = qApp->activePopupWidget();
|
||||
if (!parent) parent = qApp->activeWindow();
|
||||
if (parent)
|
||||
{
|
||||
//fprintf(stderr, "set menu transient to %p\n", parent->windowHandle());
|
||||
menu->menu->windowHandle()->setTransientParent(parent->windowHandle());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
GB.Ref(menu);
|
||||
|
||||
menu->opened = TRUE;
|
||||
|
|
Loading…
Reference in a new issue