From: Po Lu Date: Mon, 15 Nov 2021 01:27:31 +0000 (+0800) Subject: Stop assuming xwidget views will only be displayed in TEXT_AREA X-Git-Tag: emacs-29.0.90~2852^2~281 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d9e91da7690a7872a27d9fcb652a170d84e4d891;p=emacs.git Stop assuming xwidget views will only be displayed in TEXT_AREA * src/xterm.c (x_scroll_run): Use view->area when calculating xwidget view clipping. * src/xwidget.c (x_draw_xwidget_glyph_string): Set view->area to s->area and use that instead. * src/xwidget.h (struct xwidget_view): Add glyph row area field. --- diff --git a/src/xterm.c b/src/xterm.c index fd498c0e32b..5988d3a15fb 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4439,7 +4439,7 @@ x_scroll_run (struct window *w, struct run *run) int text_area_x, text_area_y, text_area_width, text_area_height; int clip_top, clip_bottom; - window_box (w, TEXT_AREA, &text_area_x, &text_area_y, + window_box (w, view->area, &text_area_x, &text_area_y, &text_area_width, &text_area_height); view->y = y; diff --git a/src/xwidget.c b/src/xwidget.c index 0e8bf13715f..48927524320 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -1631,7 +1631,9 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) } #endif - window_box (s->w, TEXT_AREA, &text_area_x, &text_area_y, + xv->area = s->area; + + window_box (s->w, xv->area, &text_area_x, &text_area_y, &text_area_width, &text_area_height); clip_left = max (0, text_area_x - x); diff --git a/src/xwidget.h b/src/xwidget.h index 4377b50e840..df55dacffef 100644 --- a/src/xwidget.h +++ b/src/xwidget.h @@ -104,6 +104,8 @@ struct xwidget_view /* The "live" instance isn't drawn. */ bool hidden; + enum glyph_row_area area; + #if defined (USE_GTK) Display *dpy; Window wdesc;