From 16d8a26a972edaf444df4a9f5d0f9754bd2fe0a9 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Sat, 7 Mar 2026 11:06:39 -0500 Subject: [PATCH] actiondrawer: Preload for first open Preload the action drawer so that it doesn't get loaded only when the user attempts to open it for the first time (making it laggy). --- .../qml/actiondrawer/ActionDrawerWindow.qml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml b/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml index 2c30562f..9be9ff0d 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml @@ -35,13 +35,27 @@ Window { property alias actionDrawer: drawer property alias state: drawer.state - visible: drawer.intendedToBeVisible + visible: true color: "transparent" - // set input to transparent when closing to prevent window from taking unwanted touch inputs + // Set input to transparent when closing to prevent window from taking unwanted touch inputs onStateChanged: MobileShell.ShellUtil.setInputTransparent(window, state === "close") + // Preload and render content to avoid lag on first open + Component.onCompleted: { + preloadTimer.start(); + } + + Timer { + id: preloadTimer + interval: 1 + onTriggered: { + // Set window visibility binding after preloading content to the action drawer state + window.visible = Qt.binding(() => drawer.intendedToBeVisible); + } + } + onVisibleChanged: { if (visible) { window.raise();