From fea9a1b7be655429823fe86b0bcf3178f5159a2b Mon Sep 17 00:00:00 2001 From: "gaelle.braud" Date: Fri, 21 Nov 2025 14:01:16 +0100 Subject: [PATCH] fix binding loop in getLastFocusableItemInItem (fix #LINQT-2210) --- Linphone/view/Control/Tool/Helper/utils.js | 10 +++++----- Linphone/view/Page/Window/Call/CallsWindow.qml | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Linphone/view/Control/Tool/Helper/utils.js b/Linphone/view/Control/Tool/Helper/utils.js index 683e34ef5..9b72b4c14 100644 --- a/Linphone/view/Control/Tool/Helper/utils.js +++ b/Linphone/view/Control/Tool/Helper/utils.js @@ -154,8 +154,8 @@ function isDescendant(child, parent) { // ----------------------------------------------------------------------------- -// Retrieve first focussable item of an Item. If no item found, return undefined -function getFirstFocussableItemInItem(item) { +// Retrieve first focusable item of an Item. If no item found, return undefined +function getFirstFocusableItemInItem(item) { var next = item.nextItemInFocusChain(); if (next && isDescendant(next, item)){ return next; @@ -163,8 +163,8 @@ function getFirstFocussableItemInItem(item) { return undefined; } -// Retrieve last focussable item of an Item. If no item found, return undefined -function getLastFocussableItemInItem(item) { +// Retrieve last focusable item of an Item. If no item found, return undefined +function getLastFocusableItemInItem(item) { var next = item.nextItemInFocusChain(); if(next && !isDescendant(next, item)){ return undefined; @@ -173,7 +173,7 @@ function getLastFocussableItemInItem(item) { do{ current = next; next = current.nextItemInFocusChain(); - } while(isDescendant(next, item) && next.visible) + } while(isDescendant(next, item) && next.visible && next !== current) return current; } diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index 162e2dcdc..5a56d5b79 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -38,7 +38,7 @@ AbstractWindow { == LinphoneEnums.CallState.OutgoingEarlyMedia || mainWindow.callState == LinphoneEnums.CallState.IncomingReceived property Item firstButtonInBottomTab : mainWindow.startingCall ? endCallButton : (videoCameraButton.visible && videoCameraButton.enabled ? videoCameraButton : audioMicrophoneButton) - property Item lastButtonInBottomTab : mainWindow.startingCall ? Utils.getLastFocussableItemInItem(controlCallButtons) : endCallButton + property Item lastButtonInBottomTab : mainWindow.startingCall ? Utils.getLastFocusableItemInItem(controlCallButtons) : endCallButton onCallStateChanged: { if (callState === LinphoneEnums.CallState.Connected) { @@ -738,9 +738,9 @@ AbstractWindow { if (!rightPanel.contentLoader.item || rightPanel.contentLoader.item.objectName !== "participantListPanel") participantListButton.checked = false // Update tab focus properties - var firstContentFocusableItem = Utils.getFirstFocussableItemInItem(rightPanel.contentLoader.item) + var firstContentFocusableItem = Utils.getFirstFocusableItemInItem(rightPanel.contentLoader.item) rightPanel.firstContentFocusableItem = firstContentFocusableItem ?? mainWindow.firstButtonInBottomTab - var lastContentFocusableItem = Utils.getLastFocussableItemInItem(rightPanel.contentLoader.item) + var lastContentFocusableItem = Utils.getLastFocusableItemInItem(rightPanel.contentLoader.item) if(lastContentFocusableItem != undefined){ lastContentFocusableItem.KeyNavigation.tab = mainWindow.firstButtonInBottomTab } @@ -1302,7 +1302,7 @@ AbstractWindow { style: ButtonStyle.phoneRedLightBorder Layout.column: mainWindow.startingCall ? 0 : bottomButtonsLayout.columns - 1 KeyNavigation.tab: mainWindow.startingCall ? (videoCameraButton.visible && videoCameraButton.enabled ? videoCameraButton : audioMicrophoneButton) : openStatisticPanelButton - KeyNavigation.backtab: mainWindow.startingCall ? rightPanel.visible ? Utils.getLastFocussableItemInItem(rightPanel) : nextItemInFocusChain(false): callListButton + KeyNavigation.backtab: mainWindow.startingCall ? rightPanel.visible ? Utils.getLastFocusableItemInItem(rightPanel) : nextItemInFocusChain(false): callListButton onClicked: { mainWindow.callTerminatedByUser = true mainWindow.endCall(mainWindow.call)