Daniel Brötzmann pushed to branch mainwindow at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/gtk/chat_page.py
    ... ... @@ -60,6 +60,7 @@ def __init__(self):
    60 60
             self._ui.filter_bar_toggle.connect(
    
    61 61
                 'toggled', self._on_filter_revealer_toggled)
    
    62 62
     
    
    63
    +        self._active_control = None
    
    63 64
             self._chat_list_stack = ChatListStack(
    
    64 65
                 self._chat_filter, self._ui.search_entry)
    
    65 66
             self._chat_list_stack.connect('chat-selected', self._on_chat_selected)
    
    ... ... @@ -130,6 +131,13 @@ def _on_chat_selected(self, _chat_list_stack, workspace_id, account, jid):
    130 131
             self._search_view.set_context(account, jid)
    
    131 132
             self.emit('chat-selected', workspace_id, account, jid)
    
    132 133
     
    
    134
    +        control = self.get_control(account, jid)
    
    135
    +        if self._active_control != control:
    
    136
    +            if self._active_control is not None:
    
    137
    +                self._active_control.set_control_active(False)
    
    138
    +            control.set_control_active(True)
    
    139
    +        self._active_control = control
    
    140
    +
    
    133 141
         def _on_chat_unselected(self, _chat_list_stack):
    
    134 142
             self._chat_stack.clear()
    
    135 143
             self._search_view.set_context(None, None)
    

  • gajim/gtk/controls/base.py
    ... ... @@ -1264,16 +1264,7 @@ def clear(tv):
    1264 1264
         def set_control_active(self, state):
    
    1265 1265
             if state:
    
    1266 1266
                 self.set_emoticon_popover()
    
    1267
    -            jid = self.contact.jid
    
    1268
    -            if self.conversation_view.autoscroll:
    
    1269
    -                # we are at the end
    
    1270
    -                if app.window.get_chat_unread_count(
    
    1271
    -                        self.account, self.contact.jid) > 0:
    
    1272
    -                    self.redraw_after_event_removed(jid)
    
    1273
    -                    app.window.mark_as_read(self.account, self.contact.jid)
    
    1274
    -
    
    1275
    -            # send chatstate inactive to the one we're leaving
    
    1276
    -            # and active to the one we visit
    
    1267
    +
    
    1277 1268
                 if self.msg_textview.has_text():
    
    1278 1269
                     self._client.get_module('Chatstate').set_chatstate(
    
    1279 1270
                         self.contact, Chatstate.PAUSED)