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
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
dde-shell (1.99.8) UNRELEASED; urgency=medium

* fix popup can not hide on treeland

-- tsic404 <[email protected]> Fri, 29 Nov 2024 17:30:18 +0800

dde-shell (1.99.8) UNRELEASED; urgency=medium

* fix: Adjust the effects level of kwin to Optimal-performance, multiTasks plugin can not hide(Bug: 286871)
Expand Down
3 changes: 3 additions & 0 deletions frame/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ add_library(dde-shell-frame SHARED
models/kextracolumnsproxymodel.cpp
models/listtotableproxymodel.cpp
quick/dsquickdrag.cpp
popupwindow.h
popupwindow.cpp
ddeshell_qml.qrc
dsutility.cpp
)
Expand Down Expand Up @@ -98,6 +100,7 @@ PUBLIC
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Quick
PRIVATE
Qt${QT_VERSION_MAJOR}::QuickPrivate
Qt${QT_VERSION_MAJOR}::Concurrent
Qt${QT_VERSION_MAJOR}::GuiPrivate
Qt${QT_VERSION_MAJOR}::WaylandClientPrivate
Expand Down
2 changes: 2 additions & 0 deletions frame/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ add_library(dde-shell-plugin SHARED
target_link_libraries(dde-shell-plugin
PUBLIC
dde-shell-frame
PRIVATE
Qt${QT_VERSION_MAJOR}::QuickPrivate
)

string(REPLACE "." "/" URI_PATH ${URI})
Expand Down
8 changes: 5 additions & 3 deletions frame/plugin/qmlplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
#include "applet.h"
#include "appletitem.h"
#include "containmentitem.h"
#include "panel.h"
#include "dstypes.h"
#include "private/dsqmlglobal_p.h"
#include "quick/dsquickdrag_p.h"
#include "layershell/dlayershellwindow.h"
#include "models/listtotableproxymodel.h"
#include "panel.h"
#include "popupwindow.h"
#include "private/dsqmlglobal_p.h"
#include "quick/dsquickdrag_p.h"

#include <qqml.h>

Expand Down Expand Up @@ -45,6 +46,7 @@ void QmlpluginPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType<DLayerShellWindow>(uri, 1, 0, "DLayerShellWindow","LayerShell Attached");
qmlRegisterUncreatableType<DQuickDrag>(uri, 1, 0, "DQuickDrag","DQuickDrag Attached");
qmlRegisterType<ListToTableProxyModel>(uri, 1, 0, "DListToTableProxyModel");
qmlRegisterType<PopupWindow>(uri, 1, 0, "PopupWindow");

dsRegisterType(uri, 1, 0, "PanelPopup");
dsRegisterType(uri, 1, 0, "PanelToolTip");
Expand Down
22 changes: 22 additions & 0 deletions frame/popupwindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-FileCopyrightText: 2024 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)
{
}

void PopupWindow::mouseReleaseEvent(QMouseEvent *event)
{
QQuickWindowQmlImpl::mouseReleaseEvent(event);
auto rect = geometry();
if (!rect.contains(event->globalPosition().toPoint())) {
close();
}
}

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

#pragma once

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

DS_BEGIN_NAMESPACE
class PopupWindow : public QQuickWindowQmlImpl
{
Q_OBJECT
Q_PROPERTY(QWindow *transientParent READ transientParent WRITE setTransientParent NOTIFY transientParentChanged)
QML_NAMED_ELEMENT(PopupWindow)

public:
PopupWindow(QWindow *parent = nullptr);

protected:
void mouseReleaseEvent(QMouseEvent *event) override;
};
DS_END_NAMESPACE
4 changes: 2 additions & 2 deletions frame/qml/PanelPopupWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.deepin.ds 1.0
import org.deepin.dtk 1.0 as D
import org.deepin.dtk.style 1.0 as DStyle

Window {
PopupWindow {
id: root

property real xOffset: 0
Expand Down Expand Up @@ -53,7 +53,7 @@ Window {

width: 10
height: 10
flags: (Qt.platform.pluginName === "xcb" ? (Qt.Tool | Qt.WindowStaysOnTopHint) : Qt.Popup)
flags: (Qt.platform.pluginName === "xcb" ? (Qt.Tool | Qt.WindowStaysOnTopHint) : Qt.Popup)
D.DWindow.enabled: true
D.DWindow.windowRadius: D.DTK.platformTheme.windowRadius < 0 ? 4 : D.DTK.platformTheme.windowRadius
D.DWindow.enableSystemResize: false
Expand Down
1 change: 1 addition & 0 deletions panels/dock/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Window {
DLayerShellWindow.layer: DLayerShellWindow.LayerTop
DLayerShellWindow.exclusionZone: Panel.hideMode === Dock.KeepShowing ? Applet.dockSize : 0
DLayerShellWindow.scope: "dde-shell/dock"
DLayerShellWindow.keyboardInteractivity: DLayerShellWindow.KeyboardInteractivityOnDemand

D.DWindow.enabled: true
D.DWindow.windowRadius: 0
Expand Down
Loading