Index: src/glyphs-widget.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/glyphs-widget.c,v retrieving revision 1.1.2.26 diff -u -r1.1.2.26 glyphs-widget.c --- src/glyphs-widget.c 2000/02/09 19:20:18 1.1.2.26 +++ src/glyphs-widget.c 2000/02/10 22:15:48 @@ -964,7 +964,6 @@ } else { - nitems ++; if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL) @@ -1055,9 +1054,6 @@ /* Now layout subwidgets if they require it. */ image_instance_layout (glyph, gwidth, gheight, domain); } - - IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = width; - IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = height; } Index: src/glyphs.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.c,v retrieving revision 1.23.2.47 diff -u -r1.23.2.47 glyphs.c --- src/glyphs.c 2000/02/09 19:20:19 1.23.2.47 +++ src/glyphs.c 2000/02/10 22:16:01 @@ -815,6 +815,8 @@ /* do this so that the cachels get reset */ if (IMAGE_INSTANCE_TYPE (i) == IMAGE_WIDGET || + IMAGE_INSTANCE_TYPE (i) == IMAGE_SUBWINDOW + || IMAGE_INSTANCE_TYPE (i) == IMAGE_SUBWINDOW) { MARK_FRAME_SUBWINDOWS_CHANGED @@ -1694,9 +1696,15 @@ /* At this point width and height should contain sane values. Thus we set the glyph geometry and lay it out. */ + if (IMAGE_INSTANCE_WIDTH (ii) != width + || + IMAGE_INSTANCE_HEIGHT (ii) != height) + { + IMAGE_INSTANCE_SIZE_CHANGED (ii) = 1; + } + IMAGE_INSTANCE_WIDTH (ii) = width; IMAGE_INSTANCE_HEIGHT (ii) = height; - IMAGE_INSTANCE_SIZE_CHANGED (ii) =1; if (meths && HAS_IIFORMAT_METH_P (meths, layout)) { @@ -4224,14 +4232,17 @@ *****************************************************************************/ /* update the displayed characteristics of a subwindow */ -static void +void update_subwindow (Lisp_Object subwindow) { Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow); - if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET) + if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET + || + IMAGE_INSTANCE_TYPE (ii) == IMAGE_LAYOUT) { - update_widget (subwindow); + if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET) + update_widget (subwindow); /* Reset the changed flags. */ IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) = 0; IMAGE_INSTANCE_WIDGET_PERCENT_CHANGED (ii) = 0; @@ -4255,6 +4266,8 @@ { int elt; + /* #### Checking all of these might be overkill now that we update + subwindows in the actual redisplay code. */ if (f->subwindows_changed || f->subwindows_state_changed || f->faces_changed) for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++) { Index: src/redisplay-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-msw.c,v retrieving revision 1.28.2.15 diff -u -r1.28.2.15 redisplay-msw.c --- src/redisplay-msw.c 2000/02/07 07:59:51 1.28.2.15 +++ src/redisplay-msw.c 2000/02/10 22:16:11 @@ -26,8 +26,9 @@ Chuck Thompson Lots of work done by Ben Wing for Mule - Partially rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. - */ + + Partially rewritten for mswindows by Jonathan Harris, November 1997 + for 21.0. */ #include #include "lisp.h" Index: src/redisplay-output.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-output.c,v retrieving revision 1.11.2.26 diff -u -r1.11.2.26 redisplay-output.c --- src/redisplay-output.c 2000/02/09 19:20:20 1.11.2.26 +++ src/redisplay-output.c 2000/02/10 22:16:17 @@ -1161,9 +1161,14 @@ Lisp_Object window; struct display_glyph_area sdga; - dga->height = IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p); - dga->width = IMAGE_INSTANCE_SUBWINDOW_WIDTH (p); + dga->height = IMAGE_INSTANCE_HEIGHT (p); + dga->width = IMAGE_INSTANCE_WIDTH (p); + /* The first thing we are going to do is update the display + characteristics of the subwindow. This also clears the dirty + flags as a side effect. */ + update_subwindow (image_instance); + /* This makes the glyph area fit into the display area. */ if (!redisplay_normalize_glyph_area (db, dga)) return; @@ -1187,8 +1192,8 @@ cases.*/ sdga.xoffset = -dga->xoffset; sdga.yoffset = -dga->yoffset; - sdga.height = IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p); - sdga.width = IMAGE_INSTANCE_SUBWINDOW_WIDTH (p); + sdga.height = IMAGE_INSTANCE_HEIGHT (p); + sdga.width = IMAGE_INSTANCE_WIDTH (p); if (redisplay_display_boxes_in_window_p (w, db, &sdga) < 0) { @@ -1207,22 +1212,23 @@ Output a widget hierarchy. This can safely call itself recursively. - #### The complexity of outputting layouts is deciding whether to do - it or not. Consider a layout enclosing some text, the text changes - and is marked as dirty, but the enclosing layout has not been marked - as dirty so no updates occur and the text will potentially be - truncated. Alternatively we hold a back pointer in the image - instance to the parent and mark the parent as dirty. But the layout - code assumes that if the layout is dirty then the whole layout should - be redisplayed, so we then get lots of flashing even though only the - text has changed size. Of course if the text shrinks in size then we - do actually need to redisplay the layout to repaint the exposed - area. So what happens if we make a non-structural change liek - changing color? Either we redisplay everything, or we redisplay - nothing. These are exactly the issues lwlib has to grapple with. We - really need to know what has actually changed and make a layout - decision based on that. We also really need to know what has changed - so that we can only make the neccessary changes in update_subwindow. + The complexity of outputting layouts is deciding whether to do it or + not. Consider a layout enclosing some text, the text changes and is + marked as dirty, but the enclosing layout has not been marked as + dirty so no updates occur and the text will potentially be truncated. + Alternatively we hold a back pointer in the image instance to the + parent and mark the parent as dirty. But the layout code assumes that + if the layout is dirty then the whole layout should be redisplayed, + so we then get lots of flashing even though only the text has changed + size. Of course if the text shrinks in size then we do actually need + to redisplay the layout to repaint the exposed area. So what happens + if we make a non-structural change like changing color? Either we + redisplay everything, or we redisplay nothing. These are exactly the + issues lwlib has to grapple with. We really need to know what has + actually changed and make a layout decision based on that. We also + really need to know what has changed so that we can only make the + neccessary changes in update_subwindow. This has all now been + implemented, Viva la revolution! ****************************************************************************/ void redisplay_output_layout (struct window *w, @@ -1431,6 +1437,11 @@ } } } + + /* Update any display properties. I'm not sure whether this actually + does anything for layouts except clear the changed flags. */ + update_subwindow (image_instance); + Dynarr_free (buf); }