mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-07 22:18:30 -04:00
fix(frame): honor showOnLastDisplay fallback in bar screen-coverage checks
fixes #2998
This commit is contained in:
@@ -2408,8 +2408,7 @@ Singleton {
|
||||
const bc = bars[i];
|
||||
if (bc.position !== sidePos)
|
||||
continue;
|
||||
const prefs = bc.screenPreferences || ["all"];
|
||||
if (prefs.includes("all") || isScreenInPreferences(screen, prefs))
|
||||
if (barConfigCoversScreen(bc, screen))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -2512,6 +2511,13 @@ Singleton {
|
||||
return filtered;
|
||||
}
|
||||
|
||||
function barConfigCoversScreen(bc, screen) {
|
||||
var prefs = bc?.screenPreferences || ["all"];
|
||||
if (prefs.includes("all") || isScreenInPreferences(screen, prefs))
|
||||
return true;
|
||||
return (bc?.showOnLastDisplay ?? false) && Quickshell.screens.length === 1;
|
||||
}
|
||||
|
||||
function getActiveBarEdgesForScreen(screen) {
|
||||
if (!screen)
|
||||
return [];
|
||||
@@ -2520,8 +2526,7 @@ Singleton {
|
||||
var bc = barConfigs[i];
|
||||
if (!bc.enabled)
|
||||
continue;
|
||||
var prefs = bc.screenPreferences || ["all"];
|
||||
if (!prefs.includes("all") && !isScreenInPreferences(screen, prefs))
|
||||
if (!barConfigCoversScreen(bc, screen))
|
||||
continue;
|
||||
switch (bc.position ?? 0) {
|
||||
case SettingsData.Position.Top:
|
||||
@@ -2549,8 +2554,7 @@ Singleton {
|
||||
var bc = barConfigs[i];
|
||||
if (!bc.enabled || !(bc.useOverlayLayer ?? false))
|
||||
continue;
|
||||
var prefs = bc.screenPreferences || ["all"];
|
||||
if (!prefs.includes("all") && !isScreenInPreferences(screen, prefs))
|
||||
if (!barConfigCoversScreen(bc, screen))
|
||||
continue;
|
||||
switch (bc.position ?? 0) {
|
||||
case SettingsData.Position.Top:
|
||||
|
||||
@@ -163,16 +163,7 @@ Item {
|
||||
Variants {
|
||||
id: barVariants
|
||||
model: {
|
||||
const prefs = root.barConfig?.screenPreferences || ["all"];
|
||||
const wantsAll = prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all");
|
||||
let base;
|
||||
if (wantsAll) {
|
||||
base = Quickshell.screens;
|
||||
} else {
|
||||
base = Quickshell.screens.filter(screen => SettingsData.isScreenInPreferences(screen, prefs));
|
||||
if (base.length === 0 && root.barConfig?.showOnLastDisplay && Quickshell.screens.length === 1)
|
||||
base = Quickshell.screens;
|
||||
}
|
||||
const base = Quickshell.screens.filter(screen => SettingsData.barConfigCoversScreen(root.barConfig, screen));
|
||||
// Connected frame mode renders the bar inside the frame surface; skip the standalone window there
|
||||
// unless this bar wants the overlay layer, which the frame surface cannot provide.
|
||||
return base.filter(screen => !CompositorService.frameHostsBarForConfig(screen, root.barConfig));
|
||||
|
||||
@@ -25,8 +25,7 @@ Item {
|
||||
const bc = configs[i];
|
||||
if (!bc.enabled || (bc.useOverlayLayer ?? false))
|
||||
continue;
|
||||
const prefs = bc.screenPreferences || ["all"];
|
||||
if (!prefs.includes("all") && !SettingsData.isScreenInPreferences(host.targetScreen, prefs))
|
||||
if (!SettingsData.barConfigCoversScreen(bc, host.targetScreen))
|
||||
continue;
|
||||
let edge = "top";
|
||||
switch (bc.position ?? 0) {
|
||||
|
||||
@@ -135,8 +135,7 @@ PanelWindow {
|
||||
const bc = configs[i];
|
||||
if (!bc || !(bc.enabled ?? true) || !(bc.visible ?? true))
|
||||
continue;
|
||||
const prefs = bc.screenPreferences || ["all"];
|
||||
if (!prefs.includes("all") && !SettingsData.isScreenInPreferences(screen, prefs))
|
||||
if (!SettingsData.barConfigCoversScreen(bc, screen))
|
||||
continue;
|
||||
const innerPadding = bc.innerPadding ?? (defaultBar?.innerPadding ?? 4);
|
||||
const widgetThickness = Math.max(20, 26 + innerPadding * 0.6);
|
||||
|
||||
Reference in New Issue
Block a user