mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-05 21:18:30 -04:00
@@ -1016,6 +1016,17 @@ Singleton {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
// Standalone bar xray is unsafe when windows can render beneath its surface
|
||||||
|
function _standaloneBarXrayAvailable(configs) {
|
||||||
|
const list = configs || [];
|
||||||
|
const activeBars = list.filter(c => c && c.enabled && (c.visible ?? true));
|
||||||
|
const gapsOverride = (typeof CompositorService !== "undefined" && CompositorService.isHyprland) ? hyprlandLayoutGapsOverride : niriLayoutGapsOverride;
|
||||||
|
const layoutGaps = gapsOverride >= 0 ? gapsOverride : Math.max(4, (list[0]?.spacing ?? 4));
|
||||||
|
return activeBars.every(c => !c.autoHide && !(c.useOverlayLayer ?? false) && (c.spacing ?? 4) + (c.bottomGap ?? 0) + layoutGaps >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property bool standaloneBarXrayAvailable: _standaloneBarXrayAvailable(barConfigs)
|
||||||
|
|
||||||
property bool desktopClockEnabled: false
|
property bool desktopClockEnabled: false
|
||||||
property string desktopClockStyle: "analog"
|
property string desktopClockStyle: "analog"
|
||||||
property real desktopClockTransparency: 0.8
|
property real desktopClockTransparency: 0.8
|
||||||
@@ -2418,13 +2429,17 @@ Singleton {
|
|||||||
if (index === -1)
|
if (index === -1)
|
||||||
return;
|
return;
|
||||||
const positionChanged = updates.position !== undefined && configs[index].position !== updates.position;
|
const positionChanged = updates.position !== undefined && configs[index].position !== updates.position;
|
||||||
|
const barXrayTargetWasAvailable = _standaloneBarXrayAvailable(configs);
|
||||||
if (updates.autoHide === false || updates.visible === false)
|
if (updates.autoHide === false || updates.visible === false)
|
||||||
setBarIpcReveal(barId, false);
|
setBarIpcReveal(barId, false);
|
||||||
|
|
||||||
Object.assign(configs[index], updates);
|
Object.assign(configs[index], updates);
|
||||||
barConfigs = _sanitizeBarConfigsForConnectedFrame(configs).configs;
|
const sanitizedConfigs = _sanitizeBarConfigsForConnectedFrame(configs).configs;
|
||||||
|
barConfigs = sanitizedConfigs;
|
||||||
updateBarConfigs();
|
updateBarConfigs();
|
||||||
|
|
||||||
|
if (!frameEnabled && _standaloneBarXrayAvailable(sanitizedConfigs) !== barXrayTargetWasAvailable)
|
||||||
|
updateCompositorLayout();
|
||||||
if (positionChanged) {
|
if (positionChanged) {
|
||||||
NotificationService.dismissAllPopups();
|
NotificationService.dismissAllPopups();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ Singleton {
|
|||||||
const frameConnectedMode = frameEnabled && SettingsData.frameMode === "connected";
|
const frameConnectedMode = frameEnabled && SettingsData.frameMode === "connected";
|
||||||
// Hyprland `xray = false` is still early-development; unset already samples real content, so only force xray=true
|
// Hyprland `xray = false` is still early-development; unset already samples real content, so only force xray=true
|
||||||
// Connected frame mode has no separate bar/frame surface to target
|
// Connected frame mode has no separate bar/frame surface to target
|
||||||
const barFrameTargetNamespace = !frameEnabled ? "dms:bar" : (frameConnectedMode ? null : "dms:frame");
|
const barFrameTargetNamespace = !frameEnabled ? (SettingsData.standaloneBarXrayAvailable ? "dms:bar" : null) : (frameConnectedMode ? null : "dms:frame");
|
||||||
|
|
||||||
let content = `-- Auto-generated by DMS — do not edit manually
|
let content = `-- Auto-generated by DMS — do not edit manually
|
||||||
|
|
||||||
|
|||||||
@@ -1161,7 +1161,7 @@ Singleton {
|
|||||||
const frameEnabled = typeof SettingsData !== "undefined" && SettingsData.frameEnabled;
|
const frameEnabled = typeof SettingsData !== "undefined" && SettingsData.frameEnabled;
|
||||||
const frameConnectedMode = frameEnabled && SettingsData.frameMode === "connected";
|
const frameConnectedMode = frameEnabled && SettingsData.frameMode === "connected";
|
||||||
// Connected frame mode has no separate bar/frame surface to target
|
// Connected frame mode has no separate bar/frame surface to target
|
||||||
const barFrameTargetNamespace = !frameEnabled ? "dms:bar" : (frameConnectedMode ? null : "dms:frame");
|
const barFrameTargetNamespace = !frameEnabled ? (SettingsData.standaloneBarXrayAvailable ? "dms:bar" : null) : (frameConnectedMode ? null : "dms:frame");
|
||||||
|
|
||||||
// Xray is niri's default blur, so only the off state needs a rule
|
// Xray is niri's default blur, so only the off state needs a rule
|
||||||
let xrayRules = "";
|
let xrayRules = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user