From 2b4685288169616293b279c123f9293fcbcb9deb Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 14 Mar 2014 01:48:19 +0100 Subject: fix for fixes in sigusr2 handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blueshift-tray.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/blueshift-tray.py b/src/blueshift-tray.py index 97cc75e..1da1f62 100755 --- a/src/blueshift-tray.py +++ b/src/blueshift-tray.py @@ -104,8 +104,6 @@ def f_toggle(widget, data = None): if now < last_time + 0.2: return last_time = now - if paused is None: - paused = False process.send_signal(signal.SIGUSR2) icon.set_from_icon_name('blueshift-on' if paused else 'blueshift-off') paused = not paused @@ -119,12 +117,8 @@ def f_quit(widget, data = None): running = False icon.set_visible(False) gtk.main_quit() - if paused is None: - term() - elif paused: - term(2, True) - else: - term(2, True) + term(1) + process.wait() def f_panic_quit(widget, data = None): global running @@ -137,9 +131,9 @@ def f_panic_quit(widget, data = None): signal.signal(signal.SIGCHLD, process_quit) -process = subprocess.Popen(['blueshift'] + sys.argv[1:]) +process = subprocess.Popen(['blueshift'] + sys.argv[1:], stdout = sys.stdout, stderr = sys.stderr) running = True -paused = None +paused = False last_time = time.time() - 1 @@ -176,5 +170,7 @@ finally: term() if process.poll() is None: - process.send_signal(signal.KILL) + time.sleep(0.1) + if process.poll() is None: + process.send_signal(signal.SIGKILL) -- cgit v1.2.3-70-g09d2