diff --git a/debian/control b/debian/control index 55d841ac7..e068e0423 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Build-Depends: debhelper-compat (= 13), cmake, dde-application-manager-api (>= 1.2.23), - dde-tray-loader-dev (>= 1.99.14), + dde-tray-loader-dev (> 2.0.24), extra-cmake-modules, libdtk6core-bin, libdtk6core-dev, diff --git a/panels/dock/pluginmanagerextension.cpp b/panels/dock/pluginmanagerextension.cpp index 9c17a9948..3f77ac101 100644 --- a/panels/dock/pluginmanagerextension.cpp +++ b/panels/dock/pluginmanagerextension.cpp @@ -400,6 +400,12 @@ void PluginPopup::plugin_popup_source_size(Resource *resource, int32_t width, in } } +void PluginPopup::plugin_popup_set_cursor(Resource *resource, int32_t cursor_shape) +{ + Q_UNUSED(resource); + Q_EMIT cursorShapeRequested(cursor_shape); +} + PluginManager::PluginManager(QWaylandCompositor *compositor) : QWaylandCompositorExtensionTemplate(compositor) { diff --git a/panels/dock/pluginmanagerextension_p.h b/panels/dock/pluginmanagerextension_p.h index eb86beab1..ff5dd316d 100644 --- a/panels/dock/pluginmanagerextension_p.h +++ b/panels/dock/pluginmanagerextension_p.h @@ -255,12 +255,14 @@ class PluginPopup : public QWaylandShellSurfaceTemplate, public QtW virtual void plugin_popup_destroy_resource(Resource *resource) override; virtual void plugin_popup_destroy(Resource *resource) override; virtual void plugin_popup_source_size(Resource *resource, int32_t width, int32_t height) override; + virtual void plugin_popup_set_cursor(Resource *resource, int32_t cursor_shape) override; Q_SIGNALS: void xChanged(); void yChanged(); void heightChanged(); void widthChanged(); + void cursorShapeRequested(int cursorShape); private: PluginManager* m_manager; diff --git a/panels/dock/tray/ShellSurfaceItemProxy.qml b/panels/dock/tray/ShellSurfaceItemProxy.qml index 9b8fcd31b..ed0ed781f 100644 --- a/panels/dock/tray/ShellSurfaceItemProxy.qml +++ b/panels/dock/tray/ShellSurfaceItemProxy.qml @@ -16,6 +16,7 @@ Item { property bool inputEventsEnabled: true property bool hovered: hoverHandler.hovered property bool pressed: tapHandler.pressed + property int cursorShape: Qt.ArrowCursor implicitWidth: shellSurface ? shellSurface.width : 10 implicitHeight: shellSurface ? shellSurface.height : 10 @@ -42,6 +43,7 @@ Item { HoverHandler { id: hoverHandler + cursorShape: root.cursorShape } TapHandler { id: tapHandler @@ -111,5 +113,17 @@ Item { }) }) } + + function onCursorShapeRequested(cursorShape) + { + console.log("onCursorShapeRequested:", cursorShape) + // Qt::CursorShape range is 0-21, plus 24 (BitmapCursor) and 25 (CustomCursor). + // We set a default if the value is out of logical bounds. + if (cursorShape < 0 || cursorShape > 25) { + root.cursorShape = Qt.ArrowCursor + } else { + root.cursorShape = cursorShape + } + } } }