feat(backend): 写入 _NET_SUPPORTED 属性声明 EWMH 支持能力
This commit is contained in:
@@ -60,6 +60,21 @@ static void atoms_init(backend_t *backend) {
|
|||||||
*atom->atom = reply->atom;
|
*atom->atom = reply->atom;
|
||||||
p_delete(&reply);
|
p_delete(&reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define EWMH_ITEM(name) atoms->name,
|
||||||
|
xcb_atom_t ewmh_supported_atoms[] = {EWMH_ATOMS(EWMH_ITEM)};
|
||||||
|
#undef EWMH_ITEM
|
||||||
|
auto root = backend->screen->root;
|
||||||
|
xcb_change_property(
|
||||||
|
conn,
|
||||||
|
XCB_PROP_MODE_REPLACE,
|
||||||
|
root,
|
||||||
|
atoms->_NET_SUPPORTED,
|
||||||
|
XCB_ATOM_ATOM,
|
||||||
|
32,
|
||||||
|
countof(ewmh_supported_atoms),
|
||||||
|
ewmh_supported_atoms
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_wm_check_window(backend_t *backend) {
|
static void create_wm_check_window(backend_t *backend) {
|
||||||
|
|||||||
@@ -9,21 +9,9 @@
|
|||||||
#include "base/window_list.h"
|
#include "base/window_list.h"
|
||||||
#include "core/event.h"
|
#include "core/event.h"
|
||||||
|
|
||||||
#define ATOM_LIST(X) \
|
#define EWMH_ATOMS(X) \
|
||||||
X(COMPOUND_TEXT) \
|
|
||||||
X(UTF8_STRING) \
|
|
||||||
\
|
|
||||||
X(WM_WINDOW_ROLE) \
|
|
||||||
X(WM_NAME) \
|
|
||||||
X(WM_CHANGE_STATE) \
|
|
||||||
X(_NET_WM_NAME) \
|
X(_NET_WM_NAME) \
|
||||||
\
|
|
||||||
X(WM_PROTOCOLS) \
|
|
||||||
X(WM_TAKE_FOCUS) \
|
|
||||||
X(WM_DELETE_WINDOW) \
|
|
||||||
X(_NET_ACTIVE_WINDOW) \
|
X(_NET_ACTIVE_WINDOW) \
|
||||||
\
|
|
||||||
X(_NET_SUPPORTING_WM_CHECK) \
|
|
||||||
X(_NET_WM_PID) \
|
X(_NET_WM_PID) \
|
||||||
\
|
\
|
||||||
X(_NET_CLIENT_LIST) \
|
X(_NET_CLIENT_LIST) \
|
||||||
@@ -56,6 +44,22 @@
|
|||||||
X(_NET_WM_WINDOW_TYPE_DND) \
|
X(_NET_WM_WINDOW_TYPE_DND) \
|
||||||
X(_NET_WM_WINDOW_TYPE_NOTIFICATION)
|
X(_NET_WM_WINDOW_TYPE_NOTIFICATION)
|
||||||
|
|
||||||
|
#define ATOM_LIST(X) \
|
||||||
|
X(COMPOUND_TEXT) \
|
||||||
|
X(UTF8_STRING) \
|
||||||
|
\
|
||||||
|
X(WM_WINDOW_ROLE) \
|
||||||
|
X(WM_NAME) \
|
||||||
|
X(WM_CHANGE_STATE) \
|
||||||
|
\
|
||||||
|
X(WM_PROTOCOLS) \
|
||||||
|
X(WM_TAKE_FOCUS) \
|
||||||
|
X(WM_DELETE_WINDOW) \
|
||||||
|
\
|
||||||
|
X(_NET_SUPPORTING_WM_CHECK) \
|
||||||
|
X(_NET_SUPPORTED) \
|
||||||
|
EWMH_ATOMS(X)
|
||||||
|
|
||||||
typedef struct atoms_t {
|
typedef struct atoms_t {
|
||||||
#define DECLARATION_ATOM(name) xcb_atom_t name;
|
#define DECLARATION_ATOM(name) xcb_atom_t name;
|
||||||
ATOM_LIST(DECLARATION_ATOM);
|
ATOM_LIST(DECLARATION_ATOM);
|
||||||
|
|||||||
Reference in New Issue
Block a user