Index: lwlib/lwlib-Xaw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/lwlib/lwlib-Xaw.c,v retrieving revision 1.9.2.8 diff -u -r1.9.2.8 lwlib-Xaw.c --- lwlib/lwlib-Xaw.c 2000/02/16 02:06:26 1.9.2.8 +++ lwlib/lwlib-Xaw.c 2000/02/21 21:28:50 @@ -788,7 +788,7 @@ int ac = 0; Widget scale = 0; widget_value* val = instance->info->val; - +#if 0 /* This looks too awful, although more correct. */ if (!val->call_data) { XtSetArg (al [ac], XtNsensitive, False); ac++; @@ -797,6 +797,10 @@ { XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; } +#else + XtSetArg (al [ac], XtNsensitive, True); ac++; +#endif + XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++; XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++; Index: lwlib/lwlib-Xm.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/lwlib/lwlib-Xm.c,v retrieving revision 1.11.2.13 diff -u -r1.11.2.13 lwlib-Xm.c --- lwlib/lwlib-Xm.c 2000/02/16 02:06:26 1.11.2.13 +++ lwlib/lwlib-Xm.c 2000/02/21 21:28:56 @@ -1646,7 +1646,7 @@ int ac = 0; Widget scale = 0; widget_value* val = instance->info->val; - +#if 0 /* This looks too awful, although more correct. */ if (!val->call_data) { XtSetArg (al [ac], XmNsensitive, False); ac++; @@ -1655,6 +1655,9 @@ { XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; } +#else + XtSetArg (al [ac], XmNsensitive, True); ac++; +#endif XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; XtSetArg (al [ac], XmNuserData, val->call_data); ac++; XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; Index: lwlib/lwlib.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/lwlib/lwlib.c,v retrieving revision 1.13.2.9 diff -u -r1.13.2.9 lwlib.c --- lwlib/lwlib.c 2000/02/16 02:06:26 1.13.2.9 +++ lwlib/lwlib.c 2000/02/21 21:29:00 @@ -261,7 +261,6 @@ { /* #### Do something more sensible here than just copying the new values (like actually merging the values). */ - free_widget_value_args (old); lw_copy_widget_value_args (new, old); changed = True; } @@ -1365,6 +1364,7 @@ void lw_add_widget_value_arg (widget_value* wv, String name, XtArgVal value) { + int i = 0; if (!wv->args) { wv->args = (widget_args *) malloc (sizeof (widget_args)); @@ -1378,7 +1378,19 @@ if (wv->args->nargs > 10) return; - XtSetArg (wv->args->args [wv->args->nargs], name, value); wv->args->nargs++; + /* If the arg is already there then we must replace it. */ + for (i = 0; i < wv->args->nargs; i++) + { + if (!strcmp (wv->args->args[i].name, name)) + { + XtSetArg (wv->args->args [i], name, value); + break; + } + } + if (i >= wv->args->nargs) + { + XtSetArg (wv->args->args [wv->args->nargs], name, value); wv->args->nargs++; + } } static void free_widget_value_args (widget_value* wv) @@ -1397,20 +1409,22 @@ #endif free (wv->args->args); free (wv->args); - wv->args = (widget_args*)0xDEADBEEF; + wv->args = 0; } } } void lw_copy_widget_value_args (widget_value* val, widget_value* copy) { - if (!val->args) + if (val == copy || val->args == copy->args) + return; + + if (copy->args) { - if (copy->args) - free_widget_value_args (copy); - copy->args = 0; + free_widget_value_args (copy); } - else + + if (val->args) { copy->args = val->args; copy->args->ref_count++; Index: src/buffer.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/buffer.c,v retrieving revision 1.36.2.23 diff -u -r1.36.2.23 buffer.c --- src/buffer.c 2000/02/16 02:07:20 1.36.2.23 +++ src/buffer.c 2000/02/21 21:29:14 @@ -1304,12 +1304,12 @@ kill_buffer_processes (buf); + delete_from_buffer_alist (buf); + /* #### This is a problem if this buffer is in a dedicated window. Need to undedicate any windows of this buffer first (and delete them?) */ Freplace_buffer_in_windows (buf); - - delete_from_buffer_alist (buf); font_lock_buffer_was_killed (b); Index: src/glyphs-widget.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/glyphs-widget.c,v retrieving revision 1.1.2.28 diff -u -r1.1.2.28 glyphs-widget.c --- src/glyphs-widget.c 2000/02/13 20:22:24 1.1.2.28 +++ src/glyphs-widget.c 2000/02/21 21:29:26 @@ -715,7 +715,7 @@ enum image_instance_geometry disp, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii); + Lisp_Object items = XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)); Lisp_Object rest; unsigned int tw = 0, th = 0; @@ -726,7 +726,7 @@ query_string_geometry (XGUI_ITEM (XCAR (rest))->name, IMAGE_INSTANCE_WIDGET_FACE (ii), &w, &h, 0, domain); - tw += 2 * WIDGET_BORDER_WIDTH; /* some bias */ + tw += 5 * WIDGET_BORDER_WIDTH; /* some bias */ tw += w; th = max (th, h + 2 * WIDGET_BORDER_HEIGHT); } Index: src/glyphs-x.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-x.c,v retrieving revision 1.49.2.56 diff -u -r1.49.2.56 glyphs-x.c --- src/glyphs-x.c 2000/02/17 14:16:43 1.49.2.56 +++ src/glyphs-x.c 2000/02/21 21:29:35 @@ -2183,18 +2183,30 @@ /* This function can GC if IN_REDISPLAY is false. */ #ifdef HAVE_WIDGETS widget_value* wv = 0; - Boolean deep_p = False; - /* First get the items if they have changed since this is a structural change. */ + /* First get the items if they have changed since this is a + structural change. As such it will nuke all added values so we + need to update most other things after the items have changed.*/ if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) { wv = gui_items_to_widget_values (IMAGE_INSTANCE_WIDGET_ITEMS (p)); - deep_p = True; + wv->change = STRUCTURAL_CHANGE; + /* now modify the widget */ + lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), + wv, True); + free_widget_value_tree (wv); } + /* Now do non structural updates. */ + wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (p)); + /* Possibly update the colors and font */ - if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p)) + if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p) + || + XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (p))->faces_changed + || + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) { update_widget_face (wv, p, IMAGE_INSTANCE_SUBWINDOW_FRAME (p)); } @@ -2209,23 +2221,12 @@ Qnative); wv->value = str; } - - /* now modify the widget */ - lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), - wv, deep_p); - free_widget_value_tree (wv); - /* Possibly update the size. Do this last in case anything has - fiddled with the size previously. */ - /* #### FIXME: for some reason the widget gets resized even when we - don't want it to. This may be a bug in the tab widget. The work - around is to always resize in update - that way we can guarantee - that we get what we should at the expense of a little - performance. */ - if (1 /*IMAGE_INSTANCE_SIZE_CHANGED (p) */) + /* Possibly update the size. */ + if (IMAGE_INSTANCE_SIZE_CHANGED (p) + || + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) { - Arg al[2]; - assert (IMAGE_INSTANCE_X_WIDGET_ID (p) && IMAGE_INSTANCE_X_CLIPWIDGET (p)) ; @@ -2237,10 +2238,15 @@ signal_simple_error ("XEmacs bug: subwindow is deleted", sw); } - XtSetArg (al [0], XtNwidth, (Dimension)IMAGE_INSTANCE_WIDTH (p)); - XtSetArg (al [1], XtNheight, (Dimension)IMAGE_INSTANCE_HEIGHT (p)); - XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (p), al, 2); + lw_add_widget_value_arg (wv, XtNwidth, + (Dimension)IMAGE_INSTANCE_WIDTH (p)); + lw_add_widget_value_arg (wv, XtNheight, + (Dimension)IMAGE_INSTANCE_HEIGHT (p)); } + + /* now modify the widget */ + lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), + wv, False); #endif } @@ -2439,9 +2445,9 @@ lw_add_widget_value_arg (clip_wv, XtNresize, False); lw_add_widget_value_arg (clip_wv, XtNwidth, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii)); + (Dimension)IMAGE_INSTANCE_WIDTH (ii)); lw_add_widget_value_arg (clip_wv, XtNheight, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii)); + (Dimension)IMAGE_INSTANCE_HEIGHT (ii)); clip_wv->enabled = True; clip_wv->name = xstrdup ("clip-window"); @@ -2477,9 +2483,9 @@ /* we cannot allow widgets to resize themselves */ lw_add_widget_value_arg (wv, XtNresize, False); lw_add_widget_value_arg (wv, XtNwidth, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii)); + (Dimension)IMAGE_INSTANCE_WIDTH (ii)); lw_add_widget_value_arg (wv, XtNheight, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii)); + (Dimension)IMAGE_INSTANCE_HEIGHT (ii)); /* update the font. */ update_widget_face (wv, ii, domain); @@ -2678,14 +2684,17 @@ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); /* Possibly update the face. */ - if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii)) + if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) + || + XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii))->faces_changed + || + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) { widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); update_tab_widget_face (wv, ii, IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, True); - free_widget_value_tree (wv); } } Index: src/glyphs.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.c,v retrieving revision 1.23.2.51 diff -u -r1.23.2.51 glyphs.c --- src/glyphs.c 2000/02/17 14:16:44 1.23.2.51 +++ src/glyphs.c 2000/02/21 21:29:49 @@ -4266,7 +4266,14 @@ * subwindow functions * *****************************************************************************/ -/* update the displayed characteristics of a subwindow */ +/* Update the displayed characteristics of a subwindow. This function + should generally only get called if the subwindow is actually + dirty. The only other time it gets called is if subwindow state + changed, when we can't actually tell whether its going to be dirty + or not. + #### I suspect what we should really do is re-evaluate all the + gui slots that could affect this and then mark the instance as + dirty. Right now, updating everything is safe but expensive. */ void update_subwindow (Lisp_Object subwindow) { @@ -4284,7 +4291,7 @@ IMAGE_INSTANCE_TYPE (ii) == IMAGE_LAYOUT) { if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET) - update_widget (subwindow); + update_widget (subwindow); /* Reset the changed flags. */ IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) = 0; IMAGE_INSTANCE_WIDGET_PERCENT_CHANGED (ii) = 0; @@ -4317,7 +4324,13 @@ struct subwindow_cachel *cachel = Dynarr_atp (f->subwindow_cachels, elt); - if (cachel->being_displayed) + if (cachel->being_displayed + && + /* We only want to update if something has really + changed. */ + (f->subwindows_state_changed + || + XIMAGE_INSTANCE_DIRTYP (cachel->subwindow))) { update_subwindow (cachel->subwindow); } @@ -4385,17 +4398,6 @@ cachel->width = dga->width; 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. */ - if (IMAGE_INSTANCE_DIRTYP (ii)) - { - update_subwindow (subwindow); - IMAGE_INSTANCE_DIRTYP (ii) = 0; - } -#endif MAYBE_DEVMETH (XDEVICE (ii->device), map_subwindow, (ii, x, y, dga)); } Index: src/gui-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/gui-msw.c,v retrieving revision 1.1.2.5 diff -u -r1.1.2.5 gui-msw.c --- src/gui-msw.c 2000/02/09 11:12:56 1.1.2.5 +++ src/gui-msw.c 2000/02/21 21:29:50 @@ -92,9 +92,6 @@ CHECK_STRING (document); - /* Just get the filename if we were given it. */ - document = Ffile_name_nondirectory (document); - if (NILP (current_dir)) current_dir = current_buffer->directory; @@ -118,7 +115,11 @@ TO_EXTERNAL_FORMAT (LISP_STRING, document, C_STRING_ALLOCA, f, Qfile_name); +#ifdef __CYGWIN32__ + CYGWIN_WIN32_PATH (f, doc); +#else doc = f; +#endif } UNGCPRO;