Revert "fix(bar): defer update to next cycle"

This reverts commit 2fcd219c34.
This commit is contained in:
Lysec
2026-03-17 10:38:25 +01:00
parent 2fcd219c34
commit 46a3c7e2d4
24 changed files with 162 additions and 2459 deletions
+11 -27
View File
@@ -196,42 +196,20 @@ Singleton {
// Track last workspace ID to detect actual workspace changes
property var lastWorkspaceId: null
// Workspace switch handler - show bar on the focused workspace screen
// Deferred via Timer to avoid re-entrant incubation: setScreenHidden emits
// barAutoHideStateChanged which triggers BarContentWindow to load bar content.
// Loading Bar+widgets synchronously during workspaceChanged nests QQmlIncubatorPrivate
// inside the signal handler, corrupting the V4 heap (SIGSEGV in QV4::Object::insertMember).
Timer {
id: workspaceShowBarTimer
interval: 0
property string pendingScreenName: ""
onTriggered: {
if (pendingScreenName === "")
return;
var screenName = pendingScreenName;
pendingScreenName = "";
setScreenHidden(screenName, false);
if (!root.isBarHovered(screenName)) {
barHoverStateChanged(screenName, false);
}
}
}
// Workspace switch handler - directly show bar on the focused workspace screen
Connections {
target: CompositorService
function onWorkspaceChanged() {
if (!Settings.data.bar.showOnWorkspaceSwitch)
return;
if (Settings.data.bar.displayMode !== "auto_hide")
return;
var ws = CompositorService.getCurrentWorkspace();
if (!ws || !ws.output) {
return;
}
var screenName = ws.output || "";
if (Settings.getBarDisplayModeForScreen(screenName) !== "auto_hide")
return;
// Only trigger if workspace actually changed
var currentWsId = ws.id;
if (currentWsId === root.lastWorkspaceId) {
@@ -239,10 +217,16 @@ Singleton {
}
root.lastWorkspaceId = currentWsId;
var screenName = ws.output || "";
Logger.d("BarService", "Workspace switched to:", currentWsId, "on screen:", screenName);
workspaceShowBarTimer.pendingScreenName = screenName;
workspaceShowBarTimer.restart();
// Show bar immediately
setScreenHidden(screenName, false);
// Only trigger hideTimer if not already hovered (e.g., mouse on trigger zone)
if (!root.isBarHovered(screenName)) {
barHoverStateChanged(screenName, false);
}
}
}