Dont crash when user attempts to resize panel via remote control

Fixes #8550
This commit is contained in:
Kovid Goyal 2025-04-20 15:19:35 +05:30
parent ef2713a5bd
commit e2cf1e9185
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 29 additions and 1 deletions

5
glfw/wl_window.c vendored
View file

@ -1553,6 +1553,11 @@ void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
{
if (is_layer_shell(window)) {
_glfwInputError(GLFW_FEATURE_UNAVAILABLE,
"Wayland: Resizing of layer shell surfaces is not supported");
return;
}
if (width != window->wl.width || height != window->wl.height) {
window->wl.user_requested_content_size.width = width;
window->wl.user_requested_content_size.height = height;

View file

@ -211,7 +211,16 @@ def set_cocoa_global_shortcuts(opts: Options) -> dict[str, SingleKey]:
return global_shortcuts
_is_panel_kitten = False
def is_panel_kitten() -> bool:
return _is_panel_kitten
def _run_app(opts: Options, args: CLIOptions, bad_lines: Sequence[BadLine] = (), talk_fd: int = -1) -> None:
global _is_panel_kitten
_is_panel_kitten = run_app.cached_values_name == 'panel'
if is_macos:
global_shortcuts = set_cocoa_global_shortcuts(opts)
if opts.macos_custom_beam_cursor:

View file

@ -3,7 +3,18 @@
from typing import TYPE_CHECKING
from .base import MATCH_WINDOW_OPTION, ArgsType, Boss, PayloadGetType, PayloadType, RCOptions, RemoteCommand, ResponseType, Window
from .base import (
MATCH_WINDOW_OPTION,
ArgsType,
Boss,
PayloadGetType,
PayloadType,
RCOptions,
RemoteCommand,
RemoteControlErrorWithoutTraceback,
ResponseType,
Window,
)
if TYPE_CHECKING:
from kitty.cli_stub import ResizeOSWindowRCOptions as CLIOptions
@ -77,6 +88,9 @@ using this option means that you will not be notified of failures.
}
def response_from_kitty(self, boss: Boss, window: Window | None, payload_get: PayloadGetType) -> ResponseType:
from kitty.main import is_panel_kitten
if is_panel_kitten():
raise RemoteControlErrorWithoutTraceback('Resizing of panels created by the panel kitten is not supported')
windows = self.windows_for_match_payload(boss, window, payload_get)
if windows:
ac = payload_get('action')