Be more careful with the beeps

svn path=/trunk/; revision=22262
This commit is contained in:
Matthias Clasen 2009-01-31 05:52:58 +00:00
parent dbb97978a8
commit e380d4143d
2 changed files with 16 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2009-01-30 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextview.c (preedit_changed_handler): Be more careful
with the beeps, since preedit-changed is occasionally emitted
without actual input. Pointed out by Tor Lillqvist.
2009-01-30 Matthias Clasen <mclasen@redhat.com>
Bug 569918 64bit portability issue in gtkrecentchooser.c

View File

@ -7320,21 +7320,24 @@ gtk_text_view_preedit_changed_handler (GtkIMContext *context,
/* Keypress events are passed to input method even if cursor position is not editable;
* so beep here if it's multi-key input sequence, input method will be reset in
* key-press-event handler. */
if (!gtk_text_iter_can_insert (&iter, text_view->editable))
* key-press-event handler.
*/
gtk_im_context_get_preedit_string (context, &str, &attrs, &cursor_pos);
if (str && str[0] && !gtk_text_iter_can_insert (&iter, text_view->editable))
{
gtk_widget_error_bell (GTK_WIDGET (text_view));
return;
goto out;
}
gtk_im_context_get_preedit_string (context, &str, &attrs, &cursor_pos);
gtk_text_layout_set_preedit_string (text_view->layout, str, attrs, cursor_pos);
pango_attr_list_unref (attrs);
g_free (str);
if (GTK_WIDGET_HAS_FOCUS (text_view))
gtk_text_view_scroll_mark_onscreen (text_view,
gtk_text_buffer_get_insert (get_buffer (text_view)));
out:
pango_attr_list_unref (attrs);
g_free (str);
}
static gboolean