From c1a4795a85396429ee90f8fe9bb676b56b09977e Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Thu, 7 May 2026 04:11:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(state):=20=E5=88=9D=E5=A7=8B=E5=8C=96=20fl?= =?UTF-8?q?oat=5Frect=20=E5=B9=B6=E5=9C=A8=E5=88=87=E6=8D=A2=20floating=20?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=97=B6=E5=8F=8C=E5=90=91=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/state.c | 1 + src/core/window.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/state.c b/src/core/state.c index ab37056..a80a6e2 100644 --- a/src/core/state.c +++ b/src/core/state.c @@ -355,6 +355,7 @@ const window_t *state_window_add(state_t *state, const window_info_t *info) { window_set_urgent(window, info->urgent); window_set_fixed_size(window, info->fixed_size); window_set_frame_rect(window, info->frame_rect); + window_set_float_rect(window, info->frame_rect); window_set_title(window, info->title); window_set_app_id(window, info->app_id); window_set_role(window, info->role); diff --git a/src/core/window.c b/src/core/window.c index 3f66a01..054e19d 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -54,7 +54,8 @@ void window_set_floating(window_t *window, bool floating) { if (floating == window->floating) return; window->floating = floating; - if (floating) window->float_rect = window->frame_rect; + if (floating) window_set_frame_rect(window, window->float_rect); + else window_set_float_rect(window, window->frame_rect); } void window_set_sticky(window_t *window, bool sticky) {