static gboolean custom_list_release_event (GtkWidget *widget,
                                           GdkEventSelection *event,
                                           gpointer user_data)
{
  GreeterItemInfo *entry_info = greeter_lookup_id ("user-pw-entry");

  /* Make sure that focus never leaves username/password entry */
  if (entry_info && entry_info->item &&
      GNOME_IS_CANVAS_WIDGET (entry_info->item) &&
      GTK_IS_ENTRY (GNOME_CANVAS_WIDGET (entry_info->item)->widget))
    {
      GtkWidget *entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
      gtk_widget_grab_focus (entry);
    }
    return FALSE;
}
Beispiel #2
0
gboolean
greeter_item_ulist_setup (void)
{
	GreeterItemInfo *info;

	info = greeter_lookup_id ("user-pw-entry");
	if (info && info->item &&
	    GNOME_IS_CANVAS_WIDGET (info->item) &&
	    GTK_IS_ENTRY (GNOME_CANVAS_WIDGET (info->item)->widget)) {
		pam_entry = GNOME_CANVAS_WIDGET (info->item)->widget;
	}

	info = greeter_lookup_id ("userlist");

	if (info && info->item &&
	    GNOME_IS_CANVAS_WIDGET (info->item)) {
		GtkWidget *sw = GNOME_CANVAS_WIDGET (info->item)->widget;

		if (GTK_IS_SCROLLED_WINDOW (sw) && 
		    GTK_IS_TREE_VIEW (GTK_BIN (sw)->child)) {
			GtkRequisition req;
			gdouble        height;

			user_list = GTK_BIN (sw)->child;

			force_no_tree_separators (user_list);

			greeter_generate_userlist (user_list, info);

			/* Reset size of the widget canvas item so it
			 * is the same size as the userlist.  This
			 * avoids the ugly white background displayed
			 * below the Face Browser when the list isn't
			 * as large as the rectangle defined in the
			 * MDM theme file.
			 */

			gtk_widget_size_request (user_list, &req);
			g_object_get (info->item, "height", &height, NULL);

			if (req.height < height)
				g_object_set (info->item, "height", (double)req.height, NULL);
		}
	}

	return TRUE;
}
Beispiel #3
0
static void
menubar_done (GtkMenuShell *menushell, gpointer data)
{
    GreeterItemInfo *entry_info = greeter_lookup_id ("user-pw-entry");
    GtkWidget *entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;

    gtk_widget_grab_focus (entry);
}
/*
 * This function initializes all custom lists aside from
 * the userlist (face browser), which is handled 
 * separately.
 */
gboolean
greeter_item_customlist_setup (void)
{
  const GList *custom_items = greeter_custom_items ();
  const GList *li;
  for (li = custom_items; li != NULL; li = li->next)
    {
      GreeterItemInfo *info = li->data;

      if (info != NULL &&
	  info->item_type == GREETER_ITEM_TYPE_LIST &&
	  info->item != NULL &&
          GNOME_IS_CANVAS_WIDGET (info->item))
        {
          GtkWidget *sw = GNOME_CANVAS_WIDGET (info->item)->widget;

          /*
           * Store these so that when the values change in the 
           * F10 session/language dialogs, we can easily modify
           * them.
           */
          if (strcmp (info->id, "session") == 0)
             session_widget = sw;
          else if (strcmp (info->id, "language") == 0)
             language_widget = sw;

          /* If combo or list style, process appropriately */
          if (GTK_IS_SCROLLED_WINDOW (sw) && 
	      GTK_IS_TREE_VIEW (GTK_BIN (sw)->child))
            {
	      setup_customlist (GTK_BIN (sw)->child, info);
            }
          else if (GTK_IS_COMBO_BOX (sw))
            {
              setup_combo_customlist (GTK_COMBO_BOX (sw), info);
            }
        }
    }
  return TRUE;
}