summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2012-10-22 22:27:30 +0200
committerBerke Viktor <bviktor@hexchat.org>2012-10-22 22:27:30 +0200
commita9fe82a1b8a61276ba7c1f8165f5f6c4cf3b556e (patch)
treed7e408fd0236b6a9d3eed9fe8cf048015bc76467 /src
parent332bde3c9975aff0978ba99e97870de0812b2b7c (diff)
Fix nick change dialog being barely visible in most cases
Diffstat (limited to 'src')
-rw-r--r--src/fe-gtk/gtkutil.c11
-rw-r--r--src/fe-gtk/maingui.c2
2 files changed, 11 insertions, 2 deletions
diff --git a/src/fe-gtk/gtkutil.c b/src/fe-gtk/gtkutil.c
index 241ff3e5..58f7b804 100644
--- a/src/fe-gtk/gtkutil.c
+++ b/src/fe-gtk/gtkutil.c
@@ -572,7 +572,16 @@ fe_get_str (char *msg, char *def, void *callback, void *userdata)
 										GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
 										NULL);
 	gtk_box_set_homogeneous (GTK_BOX (GTK_DIALOG (dialog)->vbox), TRUE);
-	gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
+
+	if ((int*) userdata == 1)	/* nick box is usually on the very bottom, make it centered */
+	{
+		gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
+	}
+	else
+	{
+		gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
+	}
+
 	hbox = gtk_hbox_new (TRUE, 0);
 
 	g_object_set_data (G_OBJECT (dialog), "cb", callback);
diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c
index 43adaffb..c1b60c27 100644
--- a/src/fe-gtk/maingui.c
+++ b/src/fe-gtk/maingui.c
@@ -2641,7 +2641,7 @@ static void
 mg_nickclick_cb (GtkWidget *button, gpointer userdata)
 {
 	fe_get_str (_("Enter new nickname:"), current_sess->server->nick,
-					mg_change_nick, NULL);
+					mg_change_nick, 1);
 }
 
 /* make sure chanview and userlist positions are sane */