summaryrefslogtreecommitdiffstats
path: root/pica-client/callwindow.cpp
diff options
context:
space:
mode:
authorAnton <anton@picapica.im>2026-08-09 14:30:20 +0400
committerAnton <anton@picapica.im>2026-08-09 14:30:20 +0400
commit4bfdcf3288b921c7a648dc1f85754ee4482c24d5 (patch)
treea432e80cba02277b3a376fc4d19e767335ac04d7 /pica-client/callwindow.cpp
parent3fcb0660953fbf222b6cbe5e08c2b0488b7b68f8 (diff)
downloadpica-pica-4bfdcf3288b921c7a648dc1f85754ee4482c24d5.tar.gz
pica-pica-4bfdcf3288b921c7a648dc1f85754ee4482c24d5.zip
pica-client: fix CallWindow only being usable for the first call
AudioVideoCallController never cleared its callwindow pointer after a call ended, so start_call()/call_from() would see it as non-null forever and silently refuse every subsequent call. CallWindow now sets WA_DeleteOnClose and emits callwindow_closed() from closeEvent(), mirroring the ChatWindow/MsgUIRouter pattern. The controller resets its pointer to 0 in response, and end_call() closes the window once the hangup/reject has been handled.
Diffstat (limited to 'pica-client/callwindow.cpp')
-rw-r--r--pica-client/callwindow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/pica-client/callwindow.cpp b/pica-client/callwindow.cpp
index 4443807..a987b79 100644
--- a/pica-client/callwindow.cpp
+++ b/pica-client/callwindow.cpp
@@ -18,10 +18,13 @@
#include "callwindow.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
+#include <QCloseEvent>
CallWindow::CallWindow(QByteArray peer_id, bool incoming)
: m_peer_id(peer_id), is_incoming(incoming)
{
+ setAttribute(Qt::WA_DeleteOnClose);
+
QHBoxLayout *lh = new QHBoxLayout(this);
QVBoxLayout *lv = new QVBoxLayout(this);
@@ -63,3 +66,10 @@ void CallWindow::accept()
{
emit accept_call_pressed();
}
+
+void CallWindow::closeEvent(QCloseEvent *e)
+{
+ emit callwindow_closed(this);
+
+ e->accept();
+}