1- // SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
1+ // SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
22//
33// SPDX-License-Identifier: GPL-3.0-or-later
44
@@ -17,16 +17,12 @@ Item {
1717 property int toolTipVOffset: 0
1818 signal popupCreated (var surfaceId)
1919
20- PanelToolTipWindow {
21- id: toolTipWindow
22- onVisibleChanged : function (arg ) {
23- if (arg && menuWindow .visible )
24- menuWindow .close ()
25- }
26- }
2720 PanelToolTip {
2821 id: toolTip
29- toolTipWindow: toolTipWindow
22+ onToolTipVisibleChanged : function (visible ) {
23+ if (visible && menuWindow .visible )
24+ menuWindow .close ()
25+ }
3026
3127 property alias shellSurface: surfaceLayer .shellSurface
3228 ShellSurfaceItemProxy {
@@ -39,17 +35,11 @@ Item {
3935 }
4036 }
4137
42- WaylandOutput {
43- compositor: DockCompositor .compositor
44- window : toolTip .toolTipWindow
45- sizeFollowsWindow: false
46- }
47-
4838 PanelMenuWindow {
4939 id: menuWindow
5040 onVisibleChanged : function (arg ) {
51- if (arg && toolTipWindow . visible )
52- toolTipWindow .close ()
41+ if (arg && toolTip . toolTipVisible )
42+ toolTip .close ()
5343 }
5444 onUpdateGeometryFinished : function () {
5545 if (! menu .shellSurface )
@@ -128,10 +118,10 @@ Item {
128118
129119 toolTip .shellSurface = popupSurface
130120 toolTip .toolTipX = Qt .binding (function () {
131- return toolTip .shellSurface .x - toolTip .width / 2
121+ return Panel . popupWindow . xOffset + toolTip .shellSurface .x - toolTip .width / 2
132122 })
133123 toolTip .toolTipY = Qt .binding (function () {
134- return toolTip .shellSurface .y - toolTip .height - toolTipVOffset
124+ return Panel . popupWindow . yOffset + toolTip .shellSurface .y - toolTip .height - toolTipVOffset
135125 })
136126 toolTip .open ()
137127 } else if (popupSurface .popupType === Dock .TrayPopupTypeMenu ) {
0 commit comments