mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-09 02:46:34 +00:00
Fix non-working UniqueConnection in gtk file dialog
This commit is contained in:
@@ -147,6 +147,8 @@ private:
|
||||
rpl::event_stream<> _accept;
|
||||
rpl::event_stream<> _reject;
|
||||
|
||||
bool _destroyedConnected = false;
|
||||
|
||||
};
|
||||
|
||||
class GtkFileDialog : public QDialog {
|
||||
@@ -261,8 +263,9 @@ void QGtkDialog::exec() {
|
||||
}
|
||||
|
||||
void QGtkDialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) {
|
||||
connect(parent, &QWindow::destroyed, this, [=] { onParentWindowDestroyed(); },
|
||||
Qt::UniqueConnection);
|
||||
if (!std::exchange(_destroyedConnected, true)) {
|
||||
connect(parent, &QWindow::destroyed, this, [=] { onParentWindowDestroyed(); });
|
||||
}
|
||||
setParent(parent);
|
||||
setFlags(flags);
|
||||
setModality(modality);
|
||||
|
Reference in New Issue
Block a user