]> git.0d.be Git - empathy.git/commitdiff
Set position/size of chat window only when adding the first chat. Fixes bug #536391...
authorXavier Claessens <xclaesse@src.gnome.org>
Sat, 7 Jun 2008 17:23:21 +0000 (17:23 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Sat, 7 Jun 2008 17:23:21 +0000 (17:23 +0000)
svn path=/trunk/; revision=1153

src/empathy-chat-window.c

index 1db873b5a435a9246d763fe0744939dc59ca5b24..8be64a3d8f3b959abcf64637d52e793963bf16e1 100644 (file)
@@ -1299,20 +1299,23 @@ empathy_chat_window_add_chat (EmpathyChatWindow *window,
        /* Reference the chat object */
        g_object_ref (chat);
 
-       empathy_geometry_load (chat_get_window_id_for_geometry (chat), &x, &y, &w, &h);
-
-       if (x >= 0 && y >= 0) {
-               /* Let the window manager position it if we don't have
-                * good x, y coordinates.
-                */
-               gtk_window_move (GTK_WINDOW (priv->dialog), x, y);
-       }
-
-       if (w > 0 && h > 0) {
-               /* Use the defaults from the glade file if we don't have
-                * good w, h geometry.
-                */
-               gtk_window_resize (GTK_WINDOW (priv->dialog), w, h);
+       /* If this window has just been created, position it */
+       if (priv->chats == NULL) {
+               empathy_geometry_load (chat_get_window_id_for_geometry (chat), &x, &y, &w, &h);
+               
+               if (x >= 0 && y >= 0) {
+                       /* Let the window manager position it if we don't have
+                        * good x, y coordinates.
+                        */
+                       gtk_window_move (GTK_WINDOW (priv->dialog), x, y);
+               }
+               
+               if (w > 0 && h > 0) {
+                       /* Use the defaults from the glade file if we don't have
+                        * good w, h geometry.
+                        */
+                       gtk_window_resize (GTK_WINDOW (priv->dialog), w, h);
+               }
        }
 
        child = GTK_WIDGET (chat);