Back to index

unity  6.0.0
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes
compiz::CompTransientForReader Class Reference

#include <comptransientfor.h>

Inheritance diagram for compiz::CompTransientForReader:
Inheritance graph
[legend]
Collaboration diagram for compiz::CompTransientForReader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CompTransientForReader (CompWindow *w)
virtual ~CompTransientForReader ()
bool isTransientFor (unsigned int transient)
bool isGroupTransientFor (unsigned int transient)
std::vector< unsigned int > getTransients ()

Static Public Attributes

static Atom wmTransientFor = None
static Atom wmClientLeader = None

Protected Member Functions

unsigned int getAncestor ()

Private Attributes

PrivateCompTransientForReaderpriv

Detailed Description

Definition at line 35 of file comptransientfor.h.


Constructor & Destructor Documentation

Definition at line 36 of file comptransientfor.cpp.

                                                                   :
  X11TransientForReader (screen->dpy (), w->id ())
{
  priv = new PrivateCompTransientForReader ();

  priv->mWindow = w;
}

Definition at line 44 of file comptransientfor.cpp.

{
  delete priv;
}

Member Function Documentation

unsigned int compiz::CompTransientForReader::getAncestor ( ) [protected, virtual]

Reimplemented from compiz::X11TransientForReader.

Definition at line 50 of file comptransientfor.cpp.

{
  return priv->mWindow->transientFor ();
}
std::vector< unsigned int > compiz::X11TransientForReader::getTransients ( ) [inherited]

Definition at line 152 of file transientfor.cpp.

{
  unsigned long nItems, nLeft;
  int           actualFormat;
  Atom          actualType;
  Atom          wmClientList;
  void          *prop;
  std::vector<unsigned int>   transients;
  std::vector<Window>   clientList;

  wmClientList = XInternAtom (priv->mDpy, "_NET_CLIENT_LIST", 0);

  if (XGetWindowProperty (priv->mDpy, DefaultRootWindow (priv->mDpy), wmClientList, 0L, 512L, false,
                          XA_WINDOW, &actualType, &actualFormat, &nItems, &nLeft,
                          (unsigned char **)&prop) == Success)
  {
    if (actualType == XA_WINDOW && actualFormat == 32 && nItems && !nLeft)
    {
      Window *data = static_cast <Window *> (prop);

      while (nItems--)
      {
        clientList.push_back (*data++);
      }
    }

    XFree (prop);
  }

  /* Now check all the windows in this client list
     * for the transient state (note that this won't
     * work for override redirect windows since there's
     * no concept of a client list for override redirect
     * windows, but it doesn't matter anyways in this
     * [external] case) */

  for (Window &w : clientList)
  {
    X11TransientForReader *reader = new X11TransientForReader (priv->mDpy, w);

    if (reader->isTransientFor (priv->mXid) ||
        reader->isGroupTransientFor (priv->mXid))
      transients.push_back (w);

    delete reader;
  }

  return transients;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool compiz::CompTransientForReader::isGroupTransientFor ( unsigned int  transient)

Reimplemented from compiz::X11TransientForReader.

Definition at line 66 of file comptransientfor.cpp.

{
  if (!clientLeader ||
      !priv->mWindow->id ())
    return false;

  if (priv->mWindow->transientFor () == None || priv->mWindow->transientFor () == screen->root ())
  {
    if (priv->mWindow->type () & (CompWindowTypeUtilMask    |
                                  CompWindowTypeToolbarMask |
                                  CompWindowTypeMenuMask    |
                                  CompWindowTypeDialogMask  |
                                  CompWindowTypeModalDialogMask))
    {
           if (priv->mWindow->clientLeader () == clientLeader)
        return true;
    }
  }

  return false;
}

Here is the caller graph for this function:

bool compiz::CompTransientForReader::isTransientFor ( unsigned int  transient)

Reimplemented from compiz::X11TransientForReader.

Definition at line 56 of file comptransientfor.cpp.

{
  if (!ancestor ||
      !priv->mWindow->id ())
      return false;

  return priv->mWindow->transientFor () == ancestor;
}

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from compiz::X11TransientForReader.

Definition at line 51 of file comptransientfor.h.

Atom compiz::X11TransientForReader::wmClientLeader = None [static, inherited]

Definition at line 49 of file transientfor.h.

Atom compiz::X11TransientForReader::wmTransientFor = None [static, inherited]

Definition at line 48 of file transientfor.h.


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