[evolution-data-server] gdk_window_get_pointer() needs a GdkWindow.



commit 9c0908fb361c26a8fca2746b1dd317abd225af29
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Aug 18 07:14:03 2010 -0400

    gdk_window_get_pointer() needs a GdkWindow.

 libedataserverui/e-passwords.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/libedataserverui/e-passwords.c b/libedataserverui/e-passwords.c
index 36ced34..016d224 100644
--- a/libedataserverui/e-passwords.c
+++ b/libedataserverui/e-passwords.c
@@ -1103,12 +1103,16 @@ pass_response (GtkDialog *dialog, gint response, gpointer data)
 }
 
 static gboolean
-update_capslock_state (gpointer widget, gpointer event, GtkWidget *label)
+update_capslock_state (GtkDialog *dialog,
+                       GdkEvent *event,
+                       GtkWidget *label)
 {
 	GdkModifierType mask = 0;
+	GdkWindow *window;
 	gchar *markup = NULL;
 
-	gdk_window_get_pointer (NULL, NULL, NULL, &mask);
+	window = gtk_widget_get_window (GTK_WIDGET (dialog));
+	gdk_window_get_pointer (window, NULL, NULL, &mask);
 
 	/* The space acts as a vertical placeholder. */
 	markup = g_markup_printf_escaped (
@@ -1215,7 +1219,6 @@ ep_ask_password (EPassMsg *msg)
 
 	/* Caps Lock Label */
 	widget = gtk_label_new (NULL);
-	update_capslock_state (NULL, NULL, widget);
 	gtk_widget_show (widget);
 
 	gtk_table_attach (
@@ -1260,12 +1263,14 @@ ep_ask_password (EPassMsg *msg)
 
 	msg->noreply = noreply;
 
-	g_signal_connect (password_dialog, "response", G_CALLBACK (pass_response), msg);
+	g_signal_connect (
+		password_dialog, "response",
+		G_CALLBACK (pass_response), msg);
 
 	if (msg->parent)
 		gtk_dialog_run (GTK_DIALOG (password_dialog));
 	else
-		gtk_widget_show ((GtkWidget *)password_dialog);
+		gtk_widget_show (GTK_WIDGET (password_dialog));
 }
 
 /**
@@ -1317,7 +1322,7 @@ e_passwords_cancel (void)
 	G_UNLOCK (passwords);
 
 	if (password_dialog)
-		gtk_dialog_response (password_dialog,GTK_RESPONSE_CANCEL);
+		gtk_dialog_response (password_dialog, GTK_RESPONSE_CANCEL);
 }
 
 /**



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