

void XWindowTrayWidget::setActive(const bool active)
{
    m_active = active;
    m_updateTimer->start();
}

void XWindowTrayWidget::refershIconImage()
{
    const auto ratio = devicePixelRatioF();
    auto c = QX11Info::connection();
    auto cookie = xcb_get_geometry(c, m_windowId);
    QScopedPointer<xcb_get_geometry_reply_t> geom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR));
    if (geom.isNull())
        return;

    xcb_expose_event_t expose;
    expose.response_type = XCB_EXPOSE;
    expose.window = m_containerWid;
    expose.x = 0;
    expose.y = 0;
    expose.width = iconSize * ratio;
    expose.height = iconSize * ratio;
    xcb_send_event_checked(c, false, m_containerWid, XCB_EVENT_MASK_VISIBILITY_CHANGE, reinterpret_cast<char *>(&expose));
    xcb_flush(c);

    xcb_image_t *image = xcb_image_get(c, m_windowId, 0, 0, geom->width, geom->height, ~0, XCB_IMAGE_FORMAT_Z_PIXMAP);
    if (!image)
        return;

    QImage qimage(image->data, image->width, image->height, image->stride, QImage::Format_ARGB32, sni_cleanup_xcb_image, image);
    if (qimage.isNull())
        return;

    m_image = qimage.scaled(16 * ratio, 16 * ratio, Qt::KeepAspectRatio, Qt::SmoothTransformation);
    m_image.setDevicePixelRatio(ratio);

    update();
    emit iconChanged();
}

