Diffusion Ark e932b113b2d9

Fix context menu position on Wayland

Authored by elvisangelaccio on May 29 2017, 2:52 PM.

Description

Fix context menu position on Wayland

On Wayland popup menus without a parent won't have a transient parent
window, which is required to show the menu in the right position.

The context menu in the archiveview is created by kxmlgui, without a
parent because it was a top-level <Menu> tag. If we define it as child
of the <MainWindow> tag, we ensure that the main window will be used as
parent of the menu.

Details

Committed
elvisangelaccioMay 29 2017, 2:52 PM
Parents
R36:be45a3a8e710: Fix indentation
Branches
Unknown
Tags
Unknown
dfaure added a subscriber: dfaure.May 29 2017, 9:34 PM

This makes little sense, the toolbar is not a sibling of the mainwindow.

If all menus should be children of the mainwindow, better fix this in xmlgui, no?

Why doesn't the code at kxmlguibuilder.cpp:162 do the job?

This makes little sense, the toolbar is not a sibling of the mainwindow.

Good point, this is semantically wrong...

If all menus should be children of the mainwindow, better fix this in xmlgui, no?

Why doesn't the code at kxmlguibuilder.cpp:162 do the job?

That code doesn't work because the initial parent is nullptr and it never enters the while loop.

What about using <MainWindow> as parent/container of everything (menubar, toolbar and the stand-alone popup menu)?
It fixes the parenting, but it still prints the warning of D6016

I still think it makes more sense to fix kxmlguibuilder than to try and find an XML hack (which would then have to be applied to ALL applications? What's special about ark?)

All right, I'll try to fix it in kxmlgui then.