X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fglyphs-x.c;h=04519968dac85a0d5b8682b656d14c933cd65616;hb=df28933d74967579569614970a965eb590a6d74d;hp=9a0e29612dae4b3320658c38d38724ec5e1959cf;hpb=82f6d62ee211b1d36e8f45fed3ee3edde82b6916;p=chise%2Fxemacs-chise.git- diff --git a/src/glyphs-x.c b/src/glyphs-x.c index 9a0e296..0451996 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" @@ -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)); } } @@ -2140,6 +2148,7 @@ static void x_map_subwindow (Lisp_Image_Instance *p, int x, int y, struct display_glyph_area* dga) { + assert (dga->width > 0 && dga->height > 0); if (IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW) { Window subwindow = IMAGE_INSTANCE_X_SUBWINDOW_ID (p); @@ -2259,6 +2268,16 @@ x_redisplay_widget (Lisp_Image_Instance *p) (Dimension)IMAGE_INSTANCE_HEIGHT (p)); } + /* Adjust offsets within the frame. */ + if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed) + { + Arg al[2]; + XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p)); + XtSetArg (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p)); + XtGetValues (FRAME_X_TEXT_WIDGET + (XFRAME (IMAGE_INSTANCE_FRAME (p))), al, 2); + } + /* now modify the widget */ lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), wv, True);