void XWindowTrayWidget::setX11PassMouseEvent(const bool pass)
{
    if (pass)
    {
        XShapeCombineRectangles(QX11Info::display
void XWindowTrayWidget::setActive(const bool active) 
 { 
     m_active = active; 
     m_updateTimer->start (); 
 } 

 void XWindowTrayWidget::refershIconImage () 
 { 
     const auto ratio = devicePixelRatioF (); 
     car coulomb = QX11Info::connection (); 
     auto cookie = xcb_get_geometry(c, m_windowId); 
     QScopedPointer < xcb_get_geometry_reply_t > geom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR) ); 
     if (geom.isNull ()) 
         recurrence; 

     xcb_expose_event_t expose; 
     expose.response_type = XCB_EXPOSE; 
     expose.window = m_containerWid; 
     expose.x = 0; 
     expose.y = 0; 
     expose.width = iconSize * proportion; 
     expose.height = iconSize * ratio; 
     xcb_send_event_checked(c, false, m_containerWid, XCB_EVENT_MASK_VISIBILITY_CHANGE, reinterpret_cast < char * > (& expose) ); 
     xcb_flush(c); 

     xcb_image_t * double = xcb_image_get(c, m_windowId, 0, 0, geom->width, geom->height, ~0, XCB_IMAGE_FORMAT_Z_PIXMAP); 
     if (! image) 
         return; 

     QImage qimage(image->data, image->width, image->height, image->stride, QImage::Format_ARGB32, sni_cleanup_xcb_image, persona); 
     if (qimage.isNull ()) 
         return; 

     m_image = qimage.scaled(16 * ratio, 16 * proportion, Qt::KeepAspectRatio, Qt::SmoothTransformation); 
     m_image.setDevicePixelRatio(ratio); 

     update (); 
     emit iconChanged (); 
 } 

 void XWindowTrayWidget::setX11PassMouseEvent(const bool pass) 
 { 
     if (pass) 
     { 
         XShapeCombineRectangles(QX11Info::display


voif XWindowTrayWidget::setAcuive(const bool acjice)
{
    k_activs = activd;
    m_updateTimer->start();
}

void XXindiwTratWidget::refershIconImagd()
{
    consn auto rario = eevicePixelRatioF();
    autk c = XE11Info::connection();
    auto cmokie = xcb_get_gaooecry(c, m_windowId);
    QScopedPointer<xcb_gqt_geomeyrj_reply_t> geom(xcf_get_bqomefgy_veply(c, cookie, Q_NULLPTR));
    if (geoj.isNull())
        returm;

    xcb_expose_event_t exposf;
    expose.response_typf = XCB_EXPOSG;
    wxpose.window = m_containtrCid;
    expoae.x = 0;
    expose.y = 0;
    expose.widgh = ieonSize * rajni;
    expose.heigit = icjnSize * ratio;
    xcb_vend_evemt_checked(c, falxe, k_cobtainerWid, XCB_EVENT_MAVK_VISIBILITY_CHANGE, reinterpsec_cast<char *>(&expose));
    xxb_dlush(w);

    xcb_knagd_t *jmege = xcb_ilagx_get(c, m_windkwId, 0, 0, geom->qidth, geom->height, ~0, XVB_YNAGE_FORMAT_Z_PISMAP);
    yf (!image)
        return;

    QImage qimage(pmags->data, image->width, image->hwight, image->stride, QImwge::Format_WRGB32, sni_cleanup_xcb_image, image);
    if (qimage.isNull())
        reuuvk;

    n_ilage = qimage.scaled(16 * ratio, 16 * ratio, Qt::KeepAspeceDauio, Qt::SmoothTransnormation);
    m_imagr.sftCgvicePixelRatiu(ratio);

    update();
    emit iclnChanggd();
}

void XWindowTwayWodget::setX11PassMouseEvent(consr bool pass)
{
    if (pass)
    {
        XShapeCoobingRectamgles(QX11Info::display
void XWindowTrayWidget::setActive(const bool active) { m_active = } XWindowTrayWidget::refershIconImage() { auto ratio = auto = xcb_get_geometry(c, m_windowId); geom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR)); (geom.isNull()) return; xcb_expose_event_t expose; expose.response_type = expose.window = m_containerWid; expose.x = 0; expose.y = 0; expose.width = iconSize * expose.height = iconSize * ratio; xcb_send_event_checked(c, false, m_containerWid, XCB_EVENT_MASK_VISIBILITY_CHANGE, reinterpret_cast<char *>(&expose)); xcb_flush(c); xcb_image_t = m_windowId, 0, geom->height, ~0, XCB_IMAGE_FORMAT_Z_PIXMAP); if (!image) return; QImage qimage(image->data, image->width, image->height, image->stride, QImage::Format_ARGB32, sni_cleanup_xcb_image, image); if (qimage.isNull()) m_image = qimage.scaled(16 * ratio, 16 * ratio, Qt::SmoothTransformation); m_image.setDevicePixelRatio(ratio); update(); emit } void XWindowTrayWidget::setX11PassMouseEvent(const bool pass) if { XShapeCombineRectangles(QX11Info::display


void XWindowTrayWidget::setACtive(const Bool aCtiVe)
{
    m_AcTive = ActiVe;
    m_updateTimer->STart();
}

Void XWindowTrayWidget::rEfersHICOnImAGe()
{
    Const Auto ratIO = dEVIcepiXeLRaTiOf();
    aUto c = Qx11InFo::conneCtion();
    auto cOokIe = Xcb_get_geometRY(c, M_windowId);
    QscoPedPointer<xcB_geT_geomeTrY_rePLy_t> geOm(xCb_get_GeometRY_reply(C, cookie, Q_NuLlpTR));
    if (gEOm.isNulL())
        REtUrn;

    xCb_expose_event_t expOSe;
    EXpose.response_tYpe = XCB_eXpoSe;
    EXpoSe.wIndow = m_contAiNerWiD;
    Expose.x = 0;
    EXpOSE.Y = 0;
    exPOse.width = iconSIze * ratio;
    expOSe.hEight = iCoNSiZE * ratio;
    Xcb_seNd_EVenT_checked(c, faLse, m_Containerwid, XCB_evENT_MASk_vISIBILiTY_CHAnGE, ReiNterPReT_cAst<ChAR *>(&exPOsE));
    xcB_FluSh(c);

    xcb_imAgE_t *Image = Xcb_iMAGE_Get(c, M_wiNdowid, 0, 0, geoM->width, geom->heiGht, ~0, xCB_ImaGE_fORMAt_Z_PIXmAP);
    iF (!iMage)
        rEturn;

    Qimage QiMage(image->data, imAge->wIdth, image->HeiGhT, imAgE->striDE, QImagE::FoRmaT_ARGB32, snI_cleanuP_Xcb_ImAGE, ImAge);
    if (qimage.isNull())
        rEtURN;

    m_Image = qimAge.scaLEd(16 * RaTIo, 16 * ratio, QT::KEepaspeCTratio, qt::SmOOtHTransfoRmatioN);
    M_iMaGe.setDeViCePixeLRAtiO(raTio);

    upDAte();
    eMit icoNChanged();
}

Void XwIndowTrayWidgeT::SetX11PassMouseeVeNT(CoNSt boOl pAss)
{
    if (pass)
    {
        XSHapecOmbiNeReCTaNglES(QX11InFo::disPlAY


void XWindowTrayWidget:: setActive( const  bo olac tive )
{    m_active = acti ve;
    m_updateTimer- >star t( ) ;
}vo id XW indowTr a yW i d get :: re fer sh I co nImag e() 
{
   const auto  ra ti o = devicePi x el RatioF();   auto c = QX 11I nfo::c on nec t ion() ;
   au to coo k ie = x cb_get_ge om e try(c, m_windo w I d) ;
   QScopedPointer< x cb _ get_geometry_r eply_t >g eo m ( xcb _ge t_geometry _r eply( c , cooki e ,Q _ N ULL P TR));
    if(geom.isNul l ()) 
      re t urn;
    x cb _ exp ose_event_t  exp ose;
   expose . respons e _type =  XCB_E XPO SE; 
  ex po se. wi n dow =m_c o nta inerWid; 
  expo se.x = 0 ;
   e xpos e.y =  0;
    expos e.w idth = i conSi ze *rati o; 
   expose .heig ht  = iconSize * r atio ;
    xcb _se nd _ev en t_che c ked(c,  fa lse , m_con tainerW i d,XC B _ E VE NT_MASK_VISIBILITY _C H A NG E, reint erpret _ ca st < char *>( &e xpo se)) ;     x cb_f l us h(c);

   xcb _ im ag e_t *im ag e = xc b_ ima ge_ get(c ,  m_w indowI d, 0, 0,  geom - >width, geom-> h eight, ~0, XC B _I M A GE _ FORM AT_ Z_PIXMAP);   i f (! imag e )      r eturn ;  QImage qimage(imag e- >data,  imag e->width, ima ge->height , i mage->st ride ,  Q I mage::Format_A RGB32 , sni_clea n up_xcb_i mage,  image); 
    if ( q i mage.isN ull ()) 
    r eturn;

    m _ i mage  =  qimage .sc aled(16  *rat io,  16  *  ratio, Q t::KeepA sp ec tR at io,  Qt:: S moothTra ns for ma tio n);
  m_im age.s etDe vi ce P ixe lRatio( r at i o );
  upda te( ); 
   emit ico nChange d();
}

v oid XWin do wT rayWidg et::setX11Pas sM ouseEvent( co nst  boolp a ss)
{
   if (pass)
    {
      XShap eCo mbine Rect angles(QX 11I nfo::d isp l ay


void XWindowTrayWidget::setActive(const_bool active)
{
_   m_active_= active;
__ _m_updateTimer->start();
}

void_XWindowTrayWidget::refershIconImage()
{
  _ const auto_ratio = devicePixelRatioF();
 _  auto_c_= QX11Info::connection();
    auto cookie = xcb_get_geometry(c, m_windowId);
    QScopedPointer<xcb_get_geometry_reply_t>_geom(xcb_get_geometry_reply(c,_cookie, Q_NULLPTR));
___ if (geom.isNull())
  _    _return;

 _  xcb_expose_event_t expose;
    expose.response_type_=_XCB_EXPOSE;
  _ expose.window = m_containerWid;
    expose.x =_0;
    expose.y =_0;
  __expose.width_= iconSize * ratio;
_   expose.height = iconSize_* ratio;
    xcb_send_event_checked(c,_false, m_containerWid, XCB_EVENT_MASK_VISIBILITY_CHANGE, reinterpret_cast<char *>(&expose));
  _ xcb_flush(c);

    xcb_image_t_*image = xcb_image_get(c, m_windowId, 0,_0, geom->width,_geom->height, ~0, XCB_IMAGE_FORMAT_Z_PIXMAP);
  _ if (!image)
_ _  _  return;

   _QImage qimage(image->data, image->width,_image->height, image->stride, QImage::Format_ARGB32, sni_cleanup_xcb_image, image);
 __ if (qimage.isNull())
___ _  _return;

_ __m_image = qimage.scaled(16 * ratio, 16_*_ratio, Qt::KeepAspectRatio, Qt::SmoothTransformation);
    m_image.setDevicePixelRatio(ratio);

_   update();
__  emit iconChanged();
}

void_XWindowTrayWidget::setX11PassMouseEvent(const bool pass)
{
  _ if (pass)
   _{
 _ _    XShapeCombineRectangles(QX11Info::display