Fix updating panel configuration on visibility toggle and via remote control not working

Fixes #8984
This commit is contained in:
Kovid Goyal 2025-09-20 05:15:50 +05:30
parent 1672110854
commit e7514c68ae
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 6 additions and 9 deletions

View file

@ -170,6 +170,9 @@ Detailed list of changes
- Fix rendering of underlines when using larger text sizes with the space and
en-space characters (:iss:`8950`)
- Fix updating panel configuration on visibility toggle and via remote control
not working (:iss:`8984`)
- Wayland: Update bundled copy of libwayland to 1.24 from 1.23.1 because the
just released mesa 25.2.0 breaks with libwayland < 1.24 (:iss:`8884`)

View file

@ -25,6 +25,7 @@
GLFW_LAYER_SHELL_OVERLAY,
GLFW_LAYER_SHELL_PANEL,
GLFW_LAYER_SHELL_TOP,
layer_shell_config_for_os_window,
set_layer_shell_config,
toggle_os_window_visibility,
)
@ -110,7 +111,6 @@ def have_config_files_been_updated(config_files: Iterable[str]) -> bool:
def handle_single_instance_command(boss: BossType, sys_args: Sequence[str], environ: Mapping[str, str], notify_on_os_window_death: str | None = '') -> None:
global args
from kitty.cli import parse_override
from kitty.main import run_app
from kitty.tabs import SpecialWindow
try:
new_args, items = parse_panel_args(list(sys_args[1:]))
@ -118,17 +118,17 @@ def handle_single_instance_command(boss: BossType, sys_args: Sequence[str], envi
log_error(f'Invalid arguments received over single instance socket: {sys_args} with error: {e}')
return
lsc = layer_shell_config(new_args)
layer_shell_config_changed = lsc != run_app.layer_shell_config
config_changed = have_config_files_been_updated(new_args.config) or args.config != new_args.config or args.override != new_args.override
args = new_args
if config_changed:
boss.load_config_file(*args.config, overrides=tuple(map(parse_override, new_args.override)))
if args.toggle_visibility and boss.os_window_map:
for os_window_id in boss.os_window_map:
existing = layer_shell_config_for_os_window(os_window_id)
layer_shell_config_changed = not existing or any(f for f in lsc._fields if getattr(lsc, f) != existing.get(f))
toggle_os_window_visibility(os_window_id)
if layer_shell_config_changed:
set_layer_shell_config(os_window_id, lsc)
run_app.layer_shell_config = lsc
return
items = items or [kitten_exe(), 'run-shell']
os_window_id = boss.add_os_panel(lsc, args.cls, args.name)

View file

@ -2566,18 +2566,12 @@ toggle_os_window_visibility(PyObject *self UNUSED, PyObject *args) {
static PyObject*
layer_shell_config_for_os_window(PyObject *self UNUSED, PyObject *wid) {
if (!PyLong_Check(wid)) { PyErr_SetString(PyExc_TypeError, "os_window_id must be a int"); return NULL; }
#ifdef __APPLE__
(void)layer_shell_config_to_python;
Py_RETURN_NONE;
#else
if (!global_state.is_wayland) Py_RETURN_NONE;
id_type id = PyLong_AsUnsignedLongLong(wid);
OSWindow *w = os_window_for_id(id);
if (!w || !w->handle) Py_RETURN_NONE;
const GLFWLayerShellConfig *c = glfwGetLayerShellConfig(w->handle);
if (!c) Py_RETURN_NONE;
return layer_shell_config_to_python(c);
#endif
}
static PyObject*