21 return net_wm_atoms.contains(atom);
30 xcb_window_t root =
connection()->primaryScreen()->root();
34 auto reply =
Q_XCB_REPLY(xcb_get_property,
xcb_connection()
, false, root, atom(QXcbAtom::Atom_NET_SUPPORTED), XCB_ATOM_ATOM, offset, 1024);
40 if (reply->type == XCB_ATOM_ATOM && reply->format == 32) {
41 int len = xcb_get_property_value_length(reply.get())/
sizeof(xcb_atom_t);
42 xcb_atom_t *atoms = (xcb_atom_t *)xcb_get_property_value(reply.get());
43 int s = net_wm_atoms.size();
44 net_wm_atoms.resize(s + len);
45 memcpy(net_wm_atoms.data() + s, atoms, len*
sizeof(xcb_atom_t));
47 remaining = reply->bytes_after;
50 }
while (remaining > 0);
56 net_virtual_roots.clear();
61 xcb_window_t root =
connection()->primaryScreen()->root();
66 false, root, atom(QXcbAtom::Atom_NET_VIRTUAL_ROOTS), XCB_ATOM_WINDOW, offset, 1024);
72 if (reply->type == XCB_ATOM_WINDOW && reply->format == 32) {
73 int len = xcb_get_property_value_length(reply.get())/
sizeof(xcb_window_t);
74 xcb_window_t *roots = (xcb_window_t *)xcb_get_property_value(reply.get());
75 int s = net_virtual_roots.size();
76 net_virtual_roots.resize(s + len);
77 memcpy(net_virtual_roots.data() + s, roots, len*
sizeof(xcb_window_t));
79 remaining = reply->bytes_after;
83 }
while (remaining > 0);
86#ifdef VIRTUAL_ROOTS_DEBUG
87 qDebug(
"======== updateVirtualRoots");
88 for (
int i = 0; i < net_virtual_roots.size(); ++i)
89 qDebug() << connection()->atomName(net_virtual_roots.at(i));
90 qDebug(
"======== updateVirtualRoots");
QXcbConnection * connection() const
xcb_connection_t * xcb_connection() const
xcb_atom_t atom(QXcbAtom::Atom atom) const
bool isSupportedByWM(xcb_atom_t atom) const
#define Q_XCB_REPLY(call,...)