refactor(core): 提取 window 相关类型和操作到独立模块

This commit is contained in:
2026-04-20 00:20:04 +08:00
parent a7225836e4
commit fd843dc826
12 changed files with 228 additions and 179 deletions

View File

@@ -5,7 +5,6 @@
#include "base/array.h"
#include "base/memory.h"
#include "core/types.h"
#include "core/window.h"
void layer_stack_cleanup(layer_stack_t *layer) {
p_delete(&layer->order);
@@ -87,17 +86,3 @@ bool layer_stack_lower(layer_stack_t *layer, window_id_t window) {
return true;
}
layer_type_t layer_classify(const window_layer_props_t *props) {
for (size_t i = 0; i < props->type_count; ++i) {
window_type_t type = props->types[i];
if (type == ZDWM_WINDOW_TYPE_NOTIFICATION) return ZDWM_WINDOW_LAYER_OVERLAY;
}
for (size_t i = 0; i < props->state_count; ++i) {
window_state_t state = props->states[i];
if (state == ZDWM_WINDOW_STATE_ABOVE) return ZDWM_WINDOW_LAYER_TOP;
}
return ZDWM_WINDOW_LAYER_NORMAL;
}