mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Fix handleNativeSurfaceChanged when dbus integration is disabled
This commit is contained in:
parent
79f96480c2
commit
a59bfdb2f8
1 changed files with 21 additions and 21 deletions
|
@ -558,6 +558,27 @@ MainWindow::MainWindow(not_null<Window::Controller*> controller)
|
|||
}
|
||||
|
||||
void MainWindow::initHook() {
|
||||
base::install_event_filter(windowHandle(), [=](not_null<QEvent*> e) {
|
||||
if (e->type() == QEvent::Expose) {
|
||||
auto ee = static_cast<QExposeEvent*>(e.get());
|
||||
if (ee->region().isNull()) {
|
||||
return base::EventFilterResult::Continue;
|
||||
}
|
||||
if (!windowHandle()
|
||||
|| windowHandle()->parent()
|
||||
|| !windowHandle()->isVisible()) {
|
||||
return base::EventFilterResult::Continue;
|
||||
}
|
||||
handleNativeSurfaceChanged(true);
|
||||
} else if (e->type() == QEvent::Hide) {
|
||||
if (!windowHandle() || windowHandle()->parent()) {
|
||||
return base::EventFilterResult::Continue;
|
||||
}
|
||||
handleNativeSurfaceChanged(false);
|
||||
}
|
||||
return base::EventFilterResult::Continue;
|
||||
});
|
||||
|
||||
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
_sniAvailable = IsSNIAvailable();
|
||||
|
||||
|
@ -601,27 +622,6 @@ void MainWindow::initHook() {
|
|||
} catch (...) {
|
||||
}
|
||||
|
||||
base::install_event_filter(windowHandle(), [=](not_null<QEvent*> e) {
|
||||
if (e->type() == QEvent::Expose) {
|
||||
auto ee = static_cast<QExposeEvent*>(e.get());
|
||||
if (ee->region().isNull()) {
|
||||
return base::EventFilterResult::Continue;
|
||||
}
|
||||
if (!windowHandle()
|
||||
|| windowHandle()->parent()
|
||||
|| !windowHandle()->isVisible()) {
|
||||
return base::EventFilterResult::Continue;
|
||||
}
|
||||
handleNativeSurfaceChanged(true);
|
||||
} else if (e->type() == QEvent::Hide) {
|
||||
if (!windowHandle() || windowHandle()->parent()) {
|
||||
return base::EventFilterResult::Continue;
|
||||
}
|
||||
handleNativeSurfaceChanged(false);
|
||||
}
|
||||
return base::EventFilterResult::Continue;
|
||||
});
|
||||
|
||||
if (UseUnityCounter()) {
|
||||
LOG(("Using Unity launcher counter."));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue