Index: src/glyphs-widget.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/glyphs-widget.c,v retrieving revision 1.1.2.27 diff -u -r1.1.2.27 glyphs-widget.c --- src/glyphs-widget.c 2000/02/10 22:20:14 1.1.2.27 +++ src/glyphs-widget.c 2000/02/13 20:18:24 @@ -672,8 +672,6 @@ pw ? pw : IMAGE_UNSPECIFIED_GEOMETRY, ph ? ph : IMAGE_UNSPECIFIED_GEOMETRY, domain); - /* Layout has already been done so we don't need to re-layout. */ - IMAGE_INSTANCE_DIRTYP (ii) = 0; #ifdef DEBUG_WIDGETS debug_widget_instances++; Index: src/glyphs-x.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-x.c,v retrieving revision 1.49.2.53 diff -u -r1.49.2.53 glyphs-x.c --- src/glyphs-x.c 2000/02/13 06:41:32 1.49.2.53 +++ src/glyphs-x.c 2000/02/13 20:18:32 @@ -408,8 +408,8 @@ #endif lw_destroy_widget (IMAGE_INSTANCE_X_WIDGET_ID (p)); lw_destroy_widget (IMAGE_INSTANCE_X_CLIPWIDGET (p)); - IMAGE_INSTANCE_X_WIDGET_ID (p) = (Widget) 0xDEADBEEF; - IMAGE_INSTANCE_X_CLIPWIDGET (p) = (Widget) 0xDEADBEEF; + IMAGE_INSTANCE_X_WIDGET_ID (p) = 0; + IMAGE_INSTANCE_X_CLIPWIDGET (p) = 0; } } else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW) @@ -2188,9 +2188,8 @@ { Arg al[2]; - assert (IMAGE_INSTANCE_X_WIDGET_ID (p) != (Widget) 0xDEADBEEF - && - IMAGE_INSTANCE_X_CLIPWIDGET (p) != (Widget) 0xDEADBEEF) ; + assert (IMAGE_INSTANCE_X_WIDGET_ID (p) && + IMAGE_INSTANCE_X_CLIPWIDGET (p)) ; if ( !XtIsManaged(IMAGE_INSTANCE_X_WIDGET_ID (p)) || Index: src/glyphs-x.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-x.h,v retrieving revision 1.4.2.8 diff -u -r1.4.2.8 glyphs-x.h --- src/glyphs-x.h 2000/02/13 00:26:22 1.4.2.8 +++ src/glyphs-x.h 2000/02/13 20:18:32 @@ -137,9 +137,9 @@ #define XIMAGE_INSTANCE_X_CLIPWINDOW(i) \ IMAGE_INSTANCE_X_CLIPWINDOW (XIMAGE_INSTANCE (i)) #define IMAGE_INSTANCE_X_SUBWINDOW_ID(i) \ - (* (Window *) & IMAGE_INSTANCE_SUBWINDOW_ID (i)) + ((Window)IMAGE_INSTANCE_SUBWINDOW_ID (i)) #define IMAGE_INSTANCE_X_WIDGET_ID(i) \ - ( * (Widget *) & IMAGE_INSTANCE_SUBWINDOW_ID (i)) + ((Widget)IMAGE_INSTANCE_SUBWINDOW_ID (i)) #endif /* HAVE_X_WINDOWS */ #endif /* INCLUDED_glyphs_x_h_ */ Index: src/glyphs.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.c,v retrieving revision 1.23.2.48 diff -u -r1.23.2.48 glyphs.c --- src/glyphs.c 2000/02/10 22:20:15 1.23.2.48 +++ src/glyphs.c 2000/02/13 20:18:48 @@ -975,9 +975,13 @@ lp->width = 0; lp->height = 0; lp->parent = glyph; - MARK_IMAGE_INSTANCE_CHANGED (lp); /* So that layouts get done. */ + /* So that layouts get done. */ + lp->layout_changed = 1; + lp->dirty = 1; + XSETIMAGE_INSTANCE (val, lp); - MARK_GLYPHS_CHANGED; /* So that the dirty flag gets reset. */ + MARK_GLYPHS_CHANGED; + return val; } @@ -1370,6 +1374,9 @@ /* Make sure the image instance gets redisplayed. */ set_image_instance_dirty_p (image_instance, 1); + /* Force the glyph to be laid out again. */ + IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 1; + MARK_SUBWINDOWS_STATE_CHANGED; MARK_GLYPHS_CHANGED; @@ -1714,6 +1721,7 @@ /* Do not clear the dirty flag here - redisplay will do this for us at the end. */ + IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 0; } /* @@ -1738,7 +1746,9 @@ if (TEXT_IMAGE_INSTANCEP (image)) { - XIMAGE_INSTANCE_DIRTYP (image) = 1; + Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image); + IMAGE_INSTANCE_DIRTYP (ii) = 1; + IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 1; if (GLYPHP (glyph_or_ii)) XGLYPH_DIRTYP (glyph_or_ii) = 1; return 1; @@ -3577,7 +3587,7 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_DIRTYP (instance)) + if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNSPECIFIED_GEOMETRY, domain); @@ -3605,7 +3615,7 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_DIRTYP (instance)) + if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNSPECIFIED_GEOMETRY, domain); @@ -3623,7 +3633,7 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_DIRTYP (instance)) + if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNSPECIFIED_GEOMETRY, domain); @@ -3643,7 +3653,7 @@ if (!IMAGE_INSTANCEP (instance)) return 0; - if (XIMAGE_INSTANCE_DIRTYP (instance)) + if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance)) image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY, IMAGE_UNSPECIFIED_GEOMETRY, domain); @@ -3810,11 +3820,17 @@ * glyph cachel functions * *****************************************************************************/ -/* - #### All of this is 95% copied from face cachels. - Consider consolidating. - */ - +/* #### All of this is 95% copied from face cachels. Consider + consolidating. + + Why do we need glyph_cachels? Simply because a glyph_cachel captures + per-window information about a particular glyph. A glyph itself is + not created in any particular context, so if we were to rely on a + glyph to tell us about its dirtiness we would not be able to reset + the dirty flag after redisplaying it as it may exist in other + contexts. When we have redisplayed we need to know which glyphs to + reset the dirty flags on - the glyph_cachels give us a nice list we + can iterate through doing this. */ void mark_glyph_cachels (glyph_cachel_dynarr *elements) { @@ -4248,7 +4264,6 @@ IMAGE_INSTANCE_WIDGET_PERCENT_CHANGED (ii) = 0; IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 0; IMAGE_INSTANCE_TEXT_CHANGED (ii) = 0; - IMAGE_INSTANCE_WIDGET_LAYOUT_CHANGED (ii) = 0; } else if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW && @@ -4343,6 +4358,7 @@ cachel->height = dga->height; cachel->being_displayed = 1; +#if 0 /* This forces any pending display changes to happen to the image before we show it. I'm not sure whether or not we need mark as clean here, but for now we will. */ @@ -4351,6 +4367,7 @@ update_subwindow (subwindow); IMAGE_INSTANCE_DIRTYP (ii) = 0; } +#endif MAYBE_DEVMETH (XDEVICE (ii->device), map_subwindow, (ii, x, y, dga)); } Index: src/glyphs.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.h,v retrieving revision 1.18.2.32 diff -u -r1.18.2.32 glyphs.h --- src/glyphs.h 2000/02/13 00:26:23 1.18.2.32 +++ src/glyphs.h 2000/02/13 20:18:51 @@ -491,6 +491,8 @@ unsigned int dirty : 1; unsigned int size_changed : 1; unsigned int text_changed : 1; + unsigned int layout_changed : 1; + union { struct @@ -533,7 +535,6 @@ unsigned int face_changed : 1; unsigned int items_changed : 1; unsigned int percent_changed : 1; - unsigned int layout_changed : 1; } subwindow; } u; @@ -563,6 +564,8 @@ ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP) \ || (IMAGE_INSTANCE_TYPE (i) == IMAGE_COLOR_PIXMAP)) #define IMAGE_INSTANCE_DIRTYP(i) ((i)->dirty) +#define IMAGE_INSTANCE_NEEDS_LAYOUT(i) \ + (IMAGE_INSTANCE_DIRTYP (i) && IMAGE_INSTANCE_LAYOUT_CHANGED (i)) #define IMAGE_INSTANCE_FACE(i) \ XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i)) @@ -575,8 +578,8 @@ ((i)->u.subwindow.items_changed) #define IMAGE_INSTANCE_WIDGET_PERCENT_CHANGED(i) \ ((i)->u.subwindow.percent_changed) -#define IMAGE_INSTANCE_WIDGET_LAYOUT_CHANGED(i) \ - ((i)->u.subwindow.layout_changed) +#define IMAGE_INSTANCE_LAYOUT_CHANGED(i) \ + ((i)->layout_changed) /* Text properties */ #define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string) @@ -664,6 +667,8 @@ IMAGE_INSTANCE_YOFFSET (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_DIRTYP(i) \ IMAGE_INSTANCE_DIRTYP (XIMAGE_INSTANCE (i)) +#define XIMAGE_INSTANCE_NEEDS_LAYOUT(i) \ + IMAGE_INSTANCE_NEEDS_LAYOUT (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_WIDTH(i) \ IMAGE_INSTANCE_WIDTH (XIMAGE_INSTANCE (i)) #define XIMAGE_INSTANCE_HEIGHT(i) \ @@ -976,6 +981,7 @@ void update_frame_subwindows (struct frame *f); int find_matching_subwindow (struct frame* f, int x, int y, int width, int height); void update_widget (Lisp_Object widget); +void update_subwindow (Lisp_Object subwindow); Lisp_Object image_instance_parent_glyph (struct Lisp_Image_Instance*); struct expose_ignore Index: src/redisplay-output.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-output.c,v retrieving revision 1.11.2.27 diff -u -r1.11.2.27 redisplay-output.c --- src/redisplay-output.c 2000/02/10 22:20:16 1.11.2.27 +++ src/redisplay-output.c 2000/02/13 20:18:58 @@ -1270,7 +1270,7 @@ /* Highly dodgy optimization. We want to only output the whole layout if we really have to. */ if (frame_really_changed - || IMAGE_INSTANCE_WIDGET_LAYOUT_CHANGED (p) + || IMAGE_INSTANCE_LAYOUT_CHANGED (p) || IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p) || IMAGE_INSTANCE_SIZE_CHANGED (p) || IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) Index: src/redisplay.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay.c,v retrieving revision 1.55.2.38 diff -u -r1.55.2.38 redisplay.c --- src/redisplay.c 2000/02/07 07:59:56 1.55.2.38 +++ src/redisplay.c 2000/02/13 20:19:27 @@ -1528,6 +1528,12 @@ glyph sizes might have changed too */ invalidate_glyph_geometry_maybe (gb->glyph, w); + /* This makes sure the glyph is in the cachels. + + #### We need to change this so that we hold onto the glyph_index + here, not the glyph itself. */ + get_glyph_cachel_index (w, gb->glyph); + /* A nil extent indicates a special glyph (ex. truncator). */ if (NILP (gb->extent) || (pos_type == BEGIN_GLYPHS &&