Problem: the workspace global variable in main.js which was called from main.qml is underfined but if i use main.js as script entry point then all global kwin variables on place.
main.qml which run js script.
import QtQuick
import org.kde.plasma.plasma5support as PlasmaSupport
import org.kde.kwin
import org.kde.taskmanager as TaskManager
import "../code/main.js" as jsScript
Item {
id: scriptRoot
TaskManager.ActivityInfo {
id: activityInfo
}
PlasmaSupport.DataSource {
id: mousePoller
engine: 'executable'
}
Loader {
id: popupDialog
source: "popup.qml"
function show(text) {
var area = workspace.clientArea(KWin.FullScreenArea, workspace.activeScreen, workspace.currentDesktop);
this.item.show(text, area, 1000);
}
}
Component.onCompleted: {
console.log("JS script: starting the script");
(new jsScript.KWinDriver()).main();
}
}