[Xfce4-commits] [xfce/exo] 01/01: Fix StartupNotify (Bug 9570, thanks Thaddaeus)
noreply at xfce.org
noreply at xfce.org
Thu Mar 5 21:56:05 CET 2015
This is an automated email from the git hooks/post-receive script.
bluesabre pushed a commit to branch master
in repository xfce/exo.
commit 3a2c05bd68f924f5c8bd530a2fe8f4cc5b671b16
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Thu Mar 5 15:55:59 2015 -0500
Fix StartupNotify (Bug 9570, thanks Thaddaeus)
---
exo-helper/exo-helper.c | 52 +++--------------------------------------------
1 file changed, 3 insertions(+), 49 deletions(-)
diff --git a/exo-helper/exo-helper.c b/exo-helper/exo-helper.c
index 37d8901..aba3749 100644
--- a/exo-helper/exo-helper.c
+++ b/exo-helper/exo-helper.c
@@ -359,8 +359,6 @@ exo_helper_execute (ExoHelper *helper,
gint pid;
const gchar *real_parameter = parameter;
- // FIXME: startup-notification
-
g_return_val_if_fail (EXO_IS_HELPER (helper), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (screen == NULL || GDK_IS_SCREEN (screen), FALSE);
@@ -399,58 +397,14 @@ exo_helper_execute (ExoHelper *helper,
continue;
/* try to run the command */
- succeed = gdk_spawn_on_screen (screen, NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, NULL, NULL, &pid, &err);
+ succeed = xfce_spawn_on_screen (screen, NULL, argv, NULL, G_SPAWN_SEARCH_PATH, helper->startup_notify, gtk_get_current_event_time (), NULL, &err);
/* cleanup */
g_strfreev (argv);
- /* check if the execution was successful */
+ /* check if we should retry with the next command */
if (G_LIKELY (succeed))
- {
- /* determine the current time */
- g_get_current_time (&previous);
-
- /* wait up to 5 seconds to see whether the command worked */
- for (;;)
- {
- /* check if the command exited with an error */
- result = waitpid (pid, &status, WNOHANG);
- if (result < 0)
- {
- /* something weird happened */
- err = g_error_new_literal (G_FILE_ERROR, g_file_error_from_errno (errno), g_strerror (errno));
- succeed = FALSE;
- break;
- }
- else if (result > 0 && status != 0)
- {
- /* the command failed */
- err = g_error_new_literal (G_FILE_ERROR, g_file_error_from_errno (EIO), g_strerror (EIO));
- succeed = FALSE;
- break;
- }
- else if (result == pid)
- {
- /* the command succeed */
- succeed = TRUE;
- break;
- }
-
- /* determine the current time */
- g_get_current_time (¤t);
-
- /* check if the command is still running after 5 seconds (which indicates that the command worked) */
- if (((current.tv_sec - previous.tv_sec) * 1000ll + (current.tv_usec - previous.tv_usec) / 1000ll) > 5000ll)
- break;
-
- /* wait some time */
- g_usleep (50 * 1000);
- }
-
- /* check if we should retry with the next command */
- if (G_LIKELY (succeed))
- break;
- }
+ break;
}
/* propagate the error */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list