- if ((seqid && id && !strcmp(seqid, id)) ||
- (seqclass && wmclass && !strcmp(seqclass, wmclass)))
- {
+ 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) {