Commit ba96fda8 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Fixed WTT popup location.

parent 33d596bd
......@@ -578,10 +578,10 @@ int WttQt::create_popup_menu(pwr_sAttrRef aref, int x, int y)
int sts;
// Calculate position
if (((WNavQt*)wnavnode)->brow_widget->window()->isActiveWindow()) {
if (((WNavQt*)wnavnode)->brow_widget->hasFocus()) {
CoWowQt::PopupPosition(
((WNavQt*)wnavnode)->brow_widget, x, y, &popupmenu_x, &popupmenu_y);
} else if (((WNavQt*)wnav)->brow_widget->window()->isActiveWindow()) {
} else if (((WNavQt*)wnav)->brow_widget->hasFocus()) {
CoWowQt::PopupPosition(
((WNavQt*)wnav)->brow_widget, x, y, &popupmenu_x, &popupmenu_y);
} else {
......
......@@ -571,16 +571,12 @@ void CoWowQt::PopupPosition(
QWidget* parent, int x_event, int y_event, int* x, int* y)
{
QWidget* grandparent;
int x1 = 0;
int y1 = 0;
QPoint p0((int)x_event, (int)y_event);
grandparent = parent->parentWidget();
while (!grandparent->isWindow()) {
if (!x1 && !y1 && (parent->geometry().x() || parent->geometry().y())) {
x1 = parent->geometry().x();
y1 = parent->geometry().y();
if (parent->geometry().x() || parent->geometry().y()) {
p0 = parent->mapToParent(p0);
}
parent = grandparent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment