feat(backend): 添加光标支持

This commit is contained in:
2026-06-19 17:12:08 +08:00
parent 090266baa5
commit 7a47f4d44d
7 changed files with 99 additions and 2 deletions

View File

@@ -18,6 +18,7 @@
#include <xcb/xproto.h>
#include "backend/output_utils.h"
#include "backend/x11/cursor.h"
#include "backend/x11/window.h"
#include "base/app.h"
#include "base/array.h"
@@ -184,10 +185,13 @@ backend_t *backend_create(const char *display_name) {
backend->key_symbols = xcb_key_symbols_alloc(conn);
cursor_init(backend);
atoms_init(backend);
create_wm_check_window(backend);
create_no_focus_window(backend);
window_change_cursor(backend, root, ZDWM_CURSOR_NORMAL);
return backend;
}
@@ -204,6 +208,8 @@ void backend_destroy(backend_t *backend) {
xcb_key_symbols_free(backend->key_symbols);
backend->key_symbols = nullptr;
cursor_cleanup(backend);
xcb_disconnect(backend->conn);
backend->conn = nullptr;
free(backend);