mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-04 12:38:31 -04:00
@@ -1027,17 +1027,6 @@ 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 string desktopClockStyle: "analog"
|
||||
property real desktopClockTransparency: 0.8
|
||||
@@ -2479,17 +2468,13 @@ Singleton {
|
||||
if (index === -1)
|
||||
return;
|
||||
const positionChanged = updates.position !== undefined && configs[index].position !== updates.position;
|
||||
const barXrayTargetWasAvailable = _standaloneBarXrayAvailable(configs);
|
||||
if (updates.autoHide === false || updates.visible === false)
|
||||
setBarIpcReveal(barId, false);
|
||||
|
||||
Object.assign(configs[index], updates);
|
||||
const sanitizedConfigs = _sanitizeBarConfigsForConnectedFrame(configs).configs;
|
||||
barConfigs = sanitizedConfigs;
|
||||
barConfigs = _sanitizeBarConfigsForConnectedFrame(configs).configs;
|
||||
updateBarConfigs();
|
||||
|
||||
if (!frameEnabled && _standaloneBarXrayAvailable(sanitizedConfigs) !== barXrayTargetWasAvailable)
|
||||
updateCompositorLayout();
|
||||
if (positionChanged) {
|
||||
NotificationService.dismissAllPopups();
|
||||
}
|
||||
|
||||
@@ -341,10 +341,11 @@ Singleton {
|
||||
const borderSize = (typeof SettingsData !== "undefined" && SettingsData.hyprlandLayoutBorderSize >= 0) ? SettingsData.hyprlandLayoutBorderSize : defaultBorderSize;
|
||||
const resizeOnBorder = (typeof SettingsData !== "undefined" && SettingsData.hyprlandResizeOnBorder) ? true : false;
|
||||
const frameEnabled = typeof SettingsData !== "undefined" && SettingsData.frameEnabled;
|
||||
const frameConnectedMode = frameEnabled && SettingsData.frameMode === "connected";
|
||||
// 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
|
||||
const barFrameTargetNamespace = !frameEnabled ? (SettingsData.standaloneBarXrayAvailable ? "dms:bar" : null) : (frameConnectedMode ? null : "dms:frame");
|
||||
// dms:frame only in separate mode — connected-mode frame blur overlaps windows via popouts/arcs
|
||||
const xrayNamespaces = ["dms:bar"];
|
||||
if (frameEnabled && SettingsData.frameMode !== "connected")
|
||||
xrayNamespaces.push("dms:frame");
|
||||
|
||||
const generalLines = [];
|
||||
if (manageGaps)
|
||||
@@ -371,13 +372,15 @@ hl.layer_rule({
|
||||
})
|
||||
`;
|
||||
}
|
||||
if (layoutBarXrayEnabled && barFrameTargetNamespace) {
|
||||
content += `
|
||||
if (layoutBarXrayEnabled) {
|
||||
for (const ns of xrayNamespaces) {
|
||||
content += `
|
||||
hl.layer_rule({
|
||||
match = { namespace = "^${barFrameTargetNamespace}$" },
|
||||
match = { namespace = "^${ns}$" },
|
||||
xray = true,
|
||||
})
|
||||
`;
|
||||
}
|
||||
}
|
||||
// Marker persists the preference even while the rule has no target
|
||||
if (!layoutBarXrayEnabled) {
|
||||
|
||||
@@ -1189,19 +1189,18 @@ Singleton {
|
||||
const gaps = gapsOverride >= 0 ? gapsOverride : defaultGaps;
|
||||
const borderSize = (typeof SettingsData !== "undefined" && SettingsData.niriLayoutBorderSize >= 0) ? SettingsData.niriLayoutBorderSize : defaultBorderSize;
|
||||
const frameEnabled = typeof SettingsData !== "undefined" && SettingsData.frameEnabled;
|
||||
const frameConnectedMode = frameEnabled && SettingsData.frameMode === "connected";
|
||||
// Connected frame mode has no separate bar/frame surface to target
|
||||
const barFrameTargetNamespace = !frameEnabled ? (SettingsData.standaloneBarXrayAvailable ? "dms:bar" : null) : (frameConnectedMode ? null : "dms:frame");
|
||||
// dms:frame only in separate mode — connected-mode frame blur overlaps windows via popouts/arcs
|
||||
const excludeNamespaces = ["dms:bar"];
|
||||
if (frameEnabled && SettingsData.frameMode !== "connected")
|
||||
excludeNamespaces.push("dms:frame");
|
||||
|
||||
// Xray is niri's default blur, so only the off state needs a rule.
|
||||
// A single rule excluding the bar/frame keeps its blur on the wallpaper
|
||||
// without a second namespace-matched override rule.
|
||||
let xrayRules = "";
|
||||
if (!layoutXrayEnabled) {
|
||||
const excludeLine = (layoutBarXrayEnabled && barFrameTargetNamespace) ? `\n exclude namespace="^${barFrameTargetNamespace}$"` : "";
|
||||
const excludeLines = layoutBarXrayEnabled ? excludeNamespaces.map(ns => `\n exclude namespace="^${ns}$"`).join("") : "";
|
||||
xrayRules += `
|
||||
|
||||
layer-rule {${excludeLine}
|
||||
layer-rule {${excludeLines}
|
||||
background-effect {
|
||||
xray false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user