Commit 6dbf8d79 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Use PipeWire streams for thumbnails on Wayland

parent f0366dba
/*
* Copyright 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick.Window 2.14
import org.kde.taskmanager 0.1 as TaskManager
TaskManager.PipeWireSourceItem {
visible: waylandItem.nodeId > 0
nodeId: waylandItem.nodeId
anchors.fill: parent
TaskManager.ScreencastingRequest {
id: waylandItem
uuid: toolTipDelegate.Window.visibility === Window.Hidden ? "" : thumbnailSourceItem.winId
}
}
......@@ -33,8 +33,6 @@ import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
import org.kde.taskmanager 0.1 as TaskManager
ColumnLayout {
property var submodelIndex
property int flatIndex: isGroup && index != undefined ? index : 0
......@@ -160,11 +158,11 @@ ColumnLayout {
Layout.minimumWidth: header.width
Layout.preferredHeight: header.width / 2
visible: isWin
visible: toolTipDelegate.isWin
readonly property bool isMinimized: isGroup ? IsMinimized == true : isMinimizedParent
// TODO: this causes XCB error message when being visible the first time
property int winId: isWin && windows[flatIndex] !== undefined ? windows[flatIndex] : 0
readonly property var winId: toolTipDelegate.isWin && toolTipDelegate.windows[flatIndex] !== undefined ? toolTipDelegate.windows[flatIndex] : 0
// There's no PlasmaComponents3 version
PlasmaComponents.Highlight {
......@@ -178,8 +176,18 @@ ColumnLayout {
// Indent by one pixel to make sure we never cover up the entire highlight
anchors.margins: 1
visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized
winId: thumbnailSourceItem.winId
visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized && Number.isInteger(thumbnailSourceItem.winId)
winId: Number.isInteger(thumbnailSourceItem.winId) ? thumbnailSourceItem.winId : 0
}
Loader {
anchors.fill: hoverHandler
anchors.margins: 1
active: !albumArtImage.visible && !Number.isInteger(thumbnailSourceItem.winId)
//In a loader since we might not have PipeWire available yet
source: "PipeWireThumbnail.qml"
}
Image {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment