climsg(winId(), NET_ACTIVE_WINDOW, 2, CurrentTime);
C++ (Qt)void BaseFrame::stickToAll(bool stick){#ifdef Q_WS_X11 // панель будет видима на всех рабочих столах uint val = 0xffffffff; if (!stick) { Atom NET_CURRENT_DESKTOP = XInternAtom(QX11Info::display(), "_NET_CURRENT_DESKTOP", False); ulong *u = reinterpret_cast<ulong *>(wm_property(QX11Info::appRootWindow(), NET_CURRENT_DESKTOP, XA_CARDINAL)); val = (uint)*u; } Atom NET_WM_DESKTOP = XInternAtom(QX11Info::display(), "_NET_WM_DESKTOP", False); XChangeProperty(QX11Info::display(), winId(), NET_WM_DESKTOP, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); #endif}
using namespace netwm;class W : public QPushButton{ Q_OBJECT public: W() : QPushButton("Click") { netwm::init(); setCheckable(true); connect(this, SIGNAL(toggled(bool)), this, SLOT(slot(bool))); } public slots: void slot(bool stick) {#ifdef Q_WS_X11 quint32 val = 0xffffffff; if(!stick) { quint32 *u = reinterpret_cast<quint32 *>(::property(QX11Info::appRootWindow(), NET_CURRENT_DESKTOP, XA_CARDINAL, 0)); if(u) { val = (uint) *u; XFree(u); } } qDebug("Setting desktop %d", val); climsg(winId(), NET_WM_DESKTOP, val);#endif }};
void BaseFrame::stickToAll(bool stick){#ifdef Q_WS_X11 // панель будет видима на всех рабочих столах uint val = 0xffffffff; if (!stick) { Atom NET_CURRENT_DESKTOP = XInternAtom(QX11Info::display(), "_NET_CURRENT_DESKTOP", False); ulong *u = reinterpret_cast<ulong *>(wm_property(QX11Info::appRootWindow(), NET_CURRENT_DESKTOP, XA_CARDINAL)); if (u) val = (uint)*u; } Atom NET_WM_DESKTOP = XInternAtom(QX11Info::display(), "_NET_WM_DESKTOP", False); wm_climsg(winId(), NET_WM_DESKTOP, val); XChangeProperty(QX11Info::display(), winId(), NET_WM_DESKTOP, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1);#endif}