Skip to content
Open
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
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ endif ()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-Werror>)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
Expand Down Expand Up @@ -119,5 +120,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/DDEShellConfigVersion.cmake" DESTINAT

# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
if(KDE_CLANG_FORMAT_EXECUTABLE)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()
2 changes: 1 addition & 1 deletion applets/dde-apps/amappitemmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace apps
{
AMAppItemModel::AMAppItemModel(QObject *parent)
: AppItemModel(parent)
, m_manager(new ObjectManager("org.desktopspec.ApplicationManager1", "/org/desktopspec/ApplicationManager1", QDBusConnection::sessionBus(), this))
, m_ready(false)
, m_manager(new ObjectManager("org.desktopspec.ApplicationManager1", "/org/desktopspec/ApplicationManager1", QDBusConnection::sessionBus(), this))
{
qRegisterMetaType<ObjectInterfaceMap>();
qDBusRegisterMetaType<ObjectInterfaceMap>();
Expand Down
2 changes: 1 addition & 1 deletion panels/dock/AppletDockItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AppletItem {
id: appletDockItem

property int dockOrder: 0
property bool shouldVisible: Applet.visible && Applet.supported
property bool shouldVisible: !!Applet.visible && !!Applet.supported
property bool useColumnLayout: Panel.position % 2
implicitWidth: useColumnLayout ? Panel.rootObject.dockSize : Panel.rootObject.dockItemMaxSize * 0.8
implicitHeight: useColumnLayout ? Panel.rootObject.dockItemMaxSize * 0.8 : Panel.rootObject.dockSize
Expand Down
35 changes: 25 additions & 10 deletions panels/dock/ShellSurfaceItemProxy.qml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Item {
}
Component.onCompleted: function () {
impl.surfaceDestroyed.connect(root.surfaceDestroyed)
updateCursorShapeConnection()
}

Connections {
Expand All @@ -125,17 +126,31 @@ Item {
})
})
}
}

function onCursorShapeRequested(cursorShape)
{
console.log("onCursorShapeRequested:", cursorShape)
// Qt::CursorShape range is 0-21, plus 24 (BitmapCursor) and 25 (CustomCursor).
// We set a default if the value is out of logical bounds.
if (cursorShape < 0 || cursorShape > 25) {
root.cursorShape = Qt.ArrowCursor
} else {
root.cursorShape = cursorShape
}
property var cursorShapeConnection: null

onShellSurfaceChanged: updateCursorShapeConnection()

function updateCursorShapeConnection() {
if (cursorShapeConnection) {
cursorShapeConnection.disconnect()
cursorShapeConnection = null
}
// cursorShapeRequested only exists on PluginPopup, not on PluginSurface,
// so connect dynamically to avoid a QML warning for surfaces lacking it.
if (shellSurface && shellSurface.cursorShapeRequested) {
cursorShapeConnection = shellSurface.cursorShapeRequested.connect(onCursorShapeRequested)
}
}

function onCursorShapeRequested(cursorShape) {
// Qt::CursorShape range is 0-21, plus 24 (BitmapCursor) and 25 (CustomCursor).
// We set a default if the value is out of logical bounds.
if (cursorShape < 0 || cursorShape > 25) {
root.cursorShape = Qt.ArrowCursor
} else {
root.cursorShape = cursorShape
}
}
}
4 changes: 2 additions & 2 deletions panels/dock/dockhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void DockHelper::updateAllDockWakeArea()

void DockHelper::checkNeedHideOrNot()
{
bool needHide;
bool needHide = false;
switch (parent()->hideMode()) {
case KeepShowing: {
// KeepShow. current activeWindow is fullscreend.
Expand Down Expand Up @@ -238,7 +238,7 @@ void DockHelper::checkNeedHideOrNot()

void DockHelper::checkNeedShowOrNot()
{
bool needShow;
bool needShow = false;
switch (parent()->hideMode()) {
case KeepShowing: {
// KeepShow. currentWindow is not fullscreened.
Expand Down
1 change: 0 additions & 1 deletion panels/dock/taskmanager/dockgroupmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ DockGroupModel::DockGroupModel(QAbstractItemModel *sourceModel, int role, QObjec
int parentRow = parent.row();
if (m_currentActiveWindow.contains(parentRow)) {
int currentActive = m_currentActiveWindow.value(parentRow);
int windowCount = RoleGroupModel::rowCount(parent);

// Check if the current active window was removed
if (currentActive >= first && currentActive <= last) {
Expand Down
6 changes: 5 additions & 1 deletion panels/dock/taskmanager/package/AppItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ Item {
signal dropFilesOnItem(itemId: string, files: list<string>)
signal dragFinished()

Drag.active: mouseArea.drag.active
// Binding Drag.active to mouseArea.drag.active would make Drag.active read
// back the very property it drives (see visible/fixPosition below),
// causing a QML binding loop. Set it imperatively from the MouseArea instead.
Drag.active: false
Drag.source: root
Drag.hotSpot.x: icon.width / 2
Drag.hotSpot.y: icon.height / 2
Expand Down Expand Up @@ -494,6 +497,7 @@ Item {
acceptedButtons: Qt.LeftButton | Qt.RightButton
drag.target: root
drag.onActiveChanged: {
root.Drag.active = drag.active
if (!drag.active) {
Panel.contextDragging = false
root.dragFinished()
Expand Down
25 changes: 18 additions & 7 deletions panels/dock/taskmanager/package/TaskManager.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,24 @@ ContainmentItem {
readonly property real startPadding: Math.max(0, appTitleSpacing - (Panel.rootObject.dockItemMaxSize * (multitaskViewIconRatio - iconWidthToMaxSizeRatio) / 2))

implicitWidth: {
let extra = useColumnLayout ? 0 : startPadding
// In column layout the width is fixed to the dock size, so do not
// depend on appContainer.implicitWidth (the delegates read this
// implicitWidth back, which would cause a binding loop).
if (useColumnLayout)
return Panel.rootObject.dockSize
let extra = startPadding
let w = appContainer.implicitWidth + extra
let maxW = Panel.itemAlignment === Dock.LeftAlignment ? Math.max(remainingSpacesForTaskManager, w) : Math.min(remainingSpacesForTaskManager, w)
return useColumnLayout ? Panel.rootObject.dockSize : maxW
return Panel.itemAlignment === Dock.LeftAlignment ? Math.max(remainingSpacesForTaskManager, w) : Math.min(remainingSpacesForTaskManager, w)
}
implicitHeight: {
let extra = useColumnLayout ? startPadding : 0
// In row layout the height is fixed to the dock size, so do not
// depend on appContainer.implicitHeight (the delegates read this
// implicitHeight back, which would cause a binding loop).
if (!useColumnLayout)
return Panel.rootObject.dockSize
let extra = startPadding
let h = appContainer.implicitHeight + extra
let maxH = Panel.itemAlignment === Dock.LeftAlignment ? Math.max(remainingSpacesForTaskManager, h) : Math.min(remainingSpacesForTaskManager, h)
return useColumnLayout ? maxH : Panel.rootObject.dockSize
return Panel.itemAlignment === Dock.LeftAlignment ? Math.max(remainingSpacesForTaskManager, h) : Math.min(remainingSpacesForTaskManager, h)
}
// Helper function to find the current index of an app by its appId in the visualModel
function findAppIndex(appId) {
Expand Down Expand Up @@ -140,7 +148,10 @@ ContainmentItem {
return windows.length > 0 && launcherDndDropArea.launcherDndWinId !== windows[0]
}

ListView.onAdd: NumberAnimation {
ListView.onAdd: addAnimation.restart()

NumberAnimation {
id: addAnimation
target: delegateRoot
properties: "scale,opacity"
from: 0
Expand Down
9 changes: 8 additions & 1 deletion panels/dock/tray/trayitempositionmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,15 @@ TrayItemPositionManager::TrayItemPositionManager(QObject *parent)

connect(this, &TrayItemPositionManager::visualItemCountChanged,
this, &TrayItemPositionManager::updateVisualSize);
// Use QueuedConnection for dockHeightChanged to break a synchronous
// signal/slot cascade that causes "Binding loop for dockItemMaxSize".
// When dockSize changes (e.g. during drag), dockHeightChanged fires
// synchronously, calling updateVisualSize -> visualSizeChanged, which
// marks dockItemMaxSize dirty (it transitively reads visualSize via
// dockRawCenterSpace -> dockRightPart -> tray). Queuing the slot lets
// the current binding evaluation finish before visualSize updates.
connect(this, &TrayItemPositionManager::dockHeightChanged,
this, &TrayItemPositionManager::updateVisualSize);
this, &TrayItemPositionManager::updateVisualSize, Qt::QueuedConnection);
connect(this, &TrayItemPositionManager::orientationChanged,
this, &TrayItemPositionManager::updateVisualSize);
connect(this, &TrayItemPositionManager::visualItemSizeChanged,
Expand Down
2 changes: 1 addition & 1 deletion panels/dock/tray/trayitempositionmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct DropIndex {
Q_PROPERTY(int index MEMBER index)
Q_PROPERTY(bool isOnItem MEMBER isOnItem)
Q_PROPERTY(bool isBefore MEMBER isBefore)
QML_ELEMENT
QML_NAMED_ELEMENT(dropIndex)
public:
int index;
bool isOnItem = true;
Expand Down
2 changes: 1 addition & 1 deletion panels/dock/waylanddockhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void WaylandDockHelper::updateOverlapCheckerPos()
if (!waylandScreen)
return;

uint32_t anchor;
uint32_t anchor = 0;
switch (m_panel->position()) {
case Top:
anchor = QtWayland::treeland_window_overlap_checker::anchor_top;
Expand Down
2 changes: 1 addition & 1 deletion panels/notification/center/OverlapNotify.qml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ NotifyItem {

OverlapIndicator {
id: indicator
enableAnimation: root.ListView.view.panelShown
enableAnimation: (root.ListView.view && root.ListView.view.panelShown) ?? false
clipItems: true
anchors {
bottom: parent.bottom
Expand Down
4 changes: 3 additions & 1 deletion tests/panels/notification/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ add_executable(notifyserverapplet_tests
notifyserverapplet_test.cpp
)

set_property(TARGET notifyserverapplet_tests APPEND PROPERTY AUTOMOC_MACRO_NAMES "D_APPLET_CLASS")

target_compile_options(notifyserverapplet_tests PRIVATE
-fvisibility=hidden
-fvisibility-inlines-hidden
Expand Down Expand Up @@ -64,4 +66,4 @@ add_test(
COMMAND ${CMAKE_COMMAND} -E env
LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/frame:${CMAKE_BINARY_DIR}/panels/notification
$<TARGET_FILE:notifyserverapplet_tests>
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ TEST_F(NotifyServerAppletTest, DestructorMemoryLeakTest) {
auto *testApplet = new NotifyServerApplet();

// Initialize the applet (creates m_manager, m_worker, and DbusAdaptors)
bool initResult = testApplet->init();
testApplet->init();

// Even if init fails (e.g., D-Bus not available), we should clean up properly
// Record the state before deletion
Expand Down
Loading