Commit 8980f8b
committed
fix: correct context menu coordinate mapping
Changed the DockContextMenu parent from 'this' to 'nullptr' in
PluginItem constructor to fix coordinate mapping issues when right-click
menu is shown. The issue occurred because using 'this' as parent caused
the menu's coordinate system to be relative to the PluginItem widget,
leading to incorrect position mapping when the menu was displayed. By
setting parent to nullptr, the menu becomes a top-level widget with
screen coordinates, ensuring proper positioning. Also added explicit
cleanup in destructor to safely delete the menu pointer.
Log: Fixed incorrect right-click menu position for dock plugin items
fix: 修复上下文菜单坐标映射问题
将 PluginItem 构造函数中 DockContextMenu 的父对象从 'this' 改为
'nullptr',以修复显示右键菜单时的坐标映射问题。问题原因是使用 'this' 作
为父对象会导致菜单的坐标系相对于 PluginItem 小部件,从而在显示菜单时产
生错误的位置映射。通过将父对象设置为 nullptr,菜单成为使用屏幕坐标的顶
层小部件,确保正确定位。同时在析构函数中添加了显式清理逻辑以安全删除菜单
指针。
Log: 修复了任务栏插件项右键菜单位置不正确的问题
PMS: BUG-3521591 parent e82424b commit 8980f8b
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
0 commit comments