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
This commit is contained in:
Cody Russell 2008-05-25 22:58:55 +00:00 committed by Cody Russell
parent b0ea8e9f85
commit cd7376dd5e
2 changed files with 29 additions and 5 deletions

View File

@ -1,3 +1,11 @@
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

View File

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