mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-12 09:20:36 +00:00
LibWeb: Don't paint a text cursor in unfocused frames
This commit is contained in:
parent
be76abfdb3
commit
9bdd8ec3f3
Notes:
sideshowbarker
2024-07-19 03:39:20 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9bdd8ec3f33
2 changed files with 5 additions and 0 deletions
|
@ -108,6 +108,9 @@ void LayoutText::paint_fragment(PaintContext& context, const LineBoxFragment& fr
|
|||
|
||||
void LayoutText::paint_cursor_if_needed(PaintContext& context, const LineBoxFragment& fragment) const
|
||||
{
|
||||
if (!frame().is_focused_frame())
|
||||
return;
|
||||
|
||||
if (!frame().cursor_blink_state())
|
||||
return;
|
||||
|
||||
|
|
|
@ -61,6 +61,8 @@ Frame::~Frame()
|
|||
void Frame::setup()
|
||||
{
|
||||
m_cursor_blink_timer = Core::Timer::construct(500, [this] {
|
||||
if (!is_focused_frame())
|
||||
return;
|
||||
if (m_cursor_position.node() && m_cursor_position.node()->layout_node()) {
|
||||
m_cursor_blink_state = !m_cursor_blink_state;
|
||||
m_cursor_position.node()->layout_node()->set_needs_display();
|
||||
|
|
Loading…
Reference in a new issue