src/buddy.c

changeset 4472
4c2abef133eb
parent 4453
493c53b5fd8c
child 4476
bf88170ba269
--- a/src/buddy.c	Thu Jan 30 09:47:01 2003 +0000
+++ b/src/buddy.c	Thu Jan 30 15:15:15 2003 +0000
@@ -2324,17 +2324,21 @@
 	 * more likely to work correctly.                        - Robot101 */
 	gint x, y;
 
-	gtk_window_get_position(GTK_WINDOW(blist), &x, &y);
-
-	if (x != blist_pos.x ||
-	    y != blist_pos.y ||
-	    event->width != blist_pos.width ||
-	    event->height != blist_pos.height) {
-		blist_pos.x = x;
-		blist_pos.y = y;
-		blist_pos.width = event->width;
-		blist_pos.height = event->height;
-		save_prefs();
+	/* check for visibility because when we aren't visible, this will   *
+	 *  give us bogus (0,0) coordinates.                     - xOr      */
+	if (GTK_WIDGET_VISIBLE(blist)) {
+	  gtk_window_get_position(GTK_WINDOW(blist), &x, &y);
+
+	  if (x != blist_pos.x ||
+	      y != blist_pos.y ||
+	      event->width != blist_pos.width ||
+	      event->height != blist_pos.height) {
+	    blist_pos.x = x;
+	    blist_pos.y = y;
+	    blist_pos.width = event->width;
+	    blist_pos.height = event->height;
+	    save_prefs();
+	  }
 	}
 	return FALSE;
 }

mercurial