Back to index

unity  6.0.0
Public Member Functions | Private Attributes
UnityNETWorkareaRegionScreen Class Reference

#include <networkarearegion.h>

List of all members.

Public Member Functions

 UnityNETWorkareaRegionScreen (CompScreen *)
 ~UnityNETWorkareaRegionScreen ()
void outputChangeNotify ()
void setProperty ()
void handleEvent (XEvent *event)
void addSupportedAtoms (std::vector< Atom > &atoms)

Private Attributes

Atom mUnityNETWorkareaRegionAtom

Detailed Description

Definition at line 27 of file networkarearegion.h.


Constructor & Destructor Documentation

Definition at line 122 of file networkarearegion.cpp.

                                                                        :
  PluginClassHandler <UnityNETWorkareaRegionScreen, CompScreen> (s),
  mUnityNETWorkareaRegionAtom(XInternAtom(screen->dpy(), "_UNITY_NET_WORKAREA_REGION", 0))
{
  ScreenInterface::setHandler(screen);
  screen->updateSupportedWmHints();
}

Definition at line 130 of file networkarearegion.cpp.

{
  /* Delete the property and the bit saying we support it */
  screen->addSupportedAtomsSetEnabled(this, false);
  screen->updateSupportedWmHints();

  XDeleteProperty(screen->dpy(), screen->root(), mUnityNETWorkareaRegionAtom);
}

Member Function Documentation

void UnityNETWorkareaRegionScreen::addSupportedAtoms ( std::vector< Atom > &  atoms)

Definition at line 115 of file networkarearegion.cpp.

{
  atoms.push_back(mUnityNETWorkareaRegionAtom);

  screen->addSupportedAtoms(atoms);
}

Definition at line 70 of file networkarearegion.cpp.

{
  screen->handleEvent(event);

  switch (event->type)
  {
    case PropertyNotify:

      if (event->xproperty.atom == (Atom) Atoms::wmStrut ||
         event->xproperty.atom == (Atom) Atoms::wmStrutPartial)
      {
        CompWindow* w = screen->findWindow(event->xproperty.window);

        if (w)
        {
          if (w->struts())
          {
            UnityNETWorkareaRegionWindow* unwmh = UnityNETWorkareaRegionWindow::get(w);

            w->moveNotifySetEnabled(unwmh, true);
            w->resizeNotifySetEnabled(unwmh, true);

            /* The struts got updated, so we need to set the property again */
            setProperty();
          }
        }
      }
  }
}

Here is the call graph for this function:

Definition at line 64 of file networkarearegion.cpp.

{
  setProperty();
}

Here is the call graph for this function:

Definition at line 24 of file networkarearegion.cpp.

{
  CompRegion    sr;
  unsigned long* data;
  unsigned int  dataSize;
  unsigned int  offset = 0;

  sr = sr.united(CompRect(0, 0, screen->width(), screen->height()));

  foreach(CompWindow * w, screen->clientList())
  {
    if (!w->struts())
      continue;

    sr -= CompRect(w->struts()->left.x, w->struts()->left.y, w->struts()->left.width, w->struts()->left.height);
    sr -= CompRect(w->struts()->right.x, w->struts()->right.y, w->struts()->right.width, w->struts()->right.height);
    sr -= CompRect(w->struts()->top.x, w->struts()->top.y, w->struts()->top.width, w->struts()->top.height);
    sr -= CompRect(w->struts()->bottom.x, w->struts()->bottom.y, w->struts()->bottom.width, w->struts()->bottom.height);
  }

  dataSize = sr.rects().size()  * 4;
  data = new unsigned long[dataSize];

  foreach(const CompRect & r, sr.rects())
  {
    data[offset * 4 + 0] = r.x();
    data[offset * 4 + 1] = r.y();
    data[offset * 4 + 2] = r.width();
    data[offset * 4 + 3] = r.height();

    offset++;
  }

  XChangeProperty(screen->dpy(), screen->root(), mUnityNETWorkareaRegionAtom,
                  XA_CARDINAL, 32, PropModeReplace, (const unsigned char*) data, dataSize);

  delete[] data;
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 50 of file networkarearegion.h.


The documentation for this class was generated from the following files: