1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-26 23:21:37 +03:00

[wayland] - fix previews crash

-- disable the use of PlasmaCore.WindowThumbnail
under Wayland in order to fix a crash that was
appearing after a while when the user was using
previews

BUG: 392865
This commit is contained in:
Michail Vourlakos 2018-04-08 18:24:29 +03:00
parent 6de8417007
commit 5ea2cfa79e
2 changed files with 27 additions and 16 deletions

View File

@ -198,23 +198,27 @@ Column {
// TODO: this causes XCB error message when being visible the first time
property int winId: isWin && windows[flatIndex] != undefined ? windows[flatIndex] : 0
PlasmaCore.WindowThumbnail {
id: previewThumb
Loader{
id:previewThumbX11Loader
anchors.fill: parent
active: !Latte.WindowSystem.isPlatformWayland
visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized
winId: thumbnailSourceItem.winId
ToolTipWindowMouseArea {
id: area2
anchors.fill: Latte.WindowSystem.isPlatformWayland ? parent : previewThumb
rootTask: parentTask
modelIndex: submodelIndex
sourceComponent: PlasmaCore.WindowThumbnail {
winId: thumbnailSourceItem.winId
}
}
ToolTipWindowMouseArea {
id: area2
anchors.fill: Latte.WindowSystem.isPlatformWayland ? parent : previewThumbX11Loader
rootTask: parentTask
modelIndex: submodelIndex
winId: thumbnailSourceItem.winId
}
Image {
id: albumArtImage
// also Image.Loading to prevent loading thumbnails just because the album art takes a split second to load
@ -243,7 +247,8 @@ Column {
source: icon
animated: false
usesPlasmaTheme: false
visible: thumbnailSourceItem.isMinimized && !albumArtImage.visible
visible: (thumbnailSourceItem.isMinimized && !albumArtImage.visible) //X11 case
|| (!previewThumbX11Loader.active && !albumArtImage.visible) //Wayland case
ToolTipWindowMouseArea {
id: area4

View File

@ -302,7 +302,7 @@ Item {
target: latteDock
onDockIsHiddenChanged:{
if (latteDock.dockIsHidden) {
windowsPreviewDlg.hide();
windowsPreviewDlg.hide("3.3");
}
}
@ -484,7 +484,7 @@ Item {
}
function hide(debug){
//console.log("on hide event called: "+debug);
//console.log("on hide previews event called: "+debug);
if (latteDock && signalSent) {
//it is used to unblock dock hiding
@ -523,7 +523,9 @@ Item {
}
//used to initialize windows previews buffers from task to task
visible = false;
if (!Latte.WindowSystem.isPlatformWayland) {
visible = false;
}
activeItem = taskItem;
toolTipDelegate.parentTask = taskItem;
@ -534,14 +536,18 @@ Item {
//root.signalDraggingState(true);
}
showPreviewWinTimer.start();
if (!Latte.WindowSystem.isPlatformWayland) {
showPreviewWinTimer.start();
} else {
visible = true;
}
}
}
}
//! I cant find another way to fix the issue with window thumbnails
//! there are many cases that not correct previews are shown are
//! no previews in cases that they should
//! no previews in cases that they should (X11 related)
Timer {
id: showPreviewWinTimer
interval: 50