Avoid flicker when starting kittens such as the hints kitten

Fixes #4674
This commit is contained in:
Kovid Goyal
2022-03-23 15:55:11 +05:30
parent 1837168b0b
commit 6dc1617429
14 changed files with 86 additions and 18 deletions

View File

@@ -206,18 +206,23 @@ class HandleResult:
type_of_input: Optional[str] = None
no_ui: bool = False
def __init__(self, impl: Callable[..., Any], type_of_input: Optional[str], no_ui: bool):
def __init__(self, impl: Callable[..., Any], type_of_input: Optional[str], no_ui: bool, has_ready_notification: bool):
self.impl = impl
self.no_ui = no_ui
self.type_of_input = type_of_input
self.has_ready_notification = has_ready_notification
def __call__(self, args: Sequence[str], data: Any, target_window_id: int, boss: BossType) -> Any:
return self.impl(args, data, target_window_id, boss)
def result_handler(type_of_input: Optional[str] = None, no_ui: bool = False) -> Callable[[Callable[..., Any]], HandleResult]:
def result_handler(
type_of_input: Optional[str] = None,
no_ui: bool = False,
has_ready_notification: bool = False
) -> Callable[[Callable[..., Any]], HandleResult]:
def wrapper(impl: Callable[..., Any]) -> HandleResult:
return HandleResult(impl, type_of_input, no_ui)
return HandleResult(impl, type_of_input, no_ui, has_ready_notification)
return wrapper

View File

@@ -413,6 +413,11 @@ def restore_colors() -> str:
return '\x1b[#Q'
@cmd
def overlay_ready() -> str:
return '\x1bP@kitty-overlay-ready|\x1b\\'
@cmd
def write_to_clipboard(data: Union[str, bytes], use_primary: bool = False) -> str:
from base64 import standard_b64encode