diff --git a/docs/changelog.rst b/docs/changelog.rst index 6bae033dc..2df4c7019 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -135,6 +135,9 @@ To update |kitty|, :doc:`follow the instructions `. - A new mappable action to close windows with a confirmation (:iss:`4195`) +- When remembering OS window sizes for full screen windows use the size before + the window became fullscreen (:iss:`4221`) + 0.23.1 [2021-08-17] ---------------------- diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index afb122c89..b386c7e20 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -929,8 +929,13 @@ process_pending_resizes(monotonic_t now) { static void close_os_window(ChildMonitor *self, OSWindow *os_window) { + int w = os_window->window_width, h = os_window->window_height; + if (os_window->before_fullscreen.is_set && is_os_window_fullscreen(os_window)) { + printf("11111111111111 w=%d h=%d bw: %d bh: %d\n", w, h, os_window->before_fullscreen.w, os_window->before_fullscreen.h); + w = os_window->before_fullscreen.w; h = os_window->before_fullscreen.h; + } destroy_os_window(os_window); - call_boss(on_os_window_closed, "Kii", os_window->id, os_window->window_width, os_window->window_height); + call_boss(on_os_window_closed, "Kii", os_window->id, w, h); for (size_t t=0; t < os_window->num_tabs; t++) { Tab *tab = os_window->tabs + t; for (size_t w = 0; w < tab->num_windows; w++) mark_child_for_close(self, tab->windows[w].id); diff --git a/kitty/os_window_size.py b/kitty/os_window_size.py index bcdd9d559..ad1c20503 100644 --- a/kitty/os_window_size.py +++ b/kitty/os_window_size.py @@ -31,6 +31,7 @@ class WindowSizeData(NamedTuple): def initial_window_size_func(opts: WindowSizeData, cached_values: Dict[str, Any]) -> Callable[[int, int, float, float, float, float], Tuple[int, int]]: + print(cached_values) if 'window-size' in cached_values and opts.remember_window_size: ws = cached_values['window-size'] try: