Commit bd6a2a89 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(ui/views/App/Calls/IncallFullscreenWindow): connect once to visibility...

fix(ui/views/App/Calls/IncallFullscreenWindow): connect once to visibility changed to call `showFullScreen`
parent 63230fc0
...@@ -20,7 +20,7 @@ function handleStatusChanged (status) { ...@@ -20,7 +20,7 @@ function handleStatusChanged (status) {
if (status === Linphone.CallModel.CallStatusEnded) { if (status === Linphone.CallModel.CallStatusEnded) {
var fullscreen = incall._fullscreen var fullscreen = incall._fullscreen
if (fullscreen) { if (fullscreen) {
fullscreen.close() fullscreen.exit()
} }
telKeypad.visible = false telKeypad.visible = false
......
...@@ -20,11 +20,12 @@ Window { ...@@ -20,11 +20,12 @@ Window {
property var callsWindow property var callsWindow
property bool hideButtons: false property bool hideButtons: false
property bool sFullScreen: true
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
function _exit (cb) { function exit (cb) {
// It's necessary to call `showNormal` before close on MacOs
// because the dock will be hidden forever!
incall.showNormal() incall.showNormal()
incall.close() incall.close()
...@@ -35,18 +36,22 @@ Window { ...@@ -35,18 +36,22 @@ Window {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
onVisibilityChanged: { Component.onCompleted: {
if (sFullScreen && visibility === Window.Windowed) { var show = function (visibility) {
if (visibility === Window.Windowed) {
incall.visibilityChanged.disconnect(show)
incall.showFullScreen() incall.showFullScreen()
sFullScreen = false
} }
} }
incall.visibilityChanged.connect(show)
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
Shortcut { Shortcut {
sequence: StandardKey.Close sequence: StandardKey.Close
onActivated: _exit() onActivated: incall.exit()
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
...@@ -56,10 +61,7 @@ Window { ...@@ -56,10 +61,7 @@ Window {
color: '#000000' // Not a style. color: '#000000' // Not a style.
focus: true focus: true
Keys.onEscapePressed: { Keys.onEscapePressed: incall.exit()
incall.showNormal()
incall.close()
}
Loader { Loader {
anchors.fill: parent anchors.fill: parent
...@@ -218,7 +220,7 @@ Window { ...@@ -218,7 +220,7 @@ Window {
ActionButton { ActionButton {
icon: 'fullscreen' icon: 'fullscreen'
onClicked: _exit() onClicked: incall.exit()
} }
} }
} }
...@@ -300,7 +302,7 @@ Window { ...@@ -300,7 +302,7 @@ Window {
iconSize: CallStyle.actionArea.iconSize iconSize: CallStyle.actionArea.iconSize
updating: call.updating updating: call.updating
onClicked: _exit(function () { call.videoEnabled = false }) onClicked: incall.exit(function () { call.videoEnabled = false })
} }
ActionButton { ActionButton {
...@@ -326,13 +328,13 @@ Window { ...@@ -326,13 +328,13 @@ Window {
icon: 'pause' icon: 'pause'
updating: call.updating updating: call.updating
onClicked: _exit(function () { call.pausedByUser = enabled }) onClicked: incall.exit(function () { call.pausedByUser = enabled })
} }
ActionButton { ActionButton {
icon: 'hangup' icon: 'hangup'
onClicked: _exit(call.terminate) onClicked: incall.exit(call.terminate)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment