From e3411670cb7ba7c44d1ab6e27a69fa61fd46b2f2 Mon Sep 17 00:00:00 2001 From: joevt Date: Wed, 20 Mar 2024 04:38:01 -0700 Subject: [PATCH] videoctrl: Add cursor_dirty flag. If the flag is set when it comes time to draw the cursor again, then call setup_hw_cursor to update the cursor before drawing the cursor. --- devices/video/videoctrl.cpp | 4 ++++ devices/video/videoctrl.h | 1 + 2 files changed, 5 insertions(+) diff --git a/devices/video/videoctrl.cpp b/devices/video/videoctrl.cpp index 71151f1..988d20f 100644 --- a/devices/video/videoctrl.cpp +++ b/devices/video/videoctrl.cpp @@ -75,6 +75,10 @@ void VideoCtrlBase::update_screen() } if (draw_fb) { + if (this->cursor_dirty) { + this->setup_hw_cursor(); + this->cursor_dirty = false; + } this->display.update( this->convert_fb_cb, this->cursor_ovl_cb, this->cursor_on, cursor_x, cursor_y); diff --git a/devices/video/videoctrl.h b/devices/video/videoctrl.h index 855d6de..05f8458 100644 --- a/devices/video/videoctrl.h +++ b/devices/video/videoctrl.h @@ -75,6 +75,7 @@ protected: bool crtc_on = false; bool blank_on = true; bool cursor_on = false; + bool cursor_dirty = false; int active_width; // width of the visible display area int active_height; // height of the visible display area int hori_total = 0;