]> Dogcows Code - chaz/openbox/blobdiff - openbox/startupnotify.c
make startup notification a little more robust. obconf is just broken, between
[chaz/openbox] / openbox / startupnotify.c
index f296c76d241b312f493042d530fb01f23542f5ee..dbb633ef17c4cafb65256669e4018bd0a8f93c10 100644 (file)
@@ -1,6 +1,7 @@
 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
 
    startupnotify.c for the Openbox window manager
+   Copyright (c) 2006        Mikael Magnusson
    Copyright (c) 2003        Ben Jansens
 
    This program is free software; you can redistribute it and/or modify
@@ -163,8 +164,8 @@ static void sn_event_func(SnMonitorEvent *ev, gpointer data)
     case SN_MONITOR_EVENT_INITIATED:
         d = wait_data_new(seq);
         sn_waits = g_slist_prepend(sn_waits, d);
-        /* 30 second timeout for apps to start */
-        ob_main_loop_timeout_add(ob_main_loop, 30 * G_USEC_PER_SEC,
+        /* 15 second timeout for apps to start */
+        ob_main_loop_timeout_add(ob_main_loop, 15 * G_USEC_PER_SEC,
                                  sn_wait_timeout, d, sn_wait_destroy);
         change = TRUE;
         break;
@@ -176,7 +177,8 @@ static void sn_event_func(SnMonitorEvent *ev, gpointer data)
     case SN_MONITOR_EVENT_CANCELED:
         if ((d = wait_find(sn_startup_sequence_get_id(seq)))) {
             d->feedback = FALSE;
-            ob_main_loop_timeout_remove_data(ob_main_loop, sn_wait_timeout, d);
+            ob_main_loop_timeout_remove_data(ob_main_loop, sn_wait_timeout,
+                                             d, FALSE);
             change = TRUE;
         }
         break;
@@ -186,14 +188,17 @@ static void sn_event_func(SnMonitorEvent *ev, gpointer data)
         screen_set_root_cursor();
 }
 
-void sn_app_started(gchar *wmclass)
+void sn_app_started(const gchar *id, const gchar *wmclass)
 {
     GSList *it;
 
     for (it = sn_waits; it; it = g_slist_next(it)) {
         ObWaitData *d = it->data;
-        if (sn_startup_sequence_get_wmclass(d->seq) &&
-            !strcmp(sn_startup_sequence_get_wmclass(d->seq), wmclass))
+        const gchar *seqid, *seqclass;
+        seqid = sn_startup_sequence_get_id(d->seq);
+        seqclass = sn_startup_sequence_get_wmclass(d->seq);
+        if ((seqid && id && !strcmp(seqid, id)) ||
+            (seqclass && wmclass && !strcmp(seqclass, wmclass)))
         {
             sn_startup_sequence_complete(d->seq);
             break;
This page took 0.027814 seconds and 4 git commands to generate.