diff --git a/docs/changelog.rst b/docs/changelog.rst index 3d86107c2..b0249e56a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -69,9 +69,9 @@ Detailed list of changes - kitty keyboard protocol: Specify the behavior of the modifier bits during modifier key events (:iss:`6913`) -- Wayland: Enable support for the new cursor-shape protocol so that the mouse - cursor is always rendered at the correct size in compositors that support - this protocol (:iss:`6914`) +- Wayland: Enable support for the new cursor-shape protocol so that the mouse cursor is always rendered at the correct size in compositors that support this protocol (:iss:`6914`) + +- GNOME Wayland: Fix remembered window size smaller than actual size (:iss:`6946`) 0.31.0 [2023-11-08] diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index 0d17994b2..710ab1972 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -1089,6 +1089,10 @@ close_os_window(ChildMonitor *self, OSWindow *os_window) { if (os_window->before_fullscreen.is_set && is_os_window_fullscreen(os_window)) { w = os_window->before_fullscreen.w; h = os_window->before_fullscreen.h; } + // On GNOME Wayland w, h are the content area size, we need to add the frame size back + int content_area_width, content_area_height; + adjust_window_size_for_csd(os_window, w, h, &content_area_width, &content_area_height); + w += w - content_area_width; h += h - content_area_height; destroy_os_window(os_window); call_boss(on_os_window_closed, "Kii", os_window->id, w, h); for (size_t t=0; t < os_window->num_tabs; t++) { diff --git a/kitty/glfw.c b/kitty/glfw.c index 3e55723b0..faaf385d3 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -116,7 +116,7 @@ min_size_for_os_window(OSWindow *window, int *min_width, int *min_height) { } -static void +void adjust_window_size_for_csd(OSWindow *w, int width, int height, int *adjusted_width, int *adjusted_height) { *adjusted_width = width; *adjusted_height = height; if (global_state.is_wayland) { diff --git a/kitty/state.h b/kitty/state.h index a66630763..17feb3f91 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -391,3 +391,4 @@ void update_menu_bar_title(PyObject *title UNUSED); void change_live_resize_state(OSWindow*, bool); bool render_os_window(OSWindow *w, monotonic_t now, bool ignore_render_frames, bool scan_for_animated_images); void update_mouse_pointer_shape(void); +void adjust_window_size_for_csd(OSWindow *w, int width, int height, int *adjusted_width, int *adjusted_height);