mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
refactor(compositor): reduce unnecessary UI updates
- Defer updates when window state hasn't actually changed - Cache frame-blocked state per screen instead of recalculating constantly - keep popouts cache so reopening them is instant & clean up otherwise
This commit is contained in:
@@ -134,12 +134,7 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: CompositorService
|
||||
function onToplevelsChanged() {
|
||||
root._maybeResolveBackend();
|
||||
}
|
||||
}
|
||||
// Backend re-resolution on toplevel activity is covered by CompositorService.frameBlockedByScreen.
|
||||
|
||||
function _usesConnectedBackendForScreen(targetScreen) {
|
||||
return CompositorService.usesConnectedFrameChromeForScreen(targetScreen);
|
||||
|
||||
@@ -38,6 +38,7 @@ Item {
|
||||
property bool contentHandlesKeys: false
|
||||
property bool fullHeightSurface: false
|
||||
property bool _primeContent: false
|
||||
property bool _contentWarm: false
|
||||
property bool _resizeActive: false
|
||||
property real _chromeAnimTravelX: 1
|
||||
property real _chromeAnimTravelY: 1
|
||||
@@ -472,6 +473,7 @@ Item {
|
||||
isClosing = false;
|
||||
animationsEnabled = false;
|
||||
_primeContent = true;
|
||||
_contentWarm = true;
|
||||
_supersededClose = false;
|
||||
|
||||
const screenChanged = _lastOpenedScreen !== null && _lastOpenedScreen !== screen;
|
||||
@@ -1334,7 +1336,8 @@ Item {
|
||||
Loader {
|
||||
id: contentLoader
|
||||
anchors.fill: parent
|
||||
active: root._primeContent || shouldBeVisible || contentWindow.visible
|
||||
// _contentWarm keeps the tree loaded across close for fast re-open; reclaimed by PopoutService on lock/idle.
|
||||
active: root._primeContent || shouldBeVisible || contentWindow.visible || root._contentWarm
|
||||
asynchronous: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ Item {
|
||||
property bool contentHandlesKeys: false
|
||||
property bool fullHeightSurface: false
|
||||
property bool _primeContent: false
|
||||
property bool _contentWarm: false
|
||||
property bool _resizeActive: false
|
||||
property real _surfaceMarginLeft: 0
|
||||
property real _surfaceMarginTop: 0
|
||||
@@ -305,6 +306,7 @@ Item {
|
||||
isClosing = false;
|
||||
animationsEnabled = false;
|
||||
_primeContent = true;
|
||||
_contentWarm = true;
|
||||
|
||||
_frozenMaskX = maskX;
|
||||
_frozenMaskY = maskY;
|
||||
@@ -891,7 +893,8 @@ Item {
|
||||
Loader {
|
||||
id: contentLoader
|
||||
anchors.fill: parent
|
||||
active: root._primeContent || shouldBeVisible || contentWindow.visible
|
||||
// _contentWarm keeps the tree loaded across close for fast re-open; reclaimed by PopoutService on lock/idle.
|
||||
active: root._primeContent || shouldBeVisible || contentWindow.visible || root._contentWarm
|
||||
asynchronous: false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user