diff --git a/frame/window/components/dragwidget.cpp b/frame/window/components/dragwidget.cpp index 38aef59c9..baafb055a 100644 --- a/frame/window/components/dragwidget.cpp +++ b/frame/window/components/dragwidget.cpp @@ -86,10 +86,7 @@ void DragWidget::mouseReleaseEvent(QMouseEvent *) void DragWidget::enterEvent(QEvent *) { - if (Utils::IS_WAYLAND_DISPLAY) - updateCursor(); - else - QApplication::setOverrideCursor(cursor()); + QApplication::setOverrideCursor(cursor()); } void DragWidget::leaveEvent(QEvent *) @@ -97,29 +94,3 @@ void DragWidget::leaveEvent(QEvent *) QApplication::setOverrideCursor(Qt::ArrowCursor); } -void DragWidget::updateCursor() -{ - QString theme = Utils::SettingValue("com.deepin.xsettings", "/com/deepin/xsettings/", "gtk-cursor-theme-name", "bloom").toString(); - int cursorSize = Utils::SettingValue("com.deepin.xsettings", "/com/deepin/xsettings/", "gtk-cursor-theme-size", 24).toInt(); - Dock::Position position = static_cast(qApp->property("position").toInt()); - - static QString lastTheme; - static int lastPosition = -1; - static int lastCursorSize = -1; - if (theme != lastTheme || position != lastPosition || cursorSize != lastCursorSize) { - lastTheme = theme; - lastPosition = position; - lastCursorSize = cursorSize; - const char* cursorName = (position == Dock::Position::Bottom || position == Dock::Position::Top) ? "v_double_arrow" : "h_double_arrow"; - QCursor *newCursor = ImageUtil::loadQCursorFromX11Cursor(theme.toStdString().c_str(), cursorName, cursorSize); - if (!newCursor) - return; - - setCursor(*newCursor); - static QCursor *lastCursor = nullptr; - if (lastCursor) - delete lastCursor; - - lastCursor = newCursor; - } -} diff --git a/frame/window/components/dragwidget.h b/frame/window/components/dragwidget.h index d19f9a2af..81e1f85c1 100644 --- a/frame/window/components/dragwidget.h +++ b/frame/window/components/dragwidget.h @@ -46,9 +46,6 @@ protected: void enterEvent(QEvent *) override; void leaveEvent(QEvent *) override; -private: - void updateCursor(); - private: bool m_dragStatus; QPoint m_resizePoint;