summaryrefslogtreecommitdiff
path: root/openbox/startupnotify.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-03-11 14:31:11 +0000
committerDana Jansens <danakj@orodu.net>2007-03-11 14:31:11 +0000
commit923e0edfa80dbfe7e9fa90bee8f6bb2dfb2f9907 (patch)
tree96342abc91c48e9f7a1721996ff00d043b349306 /openbox/startupnotify.c
parent2c98204dfedafcf3d2fa010c1b6ac72110256c8c (diff)
look for more things to cancel startup notification on, from the wmclass. if the wmclass is related to the name or the binary name, then it will cancel it also. this is so that oldschool stuff doesn't thing its opening forever.
Diffstat (limited to 'openbox/startupnotify.c')
-rw-r--r--openbox/startupnotify.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/openbox/startupnotify.c b/openbox/startupnotify.c
index 1114d28f..5db9bd48 100644
--- a/openbox/startupnotify.c
+++ b/openbox/startupnotify.c
@@ -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;