mirror of https://github.com/procxx/kepka.git
				
				
				
			Gnome notification fix (#5215)
* Set notification desktop entry hint * Set X-GNOME-UsesNotifications flag
This commit is contained in:
		
							parent
							
								
									3646301ce4
								
							
						
					
					
						commit
						496c361bdc
					
				|  | @ -111,6 +111,7 @@ public: | ||||||
| 	bool show() { | 	bool show() { | ||||||
| 		if (valid()) { | 		if (valid()) { | ||||||
| 			GError *error = nullptr; | 			GError *error = nullptr; | ||||||
|  | 
 | ||||||
| 			Libs::notify_notification_show(_data, &error); | 			Libs::notify_notification_show(_data, &error); | ||||||
| 			if (!error) { | 			if (!error) { | ||||||
| 				return true; | 				return true; | ||||||
|  | @ -152,6 +153,8 @@ private: | ||||||
| 			Libs::notify_notification_set_hint_string(_data, "x-canonical-append", "true"); | 			Libs::notify_notification_set_hint_string(_data, "x-canonical-append", "true"); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		Libs::notify_notification_set_hint_string(_data, "desktop-entry", "telegramdesktop"); | ||||||
|  | 
 | ||||||
| 		auto signalReceiver = Libs::g_object_cast(_data); | 		auto signalReceiver = Libs::g_object_cast(_data); | ||||||
| 		auto signalHandler = G_CALLBACK(NotificationData::notificationClosed); | 		auto signalHandler = G_CALLBACK(NotificationData::notificationClosed); | ||||||
| 		auto signalName = "closed"; | 		auto signalName = "closed"; | ||||||
|  |  | ||||||
|  | @ -383,6 +383,7 @@ void RegisterCustomScheme() { | ||||||
| 			s << "Categories=Network;InstantMessaging;Qt;\n"; | 			s << "Categories=Network;InstantMessaging;Qt;\n"; | ||||||
| 			s << "MimeType=x-scheme-handler/tg;\n"; | 			s << "MimeType=x-scheme-handler/tg;\n"; | ||||||
| 			s << "Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;\n"; | 			s << "Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;\n"; | ||||||
|  | 			s << "X-GNOME-UsesNotifications=true\n"; | ||||||
| 			f.close(); | 			f.close(); | ||||||
| 
 | 
 | ||||||
| 			if (_psRunCommand("desktop-file-install --dir=" + EscapeShell(QFile::encodeName(home + qsl(".local/share/applications"))) + " --delete-original " + EscapeShell(QFile::encodeName(file)))) { | 			if (_psRunCommand("desktop-file-install --dir=" + EscapeShell(QFile::encodeName(home + qsl(".local/share/applications"))) + " --delete-original " + EscapeShell(QFile::encodeName(file)))) { | ||||||
|  |  | ||||||
|  | @ -10,3 +10,4 @@ Type=Application | ||||||
| Categories=Network;InstantMessaging;Qt; | Categories=Network;InstantMessaging;Qt; | ||||||
| MimeType=x-scheme-handler/tg; | MimeType=x-scheme-handler/tg; | ||||||
| Keywords=tg;chat;im;messaging;messenger;sms;tdesktop; | Keywords=tg;chat;im;messaging;messenger;sms;tdesktop; | ||||||
|  | X-GNOME-UsesNotifications=true | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue