summaryrefslogtreecommitdiff
path: root/modules/bar
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-03 13:29:11 +0800
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-03 13:29:11 +0800
commit5bd740abe70dbf061c21971902eb442681d2b1e9 (patch)
tree70e01f26dafc6f567ea34dadfbcd64b3a8b0c80d /modules/bar
parentbar: add preview to activewindow popout (diff)
downloadcaelestia-shell-5bd740abe70dbf061c21971902eb442681d2b1e9.tar.gz
caelestia-shell-5bd740abe70dbf061c21971902eb442681d2b1e9.tar.bz2
caelestia-shell-5bd740abe70dbf061c21971902eb442681d2b1e9.zip
bar: save cpu usage
Stop window preview when not visible
Diffstat (limited to 'modules/bar')
-rw-r--r--modules/bar/popouts/ActiveWindow.qml2
-rw-r--r--modules/bar/popouts/Wrapper.qml2
2 files changed, 3 insertions, 1 deletions
diff --git a/modules/bar/popouts/ActiveWindow.qml b/modules/bar/popouts/ActiveWindow.qml
index d9e9b9e..547c019 100644
--- a/modules/bar/popouts/ActiveWindow.qml
+++ b/modules/bar/popouts/ActiveWindow.qml
@@ -39,7 +39,7 @@ Item {
ScreencopyView {
id: preview
- captureSource: ToplevelManager.toplevels.values.find(t => t.title === Hyprland.activeClient?.title) ?? null
+ captureSource: visible ? (ToplevelManager.toplevels.values.find(t => t.title === Hyprland.activeClient?.title) ?? null) : null
live: true
constraintSize.width: BarConfig.sizes.windowPreviewSize
diff --git a/modules/bar/popouts/Wrapper.qml b/modules/bar/popouts/Wrapper.qml
index 7782d90..0b6fba8 100644
--- a/modules/bar/popouts/Wrapper.qml
+++ b/modules/bar/popouts/Wrapper.qml
@@ -8,6 +8,8 @@ Item {
required property ShellScreen screen
+ visible: width > 0 && height > 0
+
implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight + BorderConfig.rounding * 2