/* Used to signal TimerThread to quit. Inactive for now. */
static bool quit = FALSE;
+static int double_click_notif = FALSE;
+
/* TimerThread ID */
static pthread_t timer_thread;
}
+static void
+DisplayExecuteCommandNotification( void )
+{
+ /* Visual notification that the double-click was catched. */
+ copyXPMArea( EXEC_CMD_IMG_SRC_X, EXEC_CMD_IMG_SRC_Y,
+ MAILBOX_SIZE_X, MAILBOX_SIZE_Y, MAILBOX_DEST_X, MAILBOX_DEST_Y );
+ RedrawWindow();
+}
+
+
static void
ExecuteCommand( char *argv[] )
{
if( argv[0] == NULL ) {
return;
}
-
+
pid = fork(); /* fork a child process. */
if( pid < 0) {
/* Starting external mail client. */
ExecuteCommand( wmnotify_infos.mail_client_argv );
+ double_click_notif = TRUE;
+
/* Sending a signal to awake the TimerThread() thread. This was previously
done with a mutex variable (animation_stop), but this caused a bug when the
following sequence was encountered:
ErrorLocation( __FILE__, __LINE__ );
exit( EXIT_FAILURE );
}
+
+ DisplayExecuteCommandNotification();
+ sleep(1);
+ DisplayClosedMailbox();
+
+ double_click_notif = FALSE;
}
else {
fprintf( stderr, "%s: Warning: No email-client defined.\n", PACKAGE );
}
animation_running = FALSE;
animation_stop = FALSE;
- /* Before exiting, be sure to put NO MAIL image back in place... */
- DisplayClosedMailbox();
+ if( double_click_notif == FALSE ) {
+ /* Before exiting, be sure to put NO MAIL image back in place... */
+ DisplayClosedMailbox();
+ }
}
/* If sleep() returns because the requested time has elapsed, the value returned will be