[WIP] workarounds for menu positioning
ClosedPublic

Authored by mart on May 8 2017, 5:05 PM.

Details

Summary

this ensure two things:

  • submenus have the main menu as transientParent
  • the visualParent window() is used as transientParent, if exists

this partly fixes popup positioning in wayland, tough
the main taskbar menu is still mis positioned

Test Plan

submenus ok, taskbar contextmenus only partially fixed

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.May 8 2017, 5:05 PM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptMay 8 2017, 5:05 PM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript

looks sensible.

Is this only needed for a specific version of Qt? In either case can you check on the Qt 5.7 machine.

src/declarativeimports/plasmacomponents/qmenu.cpp
112

there's a code path in open that says:

if (m_visualParent) {
     parentItem = qobject_cast<QQuickItem *>(m_visualParent.data());
 } else {
     parentItem = qobject_cast<QQuickItem *>(parent());
 }

does this not need doing for the latter branch?

mart updated this revision to Diff 14311.May 8 2017, 7:51 PM

apply workaround when we have only parentItem

Restricted Application edited projects, added Plasma on Wayland; removed Plasma. · View Herald TranscriptMay 8 2017, 7:51 PM
src/declarativeimports/plasmacomponents/qmenu.cpp
315–320

why not just also do the code at line 113 here? will be simpler code all round.

mart updated this revision to Diff 14438.May 12 2017, 3:55 PM
  • more aggressive reparenting in open()
Restricted Application edited projects, added Plasma; removed Plasma on Wayland. · View Herald TranscriptMay 12 2017, 3:55 PM
davidedmundson added inline comments.May 12 2017, 4:07 PM
src/declarativeimports/plasmacomponents/qmenu.cpp
117

we always do this in ::open()

so why have this chunk?

mart updated this revision to Diff 14444.May 12 2017, 6:36 PM
  • remove duplication
Restricted Application edited projects, added Plasma on Wayland; removed Plasma. · View Herald TranscriptMay 12 2017, 6:36 PM
davidedmundson accepted this revision.May 12 2017, 6:38 PM
This revision is now accepted and ready to land.May 12 2017, 6:38 PM

don't keep [WIP} in the title though :)

This revision was automatically updated to reflect the committed changes.