[help] gdm graphics greeter hack.
- From: Yang Hong <yanghong ccoss com cn>
- To: gdm sunsite dk, walte linuxforum net
- Subject: [help] gdm graphics greeter hack.
- Date: Sun, 09 May 2004 10:34:52 +0800
hi, George & Alex
I'm doing a hack on the gdm's graphics greeter, based on the gdm-2.6.0.1:
I've added :
1) my-pw-entry: a common entry widget,
2) user-box: a full canvas based area to list all avilable use in the
system, ( like the user-list but it's not a tree-view)
3) user-items: evry user-item is a image of a real user, it contents
user's header image, login name. all user-items were placed in user-box.
4) clip-box: it's a canvas clip group, I use it to implement a scroll
area for user-box .( when user number is large, we must use it ).
now I hide the original "user-pw-entry", and let user click on the
user-item, then I show "my-pw-entry" and let user to entry password for
the clicked user-item's user.
I used the follow 2 ways to authentication user after user entered
passwd and pressed "enter" :
1) pass user to the original "user-pw-entry", then emit a "acitvate"
event for the original "user-pw-entry", then pass the password in the
same way.
2) ignore original "user-pw-entry", directly print user's name and
passwd like the user_pw_activate(...) does. but I failed in the both
ways. I checked the value passwd to the original "user-pw-entry", the
callback func user_pw_activate(...), the are all right. why a user can't
authened by such way? what happen behind the printf("%c%s\\n", STX,
tmp);" in the user_pw_activate(...), and what happend when username was
entered?
the follow codes is my major authentication function after user enter
password in my-pw-entry
void greeter_cc_user_pw_entry_enter_enter(gchar *name, gchar *passwd)
{
GreeterItemInfo *pw_entry;
GtkWidget *entry;
gchar *tmp;
g_return_if_fail (name != NULL);
pw_entry = greeter_lookup_id("user-pw-entry");
if (pw_entry != NULL)
{
entry = GNOME_CANVAS_WIDGET(pw_entry->item)->widget;
gtk_entry_set_text(GTK_ENTRY(entry), "");
gtk_entry_set_text(GTK_ENTRY(entry), g_strdup(name));
g_signal_emit_by_name(entry, "activate", g_strdup(name));
printf ("%c\n", STX);
fflush (stdout);
gtk_entry_set_text(GTK_ENTRY(entry), "");
gtk_entry_set_text(GTK_ENTRY(entry), g_strdup(passwd));
g_signal_emit_by_name(entry, "activate", g_strdup(passwd));
}
/*
tmp = ve_locale_from_utf8 (name);
set_debug_info_str(tmp);
printf("%c%s\n", STX, tmp);
fflush(stdout);
g_free(tmp);
tmp = ve_locale_from_utf8 (passwd);
set_debug_info_str2(tmp);
printf("%c%s\n", STX, tmp);
fflush(stdout);
g_free(tmp);
set_debug_info_str(g_strdup_printf("%s : %s", name, passwd));
*/
}
any comments plz.
Regards.
--
+==---_---------------------------------------===+
| /_\ __
| // \ //\\ Yang Hong < yanghong /-\T ccoss () com () cn>
| // @ //
| \\// \_// Co-Create OpenSource Software CO.,Ltd.
| `` \_/ GNU/Linux , Thunderbird Powered
+==-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]