Skip to content

Commit e7514c6

Browse files
committed
Fix updating panel configuration on visibility toggle and via remote control not working
Fixes #8984
1 parent 1672110 commit e7514c6

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

docs/changelog.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ Detailed list of changes
170170
- Fix rendering of underlines when using larger text sizes with the space and
171171
en-space characters (:iss:`8950`)
172172

173+
- Fix updating panel configuration on visibility toggle and via remote control
174+
not working (:iss:`8984`)
175+
173176
- Wayland: Update bundled copy of libwayland to 1.24 from 1.23.1 because the
174177
just released mesa 25.2.0 breaks with libwayland < 1.24 (:iss:`8884`)
175178

kittens/panel/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
GLFW_LAYER_SHELL_OVERLAY,
2626
GLFW_LAYER_SHELL_PANEL,
2727
GLFW_LAYER_SHELL_TOP,
28+
layer_shell_config_for_os_window,
2829
set_layer_shell_config,
2930
toggle_os_window_visibility,
3031
)
@@ -110,25 +111,24 @@ def have_config_files_been_updated(config_files: Iterable[str]) -> bool:
110111
def handle_single_instance_command(boss: BossType, sys_args: Sequence[str], environ: Mapping[str, str], notify_on_os_window_death: str | None = '') -> None:
111112
global args
112113
from kitty.cli import parse_override
113-
from kitty.main import run_app
114114
from kitty.tabs import SpecialWindow
115115
try:
116116
new_args, items = parse_panel_args(list(sys_args[1:]))
117117
except BaseException as e:
118118
log_error(f'Invalid arguments received over single instance socket: {sys_args} with error: {e}')
119119
return
120120
lsc = layer_shell_config(new_args)
121-
layer_shell_config_changed = lsc != run_app.layer_shell_config
122121
config_changed = have_config_files_been_updated(new_args.config) or args.config != new_args.config or args.override != new_args.override
123122
args = new_args
124123
if config_changed:
125124
boss.load_config_file(*args.config, overrides=tuple(map(parse_override, new_args.override)))
126125
if args.toggle_visibility and boss.os_window_map:
127126
for os_window_id in boss.os_window_map:
127+
existing = layer_shell_config_for_os_window(os_window_id)
128+
layer_shell_config_changed = not existing or any(f for f in lsc._fields if getattr(lsc, f) != existing.get(f))
128129
toggle_os_window_visibility(os_window_id)
129130
if layer_shell_config_changed:
130131
set_layer_shell_config(os_window_id, lsc)
131-
run_app.layer_shell_config = lsc
132132
return
133133
items = items or [kitten_exe(), 'run-shell']
134134
os_window_id = boss.add_os_panel(lsc, args.cls, args.name)

kitty/glfw.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,18 +2566,12 @@ toggle_os_window_visibility(PyObject *self UNUSED, PyObject *args) {
25662566
static PyObject*
25672567
layer_shell_config_for_os_window(PyObject *self UNUSED, PyObject *wid) {
25682568
if (!PyLong_Check(wid)) { PyErr_SetString(PyExc_TypeError, "os_window_id must be a int"); return NULL; }
2569-
#ifdef __APPLE__
2570-
(void)layer_shell_config_to_python;
2571-
Py_RETURN_NONE;
2572-
#else
2573-
if (!global_state.is_wayland) Py_RETURN_NONE;
25742569
id_type id = PyLong_AsUnsignedLongLong(wid);
25752570
OSWindow *w = os_window_for_id(id);
25762571
if (!w || !w->handle) Py_RETURN_NONE;
25772572
const GLFWLayerShellConfig *c = glfwGetLayerShellConfig(w->handle);
25782573
if (!c) Py_RETURN_NONE;
25792574
return layer_shell_config_to_python(c);
2580-
#endif
25812575
}
25822576

25832577
static PyObject*

0 commit comments

Comments
 (0)