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];
|
const bc = bars[i];
|
||||||
if (bc.position !== sidePos)
|
if (bc.position !== sidePos)
|
||||||
continue;
|
continue;
|
||||||
const prefs = bc.screenPreferences || ["all"];
|
if (barConfigCoversScreen(bc, screen))
|
||||||
if (prefs.includes("all") || isScreenInPreferences(screen, prefs))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -2512,6 +2511,13 @@ Singleton {
|
|||||||
return filtered;
|
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) {
|
function getActiveBarEdgesForScreen(screen) {
|
||||||
if (!screen)
|
if (!screen)
|
||||||
return [];
|
return [];
|
||||||
@@ -2520,8 +2526,7 @@ Singleton {
|
|||||||
var bc = barConfigs[i];
|
var bc = barConfigs[i];
|
||||||
if (!bc.enabled)
|
if (!bc.enabled)
|
||||||
continue;
|
continue;
|
||||||
var prefs = bc.screenPreferences || ["all"];
|
if (!barConfigCoversScreen(bc, screen))
|
||||||
if (!prefs.includes("all") && !isScreenInPreferences(screen, prefs))
|
|
||||||
continue;
|
continue;
|
||||||
switch (bc.position ?? 0) {
|
switch (bc.position ?? 0) {
|
||||||
case SettingsData.Position.Top:
|
case SettingsData.Position.Top:
|
||||||
@@ -2549,8 +2554,7 @@ Singleton {
|
|||||||
var bc = barConfigs[i];
|
var bc = barConfigs[i];
|
||||||
if (!bc.enabled || !(bc.useOverlayLayer ?? false))
|
if (!bc.enabled || !(bc.useOverlayLayer ?? false))
|
||||||
continue;
|
continue;
|
||||||
var prefs = bc.screenPreferences || ["all"];
|
if (!barConfigCoversScreen(bc, screen))
|
||||||
if (!prefs.includes("all") && !isScreenInPreferences(screen, prefs))
|
|
||||||
continue;
|
continue;
|
||||||
switch (bc.position ?? 0) {
|
switch (bc.position ?? 0) {
|
||||||
case SettingsData.Position.Top:
|
case SettingsData.Position.Top:
|
||||||
|
|||||||
@@ -163,16 +163,7 @@ Item {
|
|||||||
Variants {
|
Variants {
|
||||||
id: barVariants
|
id: barVariants
|
||||||
model: {
|
model: {
|
||||||
const prefs = root.barConfig?.screenPreferences || ["all"];
|
const base = Quickshell.screens.filter(screen => SettingsData.barConfigCoversScreen(root.barConfig, screen));
|
||||||
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;
|
|
||||||
}
|
|
||||||
// Connected frame mode renders the bar inside the frame surface; skip the standalone window there
|
// 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.
|
// unless this bar wants the overlay layer, which the frame surface cannot provide.
|
||||||
return base.filter(screen => !CompositorService.frameHostsBarForConfig(screen, root.barConfig));
|
return base.filter(screen => !CompositorService.frameHostsBarForConfig(screen, root.barConfig));
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ Item {
|
|||||||
const bc = configs[i];
|
const bc = configs[i];
|
||||||
if (!bc.enabled || (bc.useOverlayLayer ?? false))
|
if (!bc.enabled || (bc.useOverlayLayer ?? false))
|
||||||
continue;
|
continue;
|
||||||
const prefs = bc.screenPreferences || ["all"];
|
if (!SettingsData.barConfigCoversScreen(bc, host.targetScreen))
|
||||||
if (!prefs.includes("all") && !SettingsData.isScreenInPreferences(host.targetScreen, prefs))
|
|
||||||
continue;
|
continue;
|
||||||
let edge = "top";
|
let edge = "top";
|
||||||
switch (bc.position ?? 0) {
|
switch (bc.position ?? 0) {
|
||||||
|
|||||||
@@ -135,8 +135,7 @@ PanelWindow {
|
|||||||
const bc = configs[i];
|
const bc = configs[i];
|
||||||
if (!bc || !(bc.enabled ?? true) || !(bc.visible ?? true))
|
if (!bc || !(bc.enabled ?? true) || !(bc.visible ?? true))
|
||||||
continue;
|
continue;
|
||||||
const prefs = bc.screenPreferences || ["all"];
|
if (!SettingsData.barConfigCoversScreen(bc, screen))
|
||||||
if (!prefs.includes("all") && !SettingsData.isScreenInPreferences(screen, prefs))
|
|
||||||
continue;
|
continue;
|
||||||
const innerPadding = bc.innerPadding ?? (defaultBar?.innerPadding ?? 4);
|
const innerPadding = bc.innerPadding ?? (defaultBar?.innerPadding ?? 4);
|
||||||
const widgetThickness = Math.max(20, 26 + innerPadding * 0.6);
|
const widgetThickness = Math.max(20, 26 + innerPadding * 0.6);
|
||||||
|
|||||||
Reference in New Issue
Block a user