[geary/bug/788797-missing_text_caret: 5/5] Fix composer body text caret not being visible on reply. Bug 788797.



commit 343bb640e93df112c12084c533eb7fcfe81a9853
Author: Michael James Gratton <mike vee net>
Date:   Thu Nov 16 12:49:49 2017 +1100

    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 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 625e683..44881f1 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]