From 0dce40bb576570eaa0be940946f0933c49bf2705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Mon, 23 Jan 2017 21:57:41 +0100 Subject: [PATCH] Fix history scrolling in gtk3 #8481. * Delay scrolling using GLib.idle_add. According to the GTK documentation the scroll_to_mark should be doing this internally already, but it is not the case. * Center highlighted message vertically. --- src/history_window.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/history_window.py b/src/history_window.py index 2f222aa38..1a0a8d2f9 100644 --- a/src/history_window.py +++ b/src/history_window.py @@ -622,10 +622,9 @@ class HistoryWindow: match_end_iter.forward_line() # highlight all message not just time self.history_buffer.apply_tag_by_name('highlight', match_start_iter, match_end_iter) - - match_start_mark = self.history_buffer.create_mark('match_start', - match_start_iter, True) - self.history_textview.tv.scroll_to_mark(match_start_mark, 0, True) + mark = self.history_buffer.create_mark('match', match_start_iter, True) + GLib.idle_add(self.history_textview.tv.scroll_to_mark, mark, + 0, True, 0.0, 0.5) def on_log_history_checkbutton_toggled(self, widget): # log conversation history?