gtk+ r20162 - in trunk: . gtk
- From: bratsche svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r20162 - in trunk: . gtk
- Date: Sun, 25 May 2008 22:58:56 +0000 (UTC)
Author: bratsche
Date: Sun May 25 22:58:55 2008
New Revision: 20162
URL: http://svn.gnome.org/viewvc/gtk+?rev=20162&view=rev
Log:
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.
Modified:
trunk/ChangeLog
trunk/gtk/gtktextview.c
Modified: trunk/gtk/gtktextview.c
==============================================================================
--- trunk/gtk/gtktextview.c (original)
+++ trunk/gtk/gtktextview.c Sun May 25 22:58:55 2008
@@ -2234,8 +2234,18 @@
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 @@
"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 @@
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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]