- long x = 0;
- long y1 = 0;
- long y2 = 0;
-
- if (cursor_visible) return;
-
- x = text->cursor.x;
-
- y1 = text->cursor.y - text->real_current_font.maxAscent() - first;
- if (y1 < 0) y1 = 0;
-
- y2 = text->cursor.y + text->real_current_font.maxDescent() - first;
- if (y2 > _height) y2 = _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 < _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,
- _window,
- cursor_pixmap,
- gc_copy,
- _offset_x + cursor_pixmap_x,
- _offset_y + cursor_pixmap_y,
- cursor_pixmap_w, cursor_pixmap_h,
- 0, 0);
- XDrawLine(fl_display,
- _window, gc_copy,
- x + _offset_x,
- y1 + _offset_y,
- x + _offset_x,
- y2 + _offset_y);
- 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);