@@ -28,6 +28,7 @@ PlasmoidItem {
28
28
property bool horizontal: Plasmoid .formFactor === PlasmaCore .Types .Horizontal
29
29
property bool editMode: Plasmoid .containment .corona ? .editMode ?? false
30
30
property bool onDesktop: plasmoid .location === PlasmaCore .Types .Floating
31
+ property bool isWayland: Qt .platform .pluginName .includes (" wayland" )
31
32
property string iconName: ! onDesktop ? " icon" : " error"
32
33
property string icon: Qt .resolvedUrl (" ../icons/" + iconName + " .svg" ).toString ().replace (" file://" , " " )
33
34
property bool hideWidget: plasmoid .configuration .hideWidget
@@ -145,6 +146,7 @@ PlasmoidItem {
145
146
panelView .visible = true
146
147
}
147
148
Utils .evaluateScript (script)
149
+ reconfigure ()
148
150
})
149
151
}
150
152
@@ -1357,16 +1359,17 @@ PlasmoidItem {
1357
1359
1358
1360
onPanelLayoutChanged: {
1359
1361
if (! panelLayout) return
1360
- panelFixTimer .start ()
1362
+ panelFixTimer .restart ()
1361
1363
}
1362
1364
1363
1365
Timer {
1364
1366
id: panelFixTimer
1365
1367
repeat: false
1366
- interval: 1000
1368
+ interval: 2000
1367
1369
onTriggered: {
1368
1370
doPanelLengthFix = true
1369
1371
doPanelLengthFix = false
1372
+ reconfigure ()
1370
1373
}
1371
1374
}
1372
1375
@@ -1446,12 +1449,36 @@ PlasmoidItem {
1446
1449
inSignature: null
1447
1450
}
1448
1451
1452
+ // temporarily show the panel
1449
1453
Timer {
1450
- id: reconfigureTimer
1451
- interval: 10
1454
+ id: tempActivationTimer
1455
+ interval: 500
1456
+ triggeredOnStart: true
1452
1457
onTriggered: {
1458
+ Plasmoid .activated ()
1459
+ main .expanded = false
1460
+ }
1461
+ }
1462
+
1463
+ function reconfigure () {
1464
+ // sometimes windows won't update when the panel visibility or height
1465
+ // (and maybe other properties) changes, this is more noticeable with
1466
+ // krohnkite tiling extension so we make the panel visible by
1467
+ // activating the widget for a moment which in turn activates the panel
1468
+ // and org.kde.KWin.reconfigure triggers the resize we need
1469
+ // TODO figure out how the desktop edit mode informs the new available size
1470
+ if (isWayland) {
1471
+ // X11 doesn't seem to need it and also would flicker the panel/screen
1453
1472
dbusKWinReconfigure .call ()
1454
1473
}
1474
+ if ([" autohide" , " dodgewindows" ].includes (stockPanelSettings .visibility .value )) {
1475
+ // activate the panel for a longer time if it can hide
1476
+ // to avoid plasma crash when changing its location
1477
+ tempActivationTimer .restart ()
1478
+ } else {
1479
+ Plasmoid .activated ()
1480
+ Plasmoid .activated ()
1481
+ }
1455
1482
}
1456
1483
1457
1484
// https://github.com/olib14/pinpanel/blob/2d126f0f3ac3e35a725f05b0060a3dd5c924cbe7/package/contents/ui/main.qml#L58 ♥
@@ -1461,15 +1488,6 @@ PlasmoidItem {
1461
1488
}
1462
1489
}
1463
1490
1464
- Connections {
1465
- target: plasmoid .configuration
1466
- onValueChanged: {
1467
- Qt .callLater (function () {
1468
- reconfigureTimer .restart ()
1469
- })
1470
- }
1471
- }
1472
-
1473
1491
function updateCurrentWidgets () {
1474
1492
panelWidgets = []
1475
1493
panelWidgets = Utils .findWidgets (panelLayout, panelWidgets)
0 commit comments