1
0
Fork 0

text: Don't accept new line characters in single line mode

Modified Return key presses don't trigger ::activate so we would end
up adding an unprintable character to a single paragraph mode pango
layout which renders it as a box.

https://bugzilla.gnome.org/show_bug.cgi?id=623344
This commit is contained in:
Rui Matos 2012-09-09 20:44:43 +02:00
parent 5e18c2f9b4
commit ea50df6bb6

View file

@ -2074,7 +2074,7 @@ clutter_text_key_press (ClutterActor *actor,
if (key_unichar == '\r')
key_unichar = '\n';
if (key_unichar == '\n' ||
if ((key_unichar == '\n' && !priv->single_line_mode) ||
(g_unichar_validate (key_unichar) &&
!g_unichar_iscntrl (key_unichar)))
{