feat(backend): 添加光标支持
This commit is contained in:
@@ -3,10 +3,12 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <xcb/xcb.h>
|
||||
#include <xcb/xcb_aux.h>
|
||||
#include <xcb/xcb_icccm.h>
|
||||
#include <xcb/xcb_keysyms.h>
|
||||
#include <xcb/xproto.h>
|
||||
|
||||
#include "backend/x11/cursor.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory.h"
|
||||
#include "core/backend.h"
|
||||
@@ -451,3 +453,13 @@ visual_t *window_get_visual(backend_t *backend, bool prefer_alpha) {
|
||||
|
||||
return visual;
|
||||
}
|
||||
|
||||
void window_change_cursor(
|
||||
backend_t *backend,
|
||||
xcb_window_t window,
|
||||
cursor_t cursor
|
||||
) {
|
||||
auto conn = backend->conn;
|
||||
xcb_params_cw_t params = {.cursor = cursor_get_xcb_cursor(backend, cursor)};
|
||||
xcb_aux_change_window_attributes(conn, window, XCB_CW_CURSOR, ¶ms);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user