fix: fix tray plugin drag behavior based on plugin flags #1424
+6
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The issue was that tray plugin items could be dragged regardless of their plugin flags. The fix introduces a new readonly property
canDragByFlagsthat checks if the shellSurface's pluginFlags contain the Attribute_CanDrag flag (0x200). The maincanDragproperty now defaults to this flag-based value instead of always being true. Additionally, when mouse release events (type 3) occur, the canDrag property is restored to the flag-based value rather than being hardcoded to true, ensuring consistent drag behavior based on plugin configuration.Log: Fixed tray plugin drag behavior to respect plugin flags
Influence:
fix: 修复托盘插件拖动行为基于插件标志
问题在于托盘插件项目无论其插件标志如何都可以被拖动。修复引入了一个新
的只读属性
canDragByFlags,用于检查shellSurface的pluginFlags是否包含 Attribute_CanDrag标志(0x200)。主属性canDrag现在默认基于此标志值而不是 始终为true。此外,当鼠标释放事件(type 3)发生时,canDrag属性会恢复到基于标志的值而不是硬编码为true,确保基于插件配置的拖动行为一致性。
Log: 修复托盘插件拖动行为以尊重插件标志
Influence:
PMS: BUG-347287