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) ...@@ -578,10 +578,10 @@ int WttQt::create_popup_menu(pwr_sAttrRef aref, int x, int y)
int sts; int sts;
// Calculate position // Calculate position
if (((WNavQt*)wnavnode)->brow_widget->window()->isActiveWindow()) { if (((WNavQt*)wnavnode)->brow_widget->hasFocus()) {
CoWowQt::PopupPosition( CoWowQt::PopupPosition(
((WNavQt*)wnavnode)->brow_widget, x, y, &popupmenu_x, &popupmenu_y); ((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( CoWowQt::PopupPosition(
((WNavQt*)wnav)->brow_widget, x, y, &popupmenu_x, &popupmenu_y); ((WNavQt*)wnav)->brow_widget, x, y, &popupmenu_x, &popupmenu_y);
} else { } else {
......
...@@ -571,16 +571,12 @@ void CoWowQt::PopupPosition( ...@@ -571,16 +571,12 @@ void CoWowQt::PopupPosition(
QWidget* parent, int x_event, int y_event, int* x, int* y) QWidget* parent, int x_event, int y_event, int* x, int* y)
{ {
QWidget* grandparent; QWidget* grandparent;
int x1 = 0;
int y1 = 0;
QPoint p0((int)x_event, (int)y_event); QPoint p0((int)x_event, (int)y_event);
grandparent = parent->parentWidget(); grandparent = parent->parentWidget();
while (!grandparent->isWindow()) { while (!grandparent->isWindow()) {
if (!x1 && !y1 && (parent->geometry().x() || parent->geometry().y())) { if (parent->geometry().x() || parent->geometry().y()) {
x1 = parent->geometry().x();
y1 = parent->geometry().y();
p0 = parent->mapToParent(p0); p0 = parent->mapToParent(p0);
} }
parent = grandparent; 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