static runtime::User owner(KRATE_DEFAULT_OWNER);
int pid, status;
-// notification_h noti = reinterpret_cast<notification_h>(userData);
+ notification_h noti = reinterpret_cast<notification_h>(userData);
g_variant_get(params, "(ii)", &status, &pid);
return;
}
- // this will have been commented until notification_delete_for_uid can work
- /*
- if (owner.getUid() != st.st_uid) {
+ if (st.st_uid == owner.getUid() || st.st_uid == 0) {
+ if (isKrateForeground) {
+ notification_delete_for_uid(noti, owner.getUid());
+ isKrateForeground = false;
+ }
+ } else {
if (!isKrateForeground) {
notification_set_text(noti, NT_CONTENT, NT_APPINFO, NULL, NT_NONE);
notification_post_for_uid(noti, owner.getUid());
isKrateForeground = true;
}
- } else {
- if (isKrateForeground) {
- notification_delete_for_uid(noti, owner.getUid());
- isKrateForeground = false;
- }
- }*/
+ }
}
notification_h createNotification()