]> Dogcows Code - chaz/openbox/commitdiff
look for more things to cancel startup notification on, from the wmclass. if the...
authorDana Jansens <danakj@orodu.net>
Sun, 11 Mar 2007 14:31:11 +0000 (14:31 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 11 Mar 2007 14:31:11 +0000 (14:31 +0000)
openbox/startupnotify.c

index 1114d28fefa87c39fa3cda99d2ba85c3e85b11d5..5db9bd48fd09542f83dcd59fa77a0ff0da5248d0 100644 (file)
@@ -167,14 +167,35 @@ Time sn_app_started(const gchar *id, const gchar *wmclass)
     GSList *it;
     Time t = CurrentTime;
 
+    if (!id && !wmclass)
+        return t;
+
     for (it = sn_waits; it; it = g_slist_next(it)) {
         SnStartupSequence *seq = it->data;
-        const gchar *seqid, *seqclass;
+        gboolean found = FALSE;
+        const gchar *seqid, *seqclass, *seqname, *seqbin;
         seqid = sn_startup_sequence_get_id(seq);
         seqclass = sn_startup_sequence_get_wmclass(seq);
-        if ((seqid && id && !strcmp(seqid, id)) ||
-            (seqclass && wmclass && !strcmp(seqclass, wmclass)))
-        {
+        seqname = sn_startup_sequence_get_name(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 {
+            seqclass = sn_startup_sequence_get_wmclass(seq);
+            seqname = sn_startup_sequence_get_name(seq);
+            seqbin = sn_startup_sequence_get_binary_name(seq);
+
+            if ((seqname && !g_ascii_strcasecmp(seqname, wmclass)) ||
+                (seqbin && !g_ascii_strcasecmp(seqbin, wmclass)) ||
+                (seqclass && !strcmp(seqclass, wmclass)))
+                found = TRUE;
+        }
+
+        if (found) {
             sn_startup_sequence_complete(seq);
             t = sn_startup_sequence_get_timestamp(seq);
             break;
This page took 0.023862 seconds and 4 git commands to generate.