Unresponsive gtk entry



I am writing a small application to identify users using pam.
As gtk won't acept sbit binaries, its done with two programs. 

one cli program to interface with pam and talk on two pipes with the gui
one gui who forks to exec the first one and talk with it with the set of pipes.
This one also starts a thread to talk with the pam interface and control the
state of the gui, and then the main_gtk thread.

My problem is that inside the thread that talks to the pam interface, the first
mssage it recieves is to set echo on, so it set's a GtkEntry's visibility to
TRUE, after wich the entry's response becomes very slow.

If I omit that call (as the entry is visible by default and I don't expect for
the pam module to ask for visibility again, but it could change) then it works
right.

Anybody has any Idea what might be causing this?

This is the piece of code in question:
The 'id' is read from the pipes

...
gdk_threads_enter();
      

      if(id==PAM_PROMPT_ECHO_OFF) {
        widget = g_hash_table_lookup(data, "MainInstLabel");
        gtk_label_set_text(GTK_LABEL(widget), reg);
        widget = g_hash_table_lookup(data, "PassEntry");
        gtk_entry_set_visibility(GTK_ENTRY(widget), FALSE);
      } else if (id == PAM_PROMPT_ECHO_ON) {
        
        //widget = g_hash_table_lookup(data, "PassEntry");
        //gtk_entry_set_visibility(GTK_ENTRY(widget), TRUE);
        widget = g_hash_table_lookup(data, "MainInstLabel");
        gtk_label_set_text(GTK_LABEL(widget), reg);

      } 
...
gdk_threads_leave();
...

Compile line is this:

gcc -O -D_GNU_SOURCE -DNDEBUG -g -Wall -lpam `pkg-config --libs --cflags
gtk+-2.0 gthread-2.0` autent.c -o autent



-------------------------------------------------
www.correo.unam.mx
UNAMonos Comunicándonos




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]