Skip to content
Snippets Groups Projects
Commit 5cf27f1b authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

improve bigger avatar behaviour in case on_avatar_eventbox_enter_notify_event...

improve bigger avatar behaviour in case on_avatar_eventbox_enter_notify_event is called twice (when using unclutter). Fixes #5590
parent 23f73004
No related branches found
No related tags found
No related merge requests found
......@@ -1689,6 +1689,8 @@ class ChatControl(ChatControlBase):
# do we have something bigger to show?
if avatar_w > scaled_buf_w or avatar_h > scaled_buf_h:
# wait for 0.5 sec in case we leave earlier
if self.show_bigger_avatar_timeout_id is not None:
gobject.source_remove(self.show_bigger_avatar_timeout_id)
self.show_bigger_avatar_timeout_id = gobject.timeout_add(500,
self.show_bigger_avatar, widget)
......@@ -1699,6 +1701,7 @@ class ChatControl(ChatControlBase):
# did we add a timeout? if yes remove it
if self.show_bigger_avatar_timeout_id is not None:
gobject.source_remove(self.show_bigger_avatar_timeout_id)
self.show_bigger_avatar_timeout_id = None
def on_avatar_eventbox_button_press_event(self, widget, event):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment