mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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() {
|
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
|
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||||
_sniAvailable = IsSNIAvailable();
|
_sniAvailable = IsSNIAvailable();
|
||||||
|
|
||||||
|
@ -601,27 +622,6 @@ void MainWindow::initHook() {
|
||||||
} catch (...) {
|
} 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()) {
|
if (UseUnityCounter()) {
|
||||||
LOG(("Using Unity launcher counter."));
|
LOG(("Using Unity launcher counter."));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue