コード例 #1
0
ファイル: ntf-libnotify.c プロジェクト: danni/dawati-shell
static void
ntf_libnotify_notification_closed_cb (DawatiNetbookNotifyStore *store,
                                      guint                     id,
                                      guint                     reason,
                                      gpointer                  data)
{
  NtfTray         *tray;
  NtfNotification *ntf;

  /*
   * Look first in the regular tray for this id, then the urgent one.
   */
  tray = ntf_overlay_get_tray (FALSE);

  if (!(ntf = ntf_tray_find_notification (tray, subsystem_id, id)))
    {
      tray = ntf_overlay_get_tray (TRUE);
      ntf  = ntf_tray_find_notification (tray, subsystem_id, id);
    }

  if (ntf && !ntf_notification_is_closed (ntf))
    {
      n_notifiers--;
      if (n_notifiers < 0)
        {
          g_warning ("Bug in notifier accounting, attempting to fix");
          n_notifiers = 0;
        }
      ntf_notification_close (ntf);
      ntf_libnotify_update_modal ();
    }
}
コード例 #2
0
static void
ntf_wm_demands_attention_clear (MetaWindow *window)
{
  NtfTray         *tray;
  NtfNotification *ntf;
  gint             id = GPOINTER_TO_INT (window);

  /*
   * Look first in the regular tray for this id, then the urgent one.
   */
  tray = ntf_overlay_get_tray (FALSE);

  if ((ntf = ntf_tray_find_notification (tray, subsystem_id, id)) &&
      !ntf_notification_is_closed (ntf))
    {
      ntf_notification_close (ntf);
    }
}