Skip to content

Commit

Permalink
Check GtkIMContext:input-purpose to disable IM on lock screen
Browse files Browse the repository at this point in the history
Recent GtkIMContext has "input-purpose" property, which can be used to check if the target widget is a password entry, in a more reliable way.

BUG=none
R=Shawn.P.Huang@gmail.com

Review URL: https://codereview.appspot.com/7064059
  • Loading branch information
ueno committed May 13, 2013
1 parent 667b7f0 commit 927e9f5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/gtk2/ibusimcontext.c
Expand Up @@ -803,6 +803,18 @@ ibus_im_context_focus_in (GtkIMContext *context)
return;

/* don't set focus on password entry */
#if GTK_CHECK_VERSION (3, 6, 0)
{
GtkInputPurpose purpose;

g_object_get (G_OBJECT (context),
"input-purpose", &purpose,
NULL);

if (purpose == GTK_INPUT_PURPOSE_PASSWORD)
return;
}
#endif
if (ibusimcontext->client_window != NULL) {
GtkWidget *widget;

Expand Down

0 comments on commit 927e9f5

Please sign in to comment.