コード例 #1
0
QString
LauncherApplication::executable() const
{
    if (m_appInfo != NULL) {
        return QString::fromUtf8(g_app_info_get_executable(m_appInfo.data()));
    }

    if (m_snStartupSequence != NULL) {
        return QString::fromUtf8(sn_startup_sequence_get_binary_name(m_snStartupSequence.data()));
    }

    return QString("");
}
コード例 #2
0
ファイル: startupnotify.c プロジェクト: deters/openbox
Time sn_app_started(const gchar *id, const gchar *wmclass, const gchar *name)
{
    GSList *it;
    Time t = CurrentTime;

    if (!id && !wmclass)
        return t;

    for (it = sn_waits; it; it = g_slist_next(it)) {
        SnStartupSequence *seq = it->data;
        gboolean found = FALSE;
        const gchar *seqid, *seqclass, *seqbin;
        seqid = sn_startup_sequence_get_id(seq);
        seqclass = sn_startup_sequence_get_wmclass(seq);
        seqbin = sn_startup_sequence_get_binary_name(seq);

        if (id && seqid) {
            /* if the app has a startup id, then look for that for highest
               accuracy */
            if (!strcmp(seqid, id))
                found = TRUE;
        }
        else if (seqclass) {
            /* seqclass = "a string to match against the "resource name" or
               "resource class" hints.  These are WM_CLASS[0] and WM_CLASS[1]"
               - from the startup-notification spec
            */
            found = (seqclass && !strcmp(seqclass, wmclass)) ||
                (seqclass && !strcmp(seqclass, name));
        }
        else if (seqbin) {
            /* Check the binary name against the class and name hints
               as well, to help apps that don't have the class set
               correctly */
            found = (seqbin && !g_ascii_strcasecmp(seqbin, wmclass)) ||
                (seqbin && !g_ascii_strcasecmp(seqbin, name));
        }

        if (found) {
            sn_startup_sequence_complete(seq);
            t = sn_startup_sequence_get_timestamp(seq);
            break;
        }
    }
    return t;
}