mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-05-28 00:31:52 +00:00
fix: Media player auto-switching in Control Center
Detailed Explanation: Addresses an issue where the media player would automatically switch,overriding user's manual selections when the Control Center was open. The core problem was that the automatic player detection logic was too aggressive and didn't respect explicit user choices. Previous attempts to pause auto-switching based on UI visibility were unreliable due to incorrect event handling for the custom NPanel component.
This commit is contained in:
@@ -179,8 +179,7 @@ NBox {
|
||||
onTriggered: function (action) {
|
||||
var index = parseInt(action)
|
||||
if (!isNaN(index)) {
|
||||
MediaService.selectedPlayerIndex = index
|
||||
MediaService.updateCurrentPlayer()
|
||||
MediaService.switchToPlayer(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,14 @@ NPanel {
|
||||
readonly property int weatherHeight: Math.round(190 * Style.uiScaleRatio)
|
||||
readonly property int mediaSysMonHeight: Math.round(260 * Style.uiScaleRatio)
|
||||
|
||||
onOpened: {
|
||||
MediaService.autoSwitchingPaused = true
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
MediaService.autoSwitchingPaused = false
|
||||
}
|
||||
|
||||
panelContent: Item {
|
||||
id: content
|
||||
|
||||
|
||||
Reference in New Issue
Block a user