You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
785 B
C++
32 lines
785 B
C++
#include "x11shadow.h"
|
|
|
|
#include <QX11Info>
|
|
#include <xcb/xcb.h>
|
|
|
|
static xcb_atom_t internAtom(const char *name, bool only_if_exists)
|
|
{
|
|
if (!name || *name == 0)
|
|
return XCB_NONE;
|
|
|
|
if (!QX11Info::isPlatformX11())
|
|
return XCB_NONE;
|
|
|
|
xcb_intern_atom_cookie_t cookie = xcb_intern_atom(QX11Info::connection(), only_if_exists, strlen(name), name);
|
|
xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(QX11Info::connection(), cookie, 0);
|
|
|
|
if (!reply)
|
|
return XCB_NONE;
|
|
|
|
xcb_atom_t atom = reply->atom;
|
|
free(reply);
|
|
|
|
return atom;
|
|
}
|
|
|
|
X11Shadow::X11Shadow(QObject *parent)
|
|
: QObject(parent)
|
|
{
|
|
m_atom_net_wm_shadow = internAtom("_KDE_NET_WM_SHADOW", false);
|
|
m_atom_net_wm_window_type = internAtom("_NET_WM_WINDOW_TYPE", false);
|
|
}
|