mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Merge branch 'main' of https://github.com/noctalia-dev/noctalia-shell
This commit is contained in:
@@ -11,10 +11,13 @@ Item {
|
||||
// Using Wayland protocols to get focused window then determine which screen it's on.
|
||||
function getActiveScreen() {
|
||||
const activeWindow = ToplevelManager.activeToplevel
|
||||
if (activeWindow.screens.length > 0) {
|
||||
return activeWindow.screens[0]
|
||||
if (activeWindow && activeWindow.screens.length > 0) {
|
||||
var screen = activeWindow.screens[0]
|
||||
return screen
|
||||
}
|
||||
return null
|
||||
|
||||
// Fall back to the primary screen
|
||||
return Quickshell.screens[0]
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
|
||||
@@ -12,6 +12,7 @@ Singleton {
|
||||
|
||||
// Currently opened panel
|
||||
property var openedPanel: null
|
||||
readonly property bool hasOpenedPanel: (openedPanel !== null)
|
||||
|
||||
property var registeredPanels: ({})
|
||||
|
||||
@@ -33,9 +34,15 @@ Singleton {
|
||||
|
||||
// Helper to keep only one panel open at any time
|
||||
function willOpenPanel(panel) {
|
||||
if (openedPanel && openedPanel != panel) {
|
||||
if (openedPanel && openedPanel !== panel) {
|
||||
openedPanel.close()
|
||||
}
|
||||
openedPanel = panel
|
||||
}
|
||||
|
||||
function closedPanel(panel) {
|
||||
if (openedPanel && openedPanel === panel) {
|
||||
openedPanel = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +126,7 @@ Loader {
|
||||
root.closed()
|
||||
active = false
|
||||
useButtonPosition = false // Reset button position usage
|
||||
PanelService.closedPanel(root)
|
||||
}
|
||||
|
||||
// -----------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user