]> code.delx.au - gnu-emacs/commitdiff
Merge branch 'master' into xwidget
authorJoakim Verona <joakim@verona.se>
Tue, 20 Jan 2015 23:26:56 +0000 (00:26 +0100)
committerJoakim Verona <joakim@verona.se>
Tue, 20 Jan 2015 23:26:56 +0000 (00:26 +0100)
1  2 
src/dispnew.c
src/lisp.h
src/xdisp.c

diff --combined src/dispnew.c
index abfdde6ef2431411d2e5b37abf2d1f59d47d258c,9af0ae57b2e623d938b49d1e298af442358e31ed..3c0f110446bc67ad7213e4f5263d667367348912
@@@ -48,10 -48,6 +48,10 @@@ along with GNU Emacs.  If not, see <htt
  #include TERM_HEADER
  #endif /* HAVE_WINDOW_SYSTEM */
  
 +#ifdef HAVE_XWIDGETS
 +#include "xwidget.h"
 +#endif
 +
  #include <errno.h>
  
  #include <fpending.h>
@@@ -417,12 -413,6 +417,6 @@@ adjust_glyph_matrix (struct window *w, 
        new_rows = dim.height - matrix->rows_allocated;
        matrix->rows = xpalloc (matrix->rows, &matrix->rows_allocated,
                              new_rows, INT_MAX, sizeof *matrix->rows);
-       /* As a side effect, this sets the object of each glyph in the
-        row to nil, so verify we will indeed get that.  Redisplay
-        relies on the object of special glyphs (truncation and
-        continuation glyps and also blanks used to extend each line
-        on a TTY) to be nil.  */
-       verify (NIL_IS_ZERO);
        memset (matrix->rows + old_alloc, 0,
              (matrix->rows_allocated - old_alloc) * sizeof *matrix->rows);
      }
@@@ -1349,12 -1339,12 +1343,12 @@@ realloc_glyph_pool (struct glyph_pool *
        ptrdiff_t old_nglyphs = pool->nglyphs;
        pool->glyphs = xpalloc (pool->glyphs, &pool->nglyphs,
                              needed - old_nglyphs, -1, sizeof *pool->glyphs);
-       /* As a side effect, this sets the object of each glyph to nil,
-        so verify we will indeed get that.  Redisplay relies on the
-        object of special glyphs (truncation and continuation glyps
-        and also blanks used to extend each line on a TTY) to be
-        nil.  */
+       /* Redisplay relies on nil as the object of special glyphs
+        (truncation and continuation glyphs and also blanks used to
+        extend each line on a TTY), so verify that memset does this.  */
        verify (NIL_IS_ZERO);
        memset (pool->glyphs + old_nglyphs, 0,
              (pool->nglyphs - old_nglyphs) * sizeof *pool->glyphs);
      }
