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.
This commit is contained in:
Michael James Gratton 2017-11-16 12:49:49 +11:00
parent f1e92feae2
commit 343bb640e9

View file

@ -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