Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
# SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: CC0-1.0

Expand Down Expand Up @@ -52,7 +52,7 @@ include(DDEShellPackageMacros)
include(KDEClangFormat)
include(KDEGitCommitHooks)

find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Concurrent Quick WaylandClient WaylandCompositor DBus LinguistTools Sql)
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Concurrent Quick QuickTemplates2 WaylandClient WaylandCompositor DBus LinguistTools Sql)
if(Qt${QT_VERSION_MAJOR}_VERSION VERSION_GREATER_EQUAL 6.10)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS WaylandClientPrivate WaylandCompositorPrivate REQUIRED)
endif()
Expand Down
3 changes: 2 additions & 1 deletion frame/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
# SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: CC0-1.0
set(PUBLIC_HEADERS
Expand Down Expand Up @@ -100,6 +100,7 @@ PUBLIC
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Quick
PRIVATE
Qt${QT_VERSION_MAJOR}::QuickTemplates2Private
Qt${QT_VERSION_MAJOR}::QuickPrivate
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::GuiPrivate
Expand Down
3 changes: 2 additions & 1 deletion frame/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
# SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: CC0-1.0

Expand All @@ -14,6 +14,7 @@ PUBLIC
dde-shell-frame
PRIVATE
Qt${QT_VERSION_MAJOR}::QuickPrivate
Qt${QT_VERSION_MAJOR}::QuickTemplates2Private
)

string(REPLACE "." "/" URI_PATH ${URI})
Expand Down
10 changes: 5 additions & 5 deletions frame/popupwindow.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#include "popupwindow.h"

DS_BEGIN_NAMESPACE
PopupWindow::PopupWindow(QWindow *parent)
: QQuickWindowQmlImpl(parent)
: QQuickApplicationWindow(parent)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个符号可能没导出吧,

{
// minimum size is 1x1 to prevent protocols error on wayland
setMinimumSize(QSize(1, 1));
Expand All @@ -26,7 +26,7 @@ PopupWindow::PopupWindow(QWindow *parent)

void PopupWindow::mouseReleaseEvent(QMouseEvent *event)
{
QQuickWindowQmlImpl::mouseReleaseEvent(event);
QQuickApplicationWindow::mouseReleaseEvent(event);
auto rect = geometry();
if (!m_dragging && !rect.contains(event->globalPosition().toPoint()) && type() == Qt::Popup) {
QMetaObject::invokeMethod(this, &QWindow::close, Qt::QueuedConnection);
Expand All @@ -38,15 +38,15 @@ void PopupWindow::mouseReleaseEvent(QMouseEvent *event)
void PopupWindow::mousePressEvent(QMouseEvent *event)
{
m_pressing = true;
return QQuickWindowQmlImpl::mousePressEvent(event);
return QQuickApplicationWindow::mousePressEvent(event);
}

void PopupWindow::mouseMoveEvent(QMouseEvent *event)
{
if (m_pressing) {
m_dragging = true;
}
return QQuickWindowQmlImpl::mouseMoveEvent(event);
return QQuickApplicationWindow::mouseMoveEvent(event);
}

DS_END_NAMESPACE
6 changes: 3 additions & 3 deletions frame/popupwindow.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#pragma once

#include "dsglobal.h"
#include <private/qquickwindowmodule_p.h>
#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>

Check warning on line 8 in frame/popupwindow.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtQuickTemplates2/private/qquickapplicationwindow_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

DS_BEGIN_NAMESPACE
class PopupWindow : public QQuickWindowQmlImpl
class PopupWindow : public QQuickApplicationWindow
{
Comment on lines +8 to 12
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PopupWindow is only using the public QQuickApplicationWindow type, but the header includes the private Qt header QtQuickTemplates2/private/qquickapplicationwindow_p.h. This unnecessarily pulls in Qt private APIs/headers and forces consumers/builds to have the corresponding private dev package. Prefer including the public header for QQuickApplicationWindow (and only using the private header if you actually need private symbols).

Copilot uses AI. Check for mistakes.
Q_OBJECT
Q_PROPERTY(QWindow *transientParent READ transientParent WRITE setTransientParent NOTIFY transientParentChanged)
Expand Down
3 changes: 2 additions & 1 deletion frame/qml/PanelPopupWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ PopupWindow {
width: 10
height: 10
flags: (Qt.platform.pluginName === "xcb" ? (Qt.Tool | Qt.WindowStaysOnTopHint) : Qt.Popup)
font: D.DTK.fontManager.t6
// WM_NAME, used for kwin.
title: "dde-shell/panelpopup"
D.DWindow.enabled: true
Expand Down Expand Up @@ -152,4 +153,4 @@ PopupWindow {
DStyle.Style.behindWindowBlur.darkNoBlurColor)
}
}
}
}