mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Revert "fix(bar): defer update to next cycle"
This reverts commit 2fcd219c34.
This commit is contained in:
+11
-27
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user