Skip to content
Browse files

Don't set focus on GTK password entry.

For an old bug:
https://bugzilla.redhat.com/show_bug.cgi?id=484643
Input method should be disabled on password entry for security reason.

BUG=none
TEST=manually with gtk-demo "Entry Buffer" example

Review URL: http://codereview.appspot.com/5319053
  • Loading branch information...
1 parent 910f8a6 commit cca4fd8993613a6993965c3120323e43c4647ef5 @ueno ueno committed Oct 28, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 client/gtk2/ibusimcontext.c
View
13 client/gtk2/ibusimcontext.c
@@ -734,6 +734,19 @@ ibus_im_context_focus_in (GtkIMContext *context)
if (ibusimcontext->has_focus)
return;
+ /* don't set focus on password entry */
+ if (ibusimcontext->client_window != NULL) {
+ GtkWidget *widget;
+
+ gdk_window_get_user_data (ibusimcontext->client_window,
+ (gpointer *)&widget);
+
+ if (GTK_IS_ENTRY (widget) &&
+ !gtk_entry_get_visibility (GTK_ENTRY (widget))) {
+ return;
+ }
+ }
+
if (_focus_im_context != NULL) {
g_assert (_focus_im_context != context);
gtk_im_context_focus_out (_focus_im_context);

0 comments on commit cca4fd8

Please sign in to comment.
Something went wrong with that request. Please try again.