Add comment to bugfix

This commit is contained in:
Isak05 2025-04-25 13:48:29 +02:00
commit 14c9e5b041

View file

@ -1448,6 +1448,8 @@ void TransferListWidget::openPreviewSelectDialog(const BitTorrent::Torrent *torr
{
auto *dialog = new PreviewSelectDialog(this, torrent);
dialog->setAttribute(Qt::WA_DeleteOnClose);
// Qt::QueuedConnection is required to prevent a bug on wayland compositors where the preview won't open.
// It occurs when the window focus shifts immediately after TransferListWidget::previewFile has been called.
connect(dialog, &PreviewSelectDialog::readyToPreviewFile, this, &TransferListWidget::previewFile, Qt::QueuedConnection);
dialog->show();
}