From 4bfdcf3288b921c7a648dc1f85754ee4482c24d5 Mon Sep 17 00:00:00 2001 From: Anton Date: Sun, 9 Aug 2026 14:30:20 +0400 Subject: 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. --- pica-client/callwindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pica-client/callwindow.cpp') 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 #include +#include 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(); +} -- cgit v1.2.1