When reloading config also reload all GPU data
Fixes some config options such as text_composition_strategy not being reloaded.
This commit is contained in:
parent
0616f9e077
commit
bf79940a13
@ -2371,7 +2371,7 @@ class Boss:
|
||||
# Update colors
|
||||
for w in self.all_windows:
|
||||
self.default_bg_changed_for(w.id)
|
||||
w.refresh()
|
||||
w.refresh(reload_all_gpu_data=True)
|
||||
self.prewarm.reload_kitty_config()
|
||||
|
||||
@ac('misc', '''
|
||||
|
||||
@ -1105,6 +1105,9 @@ class Screen:
|
||||
def mark_as_dirty(self) -> None:
|
||||
pass
|
||||
|
||||
def reload_all_gpu_data(self) -> None:
|
||||
pass
|
||||
|
||||
def resize(self, width: int, height: int) -> None:
|
||||
pass
|
||||
|
||||
|
||||
@ -3789,6 +3789,13 @@ mark_as_dirty(Screen *self, PyObject *a UNUSED) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject*
|
||||
reload_all_gpu_data(Screen *self, PyObject *a UNUSED) {
|
||||
self->reload_all_gpu_data = true;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
static PyObject*
|
||||
current_char_width(Screen *self, PyObject *a UNUSED) {
|
||||
#define current_char_width_doc "The width of the character under the cursor"
|
||||
@ -4154,6 +4161,7 @@ static PyMethodDef methods[] = {
|
||||
{"clear_selection", (PyCFunction)clear_selection_, METH_NOARGS, ""},
|
||||
MND(reverse_index, METH_NOARGS)
|
||||
MND(mark_as_dirty, METH_NOARGS)
|
||||
MND(reload_all_gpu_data, METH_NOARGS)
|
||||
MND(resize, METH_VARARGS)
|
||||
MND(ignore_bells_for, METH_VARARGS)
|
||||
MND(set_margins, METH_VARARGS)
|
||||
|
||||
@ -816,8 +816,10 @@ class Window:
|
||||
if val:
|
||||
self.refresh()
|
||||
|
||||
def refresh(self) -> None:
|
||||
def refresh(self, reload_all_gpu_data: bool = False) -> None:
|
||||
self.screen.mark_as_dirty()
|
||||
if reload_all_gpu_data:
|
||||
self.screen.reload_all_gpu_data()
|
||||
wakeup_io_loop()
|
||||
wakeup_main_loop()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user