@@@ -3558,9 -3548,6 +3552,9 @@@ update_window (struct window *w, bool f
    add_window_display_history (w, w->current_matrix->method, paused_p);
  #endif
  
 +#ifdef HAVE_XWIDGETS
 +  xwidget_end_redisplay(w, w->current_matrix);
 +#endif
    clear_glyph_matrix (desired_matrix);
  
    return paused_p;
@@@ -4144,12 -4131,6 +4138,12 @@@ scrolling_window (struct window *w, boo
        break;
      }
  
 +#ifdef HAVE_XWIDGETS
 + //currently this is needed to detect xwidget movement reliably. or probably not.
 +  //printf("scrolling_window\n");
 +    return 0;
 +#endif
 +
    /* Give up if some rows in the desired matrix are not enabled.  */
    if (! MATRIX_ROW_ENABLED_P (desired_matrix, i))
      return -1;
diff --combined src/lisp.h
index 65e6c626527c0fefc817e1f336088206bc833b63,8967d6e56ceca227b8271bb1a733a3920156c513..f1e6945f43abf270094db42c7d01f2854ad98b8f
@@@ -781,11 -781,6 +781,11 @@@ enum pvec_typ
    PVEC_WINDOW_CONFIGURATION,
    PVEC_SUBR,
    PVEC_OTHER,
 +#ifdef HAVE_XWIDGETS
 +  PVEC_XWIDGET,
 +  PVEC_XWIDGET_VIEW,
 +#endif
 +
    /* These should be last, check internal_equal to see why.  */
    PVEC_COMPILED,
    PVEC_CHAR_TABLE,
@@@ -1513,13 -1508,13 +1513,13 @@@ gc_aset (Lisp_Object array, ptrdiff_t i
     to find such assumptions later if we change Qnil to be nonzero.  */
  enum { NIL_IS_ZERO = XLI_BUILTIN_LISPSYM (iQnil) == 0 };
  
- /* Set a Lisp_Object array V's SIZE entries to nil.  */
+ /* Set a Lisp_Object array V's N entries to nil.  */
  INLINE void
- memsetnil (Lisp_Object *v, ptrdiff_t size)
+ memsetnil (Lisp_Object *v, ptrdiff_t n)
  {
-   eassert (0 <= size);
+   eassert (0 <= n);
    verify (NIL_IS_ZERO);
-   memset (v, 0, size * sizeof *v);
+   memset (v, 0, n * sizeof *v);
  }
  
  /* If a struct is made to look like a vector, this macro returns the length
diff --combined src/xdisp.c
index 208c1243e358b59e2df23fb979a2f213c5b55999,9611952e97095bd52db20c5d7c8d0a61eb24071f..f6795415bcb314ad3a9c3966baf63bd47b5ea54d
@@@ -318,9 -318,6 +318,9 @@@ along with GNU Emacs.  If not, see <htt
  #include TERM_HEADER
  #endif /* HAVE_WINDOW_SYSTEM */
  
 +#ifdef HAVE_XWIDGETS
 +#include "xwidget.h"
 +#endif
  #ifndef FRAME_X_OUTPUT
  #define FRAME_X_OUTPUT(f) ((f)->output_data.x)
  #endif
@@@ -845,9 -842,6 +845,9 @@@ static int next_element_from_c_string (
  static int next_element_from_buffer (struct it *);
  static int next_element_from_composition (struct it *);
  static int next_element_from_image (struct it *);
 +#ifdef HAVE_XWIDGETS
 +static int next_element_from_xwidget(struct it *);
 +#endif
  static int next_element_from_stretch (struct it *);
  static void load_overlay_strings (struct it *, ptrdiff_t);
  static int init_from_display_pos (struct it *, struct window *,
@@@ -2753,19 -2747,17 +2753,17 @@@ init_iterator (struct it *it, struct wi
      }
  
    /* Clear IT.  */
-   /* As a side effect, this sets it->object to nil, so verify we will
-      indeed get that.  */
+   /* The code assumes it->object and other Lisp_Object components are
+      set to nil, so verify that memset does this.  */
    verify (NIL_IS_ZERO);
    memset (it, 0, sizeof *it);
    it->current.overlay_string_index = -1;
    it->current.dpvec_index = -1;
    it->base_face_id = remapped_base_face_id;
-   it->string = Qnil;
    IT_STRING_CHARPOS (*it) = IT_STRING_BYTEPOS (*it) = -1;
    it->paragraph_embedding = L2R;
-   it->bidi_it.string.lstring = Qnil;
-   it->bidi_it.string.s = NULL;
-   it->bidi_it.string.bufpos = 0;
    it->bidi_it.w = w;
  
    /* The window in which we iterate over current_buffer:  */
                                  * FRAME_LINE_HEIGHT (it->f));
        else if (it->f->extra_line_spacing > 0)
        it->extra_line_spacing = it->f->extra_line_spacing;
-       it->max_extra_line_spacing = 0;
      }
  
    /* If realized faces have been removed, e.g. because of face
    if (FRAME_FACE_CACHE (it->f)->used == 0)
      recompute_basic_faces (it->f);
  
-   /* Current value of the `slice', `space-width', and 'height' properties.  */
-   it->slice.x = it->slice.y = it->slice.width = it->slice.height = Qnil;
-   it->space_width = Qnil;
-   it->font_height = Qnil;
    it->override_ascent = -1;
  
    /* Are control characters displayed as `^C'?  */
    it->tab_width = SANE_TAB_WIDTH (current_buffer);
  
    /* Are lines in the display truncated?  */
-   if (base_face_id != DEFAULT_FACE_ID
-       || it->w->hscroll
-       || (! WINDOW_FULL_WIDTH_P (it->w)
-         && ((!NILP (Vtruncate_partial_width_windows)
-              && !INTEGERP (Vtruncate_partial_width_windows))
-             || (INTEGERP (Vtruncate_partial_width_windows)
-                 /* PXW: Shall we do something about this?  */
-                 && (WINDOW_TOTAL_COLS (it->w)
-                     < XINT (Vtruncate_partial_width_windows))))))
+   if (TRUNCATE != 0)
      it->line_wrap = TRUNCATE;
-   else if (NILP (BVAR (current_buffer, truncate_lines)))
+   if (base_face_id == DEFAULT_FACE_ID
+       && !it->w->hscroll
+       && (WINDOW_FULL_WIDTH_P (it->w)
+         || NILP (Vtruncate_partial_width_windows)
+         || (INTEGERP (Vtruncate_partial_width_windows)
+             /* PXW: Shall we do something about this?  */
+             && (XINT (Vtruncate_partial_width_windows)
+                 <= WINDOW_TOTAL_COLS (it->w))))
+       && NILP (BVAR (current_buffer, truncate_lines)))
      it->line_wrap = NILP (BVAR (current_buffer, word_wrap))
        ? WINDOW_WRAP : WORD_WRAP;
-   else
-     it->line_wrap = TRUNCATE;
  
    /* Get dimensions of truncation and continuation glyphs.  These are
       displayed as fringe bitmaps under X, but we need them for such
@@@ -4697,9 -4682,6 +4688,9 @@@ handle_display_spec (struct it *it, Lis
    if (CONSP (spec)
        /* Simple specifications.  */
        && !EQ (XCAR (spec), Qimage)
 +#ifdef HAVE_XWIDGETS
 +      && !EQ (XCAR (spec), Qxwidget)
 +#endif
        && !EQ (XCAR (spec), Qspace)
        && !EQ (XCAR (spec), Qwhen)
        && !EQ (XCAR (spec), Qslice)
@@@ -5146,11 -5128,7 +5137,11 @@@ handle_single_display_spec (struct it *
               || ((it ? FRAME_WINDOW_P (it->f) : frame_window_p)
                 && valid_image_p (value))
  #endif /* not HAVE_WINDOW_SYSTEM */
 -             || (CONSP (value) && EQ (XCAR (value), Qspace)));
 +             || (CONSP (value) && EQ (XCAR (value), Qspace))
 +#ifdef HAVE_XWIDGETS
 +             || valid_xwidget_spec_p(value)
 +#endif
 +             );
  
    if (valid_p && !display_replaced_p)
      {
          *position = it->position = start_pos;
          retval = 1 + (it->area == TEXT_AREA);
        }
 +#ifdef HAVE_XWIDGETS
 +      else if (valid_xwidget_spec_p(value))
 +      {
 +          //printf("handle_single_display_spec: im an xwidget!!\n");
 +          it->what = IT_XWIDGET;
 +          it->method = GET_FROM_XWIDGET;
 +          it->position = start_pos;
 +        it->object = NILP (object) ? it->w->contents : object;
 +        *position = start_pos;
 +
 +          it->xwidget = lookup_xwidget(value);
 +      }
 +#endif
  #ifdef HAVE_WINDOW_SYSTEM
        else
        {
@@@ -5974,11 -5939,6 +5965,11 @@@ push_it (struct it *it, struct text_po
      case GET_FROM_STRETCH:
        p->u.stretch.object = it->object;
        break;
 +#ifdef HAVE_XWIDGETS
 +    case GET_FROM_XWIDGET:
 +      p->u.xwidget.object = it->object;
 +      break;
 +#endif
      }
    p->position = position ? *position : it->position;
    p->current = it->current;
@@@ -6072,11 -6032,6 +6063,11 @@@ pop_it (struct it *it
        it->object = p->u.image.object;
        it->slice = p->u.image.slice;
        break;
 +#ifdef HAVE_XWIDGETS
 +    case GET_FROM_XWIDGET:
 +      it->object = p->u.xwidget.object;
 +      break;
 +#endif
      case GET_FROM_STRETCH:
        it->object = p->u.stretch.object;
        break;
@@@ -6739,9 -6694,6 +6730,9 @@@ static int (* get_next_element[NUM_IT_M
    next_element_from_c_string,
    next_element_from_image,
    next_element_from_stretch
 +#ifdef HAVE_XWIDGETS
 +  ,next_element_from_xwidget
 +#endif
  };
  
  #define GET_NEXT_DISPLAY_ELEMENT(it) (*get_next_element[(it)->method]) (it)
@@@ -7587,10 -7539,6 +7578,10 @@@ set_iterator_to_next (struct it *it, in
  
      case GET_FROM_IMAGE:
      case GET_FROM_STRETCH:
 +#ifdef HAVE_XWIDGETS
 +    case GET_FROM_XWIDGET:
 +#endif
 +
        /* The position etc with which we have to proceed are on
         the stack.  The position may be at the end of a string,
           if the `display' property takes up the whole string.  */
@@@ -8053,19 -8001,6 +8044,19 @@@ next_element_from_image (struct it *it
    return 1;
  }
  
 +#ifdef HAVE_XWIDGETS
 +/* im not sure about this FIXME JAVE*/
 +static int
 +next_element_from_xwidget (struct it *it)
 +{
 +  it->what = IT_XWIDGET;
 +  //assert_valid_xwidget_id(it->xwidget_id,"next_element_from_xwidget");
 +  //this is shaky because why do we set "what" if we dont set the other parts??
 +  //printf("xwidget_id %d: in next_element_from_xwidget: FIXME \n", it->xwidget_id);
 +  return 1;
 +}
 +#endif
 +
  
  /* Fill iterator IT with next display element from a stretch glyph
     property.  IT->object is the value of the text property.  Value is
@@@ -17079,13 -17014,6 +17070,13 @@@ try_window_reusing_current_matrix (stru
      return 0;
  #endif
  
 +#ifdef HAVE_XWIDGETS_xxx
 + //currently this is needed to detect xwidget movement reliably. or probably not.
 +  printf("try_window_reusing_current_matrix\n");
 +    return 0;
 +#endif
 +
 +
    if (/* This function doesn't handle terminal frames.  */
        !FRAME_WINDOW_P (f)
        /* Don't try to reuse the display if windows have been split
@@@ -18665,29 -18593,6 +18656,29 @@@ dump_glyph (struct glyph_row *row, stru
               glyph->left_box_line_p,
               glyph->right_box_line_p);
      }
 +#ifdef HAVE_XWIDGETS
 +  else if (glyph->type == XWIDGET_GLYPH)
 +    {
 +      fprintf (stderr,
 +             "  %5d %4c %6d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
 +             glyph - row->glyphs[TEXT_AREA],
 +             'X',
 +             glyph->charpos,
 +             (BUFFERP (glyph->object)
 +              ? 'B'
 +              : (STRINGP (glyph->object)
 +                 ? 'S'
 +                 : '-')),
 +             glyph->pixel_width,
 +             glyph->u.xwidget,
 +             '.',
 +             glyph->face_id,
 +             glyph->left_box_line_p,
 +             glyph->right_box_line_p);
 +
 +      //      printf("dump xwidget glyph\n");
 +    }
 +#endif
  }
  
  
@@@ -18905,7 -18810,7 +18896,7 @@@ usage: (trace-to-stderr STRING &rest OB
    (ptrdiff_t nargs, Lisp_Object *args)
  {
    Lisp_Object s = Fformat (nargs, args);
-   fprintf (stderr, "%s", SDATA (s));
+   fwrite (SDATA (s), 1, SBYTES (s), stderr);
    return Qnil;
  }
  
@@@ -24105,13 -24010,6 +24096,13 @@@ calc_pixel_width_or_height (double *res
  
              return OK_PIXELS (width_p ? img->width : img->height);
            }
 +#ifdef HAVE_XWIDGETS
 +        if (FRAME_WINDOW_P (it->f) && valid_xwidget_spec_p (prop))
 +          {
 +              printf("calc_pixel_width_or_height: return dummy size FIXME\n");
 +              return OK_PIXELS (width_p ? 100 : 100);
 +            }
 +#endif
  #endif
          if (EQ (car, Qplus) || EQ (car, Qminus))
            {
@@@ -24616,20 -24514,6 +24607,20 @@@ fill_image_glyph_string (struct glyph_s
  }
  
  
 +#ifdef HAVE_XWIDGETS
 +static void
 +fill_xwidget_glyph_string (struct glyph_string *s)
 +{
 +  eassert (s->first_glyph->type == XWIDGET_GLYPH);
 +  printf("fill_xwidget_glyph_string: width:%d \n",s->first_glyph->pixel_width);
 +  s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
 +  s->font = s->face->font;
 +  s->width = s->first_glyph->pixel_width;
 +  s->ybase += s->first_glyph->voffset;
 +  s->xwidget = s->first_glyph->u.xwidget;
 +  //assert_valid_xwidget_id ( s->xwidget, "fill_xwidget_glyph_string");
 +}
 +#endif
  /* Fill glyph string S from a sequence of stretch glyphs.
  
     START is the index of the first glyph to consider,
@@@ -24965,21 -24849,6 +24956,21 @@@ compute_overhangs_and_x (struct glyph_s
         }                                                              \
       while (0)
  
 +#ifdef HAVE_XWIDGETS
 +#define BUILD_XWIDGET_GLYPH_STRING(START, END, HEAD, TAIL, HL, X, LAST_X) \
 +     do                                                                       \
 +       { \
 +         printf("BUILD_XWIDGET_GLYPH_STRING\n");                                                      \
 +       s = (struct glyph_string *) alloca (sizeof *s);                \
 +       INIT_GLYPH_STRING (s, NULL, w, row, area, START, HL);          \
 +       fill_xwidget_glyph_string (s);                                 \
 +       append_glyph_string (&HEAD, &TAIL, s);                         \
 +       ++START;                                                       \
 +         s->x = (X);                                                  \
 +       }                                                              \
 +     while (0)
 +#endif
 +
  
  /* Add a glyph string for a sequence of character glyphs to the list
     of strings between HEAD and TAIL.  START is the index of the first
     to allocate glyph strings (because draw_glyphs can be called
     asynchronously).  */
  
 -#define BUILD_GLYPH_STRINGS(START, END, HEAD, TAIL, HL, X, LAST_X)    \
 +#define BUILD_GLYPH_STRINGS_1(START, END, HEAD, TAIL, HL, X, LAST_X)  \
    do                                                                  \
      {                                                                 \
        HEAD = TAIL = NULL;                                             \
            case IMAGE_GLYPH:                                           \
              BUILD_IMAGE_GLYPH_STRING (START, END, HEAD, TAIL,         \
                                        HL, X, LAST_X);                 \
 -            break;                                                    \
 -                                                                      \
 +            break;
 +
 +#define BUILD_GLYPH_STRINGS_XW(START, END, HEAD, TAIL, HL, X, LAST_X) \
 +            case XWIDGET_GLYPH:                                         \
 +              BUILD_XWIDGET_GLYPH_STRING (START, END, HEAD, TAIL,       \
 +                                          HL, X, LAST_X);               \
 +              break;
 +
 +#define BUILD_GLYPH_STRINGS_2(START, END, HEAD, TAIL, HL, X, LAST_X)  \
            case GLYPHLESS_GLYPH:                                       \
              BUILD_GLYPHLESS_GLYPH_STRING (START, END, HEAD, TAIL,     \
                                            HL, X, LAST_X);             \
      } while (0)
  
  
 +#ifdef HAVE_XWIDGETS
 +#define BUILD_GLYPH_STRINGS(START, END, HEAD, TAIL, HL, X, LAST_X)    \
 +BUILD_GLYPH_STRINGS_1(START, END, HEAD, TAIL, HL, X, LAST_X)  \
 +BUILD_GLYPH_STRINGS_XW(START, END, HEAD, TAIL, HL, X, LAST_X) \
 +BUILD_GLYPH_STRINGS_2(START, END, HEAD, TAIL, HL, X, LAST_X)
 +#else
 +#define BUILD_GLYPH_STRINGS(START, END, HEAD, TAIL, HL, X, LAST_X)    \
 +BUILD_GLYPH_STRINGS_1(START, END, HEAD, TAIL, HL, X, LAST_X)  \
 +BUILD_GLYPH_STRINGS_2(START, END, HEAD, TAIL, HL, X, LAST_X)
 +#endif
 +
 +
  /* Draw glyphs between START and END in AREA of ROW on window W,
     starting at x-position X.  X is relative to AREA in W.  HL is a
     face-override with the following meaning:
@@@ -25800,114 -25650,6 +25791,114 @@@ produce_image_glyph (struct it *it
      }
  }
  
 +#ifdef HAVE_XWIDGETS
 +static void
 +produce_xwidget_glyph (struct it *it)
 +{
 +  struct xwidget* xw;
 +  struct face *face;
 +  int glyph_ascent, crop;
 +  printf("produce_xwidget_glyph:\n");
 +  eassert (it->what == IT_XWIDGET);
 +
 +  face = FACE_FROM_ID (it->f, it->face_id);
 +  eassert (face);
 +  /* Make sure X resources of the face is loaded.  */
 +  prepare_face_for_display (it->f, face);
 +
 +  xw = it->xwidget;
 +  it->ascent = it->phys_ascent = glyph_ascent = xw->height/2;
 +  it->descent = xw->height/2;
 +  it->phys_descent = it->descent;
 +  it->pixel_width = xw->width;
 +  /* It's quite possible for images to have an ascent greater than
 +     their height, so don't get confused in that case.  */
 +  if (it->descent < 0)
 +    it->descent = 0;
 +
 +  it->nglyphs = 1;
 +
 +  if (face->box != FACE_NO_BOX)
 +    {
 +      if (face->box_line_width > 0)
 +      {
 +          it->ascent += face->box_line_width;
 +          it->descent += face->box_line_width;
 +      }
 +
 +      if (it->start_of_box_run_p)
 +      it->pixel_width += eabs (face->box_line_width);
 +      it->pixel_width += eabs (face->box_line_width);
 +    }
 +
 +  take_vertical_position_into_account (it);
 +
 +  /* Automatically crop wide image glyphs at right edge so we can
 +     draw the cursor on same display row.  */
 +  if ((crop = it->pixel_width - (it->last_visible_x - it->current_x), crop > 0)
 +      && (it->hpos == 0 || it->pixel_width > it->last_visible_x / 4))
 +    {
 +      it->pixel_width -= crop;
 +    }
 +
 +  if (it->glyph_row)
 +    {
 +      struct glyph *glyph;
 +      enum glyph_row_area area = it->area;
 +
 +      glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
 +      if (it->glyph_row->reversed_p)
 +      {
 +        struct glyph *g;
 +
 +        /* Make room for the new glyph.  */
 +        for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
 +          g[1] = *g;
 +        glyph = it->glyph_row->glyphs[it->area];
 +      }
 +      if (glyph < it->glyph_row->glyphs[area + 1])
 +      {
 +        glyph->charpos = CHARPOS (it->position);
 +        glyph->object = it->object;
 +        glyph->pixel_width = it->pixel_width;
 +        glyph->ascent = glyph_ascent;
 +        glyph->descent = it->descent;
 +        glyph->voffset = it->voffset;
 +        glyph->type = XWIDGET_GLYPH;
 +        glyph->avoid_cursor_p = it->avoid_cursor_p;
 +        glyph->multibyte_p = it->multibyte_p;
 +        if (it->glyph_row->reversed_p && area == TEXT_AREA)
 +          {
 +            /* In R2L rows, the left and the right box edges need to be
 +               drawn in reverse direction.  */
 +            glyph->right_box_line_p = it->start_of_box_run_p;
 +            glyph->left_box_line_p = it->end_of_box_run_p;
 +          }
 +        else
 +          {
 +            glyph->left_box_line_p = it->start_of_box_run_p;
 +            glyph->right_box_line_p = it->end_of_box_run_p;
 +          }
 +          glyph->overlaps_vertically_p = 0;
 +          glyph->padding_p = 0;
 +        glyph->glyph_not_available_p = 0;
 +        glyph->face_id = it->face_id;
 +          glyph->u.xwidget = it->xwidget;
 +          //assert_valid_xwidget_id(glyph->u.xwidget_id,"produce_xwidget_glyph");
 +        glyph->font_type = FONT_TYPE_UNKNOWN;
 +        if (it->bidi_p)
 +          {
 +            glyph->resolved_level = it->bidi_it.resolved_level;
 +            eassert ((it->bidi_it.type & 7) == it->bidi_it.type);
 +            glyph->bidi_type = it->bidi_it.type;
 +          }
 +        ++it->glyph_row->used[area];
 +      }
 +      else
 +      IT_EXPAND_MATRIX_WIDTH (it, area);
 +    }
 +}
 +#endif
  
  /* Append a stretch glyph to IT->glyph_row.  OBJECT is the source
     of the glyph, WIDTH and HEIGHT are the width and height of the
@@@ -27248,10 -26990,6 +27239,10 @@@ x_produce_glyphs (struct it *it
      produce_image_glyph (it);
    else if (it->what == IT_STRETCH)
      produce_stretch_glyph (it);
 +#ifdef HAVE_XWIDGETS
 +  else if (it->what == IT_XWIDGET)
 +    produce_xwidget_glyph (it);
 +#endif
  
   done:
    /* Accumulate dimensions.  Note: can't assume that it->descent > 0
@@@ -27621,13 -27359,6 +27612,13 @@@ get_window_cursor_type (struct window *
    /* Use normal cursor if not blinked off.  */
    if (!w->cursor_off_p)
      {
 +
 +#ifdef HAVE_XWIDGETS
 +      if (glyph != NULL && glyph->type == XWIDGET_GLYPH){
 +        //printf("attempt xwidget cursor avoidance in get_window_cursor_type\n");
 +        return NO_CURSOR;
 +      }
 +#endif
        if (glyph != NULL && glyph->type == IMAGE_GLYPH)
        {
          if (cursor_type == FILLED_BOX_CURSOR)