Re: [help] gdm graphics greeter hack.



Adriano Del Vigna de Almeida wrote:

Hello Y. Hong,

I'm working in something like you are doing, but more simple.
We are doing different work, I droped the original tree-view base user
list, and create a gnome-canvas based userlist, it's more complex . ;)

Originally I have to give two double clicks at user list to GDM give me
a password entry, at least in version 2.4.4.5 of GDM, the one I'm
working.
I have to change it to a single click at a user entry in the user list.
I.e., the user gives a single click at his login name and GDM gives the
password entry.

For that I changed "greeter_item_ulist.c" row_activated and
user_selected functions. I made user_selected do the same as
row_activated. But this doesn't work good. Now I'll try your signal
emission approach, with g_signal_emit_by_name.

I'm sending to you my changes, if you can give any clue of what I'm
doing wrong, could you?

### BOC ###
static void
user_selected (GtkTreeSelection *selection, gpointer data)
{
 GtkTreeModel *tm = NULL;
 GtkTreeIter iter = {0};

 if (pam_entry == NULL ||
     ! selecting_user)
   return;

 if (gtk_tree_selection_get_selected (selection, &tm, &iter)) {
     char *login;
     gtk_tree_model_get (tm, &iter, GREETER_ULIST_LOGIN_COLUMN,
			  &login, -1);
     if (login != NULL) {
         GreeterItemInfo *pamlabel;

		  if (greeter_probably_login_prompt) {
			  gtk_entry_set_text (GTK_ENTRY (pam_entry), login);

			  printf ("%c%c%c%s\n", STX, BEL, GDM_INTERRUPT_SELECT_USER,
				  login);
			  fflush (stdout);

you operate is all right. at this time, greeter will ask for passwd.
you could review the gdm_verify_user in verify_shadow.c , then you'll
got the workflow.

			  printf ("%c\n", STX);
			  fflush (stdout);
delete the two lines.

#if 0 pamlabel = greeter_lookup_id ("pam-message");
		  if (pamlabel != NULL)
			g_object_set (G_OBJECT (pamlabel->item),
				  "text", _("Doubleclick on the user\nto log in"),
				  NULL);
#endif pamlabel = greeter_lookup_id ("pam-message");
		  if (pamlabel != NULL)
			g_object_set (G_OBJECT (pamlabel->item),
				  "text", _("Enter your password"),
				  NULL);
		}
   }
 }
}

static void
row_activated (GtkTreeView *tree_view,
	       GtkTreePath *path,
	       GtkTreeViewColumn *column)
{
#if 0
 GtkTreeModel *tm = NULL;
 GtkTreeIter iter = {0};
 GtkTreeSelection *selection;

 if ( ! selecting_user)
   return;

 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));

 if (gtk_tree_selection_get_selected (selection, &tm, &iter))
   {
     char *login;
     gtk_tree_model_get (tm, &iter, GREETER_ULIST_LOGIN_COLUMN,
			  &login, -1);
     if (login != NULL)
       {
	  printf ("%c%c%c%s\n", STX, BEL, GDM_INTERRUPT_SELECT_USER,
		  login);
	  fflush (stdout);
	}
   }
#endif
}
### EOC ###

One last. Could you send me your modifications? I think I can learn more
about GDM looking at it. And if you like, I could even help you in your
modifications since I liked them a lot!

My modifications is too complex and ugly, dirty...etc. ;)

Thanks!

Em Seg, 2004-05-10 às 00:15, Yang Hong escreveu:
--

+==---_---------------------------------------===+
|    /_\  __
|   // \ //\\    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]