Fix cursor blinking problem
The problem was that when the editor had no events the cursor was not blinking because the event loop was blocking on wait_event. Now we no longer calls wait_event without a timeout if the windows has the focus. When the window has the focus the timeout is set to 1 / fps so that the cursor can blinks. In addition we react to the "focus lost" event to ensure the documents are redrawn without the cursor.
This commit is contained in:
@@ -504,6 +504,11 @@ function RootView:on_text_input(...)
|
||||
end
|
||||
|
||||
|
||||
function RootView:on_focus_lost(...)
|
||||
-- We force a redraw so documents can redraw without the cursor.
|
||||
core.redraw = true
|
||||
end
|
||||
|
||||
function RootView:update()
|
||||
copy_position_and_size(self.root_node, self)
|
||||
self.root_node:update()
|
||||
|
||||
Reference in New Issue
Block a user