Commit ef201067 authored by Kevin Wolf's avatar Kevin Wolf

vterm: Cursor beim Scrollen aktualisieren

! vterm: Wenn man scrollt, dann soll der Cursor nicht physisch an
  derselben Stelle bleiben, sondern nur logisch, d.h. er wandert mit.
  Wenn man so weit scrollt, dass der Cursor nicht mehr auf dem
  Bildschirm ist, muss der Textmodus-Cursor komplett deaktiviert werden.
Signed-off-by: Kevin Wolf's avatarKevin Wolf <kevin@tyndur.org>
parent a78a5518
......@@ -263,12 +263,22 @@ bool screen_position(vterm_output_t* out, position_t buffer_pos,
*/
static void screen_cursor_update(vterm_output_t* out)
{
static bool cursor_enabled = false;
uint16_t position = 0;
position_t pos;
// Position errechnen
if (screen_position(out, out->buffer_pos, &pos) == true) {
position = pos.line * out->screen_width + pos.column;
if (!cursor_enabled) {
outb(PORT_HW_CURSOR, 10);
outb(PORT_HW_CURSOR + 1, 0x4e);
cursor_enabled = true;
}
} else if (cursor_enabled) {
outb(PORT_HW_CURSOR, 10);
outb(PORT_HW_CURSOR + 1, 0x20);
cursor_enabled = false;
}
// Hardware Cursor verschieben
......@@ -340,6 +350,7 @@ void screen_scroll(vterm_output_t* out, int lines)
// out->screen_redraw = true;
if (out->active) {
screen_draw(out);
screen_cursor_update(out);
}
}
......
Markdown is supported
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