feat(state): 初始化 float_rect 并在切换 floating 状态时双向同步
This commit is contained in:
@@ -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_urgent(window, info->urgent);
|
||||||
window_set_fixed_size(window, info->fixed_size);
|
window_set_fixed_size(window, info->fixed_size);
|
||||||
window_set_frame_rect(window, info->frame_rect);
|
window_set_frame_rect(window, info->frame_rect);
|
||||||
|
window_set_float_rect(window, info->frame_rect);
|
||||||
window_set_title(window, info->title);
|
window_set_title(window, info->title);
|
||||||
window_set_app_id(window, info->app_id);
|
window_set_app_id(window, info->app_id);
|
||||||
window_set_role(window, info->role);
|
window_set_role(window, info->role);
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ void window_set_floating(window_t *window, bool floating) {
|
|||||||
if (floating == window->floating) return;
|
if (floating == window->floating) return;
|
||||||
|
|
||||||
window->floating = floating;
|
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) {
|
void window_set_sticky(window_t *window, bool sticky) {
|
||||||
|
|||||||
Reference in New Issue
Block a user