mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Fix window activations handling without event loop nesting.
This was causing an assertion violation in Ui::PostponeCall. - Add a generic Core::QtSignalProducer to convert Qt signals to rpl::producer. - Track event loop nesting inside QtSignalProducer. - Use QtSignalProducer for QWindow::activeChanged tracking.
This commit is contained in:
@@ -273,8 +273,18 @@ void MainWindow::init() {
|
||||
initHook();
|
||||
updateWindowIcon();
|
||||
|
||||
connect(windowHandle(), &QWindow::activeChanged, this, [this] { handleActiveChanged(); }, Qt::QueuedConnection);
|
||||
connect(windowHandle(), &QWindow::windowStateChanged, this, [this](Qt::WindowState state) { handleStateChanged(state); });
|
||||
// Non-queued activeChanged handlers must use QtSignalProducer.
|
||||
connect(
|
||||
windowHandle(),
|
||||
&QWindow::activeChanged,
|
||||
this,
|
||||
[=] { handleActiveChanged(); },
|
||||
Qt::QueuedConnection);
|
||||
connect(
|
||||
windowHandle(),
|
||||
&QWindow::windowStateChanged,
|
||||
this,
|
||||
[=](Qt::WindowState state) { handleStateChanged(state); });
|
||||
|
||||
updatePalette();
|
||||
|
||||
|
Reference in New Issue
Block a user