Invalidate actions after notification is closed
This commit is contained in:
		
							parent
							
								
									43c614559c
								
							
						
					
					
						commit
						69e319c729
					
				| @ -384,6 +384,8 @@ void signal_notification_closed(struct notification *n, enum reason reason) | ||||
|                                       body, | ||||
|                                       &err); | ||||
| 
 | ||||
|         notification_invalidate_actions(n); | ||||
| 
 | ||||
|         n->dbus_valid = false; | ||||
| 
 | ||||
|         if (err) { | ||||
|  | ||||
| @ -598,4 +598,8 @@ void notification_do_action(const struct notification *n) | ||||
|         } | ||||
| } | ||||
| 
 | ||||
| void notification_invalidate_actions(struct notification *n) { | ||||
|         g_hash_table_remove_all(n->actions); | ||||
| } | ||||
| 
 | ||||
| /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ | ||||
|  | ||||
| @ -191,6 +191,15 @@ void notification_update_text_to_render(struct notification *n); | ||||
|  */ | ||||
| void notification_do_action(const struct notification *n); | ||||
| 
 | ||||
| /**
 | ||||
|  * Remove all client action data from the notification. | ||||
|  * | ||||
|  * This should be called after a notification is closed to avoid showing | ||||
|  * actions that will not work anymore since the client has stopped listening | ||||
|  * for them. | ||||
|  */ | ||||
| void notification_invalidate_actions(struct notification *n); | ||||
| 
 | ||||
| const char *notification_urgency_to_string(const enum urgency urgency); | ||||
| 
 | ||||
| /**
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Nikos Tsipinakis
						Nikos Tsipinakis