taskmanager: Hide previews of capture-excluded windows

This commit is contained in:
Ramil Nurmanov 2026-10-14 14:24:42 +03:00 committed by Vlad Zahorodnii
parent 474751ac51
commit 376e7e7e63
3 changed files with 25 additions and 0 deletions

View file

@ -373,6 +373,7 @@ PlasmaCore.ToolTipArea {
mainItem.isOnAllVirtualDesktops = Qt.binding(() => model.IsOnAllVirtualDesktops);
mainItem.activities = Qt.binding(() => model.Activities);
mainItem.isReadyForPainting = Qt.binding(() => model.IsMapped);
mainItem.isExcludedFromCapture = Qt.binding(() => model.IsExcludedFromCapture);
mainItem.smartLauncherCountVisible = Qt.binding(() => smartLauncherItem?.countVisible ?? false);
mainItem.smartLauncherCount = Qt.binding(() => mainItem.smartLauncherCountVisible ? (smartLauncherItem?.count ?? 0) : 0);

View file

@ -38,6 +38,7 @@ Loader {
property bool isLauncher
property bool isMinimized
property bool isReadyForPainting
property bool isExcludedFromCapture
// Needed for generateSubtext()
property string display
@ -76,6 +77,7 @@ Loader {
display: toolTipDelegate.display
isMinimized: toolTipDelegate.isMinimized
isReadyForPainting: toolTipDelegate.isReadyForPainting
isExcludedFromCapture: toolTipDelegate.isExcludedFromCapture
isOnAllVirtualDesktops: toolTipDelegate.isOnAllVirtualDesktops
virtualDesktops: toolTipDelegate.virtualDesktops
activities: toolTipDelegate.activities
@ -165,6 +167,7 @@ Loader {
// 'display' is required already
isMinimized: model.IsMinimized
isReadyForPainting: model.IsMapped
isExcludedFromCapture: model.IsExcludedFromCapture
isOnAllVirtualDesktops: model.IsOnAllVirtualDesktops
virtualDesktops: model.VirtualDesktops
activities: model.Activities

View file

@ -34,6 +34,7 @@ ColumnLayout {
required property /*list<var>*/ var virtualDesktops // Can't use list<var> because of QTBUG-127600
required property list<string> activities
required property bool isReadyForPainting
required property bool isExcludedFromCapture
property bool hasTrackInATitle: false
property int orientation: ListView.Vertical // vertical for compact single-window tooltips
@ -262,6 +263,25 @@ ColumnLayout {
hovered: true
}
// Windows hidden from screencasts must not leak their contents through the thumbnail, show the icon instead
Loader {
active: Plasmoid.configuration.showToolTips
&& root.isExcludedFromCapture
&& !toolTipDelegate.isLauncher
&& !albumArtImage.visible
&& root.index !== -1 // Avoid loading when the instance is going to be destroyed
asynchronous: true
visible: active
anchors.fill: hoverHandler
anchors.margins: Kirigami.Units.smallSpacing * 2
sourceComponent: Kirigami.Icon {
source: toolTipDelegate.icon
animated: false
visible: valid
}
}
Loader {
id: pipeWireLoader
anchors.fill: hoverHandler
@ -273,6 +293,7 @@ ColumnLayout {
&& !toolTipDelegate.isLauncher
&& !albumArtImage.visible
&& toolTipDelegate.isReadyForPainting
&& !root.isExcludedFromCapture
&& root.index !== -1
asynchronous: true
//In a loader since we might not have PipeWire available yet (WITH_PIPEWIRE could be undefined in plasma-workspace/libtaskmanager/declarative/taskmanagerplugin.cpp)