From b550a10cf8a815a72cd7aedd776740b15aa35b8f Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Sat, 23 Jul 2005 22:37:18 +0000 Subject: [PATCH] motion-notify on TC window now works and works as expected --- src/tabbed_chat_window.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index 7704ab98d..20599d485 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -76,6 +76,10 @@ class TabbedChatWindow(chat.Chat): self.window.resize(gajim.config.get('chat-width'), gajim.config.get('chat-height')) + # gtk+ doesn't make use of the motion notify on gtkwindow by default + # so this line adds that + self.window.set_events(gtk.gdk.POINTER_MOTION_MASK) + self.window.show_all() def save_var(self, jid): @@ -91,8 +95,9 @@ class TabbedChatWindow(chat.Chat): var['gpg_enabled']) def on_tabbed_chat_window_motion_notify_event(self, widget, event): - print widget, widget.is_focus() - if widget.is_focus(): # change chatstate only if window has focus + '''it gets called no matter if it is the active window or not''' + if widget.get_property('has-toplevel-focus'): + # change chatstate only if window is the active one self.mouse_over_in_last_5_secs = True self.mouse_over_in_last_30_secs = True