处理焦点相关事件

This commit is contained in:
2025-08-24 08:46:17 +08:00
parent 25ef44e5f9
commit 7eea0ee2d3
12 changed files with 341 additions and 106 deletions

View File

@@ -48,6 +48,7 @@ void map_window(xcb_window_t window);
char *get_window_name(xcb_window_t window);
void init_window_event_mask(xcb_window_t window);
void change_window_border_color(xcb_window_t window, uint32_t argb);
void focus_window(xcb_window_t window);
typedef struct bar_cairo_params_t {
xcb_connection_t *conn;
@@ -95,3 +96,12 @@ void grab_keybindings(const keybinding_t *keys, const size_t length);
bool get_xresource_uint32(const char *name, uint32_t *value);
void get_xresource_string(const char *name, char **value, const char *fallback);
void clean_xresource(void);
typedef enum atom_t {
atom_wm_protocols,
atom_wm_delete,
atom_wm_take_focus,
} atom_t;
bool send_event(xcb_window_t window, atom_t atom);
bool get_pointer_position(int32_t *x, int32_t *y);