Index: lwlib/lwlib.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lwlib/lwlib.c,v
retrieving revision 1.13.2.16
diff -u -r1.13.2.16 lwlib.c
--- lwlib.c	2000/09/26 15:37:25	1.13.2.16
+++ lwlib.c	2001/01/02 22:16:16
@@ -264,6 +264,10 @@
       lw_copy_widget_value_args (new, old);
       changed = True;
     }
+  else if (new->args && new->args == old->args && new->args->args_changed == True)
+    {
+      changed = True;
+    }
 
   return changed;
 }
@@ -756,7 +760,11 @@
     update_one_widget_instance (instance, deep_p);
 
   for (val = info->val; val; val = val->next)
-    val->change = NO_CHANGE;
+    {
+      val->change = NO_CHANGE;
+      if (val->args)
+	val->args->args_changed = False;
+    }
 }
 
 void
@@ -821,7 +829,11 @@
   update_one_widget_instance (instance, True);
 
   for (val = instance->info->val; val; val = val->next)
-    val->change = NO_CHANGE;
+    {
+      val->change = NO_CHANGE;
+      if (val->args)
+	val->args->args_changed = False;
+    }
 }
 
 /* strcasecmp() is not sufficiently portable or standard,
@@ -1393,6 +1405,8 @@
   if (wv->args->nargs > 10)
     return;
 
+  /* Register the change. */
+  wv->args->args_changed = True;
   /* If the arg is already there then we must replace it. */
   for (i = 0; i < wv->args->nargs; i++)
     {
Index: lwlib/lwlib.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lwlib/lwlib.h,v
retrieving revision 1.4.2.10
diff -u -r1.4.2.10 lwlib.h
--- lwlib.h	2000/11/02 05:14:30	1.4.2.10
+++ lwlib.h	2001/01/02 22:16:16
@@ -106,6 +106,9 @@
   /* Copying args is impossible so we make the caller give us heap allocated
      args and free them when no one wants them any more. */
   int	ref_count;
+  /* Since we are reference counting we need to be able to determine
+     when something has changed. */
+  Boolean	args_changed;
 } widget_args;
 
 typedef struct _widget_value
Index: src/frame-x.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/frame-x.c,v
retrieving revision 1.41.2.19
diff -u -r1.41.2.19 frame-x.c
--- frame-x.c	2000/09/20 02:38:27	1.41.2.19
+++ frame-x.c	2001/01/02 22:16:24
@@ -2654,7 +2654,7 @@
   XFlush (XtDisplay (shell_widget)); /* hey, I'd like to DEBUG this... */
 }
 
-/* Destroy the X window of frame S.  */
+/* Destroy the X window of frame F.  */
 static void
 x_delete_frame (struct frame *f)
 {
Index: src/frame.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/frame.c,v
retrieving revision 1.37.2.42
diff -u -r1.37.2.42 frame.c
--- frame.c	2000/11/06 05:43:18	1.37.2.42
+++ frame.c	2001/01/02 22:16:33
@@ -3007,9 +3007,15 @@
      So deal. */
   check_frame_size (f, &newheight, &newwidth);
 
+  /* Unconditionally mark that the frame has changed size. This is
+     because many things need to know after the
+     fact. f->size_change_pending will get reset below. The most that
+     can happen is that we will cycle through redisplay once more
+     --andy. */
+  MARK_FRAME_SIZE_CHANGED (f);
+
   if (delay || in_display || gc_in_progress)
     {
-      MARK_FRAME_SIZE_CHANGED (f);
       f->new_width = newwidth;
       f->new_height = newheight;
       return;
Index: src/glyphs.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.c,v
retrieving revision 1.23.2.88
diff -u -r1.23.2.88 glyphs.c
--- glyphs.c	2000/12/31 14:14:02	1.23.2.88
+++ glyphs.c	2001/01/02 22:16:45
@@ -1992,9 +1992,6 @@
   assert (XIMAGE_INSTANCE_YOFFSET (image_instance) >= 0
 	  && XIMAGE_INSTANCE_XOFFSET (image_instance) >= 0);
 
-  type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii));
-  meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT);
-
   /* If geometry is unspecified then get some reasonable values for it. */
   if (width == IMAGE_UNSPECIFIED_GEOMETRY
       ||
@@ -2002,20 +1999,11 @@
     {
       int dwidth = IMAGE_UNSPECIFIED_GEOMETRY;
       int dheight = IMAGE_UNSPECIFIED_GEOMETRY;
-
       /* Get the desired geometry. */
-      if (meths && HAS_IIFORMAT_METH_P (meths, query_geometry))
-	{
-	  IIFORMAT_METH (meths, query_geometry, (image_instance, &dwidth, &dheight,
-						 IMAGE_DESIRED_GEOMETRY,
-						 domain));
-	}
-      else
-	{
-	  dwidth = IMAGE_INSTANCE_WIDTH (ii);
-	  dheight = IMAGE_INSTANCE_HEIGHT (ii);
-	}
-
+      image_instance_query_geometry (image_instance,
+				     &dwidth, &dheight,
+				     IMAGE_DESIRED_GEOMETRY,
+				     domain);
       /* Compare with allowed geometry. */
       if (width == IMAGE_UNSPECIFIED_GEOMETRY)
 	width = dwidth;
@@ -2041,13 +2029,16 @@
 
   IMAGE_INSTANCE_WIDTH (ii) = width;
   IMAGE_INSTANCE_HEIGHT (ii) = height;
+
+  type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii));
+  meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT);
 
-  if (IIFORMAT_METH_OR_GIVEN (meths, layout,
-			      (image_instance, width, height, xoffset, yoffset,
-			       domain), 1))
-    /* Do not clear the dirty flag here - redisplay will do this for
-       us at the end. */
-    IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 0;
+  MAYBE_IIFORMAT_METH (meths, layout,
+		       (image_instance, width, height, xoffset, yoffset,
+			domain));
+  /* Do not clear the dirty flag here - redisplay will do this for
+     us at the end. */
+  IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 0;
 }
 
 /* Update an image instance from its changed instantiator. */
