From cbd894121367cda2bd412bffec5412540fe6c7f9 Mon Sep 17 00:00:00 2001 From: Jaesup Kwak Date: Mon, 6 Nov 2017 03:47:11 +0900 Subject: [PATCH] Fix unnecessary xwidget_view creations * src/xwidget.c (x_draw_xwidget_glyph_string): Don't create new xwidget view if we have one already. Copyright-paperwork-exempt: yes --- src/xwidget.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/xwidget.c b/src/xwidget.c index a0c9e03477..fb776fb189 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -585,22 +585,20 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) xwidget on screen. Moving and clipping is done here. Also view initialization. */ struct xwidget *xww = s->xwidget; - struct xwidget_view *xv; + struct xwidget_view *xv = xwidget_view_lookup (xww, s->w); int clip_right; int clip_bottom; int clip_top; int clip_left; - /* FIXME: The result of this call is discarded. - What if the lookup fails? */ - xwidget_view_lookup (xww, s->w); - int x = s->x; int y = s->y + (s->height / 2) - (xww->height / 2); /* Do initialization here in the display loop because there is no other time to know things like window placement etc. */ - xv = xwidget_init_view (xww, s, x, y); + /* Do not create new one if we have found one to use. */ + if (!xv) + xv = xwidget_init_view (xww, s, x, y); int text_area_x, text_area_y, text_area_width, text_area_height; -- 2.13.6 (Apple Git-96)