- if (cursor_visible) return;
-
- long x = text->cursor.x;
-
- long y1 = max(text->cursor.y -
- text->real_current_font.maxAscent() - first, 0L);
-
- long y2 = min(text->cursor.y +
- text->real_current_font.maxDescent() - first,
- long(owner.height()));
-
- // Secure against very strange situations
- if (y2 < y1) y2 = y1;
-
- if (cursor_pixmap){
- XFreePixmap(fl_display, cursor_pixmap);
- cursor_pixmap = 0;
- }
-
- if (y2 > 0 && y1 < owner.height()) {
- cursor_pixmap_w = 1;
- cursor_pixmap_h = y2 - y1 + 1;
- cursor_pixmap_x = x;
- cursor_pixmap_y = y1;
- cursor_pixmap =
- XCreatePixmap(fl_display,
- fl_root,
- cursor_pixmap_w,
- cursor_pixmap_h,
- fl_get_visual_depth());
- XCopyArea(fl_display,
- owner.getWin(),
- cursor_pixmap,
- gc_copy,
- owner.xpos() + cursor_pixmap_x,
- owner.ypos() + cursor_pixmap_y,
- cursor_pixmap_w, cursor_pixmap_h,
- 0, 0);
- XDrawLine(fl_display,
- owner.getWin(),
- gc_copy,
- x + owner.xpos(),
- y1 + owner.ypos(),
- x + owner.xpos(),
- y2 + owner.ypos());
- cursor_visible = true;
+ if (!cursor_visible) {
+ Cursor_Shape shape = BAR_SHAPE;
+ if (text->real_current_font.language() !=
+ bv->buffer()->params.language
+ || text->real_current_font.isVisibleRightToLeft()
+ != bv->buffer()->params.language->RightToLeft())
+ shape = (text->real_current_font.isVisibleRightToLeft())
+ ? REVERSED_L_SHAPE : L_SHAPE;
+ ShowManualCursor(text, text->cursor.x(), text->cursor.y(),
+ lyxfont::maxAscent(text->real_current_font),
+ lyxfont::maxDescent(text->real_current_font),
+ shape);