Shell/Bar: create full screen window everywhere so there is no limitations.

This commit is contained in:
ItsLemmy
2025-11-04 10:19:00 -05:00
parent dc69d1f1e6
commit fd79f75fd5
5 changed files with 37 additions and 30 deletions
-1
View File
@@ -55,7 +55,6 @@ Item {
var monitors = Settings.data.bar.monitors || []
var result = monitors.length === 0 || monitors.includes(root.screen.name)
Logger.d("Shell", "NFullScreenWindow Loader for", root.screen?.name, "- shouldBeActive:", result, "- monitors:", JSON.stringify(monitors))
return result
}
+16 -6
View File
@@ -49,12 +49,22 @@ NPanel {
// Positioning
readonly property string controlCenterPosition: Settings.data.controlCenter.position
panelAnchorHorizontalCenter: controlCenterPosition !== "close_to_bar_button" && (controlCenterPosition.endsWith("_center") || controlCenterPosition === "center")
panelAnchorVerticalCenter: controlCenterPosition === "center"
panelAnchorLeft: controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.endsWith("_left")
panelAnchorRight: controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.endsWith("_right")
panelAnchorBottom: controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.startsWith("bottom_")
panelAnchorTop: controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.startsWith("top_")
// Check if there's a bar on this screen
readonly property bool hasBarOnScreen: {
var monitors = Settings.data.bar.monitors || []
return monitors.length === 0 || monitors.includes(screen?.name)
}
// When position is "close_to_bar_button" but there's no bar, fall back to center
readonly property bool shouldCenter: controlCenterPosition === "close_to_bar_button" && !hasBarOnScreen
panelAnchorHorizontalCenter: shouldCenter || (controlCenterPosition !== "close_to_bar_button" && (controlCenterPosition.endsWith("_center") || controlCenterPosition === "center"))
panelAnchorVerticalCenter: shouldCenter || controlCenterPosition === "center"
panelAnchorLeft: !shouldCenter && controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.endsWith("_left")
panelAnchorRight: !shouldCenter && controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.endsWith("_right")
panelAnchorBottom: !shouldCenter && controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.startsWith("bottom_")
panelAnchorTop: !shouldCenter && controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.startsWith("top_")
readonly property int profileHeight: Math.round(64 * Style.uiScaleRatio)
readonly property int shortcutsHeight: Math.round(52 * Style.uiScaleRatio)
-15
View File
@@ -355,21 +355,6 @@ Item {
// Execute pending callback if any
if (pendingCallback) {
// Verify we have a NFullScreenWindow for this screen
var monitors = Settings.data.bar.monitors || []
if (!(monitors.length === 0 || monitors.includes(detectedScreen.name))) {
// Fall back to first enabled screen as we can NOT show a panel on a screen without a Bar/NFullScreenWindow
if (monitors.length === 0 && Quickshell.screens.length > 0) {
detectedScreen = Quickshell.screens[0]
} else {
for (var i = 0; i < Quickshell.screens.length; i++) {
if (monitors.includes(Quickshell.screens[i].name)) {
detectedScreen = Quickshell.screens[i]
break
}
}
}
}
Logger.d("IPC", "Executing pending IPC callback on screen:", detectedScreen.name)
pendingCallback(detectedScreen)
pendingCallback = null
+10 -1
View File
@@ -15,7 +15,16 @@ Item {
// A panel can only be a attached to the bar of screen edges if
property bool couldAttach: Settings.data.ui.panelsAttachedToBar
property bool couldAttachToBar: (Settings.data.ui.panelsAttachedToBar && Settings.data.bar.backgroundOpacity >= 1.0)
property bool couldAttachToBar: {
if (!Settings.data.ui.panelsAttachedToBar || Settings.data.bar.backgroundOpacity < 1.0) {
return false
}
// A panel can only be attached to a bar if there is a bar on that screen
var monitors = Settings.data.bar.monitors || []
var result = monitors.length === 0 || monitors.includes(screen.name)
return result
}
// Edge snapping: if panel is within this distance (in pixels) from a screen edge, snap
property real edgeSnapDistance: 50
+11 -7
View File
@@ -209,11 +209,8 @@ ShellRoot {
if (!modelData || !modelData.name)
return false
var monitors = Settings.data.bar.monitors || []
var result = monitors.length === 0 || monitors.includes(modelData.name)
Logger.d("Shell", "NFullScreenWindow Loader for", modelData?.name, "- shouldBeActive:", result, "- monitors:", JSON.stringify(monitors))
return result
Logger.d("Shell", "NFullScreenWindow activated for", modelData?.name)
return true
}
property bool windowLoaded: false
@@ -281,9 +278,16 @@ ShellRoot {
}
// BarExclusionZone - created after NFullScreenWindow has fully loaded
// Must also be disabled when bar is hidden
// Disabled when bar is hidden or not configured for this screen
Loader {
active: parent.windowLoaded && parent.shouldBeActive && BarService.isVisible
active: {
if (!parent.windowLoaded || !parent.shouldBeActive || !BarService.isVisible)
return false
// Check if bar is configured for this screen
var monitors = Settings.data.bar.monitors || []
return monitors.length === 0 || monitors.includes(modelData?.name)
}
asynchronous: false
sourceComponent: BarExclusionZone {