X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fglyphs-x.c;h=b45832db0c0576c1a8026b4fc5bbf6e6d1b21e86;hb=02f4d2761a98c5cb9d5b423d2361160a5d8c9ee4;hp=e0fa2d29abf6d0edb78da2cb4fc4801a2c242b23;hpb=b50fd71ea3c920afc5ba60af567d73940993be3f;p=chise%2Fxemacs-chise.git.1 diff --git a/src/glyphs-x.c b/src/glyphs-x.c index e0fa2d2..b45832d 100644 --- a/src/glyphs-x.c +++ b/src/glyphs-x.c @@ -156,6 +156,8 @@ static void update_tab_widget_face (widget_value* wv, Lisp_Image_Instance* ii, Lisp_Object domain); #endif +void +emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget); #include "bitmaps.h" @@ -701,7 +703,7 @@ write_lisp_string_to_temp_file (Lisp_Object string, char *filename_out) /* Get the data while doing the conversion */ while (1) { - ssize_t size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); + Lstream_data_count size_in_bytes = Lstream_read (istr, tempbuf, sizeof (tempbuf)); if (!size_in_bytes) break; /* It does seem the flushes are necessary... */ @@ -796,7 +798,7 @@ generate_cursor_fg_bg (Lisp_Object device, Lisp_Object *foreground, else { xbg->pixel = 0; - xbg->red = xbg->green = xbg->blue = ~0; + xbg->red = xbg->green = xbg->blue = USHRT_MAX; } } @@ -2130,6 +2132,12 @@ x_unmap_subwindow (Lisp_Image_Instance *p) } else /* must be a widget */ { + /* Since we are being unmapped we want the enclosing frame to + get focus. The losing with simple scrolling but is the safest + thing to do. */ + emacs_Xt_handle_widget_losing_focus + ( XFRAME (IMAGE_INSTANCE_FRAME (p)), + IMAGE_INSTANCE_X_WIDGET_ID (p)); XtUnmapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p)); } } @@ -2220,8 +2228,14 @@ x_redisplay_widget (Lisp_Image_Instance *p) /* Possibly update the colors and font */ if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p) || + /* #### This is not sufficient because it will not cope with widgets + that are not currently visible. Once redisplay has done the + visible ones it will clear this flag so that when new ones + become visible they will not be updated. */ XFRAME (IMAGE_INSTANCE_FRAME (p))->faces_changed || + XFRAME (IMAGE_INSTANCE_FRAME (p))->frame_changed + || IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) { update_widget_face (wv, p, IMAGE_INSTANCE_FRAME (p)); @@ -2261,7 +2275,7 @@ x_redisplay_widget (Lisp_Image_Instance *p) } /* Adjust offsets within the frame. */ - if (XFRAME (IMAGE_INSTANCE_FRAME (p))->frame_changed) + if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed) { Arg al[2]; XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));