diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2019-05-21 16:42:05 +0200 |
---|---|---|
committer | Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com> | 2020-02-03 14:06:48 +0000 |
commit | c1442f3cb64ecd6f15ed8bd3c275d967ad7debd5 (patch) | |
tree | 87805c8b92a220d96097574d443fc00c4c2866cd /sysui | |
parent | b1ca6eb8af21ed59ae122dde9583789f7dbce138 (diff) |
Add support for handling native popups as produced by the Wayland XDG shell
This is needed for popups created by QtWebEngine (e.g. in the Netflix app)
Change-Id: Ic7b0001b64d8c09b14e261561309f102d6de337a
Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
Diffstat (limited to 'sysui')
-rw-r--r-- | sysui/centerconsole/ApplicationPopup.qml | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sysui/centerconsole/ApplicationPopup.qml b/sysui/centerconsole/ApplicationPopup.qml index 1d5c821a..4dcebb21 100644 --- a/sysui/centerconsole/ApplicationPopup.qml +++ b/sysui/centerconsole/ApplicationPopup.qml @@ -57,9 +57,20 @@ PopupItem { } Component.onCompleted: { - root.originItemX = root.window.windowProperty("originItemX"); - root.originItemY = root.window.windowProperty("originItemY"); - root.popupY = root.window.windowProperty("popupY"); - root.open(); + var nativePopup = !!window.popup + if (nativePopup) { + var pos = window.requestedPopupPosition + root.originItemX = pos.x + root.originItemY = pos.y + root.popupX = pos.x + root.popupY = pos.y + } else { + root.originItemX = root.window.windowProperty("originItemX") + root.originItemY = root.window.windowProperty("originItemY") + root.popupY = root.window.windowProperty("popupY") + } + closeToolButton.visible = !nativePopup + popupBg.visible = !nativePopup + root.open() } } |