mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 22:44:50 +02:00
More robust blink control based on window focus state
This commit is contained in:
@@ -293,10 +293,6 @@ class Boss(Thread):
|
||||
if w is not None:
|
||||
yield w
|
||||
w.focus_changed(focused)
|
||||
if focused:
|
||||
self.start_cursor_blink()
|
||||
else:
|
||||
self.stop_cursor_blinking()
|
||||
|
||||
def display_scrollback(self, data):
|
||||
if self.opts.scrollback_in_new_tab:
|
||||
@@ -405,7 +401,7 @@ class Boss(Thread):
|
||||
rd = render_data.get(active)
|
||||
if rd is not None:
|
||||
draw_cursor = True
|
||||
if self.cursor_blinking and self.opts.cursor_blink_interval > 0:
|
||||
if self.cursor_blinking and self.opts.cursor_blink_interval > 0 and self.window_is_focused:
|
||||
now = monotonic() - self.cursor_blink_zero_time
|
||||
t = int(now * 1000)
|
||||
d = int(self.opts.cursor_blink_interval * 1000)
|
||||
|
||||
@@ -481,8 +481,5 @@ class CharGrid:
|
||||
glUniform4f(ul('color'), col[0], col[1], col[2], alpha)
|
||||
glUniform2f(ul('xpos'), left, right)
|
||||
glUniform2f(ul('ypos'), top, bottom)
|
||||
if is_focused:
|
||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4)
|
||||
else:
|
||||
glDrawArrays(GL_LINE_LOOP, 0, 4)
|
||||
glDrawArrays(GL_TRIANGLE_FAN if is_focused else GL_LINE_LOOP, 0, 4)
|
||||
glDisable(GL_BLEND)
|
||||
|
||||
Reference in New Issue
Block a user