mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Use crl::on_main in MainWindow::sniSignalEmitted
This commit is contained in:
@@ -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
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user