gdm r6121 - in trunk: . gui/simple-greeter



Author: halfline
Date: Mon Apr  7 07:24:55 2008
New Revision: 6121
URL: http://svn.gnome.org/viewvc/gdm?rev=6121&view=rev

Log:
2008-04-07 Ray Strode <rstrode redhat com>

	* gui/simple-greeter/gdm-language-chooser-dialog.c
	(respond), (queue_response), (gdm_language_chooser_dialog_init):
	Add hack to make double-click work.  chooser widget really needs
	to be split into two widgets to fix this right.
	* gui/simple-greeter/gdm-chooser-widget.c
	(gdm_chooser_widget_activate_selected_item):
	Don't deactivate widget if already active. It was confusing for
	the user chooser and busts the double-click hack mentioned above.


Modified:
   trunk/ChangeLog
   trunk/gui/simple-greeter/gdm-chooser-widget.c
   trunk/gui/simple-greeter/gdm-language-chooser-dialog.c

Modified: trunk/gui/simple-greeter/gdm-chooser-widget.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-chooser-widget.c	(original)
+++ trunk/gui/simple-greeter/gdm-chooser-widget.c	Mon Apr  7 07:24:55 2008
@@ -822,8 +822,6 @@
 
         if (!is_already_active) {
                 activate_from_row (widget, row);
-        } else {
-                deactivate (widget);
         }
         gtk_tree_row_reference_free (row);
 }

Modified: trunk/gui/simple-greeter/gdm-language-chooser-dialog.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-language-chooser-dialog.c	(original)
+++ trunk/gui/simple-greeter/gdm-language-chooser-dialog.c	Mon Apr  7 07:24:55 2008
@@ -114,7 +114,9 @@
 {
         GObjectClass   *object_class = G_OBJECT_CLASS (klass);
         GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+#ifdef I_COULD_GO_BACK_IN_TIME_AND_MAKE_RESPONSE_RUN_FIRST
         GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (klass);
+#endif
 
         object_class->finalize = gdm_language_chooser_dialog_finalize;
         widget_class->size_request = gdm_language_chooser_dialog_size_request;
@@ -125,6 +127,19 @@
         g_type_class_add_private (klass, sizeof (GdmLanguageChooserDialogPrivate));
 }
 
+static gboolean
+respond (GdmLanguageChooserDialog *dialog)
+{
+        gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+        return FALSE;
+}
+
+static void
+queue_response (GdmLanguageChooserDialog *dialog)
+{
+        g_idle_add ((GSourceFunc) respond, dialog);
+}
+
 static void
 gdm_language_chooser_dialog_init (GdmLanguageChooserDialog *dialog)
 {
@@ -144,6 +159,9 @@
                                                                setlocale (LC_MESSAGES, NULL));
         gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->priv->chooser_widget);
 
+        g_signal_connect_swapped (G_OBJECT (dialog->priv->chooser_widget),
+                                  "activated", G_CALLBACK (queue_response),
+                                  dialog);
         gtk_dialog_add_buttons (GTK_DIALOG (dialog),
                                 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                 GTK_STOCK_OK, GTK_RESPONSE_OK,



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