[hamster-applet/gnome-2-30] when applet gets hidden by show desktop untoggle the button and also make sure it appears next time.
- From: Toms Baugis <tbaugis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hamster-applet/gnome-2-30] when applet gets hidden by show desktop untoggle the button and also make sure it appears next time.
- Date: Thu, 6 May 2010 00:58:56 +0000 (UTC)
commit 6c93c8b4f2cd73f291c352a7c3ea37231e263e30
Author: Toms Bauģis <toms baugis gmail com>
Date: Thu May 6 01:56:48 2010 +0100
when applet gets hidden by show desktop untoggle the button and also make sure it appears next time. fixes bug 617815
src/hamster/applet.py | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/hamster/applet.py b/src/hamster/applet.py
index 35962a6..d926ba5 100755
--- a/src/hamster/applet.py
+++ b/src/hamster/applet.py
@@ -200,6 +200,7 @@ class HamsterApplet(object):
self.window = self._gui.get_object('hamster-window')
# on close don't destroy the popup, just hide it instead
self.window.connect("delete_event", lambda *args: self.__show_toggle(None, False))
+ self.window.connect("window-state-event", self.on_window_state_changed)
self.new_name = widgets.ActivityEntry()
self.new_name.connect("value-entered", self.on_switch_activity_clicked)
@@ -345,13 +346,6 @@ class HamsterApplet(object):
self.notification.show()
- def edit_cb(self, n, action):
- dialogs.edit.show(self.applet, activity_id = self.last_activity['id'])
-
- def switch_cb(self, n, action):
- self.__show_toggle(None, not self.button.get_active())
-
-
def load_day(self):
"""sets up today's tree and fills it with records
returns information about last activity"""
@@ -473,7 +467,7 @@ class HamsterApplet(object):
# doing unstick / stick here, because sometimes while switching
- # between workplaces window still manages to dissappear
+ # between workplaces window still manages to disappear
self.window.unstick()
self.window.stick() #show on all desktops
@@ -515,11 +509,19 @@ class HamsterApplet(object):
def _delayed_display(self):
"""show window only when gtk has become idle. otherwise we get
mixed results. TODO - this looks like a hack though"""
+ self.window.show()
self.window.present()
self.new_name.grab_focus()
"""events"""
+ def on_window_state_changed(self, window, event):
+ """untoggle the button when window gets minimized"""
+ if (event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED \
+ and event.new_window_state & gtk.gdk.WINDOW_STATE_ICONIFIED):
+ self.button.set_active(False)
+
+
def on_toggle(self, widget):
self.__show_toggle(None, self.button.get_active())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]