From 343bb640e93df112c12084c533eb7fcfe81a9853 Mon Sep 17 00:00:00 2001 From: Michael James Gratton Date: Thu, 16 Nov 2017 12:49:49 +1100 Subject: [PATCH] Fix composer body text caret not being visible on reply. Bug 788797. * src/client/composer/composer-widget.vala (ComposerWidget::set_focus): Ensure we grab the web view's focus only after its content has finished loading. --- src/client/composer/composer-widget.vala | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala index 625e6830..44881f18 100644 --- a/src/client/composer/composer-widget.vala +++ b/src/client/composer/composer-widget.vala @@ -812,8 +812,15 @@ public class ComposerWidget : Gtk.EventBox { this.to_entry.grab_focus(); else if (not_compact && Geary.String.is_empty(subject)) this.subject_entry.grab_focus(); - else - this.editor.grab_focus(); + else { + // Need to grab the focus after the content has finished + // loading otherwise the text caret will not be visible. + if (this.editor.is_content_loaded) { + this.editor.grab_focus(); + } else { + this.editor.content_loaded.connect(() => { this.editor.grab_focus(); }); + } + } } // Initializes all actions and adds them to the action group