Commit cdb7f520 authored by Waldo Bastian's avatar Waldo Bastian
Browse files

Properly set XIM position.

Patch by Takumi ASAKI <asataku@osk3.3web.ne.jp>

svn path=/trunk/kdebase/konsole/; revision=137904
parent 95ed0324
......@@ -413,6 +413,22 @@ void TEWidget::drawAttrStr(QPainter &paint, QRect rect,
}
}
/*!
Set XIM Position
*/
void TEWidget::setCursorPos(const int curx, const int cury)
{
QPoint tL = contentsRect().topLeft();
int tLx = tL.x();
int tLy = tL.y();
int xpos, ypos;
ypos = bY + tLy + font_h*(cury-1) + font_a;
xpos = bX + tLx + font_w*curx;
setMicroFocusHint(xpos, ypos, 0, font_h);
// fprintf(stderr, "x/y = %d/%d\txpos/ypos = %d/%d\n", curx, cury, xpos, ypos);
}
/*!
The image can only be set completely.
......
......@@ -64,6 +64,8 @@ public:
void setImage(const ca* const newimg, int lines, int columns);
void setLineWrapped(QBitArray line_wrapped) { m_line_wrapped=line_wrapped; }
void setCursorPos(const int curx, const int cury);
int Lines() { return lines; }
int Columns() { return columns; }
......
......@@ -382,6 +382,7 @@ void TEmulation::showBulk()
gui->setImage(image,
scr->getLines(),
scr->getColumns()); // actual refresh
gui->setCursorPos(scr->getCursorX(), scr->getCursorY()); // set XIM position
free(image);
//FIXME: check that we do not trigger other draw event here.
gui->setLineWrapped( scr->getCookedLineWrapped() );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment