@@ -450,6 +450,7 @@ PlasmoidItem {
450
450
return getColor (widgetSettings .foregroundColor , targetIndex, rect .color , itemType, fgColorHolder)
451
451
}
452
452
}
453
+ property bool throttleMaskUpdate: false
453
454
Rectangle {
454
455
id: fgColorHolder
455
456
height: 6
@@ -581,7 +582,7 @@ PlasmoidItem {
581
582
Component .onCompleted : {
582
583
main .recolorCountChanged .connect (rect .recolor )
583
584
main .updateUnified .connect (updateUnifyType)
584
- main .updateMasks .connect (updateMask )
585
+ main .updateMasks .connect (updateMaskDebounced )
585
586
recolorTimer .start ()
586
587
}
587
588
@@ -1036,12 +1037,12 @@ PlasmoidItem {
1036
1037
1037
1038
onXChanged: {
1038
1039
// console.error("onXChanged()")
1039
- updateMask ()
1040
+ updateMaskDebounced ()
1040
1041
}
1041
1042
1042
1043
onYChanged: {
1043
1044
// console.error("onYChanged()")
1044
- updateMask ()
1045
+ updateMaskDebounced ()
1045
1046
}
1046
1047
1047
1048
onWidthChanged: {
@@ -1056,18 +1057,18 @@ PlasmoidItem {
1056
1057
1057
1058
onBlurMaskXChanged: {
1058
1059
// console.error("onBlurMaskXChanged()")
1059
- updateMask ()
1060
+ updateMaskDebounced ()
1060
1061
}
1061
1062
1062
1063
onBlurMaskYChanged: {
1063
1064
// console.error("onBlurMaskYChanged()")
1064
- updateMask ()
1065
+ updateMaskDebounced ()
1065
1066
}
1066
1067
1067
- onTopLeftRadiusChanged: updateMask ()
1068
- onTopRightRadiusChanged: updateMask ()
1069
- onBottomLeftRadiusChanged: updateMask ()
1070
- onBottomRightRadiusChanged: updateMask ()
1068
+ onTopLeftRadiusChanged: updateMaskDebounced ()
1069
+ onTopRightRadiusChanged: updateMaskDebounced ()
1070
+ onBottomLeftRadiusChanged: updateMaskDebounced ()
1071
+ onBottomRightRadiusChanged: updateMaskDebounced ()
1071
1072
1072
1073
// TODO find where does 16 and 8 come from instead of blindly hardcoding them
1073
1074
property real moveX: {
@@ -1084,7 +1085,7 @@ PlasmoidItem {
1084
1085
1085
1086
onVisibleChanged: {
1086
1087
main .updateUnified ()
1087
- updateMask ()
1088
+ updateMaskDebounced ()
1088
1089
}
1089
1090
1090
1091
onBlurBehindChanged: {
@@ -1095,7 +1096,18 @@ PlasmoidItem {
1095
1096
trayItemsDoingBlur[maskIndex] = blurBehind
1096
1097
anyTrayItemDoingBlur = Object .values (trayItemsDoingBlur).some (state => state)
1097
1098
}
1098
- updateMask ()
1099
+ updateMaskDebounced ()
1100
+ }
1101
+
1102
+ function updateMaskDebounced () {
1103
+ if (rect .throttleMaskUpdate ) {
1104
+ return
1105
+ }
1106
+ rect .throttleMaskUpdate = true
1107
+ Qt .callLater (function () {
1108
+ updateMask ()
1109
+ rect .throttleMaskUpdate = false
1110
+ })
1099
1111
}
1100
1112
1101
1113
function updateMask () {
@@ -1372,7 +1384,7 @@ PlasmoidItem {
1372
1384
}
1373
1385
1374
1386
onPanelLayoutCountChanged: {
1375
- console .log (" onPanelLayoutCountChanged" )
1387
+ // console.log("onPanelLayoutCountChanged")
1376
1388
initAll ()
1377
1389
// re-apply customizations after the widget stops being dagged around
1378
1390
for (var i = 0 ; i < panelLayout .children .length ; i++ ) {
@@ -1574,7 +1586,7 @@ PlasmoidItem {
1574
1586
1575
1587
function showWidgets (panelLayout ) {
1576
1588
if (! panelLayout) return
1577
- console .log (" showWidgets()" )
1589
+ // console.log("showWidgets()")
1578
1590
for (var i in panelLayout .children ) {
1579
1591
const child = panelLayout .children [i];
1580
1592
// name may not be available while gragging into the panel and
0 commit comments