1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 14:55:08 +00:00

LibWeb: Restart the cursor blink cycle whenever the user edits content

Having the text cursor disappear during rapid continuous editing is
quite jarring, so let's make sure we always restart the blink cycle
whenever the user performs some kind of editing action in a frame.
This commit is contained in:
Andreas Kling 2021-01-04 20:48:27 +01:00
parent 901ef3f1c8
commit ce2894c95b
3 changed files with 14 additions and 0 deletions

View file

@ -70,6 +70,14 @@ void Frame::setup()
});
}
void Frame::did_edit(Badge<EditEventHandler>)
{
// The user has edited the content, restart the cursor blink cycle so that
// the cursor doesn't disappear during rapid continuous editing.
m_cursor_blink_state = true;
m_cursor_blink_timer->restart();
}
bool Frame::is_focused_frame() const
{
return m_page && &m_page->focused_frame() == this;