Don't destroy components in use

Add a delay to all destructions and move the call dialog stuff up a
level, so that we don't destroy the component when destroying the parent
dialog.

fixes #984
pull/985/head
Nicolas Werner 3 years ago
parent a3dce85132
commit bf7b58c959
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 8
      resources/qml/MessageInput.qml
  2. 6
      resources/qml/Root.qml
  3. 12
      resources/qml/voip/PlaceCall.qml
  4. 8
      resources/qml/voip/ScreenShare.qml

@ -29,6 +29,14 @@ Rectangle {
}
Component {
id: screenShareDialog
ScreenShare {
}
}
RowLayout {
id: row

@ -222,12 +222,12 @@ Pane {
}
function destroyOnClose(obj) {
if (obj.closing != undefined) obj.closing.connect(() => obj.destroy());
else if (obj.closed != undefined) obj.closed.connect(() => obj.destroy());
if (obj.closing != undefined) obj.closing.connect(() => obj.destroy(1000));
else if (obj.aboutToHide != undefined) obj.aboutToHide.connect(() => obj.destroy(1000));
}
function destroyOnClosed(obj) {
obj.closed.connect(() => obj.destroy());
obj.aboutToHide.connect(() => obj.destroy(1000));
}
Connections {

@ -28,14 +28,6 @@ Popup {
}
Component {
id: screenShareDialog
ScreenShare {
}
}
ColumnLayout {
id: columnLayout
@ -81,7 +73,7 @@ Popup {
height: Nheko.avatarSize
url: room.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
displayName: room.roomName
roomid: room.roomid
roomid: room.roomId
onClicked: TimelineManager.openImageOverlay(room, room.avatarUrl(userid), room.data.eventId)
}
@ -118,8 +110,8 @@ Popup {
onClicked: {
var dialog = screenShareDialog.createObject(timelineRoot);
dialog.open();
close();
timelineRoot.destroyOnClose(dialog);
close();
}
}

@ -11,12 +11,10 @@ import im.nheko 1.0
Popup {
modal: true
// only set the anchors on Qt 5.12 or higher
// see https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#anchors.centerIn-prop
Component.onCompleted: {
if (anchors)
anchors.centerIn = parent;
anchors.centerIn: parent;
Component.onCompleted: {
frameRateCombo.currentIndex = frameRateCombo.find(Settings.screenShareFrameRate);
}
palette: Nheko.colors

Loading…
Cancel
Save