Commit cd7376dd authored by Cody Russell's avatar Cody Russell Committed by Cody Russell

Bug 534463 - non-editable GtkTextView should not call

2008-05-25  Cody Russell  <bratsche@gnome.org>

        Bug 534463 - non-editable GtkTextView should not call
        gtk_im_context_focus_in	in focus	event

        * gtk/gtktextview.c: Add checks	to see	if the textview	is
        editable.  Patch by Wang Diancheng.


svn path=/trunk/; revision=20162
parent b0ea8e9f
2008-05-25 Cody Russell <bratsche@gnome.org>
Bug 534463 - non-editable GtkTextView should not call
gtk_im_context_focus_in in focus event
* gtk/gtktextview.c: Add checks to see if the textview is
editable. Patch by Wang Diancheng.
2008-05-25 Matthias Clasen <mclasen@redhat.com>
Bug 501730 – use GSlice for small allocs
......
......@@ -2234,8 +2234,18 @@ gtk_text_view_set_editable (GtkTextView *text_view,
if (text_view->editable != setting)
{
if (!setting)
{
gtk_text_view_reset_im_context(text_view);
if (GTK_WIDGET_HAS_FOCUS (text_view))
gtk_im_context_focus_out (text_view->im_context);
}
text_view->editable = setting;
if (setting && GTK_WIDGET_HAS_FOCUS (text_view))
gtk_im_context_focus_in (text_view->im_context);
if (text_view->layout)
{
gtk_text_layout_set_overwrite_mode (text_view->layout,
......@@ -4333,9 +4343,12 @@ gtk_text_view_focus_in_event (GtkWidget *widget, GdkEventFocus *event)
"direction_changed",
G_CALLBACK (keymap_direction_changed), text_view);
gtk_text_view_check_keymap_direction (text_view);
text_view->need_im_reset = TRUE;
gtk_im_context_focus_in (GTK_TEXT_VIEW (widget)->im_context);
if (text_view->editable)
{
text_view->need_im_reset = TRUE;
gtk_im_context_focus_in (GTK_TEXT_VIEW (widget)->im_context);
}
return FALSE;
}
......@@ -4361,8 +4374,11 @@ gtk_text_view_focus_out_event (GtkWidget *widget, GdkEventFocus *event)
keymap_direction_changed,
text_view);
text_view->need_im_reset = TRUE;
gtk_im_context_focus_out (GTK_TEXT_VIEW (widget)->im_context);
if (text_view->editable)
{
text_view->need_im_reset = TRUE;
gtk_im_context_focus_out (GTK_TEXT_VIEW (widget)->im_context);
}
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment