mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-22 00:57:09 +02:00
Use crl::on_main in MainWindow::sniSignalEmitted
This commit is contained in:
parent
d73d3cd43d
commit
af6b07b780
2 changed files with 9 additions and 4 deletions
|
@ -509,7 +509,7 @@ void MainWindow::initHook() {
|
|||
_sniDBusProxy,
|
||||
"g-signal",
|
||||
G_CALLBACK(sniSignalEmitted),
|
||||
this);
|
||||
nullptr);
|
||||
|
||||
auto sniWatcher = new QDBusServiceWatcher(
|
||||
kSNIWatcherService.utf16(),
|
||||
|
@ -655,9 +655,13 @@ void MainWindow::sniSignalEmitted(
|
|||
gchar *sender_name,
|
||||
gchar *signal_name,
|
||||
GVariant *parameters,
|
||||
MainWindow *window) {
|
||||
gpointer user_data) {
|
||||
if(signal_name == qstr("StatusNotifierHostRegistered")) {
|
||||
window->handleSNIHostRegistered();
|
||||
crl::on_main([] {
|
||||
if (const auto window = App::wnd()) {
|
||||
window->handleSNIHostRegistered();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include <QtDBus/QDBusObjectPath>
|
||||
#include <dbusmenuexporter.h>
|
||||
|
||||
typedef void* gpointer;
|
||||
typedef char gchar;
|
||||
typedef struct _GVariant GVariant;
|
||||
typedef struct _GDBusProxy GDBusProxy;
|
||||
|
@ -145,7 +146,7 @@ private:
|
|||
gchar *sender_name,
|
||||
gchar *signal_name,
|
||||
GVariant *parameters,
|
||||
MainWindow *window);
|
||||
gpointer user_data);
|
||||
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue