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: 0 additions & 4 deletions frame/layershell/dlayershellwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class DS_SHARE DLayerShellWindow : public QObject
public:
~DLayerShellWindow() override;

// clang-format off
/**
* This enum type is used to specify the position where to anchor
*/
Expand All @@ -57,8 +56,6 @@ class DS_SHARE DLayerShellWindow : public QObject
LayerButtom = 1,
LayerTop = 2,
LayerOverlay = 3,
LayerExtension = 8,
LayerOSD
};

Q_ENUM(Layer)
Expand Down Expand Up @@ -86,7 +83,6 @@ class DS_SHARE DLayerShellWindow : public QObject
};

Q_ENUM(KeyboardInteractivity)
// clang-format on

void setAnchors(Anchors anchor);
Anchors anchors() const;
Expand Down
17 changes: 4 additions & 13 deletions frame/layershell/qwaylandlayershellsurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
}
}

init(shell->get_layer_surface(window->waylandSurface()->object(), output, shellLayer(), m_dlayerShellWindow->scope()));
init(shell->get_layer_surface(window->waylandSurface()->object(), output, m_dlayerShellWindow->layer(), m_dlayerShellWindow->scope()));

set_layer(shellLayer());
connect(m_dlayerShellWindow, &DLayerShellWindow::layerChanged, this, [this, window]() {
set_layer(shellLayer());
set_layer(m_dlayerShellWindow->layer());
connect(m_dlayerShellWindow, &DLayerShellWindow::layerChanged, this, [this, window](){
set_layer(m_dlayerShellWindow->layer());
window->waylandSurface()->commit();
});

Expand Down Expand Up @@ -125,16 +125,7 @@
}
}

DLayerShellWindow::Layer QWaylandLayerShellSurface::shellLayer() const
{
const auto layer = m_dlayerShellWindow->layer();
if (layer >= DLayerShellWindow::LayerExtension)
return DLayerShellWindow::LayerOverlay;

return layer;
}

void QWaylandLayerShellSurface::zwlr_layer_surface_v1_configure(uint32_t serial, uint32_t width, uint32_t height)

Check warning on line 128 in frame/layershell/qwaylandlayershellsurface.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'zwlr_layer_surface_v1_configure' is never used.
{
ack_configure(serial);
m_pendingSize = QSize(width, height);
Expand Down
1 change: 0 additions & 1 deletion frame/layershell/qwaylandlayershellsurface_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class QWaylandLayerShellSurface : public QtWaylandClient::QWaylandShellSurface,
void calcAndSetRequestSize(QSize requestSize);
bool anchorsSizeConflict() const;
void trySetAnchorsAndSize();
DLayerShellWindow::Layer shellLayer() const;

DLayerShellWindow* m_dlayerShellWindow;
QSize m_pendingSize;
Expand Down
13 changes: 0 additions & 13 deletions frame/layershell/x11dlayershellemulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@ void LayerShellEmulation::onLayerChanged()
xcbWindow->setWindowType(QNativeInterface::Private::QXcbWindow::Notification);
break;
}
case DLayerShellWindow::LayerOSD: {
// FIXME: To display on top of lock for notification.
m_window->setFlags(m_window->flags() & ~Qt::WindowStaysOnBottomHint | Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint);
QObject::connect(m_window, &QWindow::visibleChanged, this, &LayerShellEmulation::doRaiseWindow, Qt::UniqueConnection);
break;
}
}
}

Expand Down Expand Up @@ -235,13 +229,6 @@ void LayerShellEmulation::onExclusionZoneChanged()
xcb_ewmh_set_wm_strut_partial(&ewmh_connection, m_window->winId(), strut_partial);
}

void LayerShellEmulation::doRaiseWindow()
{
if (m_window && m_window->isVisible()) {
m_window->raise();
}
}

// void X11Emulation::onKeyboardInteractivityChanged()
// {
// // kwin no implentation on wayland
Expand Down
1 change: 0 additions & 1 deletion frame/layershell/x11dlayershellemulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ private slots:
void onPositionChanged();
void onExclusionZoneChanged();
// void onKeyboardInteractivityChanged();
void doRaiseWindow();

private:
QWindow* m_window;
Expand Down
2 changes: 1 addition & 1 deletion frame/qml/PanelPopupWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Window {
width: 10
height: 10
// TODO: it's a qt bug which make Qt.Popup can not get input focus
flags: Qt.platform.pluginName === "xcb" ? Qt.Tool : Qt.ToolTip
flags: (Qt.platform.pluginName === "xcb" ? Qt.Tool : Qt.ToolTip) | Qt.WindowStaysOnTopHint
D.DWindow.enabled: true
D.DWindow.windowRadius: D.DTK.platformTheme.windowRadius < 0 ? 4 : D.DTK.platformTheme.windowRadius
D.DWindow.enableSystemResize: false
Expand Down
16 changes: 0 additions & 16 deletions panels/notification/bubble/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,18 @@
# SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: GPL-3.0-or-later
find_package(Dtk6 REQUIRED COMPONENTS Core Tools)

set(BUBBLE_PANEL "notificationbubble")

file (GLOB BUBBLE_SOURCES *.cpp *.h)

set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/dbus/xml/org.deepin.dde.SessionManager1.xml
PROPERTIES
CLASSNAME
BubbleSessionManager1
)

dtk_add_dbus_interface(
DBUS_INTERFACES
${CMAKE_CURRENT_SOURCE_DIR}/dbus/xml/org.deepin.dde.SessionManager1.xml
sessionmanager1interface
)

add_library(${BUBBLE_PANEL} SHARED
${DBUS_INTERFACES}
${BUBBLE_SOURCES}
)

target_link_libraries(${BUBBLE_PANEL} PRIVATE
dde-shell-frame
ds-notification-shared
Qt${QT_MAJOR_VERSION}::DBus
)

ds_install_package(PACKAGE org.deepin.ds.notificationbubble TARGET ${BUBBLE_PANEL})
Expand Down
26 changes: 3 additions & 23 deletions panels/notification/bubble/bubblepanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "pluginfactory.h"
#include "bubbleitem.h"

#include "sessionmanager1interface.h"
#include <QLoggingCategory>
#include <QQueue>

Expand All @@ -21,9 +20,8 @@ namespace notification {
Q_DECLARE_LOGGING_CATEGORY(notifyLog)
}

namespace notification {
static const QString SessionDBusService = "org.deepin.dde.SessionManager1";
static const QString SessionDaemonDBusPath = "/org/deepin/dde/SessionManager1";
namespace notification
{

BubblePanel::BubblePanel(QObject *parent)
: DPanel(parent)
Expand Down Expand Up @@ -66,15 +64,6 @@ bool BubblePanel::init()
updateMaxBubbleCount();
connect(m_bubbles, &BubbleModel::rowsInserted, this, &BubblePanel::onBubbleCountChanged);
connect(m_bubbles, &BubbleModel::rowsRemoved, this, &BubblePanel::onBubbleCountChanged);
connect(m_bubbles, &BubbleModel::modelReset, this, &BubblePanel::onBubbleCountChanged);

auto sessionManager = new org::deepin::dde::SessionManager1(SessionDBusService, SessionDaemonDBusPath, QDBusConnection::sessionBus(), this);
if (!sessionManager->isValid()) {
qWarning(notifyLog) << "Failed to connect SessionManager1:" << sessionManager->lastError().message();
} else {
m_locked = sessionManager->locked();
QObject::connect(sessionManager, &org::deepin::dde::SessionManager1::LockedChanged, this, &BubblePanel::onLockedChanged);
}

return true;
}
Expand Down Expand Up @@ -143,16 +132,7 @@ void BubblePanel::onNotificationStateChanged(qint64 id, int processedType)
void BubblePanel::onBubbleCountChanged()
{
bool isEmpty = m_bubbles->items().isEmpty();
const bool visible = !isEmpty && enabled();
setVisible(visible);
}

void BubblePanel::onLockedChanged(bool locked)
{
m_locked = locked;
if (m_locked) {
m_bubbles->clear();
}
setVisible(!isEmpty && enabled());
}

void BubblePanel::addBubble(qint64 id)
Expand Down
2 changes: 0 additions & 2 deletions panels/notification/bubble/bubblepanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ private Q_SLOTS:
void addBubble(qint64 id);
void closeBubble(qint64 id);
void onBubbleCountChanged();
void onLockedChanged(bool locked);

private:
void onBubbleExpired(BubbleItem *);
Expand All @@ -78,7 +77,6 @@ private Q_SLOTS:
DS_NAMESPACE::DAppletProxy *m_notificationServer = nullptr;
DataAccessor *m_accessor = nullptr;
bool m_enabled = true;
bool m_locked = false;
Dtk::Core::DConfig *m_setting = nullptr;
};

Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions panels/notification/bubble/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ Window {
visible: Applet.visible
width: 380
height: Math.max(10, bubbleView.height + bubbleView.anchors.topMargin + bubbleView.anchors.bottomMargin)
DLayerShellWindow.layer: DLayerShellWindow.LayerOSD
flags: Qt.Tool
DLayerShellWindow.layer: DLayerShellWindow.LayerTop
DLayerShellWindow.anchors: DLayerShellWindow.AnchorBottom | DLayerShellWindow.AnchorRight
DLayerShellWindow.topMargin: windowMargin(0)
DLayerShellWindow.rightMargin: windowMargin(1)
Expand Down
Loading