初始化 xkb 扩展

This commit is contained in:
2025-11-22 22:59:15 +08:00
parent e5927094d1
commit 2df0b58cb0
13 changed files with 365 additions and 18 deletions

View File

@@ -12,6 +12,7 @@
#include "types.h"
#include "utils.h"
#include "wm.h"
#include "xkb.h"
static void button_press(xcb_button_press_event_t *ev) {
click_area_t click_area = click_none;
@@ -64,13 +65,18 @@ static void handle_xcb_event(xcb_generic_event_t *event) {
#define EVENT(type, callback) \
case type: \
callback((void *)event); \
break
return
EVENT(XCB_BUTTON_PRESS, button_press);
EVENT(XCB_KEY_PRESS, key_press);
#undef EVENT
}
/* 处理 XKB 事件 */
if (wm.event_base_xkb != 0 && event_type == wm.event_base_xkb) {
xkb_handle_event(event);
}
}
static gboolean xcb_event_loop(GIOChannel *channel, GIOCondition condition,