- 注册 _NET_SYSTEM_TRAY_OPCODE 与 _XEMBED atom - 在事件分发中拦截托盘 client message - tray_add_icon 将请求 dock 的窗口 reparent 到 container, 发送 XEMBED_EMBEDDED_NOTIFY 并 map,维护 icons 数组并 触发图标变更回调
25 lines
444 B
C
25 lines
444 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <xcb/xproto.h>
|
|
|
|
#include "interface/tray.h"
|
|
|
|
extern const tray_api_t tray_api;
|
|
|
|
typedef struct backend_t backend_t;
|
|
|
|
/* TODO: 添加窗口背景色 */
|
|
void tray_init(
|
|
backend_t *backend,
|
|
xcb_window_t host_window,
|
|
int32_t host_width,
|
|
int32_t host_height
|
|
);
|
|
void tray_cleanup(backend_t *backend);
|
|
|
|
bool tray_handle_client_message(
|
|
backend_t *backend,
|
|
const xcb_client_message_event_t *ev
|
|
);
|