diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2019-09-10 11:00:02 +0000 |
|---|---|---|
| committer | Jabiertxof <jabier.arraiza@marker.es> | 2019-09-10 11:00:02 +0000 |
| commit | 4a3a339a771d237ff4ddc8aa8fccb67e187da80c (patch) | |
| tree | da597a661ad358c4d1cf66cc0c3f7ccc3ab74a33 | |
| parent | Fix link pointing to old version of toolset cache (diff) | |
| download | inkscape-4a3a339a771d237ff4ddc8aa8fccb67e187da80c.tar.gz inkscape-4a3a339a771d237ff4ddc8aa8fccb67e187da80c.zip | |
Fix a focus issue pointed by Tav
| -rw-r--r-- | src/ui/tools/text-tool.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index 3c2b5400b..6b35990aa 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -160,6 +160,7 @@ void TextTool::setup() { gtk_im_context_set_client_window(this->imc, gtk_widget_get_window (canvas)); + g_signal_connect(G_OBJECT(canvas), "motion_notify_event", G_CALLBACK(sptc_focus_in), this); g_signal_connect(G_OBJECT(canvas), "focus_in_event", G_CALLBACK(sptc_focus_in), this); g_signal_connect(G_OBJECT(canvas), "focus_out_event", G_CALLBACK(sptc_focus_out), this); g_signal_connect(G_OBJECT(this->imc), "commit", G_CALLBACK(sptc_commit), this); @@ -1793,8 +1794,11 @@ static void sp_text_context_forget_text(TextTool *tc) */ } -gint sptc_focus_in(GtkWidget */*widget*/, GdkEventFocus */*event*/, TextTool *tc) +gint sptc_focus_in(GtkWidget *widget, GdkEventFocus */*event*/, TextTool *tc) { + if (!gtk_widget_is_focus (widget)) { + gtk_widget_grab_focus(widget); + } gtk_im_context_focus_in(tc->imc); return FALSE; } |
