diff --git a/frame/util/themeappicon.cpp b/frame/util/themeappicon.cpp index 16df0d0c1..857239b23 100644 --- a/frame/util/themeappicon.cpp +++ b/frame/util/themeappicon.cpp @@ -187,8 +187,6 @@ ThemeAppIcon::~ThemeAppIcon() */ QIcon ThemeAppIcon::getIcon(const QString &name) { - QIcon icon; - QPlatformTheme * const platformTheme = QGuiApplicationPrivate::platformTheme(); bool hasUserTheme = QIconLoader::instance()->hasUserTheme(); @@ -196,9 +194,7 @@ QIcon ThemeAppIcon::getIcon(const QString &name) return QIcon::fromTheme(name); QIconEngine * const engine = platformTheme->createIconEngine(name); - QIcon *cachedIcon = new QIcon(engine); - icon = *cachedIcon; - return icon; + return QIcon(engine); } bool ThemeAppIcon::getIcon(QPixmap &pix, const QString iconName, const int size, bool reObtain) diff --git a/frame/window/mainpanelcontrol.cpp b/frame/window/mainpanelcontrol.cpp index 978b593d8..a36fcad0d 100755 --- a/frame/window/mainpanelcontrol.cpp +++ b/frame/window/mainpanelcontrol.cpp @@ -592,8 +592,7 @@ bool MainPanelControl::eventFilter(QObject *watched, QEvent *event) } if (m_appDragWidget && watched == static_cast(m_appDragWidget)->viewport()) { - QDropEvent *e = static_cast(event); - bool isContains = rect().contains(mapFromGlobal(m_appDragWidget->mapToGlobal(e->pos()))); + bool isContains = rect().contains(mapFromGlobal(QCursor::pos())); if (isContains) { if (event->type() == QEvent::DragMove) { handleDragMove(static_cast(event), true); diff --git a/plugins/tray/xembedtraywidget.cpp b/plugins/tray/xembedtraywidget.cpp index ad69a3336..58ec2ef22 100644 --- a/plugins/tray/xembedtraywidget.cpp +++ b/plugins/tray/xembedtraywidget.cpp @@ -541,6 +541,10 @@ bool XEmbedTrayWidget::isBadWindow() auto c = QX11Info::connection(); auto cookie = xcb_get_geometry(c, m_windowId); - QScopedPointer clientGeom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR)); - return clientGeom.isNull(); + xcb_get_geometry_reply_t *clientGeom = xcb_get_geometry_reply(c, cookie, Q_NULLPTR); + bool result = clientGeom ? false : true; + + free(clientGeom); + + return result; }