gentoo-full-overlay/x11-misc/redshift/files/redshift-1.9-toggle.patch

37 lines
1.3 KiB
Diff

From 9426e9fba038a3b5076ed92dbe538451de8725f2 Mon Sep 17 00:00:00 2001
From: Jon Lund Steffensen <jonlst@gmail.com>
Date: Fri, 11 Apr 2014 00:26:57 +0200
Subject: [PATCH] redshift-gtk: Fix crash when toggling state using the status
icon
---
src/redshift-gtk/statusicon.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/redshift-gtk/statusicon.py b/src/redshift-gtk/statusicon.py
index 5685f08..08f28ef 100644
--- a/src/redshift-gtk/statusicon.py
+++ b/src/redshift-gtk/statusicon.py
@@ -79,7 +79,7 @@ def __init__(self, args=[]):
# Add toggle action
self.toggle_item = Gtk.CheckMenuItem.new_with_label(_('Enabled'))
- self.toggle_item.connect('activate', self.toggle_cb)
+ self.toggle_item.connect('activate', self.toggle_item_cb)
self.status_menu.append(self.toggle_item)
# Add suspend menu
@@ -215,6 +215,10 @@ def popup_menu_cb(self, widget, button, time, data=None):
self.status_icon, button, time)
def toggle_cb(self, widget, data=None):
+ self.remove_suspend_timer()
+ self.child_toggle_status()
+
+ def toggle_item_cb(self, widget, data=None):
# Only toggle if a change from current state was requested
if self.is_enabled() != widget.get_active():
self.remove_suspend_timer()
--
1.9.1