c++ - Gnome Shell causes QMenu to display in incorrect position when using multiple screens -
my qt app's context menu displayed in incorrect position when using multiple monitors on gnome 3.
it seem perhaps culprit here gnome shell, rather qt itself, can't replicate issue described below ubuntu unity, happens when running ubuntu gnome 14.04.
symptoms:
i using qwidget::maptoglobal(qpoint)
qwidget::customcontextmenurequested
signal in order find correct position display context menu.
i using qmenu::exec(qpoint)
display menu in position
void window::slotonshowcontextmenu(const qpoint& p) { _menu->exec(_tree->viewport()->maptoglobal(p)); }
my problem have following screen layout:
when window on right hand screen, or on left hand screen @ position below top of right hand screen, context menu shown correctly:
when window on left hand screen, @ level above top of right hand screen, though y value of qpoint
returned maptoglobal
correct, context menu not displayed @ point, rather constrained @ same level right hand screen.
i have confirmed _tree->viewport()->maptoglobal(p)
returns correct results (just logging resulting qpoint
)
qpoint point = _tree->viewport()->maptoglobal(p); std::cout << point.x() << ":" << point.y() << '\n';
it therefore seem qmenu::exec(qpoint)
culprit?
how can correctly display context menu?
edit:
i tried running same app on standard ubuntu 14.04 (ie: using unity instead of gnome), , incorrect behaviour doesn't present itself, seem a gnome 3 issue?
i have tried changing primary monitor portrait monitor on left primary, , context menu displays correctly.
note black launch bar on left screen
when using following layout (primary screen landscape on right) context menu position constrained top of primary monitor.
note black launch bar on right screen
so seem primary monitor's top position maximum height qt display it's context menu?
Comments
Post a Comment