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:

enter image description here

when window on right hand screen, or on left hand screen @ position below top of right hand screen, context menu shown correctly:

enter image description here

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.

enter image description here

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.

enter image description here

note black launch bar on left screen

when using following layout (primary screen landscape on right) context menu position constrained top of primary monitor.

enter image description here

note black launch bar on right screen

so seem primary monitor's top position maximum height qt display it's context menu?


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -