st-entry: Disable cut/copy actions in password entries

Curently it is possible to copy the content of password entries,
and paste it elsewhere in clear text. This is undesirable, so
follow GTK+'s behavior and disable the cut/copy actions for
password entries.

https://bugzilla.gnome.org/show_bug.cgi?id=695104
This commit is contained in:
Florian Müllner 2013-03-04 16:21:57 +01:00
parent 00eb764880
commit b52f4ed25b

View File

@ -602,7 +602,8 @@ st_entry_key_press_event (ClutterActor *actor,
/* copy */ /* copy */
if ((event->modifier_state & CLUTTER_CONTROL_MASK) if ((event->modifier_state & CLUTTER_CONTROL_MASK)
&& event->keyval == CLUTTER_c) && event->keyval == CLUTTER_c &&
clutter_text_get_password_char ((ClutterText*) priv->entry) == 0)
{ {
StClipboard *clipboard; StClipboard *clipboard;
gchar *text; gchar *text;
@ -622,7 +623,8 @@ st_entry_key_press_event (ClutterActor *actor,
/* cut */ /* cut */
if ((event->modifier_state & CLUTTER_CONTROL_MASK) if ((event->modifier_state & CLUTTER_CONTROL_MASK)
&& event->keyval == CLUTTER_x) && event->keyval == CLUTTER_x &&
clutter_text_get_password_char ((ClutterText*) priv->entry) == 0)
{ {
StClipboard *clipboard; StClipboard *clipboard;
gchar *text; gchar *text;