Watch
1
0
Fork
You've already forked souveraine
0
souveraine/surfaces/quickshell/GlobalStates.qml
Fimeg 19fe6b1d0e shell: dock reorder, fullscreen detection fix, idle-power, sessiond, misc shell work
- Dock drag-to-reorder for pinned apps (insertion gap, quick-slide vs dwell)
- Fullscreen detection: scan all windows via HyprlandData.windowList
- IdleCoordinator, GlobalStates, Session.qml updates
- Deploy script, qmldir, settings, wallpaper, visualizer fixes
- sessiond server, memory module updates

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-22 22:18:20 -04:00

143 lines
6 KiB
QML

// Souveraine patch to ii's stock GlobalStates.qml.
//
// Adds dockRevealed: the explicit, persistent dock state driven by the
// Souveraine's integrated navigation rail. Everything else in this file is
// unchanged stock ii — diff against upstream before re-applying this patch if
// ii updates.
import qs.modules.common
import qs.services
import QtQuick
import Quickshell
import Quickshell.Hyprland
import Quickshell.Io
pragma Singleton
pragma ComponentBehavior: Bound
Singleton {
id: root
property bool barOpen: true
property bool crosshairOpen: false
property bool sidebarLeftOpen: false
property bool sidebarRightOpen: false
property bool mediaControlsOpen: false
property bool osdBrightnessOpen: false
property bool osdVolumeOpen: false
property bool oskOpen: false
property bool overlayOpen: false
property bool overviewOpen: false
property bool regionSelectorOpen: false
property bool searchOpen: false
// `screenLocked` is the shell's lock *request*: it drives WlSessionLock
// and hides ordinary surfaces immediately. It is deliberately separate
// from `screenLockSecure`, which is WlSessionLock.secure and only becomes
// true once the compositor has acknowledged the lock. Consumers that
// disclose personal data must gate on secure, not merely on the request.
property bool screenLocked: false
// True while the display is genuinely in use (IdleCoordinator Active or
// Waking). The idle machine drives it; widgets/pollers whose data may go
// stale while the screen is dimmed/locked/asleep gate their timers and
// processes on this instead of importing the souveraine IdleCoordinator
// singleton into ii-base (quickshell-idle-power task 4).
property bool displayActive: true
property bool screenLockSecure: false
property bool screenLockContainsCharacters: false
property bool screenUnlockFailed: false
property bool screenTranslatorOpen: false
property bool sessionOpen: false
property bool superDown: false
property bool superReleaseMightTrigger: true
property real superPressTime: 0
property real superLastPressDuration: -1
property real superLastReleaseTime: 0
property bool wallpaperSelectorOpen: false
property bool workspaceShowNumbers: false
// Boot bloom overlay: true from shell start until the lockscreen surface is
// secure. It covers all of Hyprland's boot render, continuing the C splash's
// bloom animation. LockScreen.onSecureChanged clears it to reveal the lock.
property bool bootBloomActive: true
// In fullscreen this is the only way the dock becomes visible:
// the navigation rail swipe sets/clears it. It deliberately has no timer
// or secondary state.
property bool dockRevealed: false
// Mission Control: the Souveraine process/task surface, raised by a
// triple swipe-up on the navigation rail. A first-class shell state in
// its own right (like overviewOpen) — the rail only sets it; the
// MissionControl surface owns everything else. Deliberately distinct
// from overviewOpen (the app launcher/search) — this is the running-work
// view, reached by escalating the same upward gesture past a single dock
// reveal.
property bool missionControlOpen: false
// A rail swipe-down on a visible dock dismisses it in ANY state —
// including pinned and shown-on-empty-desktop, which dockRevealed alone
// can't reach (it only governs the fullscreen case). Swipe up clears it.
property bool dockSuppressed: false
// Transient dock reveal: shows the dock for a few seconds and restores
// whatever state ruled before. Callers: the `osk pulseDock` IPC (glance
// at the dock without closing the keyboard) and the agent's harness.
// Restored 2026-07-16 — the definition was lost in a refactor while its
// IPC caller in OnScreenKeyboard.qml survived, so pulseDock threw.
property bool dockRevealPulse: false
function pulseDockReveal() {
root.dockRevealPulse = true;
dockRevealPulseTimer.restart();
}
Timer {
id: dockRevealPulseTimer
interval: 3000
onTriggered: root.dockRevealPulse = false
}
// True while a dock icon drag is in flight. Set by DockAppButton's drag
// lifecycle, read by DockManifest's state checks so structural edits
// (pin/stack mutations) can't land mid-drag and rewrite dock.stacks out
// from under a commit.
property bool dockDragInProgress: false
function superPressDuration() {
const now = Date.now();
if (root.superPressTime > 0)
return now - root.superPressTime;
if (root.superLastReleaseTime > 0 && now - root.superLastReleaseTime < 250)
return root.superLastPressDuration;
return -1;
}
function shouldSuppressSuperReleaseSearch() {
const autoHide = Config?.options?.bar?.autoHide;
const showWhenPressingSuper = autoHide?.showWhenPressingSuper;
if (!autoHide?.enable || !showWhenPressingSuper?.enable || !showWhenPressingSuper?.suppressSearchOnHold)
return false;
const duration = root.superPressDuration();
return duration >= (showWhenPressingSuper?.suppressSearchDelay ?? showWhenPressingSuper?.delay ?? 140);
}
onSidebarRightOpenChanged: {
if (GlobalStates.sidebarRightOpen) {
Notifications.timeoutAll();
Notifications.markAllRead();
}
}
GlobalShortcut {
name: "workspaceNumber"
description: "Hold to show workspace numbers, release to show icons"
onPressed: {
root.superDown = true
root.superPressTime = Date.now()
root.superLastPressDuration = -1
}
onReleased: {
const now = Date.now()
if (root.superPressTime > 0)
root.superLastPressDuration = now - root.superPressTime
root.superLastReleaseTime = now
root.superPressTime = 0
root.superDown = false
}
}
}