fix(core/window): 添加设置窗口 floating 状态的限制条件
- 不能取消 fixed_size 和 sticky 状态窗口的 floating 状态 - 简化 window_need_layout 中浮动窗口不参加自动布局判断逻辑
This commit is contained in:
@@ -43,6 +43,8 @@ void window_set_geometry_mode(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void window_set_floating(window_t *window, bool floating) {
|
void window_set_floating(window_t *window, bool floating) {
|
||||||
|
if (!floating && (window->fixed_size || window->sticky)) return;
|
||||||
|
|
||||||
window->floating = floating;
|
window->floating = floating;
|
||||||
if (floating) window->float_rect = window->frame_rect;
|
if (floating) window->float_rect = window->frame_rect;
|
||||||
}
|
}
|
||||||
@@ -121,9 +123,7 @@ void window_take_metadata(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool window_need_layout(const window_t *window) {
|
bool window_need_layout(const window_t *window) {
|
||||||
if (window->sticky || window->floating) {
|
if (window->floating) return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (window->geometry_mode) {
|
switch (window->geometry_mode) {
|
||||||
case ZDWM_GEOMETRY_FULLSCREEN:
|
case ZDWM_GEOMETRY_FULLSCREEN:
|
||||||
|
|||||||
Reference in New Issue
Block a user