I have a layout-template and a look-and-feel that work together to install a top panel, 2 widgets on the desktop and the related wallpaper. When plasma was updated to 6.5, this theme stopped working. Essentially, I can get either the top panel, or the widgets, but not both. If the code for creating the panel and the code for installing the widgets are both present, only the widgets are installed, and the panel is nowhere to be seen. If I remove the code to install the widgets, the panel shows up. I don’t know if this is a bug or a change in the API, but over the past month I’ve tried rearranging the javascript code every way I could think of, and still the same pattern held - either the widgets or the panel but not both. There is a single exception: if I run the theme with both the panel and the widgets code, only the widgets show up, but… if I run plasma-interactiveconsole and execute only “var panel = new Panel;”, the panel shows up. Weird. But it does tell me that the code is correctly creating all components. Is there something I’m missing here?
Here’s some source code to check out.
This is the panel:
var screenWidthGridUnits = screenGeometry(0).width / gridUnit;
var screenHeightGridUnits = screenGeometry(0).height / gridUnit;
var screenWidth = screenGeometry(0).width;
var screenHeight = screenGeometry(0).height;
var panel = new Panel;
panel.location = “top”;
panel.height = 1.6 * gridUnit;
panel.lengthMode = “custom”;
panel.length = screenWidthGridUnits * 11;
panel.alignment = “center”;
panel.hiding = “dodgewindows”;
panel.minimumLength = panel.length;
panel.maximumLength = panel.length;
panelSpacer = panel.addWidget(“org.kde.plasma.panelspacer”);
panelSpacer.writeConfig(“expanding”, “false”);
panelSpacer.writeConfig(“length”, 8);
kicker = panel.addWidget(“org.kde.plasma.kicker”);
kicker.writeConfig(“customButtonImage”, “start-here-kde”);
kicker.writeConfig(“useCustomButtonImage”, “true”);
panelSpacer = panel.addWidget(“org.kde.plasma.panelspacer”);
panelSpacer.writeConfig(“expanding”, “false”);
panelSpacer.writeConfig(“length”, 8);
clock = panel.addWidget(“org.kde.plasma.digitalclock”);
clock.writeConfig(“showDate”, “false”);
panelSpacer = panel.addWidget(“org.kde.plasma.panelspacer”);
panelSpacer.writeConfig(“expanding”, “false”);
panelSpacer.writeConfig(“length”, 6);
lock_logout = panel.addWidget(“org.kde.plasma.lock_logout”);
lock_logout.writeConfig(“show_requestLogout”, “true”);
lock_logout.writeConfig(“show_requestLogoutScreen”, “false”);
lock_logout.writeConfig(“show_requestReboot”, “true”);
lock_logout.writeConfig(“show_requestShutDown”, “true”);
panelSpacer = panel.addWidget(“org.kde.plasma.panelspacer”);
panelSpacer.writeConfig(“expanding”, “false”);
panelSpacer.writeConfig(“length”, 6);
calculate = panel.addWidget(“org.kde.plasma.calculator”);
panelSpacer = panel.addWidget(“org.kde.plasma.panelspacer”);
panelSpacer.writeConfig(“expanding”, “false”);
panelSpacer.writeConfig(“length”, 17);
sysloadViewer = panel.addWidget(“org.kde.plasma.systemmonitor.cpucore”);
panelSpacer = panel.addWidget(“org.kde.plasma.panelspacer”);
sysTray = panel.addWidget(“org.kde.plasma.systemtray”);
And this is the look-and-feel which uses the panel from layout-templates:
loadTemplate(“org.bluestarlinux.desktop.bslxPanel”)
var screenWidth = screenGeometry(0).width;
var screenHeight = screenGeometry(0).height;
var config = ConfigFile(‘kdeglobals’);
config.group = ‘KDE’;
var lookandfeel = config.readEntry(‘LookAndFeelPackage’);
var wallpaperFile = “contents/components/artwork/background.png”;
var lookandfeelDir = userDataPath(“data”,“plasma/look-and-feel”);
var wallpaperImg = lookandfeelDir + “/” + lookandfeel + “/” + wallpaperFile;
var imagePath = “file://” + “/usr/share/plasma/look-and-feel/” + lookandfeel + “/” + wallpaperFile;
if (applicationExists(wallpaperImg))
imagePath = “file://” + wallpaperImg;
var desktopsArray = desktops();
for (var j = 0; j < desktopsArray.length; j++) {
var myDesktop = desktopsArray[j];
var viewFolder = myDesktop.addWidget("org.kde.plasma.folder", 50, 75, screenWidth \* 0.4, screenHeight \* 0.75);
viewFolder.writeConfig("title", "Home");
viewFolder.writeConfig("url", "file://" + userDataPath(""));
viewFolder.writeConfig("iconSize", "2");
var installIcon = myDesktop.addWidget("org.kde.plasma.icon", screenWidth \* 0.8, 80, screenWidth \* 0.1, 75);
installIcon.writeConfig("title", "Bluestar Installer");
installIcon.writeConfig("url", "file:///usr/share/applications/calamares.desktop");
installIcon.writeConfig("localPath", userDataPath("") + "/.local/share/plasma_icons/calamares.desktop");
myDesktop.wallpaperPlugin = "org.kde.image";
myDesktop.currentConfigGroup = \["Wallpaper", desktopsArray\[j\].wallpaperPlugin, "General"\];
myDesktop.writeConfig("Image", imagePath);
myDesktop.writeConfig("height", screenGeometry(0).height);
myDesktop.writeConfig("width", screenGeometry(0).width);
}
var lockConfig = ConfigFile(‘kscreenlockerrc’);
var lockConfig2 = ConfigFile(lockConfig, ‘Greeter’);
var lockConfig3 = ConfigFile(lockConfig2, ‘Wallpaper’);
var lockConfig4 = ConfigFile(lockConfig3, ‘org.kde.image’);
var lockConfig5 = ConfigFile(lockConfig4, ‘General’);
lockConfig5.writeEntry(‘Image’, imagePath);
lockConfig5.writeEntry(‘SlidePaths’, ‘/usr/share/wallpapers’);
All of this worked up until the release of plasma 6.5. I can tell it works now because it can correctly create both components. For whatever reason the panel is now not being displayed when the desktop applets are added. Is there a step missing? Does something need to be done after creating the panel? Does reloadConfig need to be called after creating the panel? Does something else need to be called? What’s missing?