Back to index

unity  6.0.0
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
unity::UnityWindow Class Reference

#include <unityshell.h>

Inheritance diagram for unity::UnityWindow:
Inheritance graph
[legend]
Collaboration diagram for unity::UnityWindow:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
compiz::CompizMinimizedWindowHandler
< UnityScreen, UnityWindow
UnityMinimizedHandler
enum  PostPaintAction { Wait = 0, Damage = 1, Remove = 2 }

Public Member Functions

 UnityWindow (CompWindow *)
 ~UnityWindow ()
void minimize ()
void unminimize ()
bool minimized ()
bool focus ()
void activate ()
void updateFrameRegion (CompRegion &region)
bool glPaint (const GLWindowPaintAttrib &attrib, const GLMatrix &matrix, const CompRegion &region, unsigned int mask)
bool glDraw (const GLMatrix &matrix, GLFragment::Attrib &attrib, const CompRegion &region, unsigned intmask)
void updateIconPos (int &wx, int &wy, int x, int y, float width, float height)
void windowNotify (CompWindowNotify n)
void moveNotify (int x, int y, bool immediate)
void resizeNotify (int x, int y, int w, int h)
void stateChangeNotify (unsigned int lastState)
bool place (CompPoint &pos)
CompPoint tryNotIntersectUI (CompPoint &pos)
void paintThumbnail (nux::Geometry const &bounding, float alpha)
void enterShowDesktop ()
void leaveShowDesktop ()
bool HandleAnimations (unsigned int ms)
void handleEvent (XEvent *event)
void EnableFocus ()
void DisableFocus ()
bool OverrideRedirect ()
bool Managed ()
bool Grabbed ()
bool DesktopOrDock ()
bool SkipTaskbarOrPager ()
bool Hidden ()
bool Shaded ()
bool Minimized ()
bool ShowDesktopMode ()
void OverrideFrameRegion (CompRegion &r)
void Hide ()
void NotifyHidden ()
void Show ()
void NotifyShown ()
void MoveFocusAway ()
void AddDamage ()
void DeleteHandler ()
unsigned int NoCoreInstanceMask ()
WindowInputRemoverLock::Ptr InputRemover ()

Public Attributes

CompWindow * window
GLWindow * gWindow
nux::Geometry last_bound
std::unique_ptr
< UnityMinimizedHandler
mMinimizeHandler
ShowdesktopHandlermShowdesktopHandler

Private Member Functions

void DoEnableFocus ()
void DoDisableFocus ()
bool IsOverrideRedirect ()
bool IsManaged ()
bool IsGrabbed ()
bool IsDesktopOrDock ()
bool IsSkipTaskbarOrPager ()
bool IsHidden ()
bool IsInShowdesktopMode ()
bool IsShaded ()
bool IsMinimized ()
void DoOverrideFrameRegion (CompRegion &r)
void DoHide ()
void DoNotifyHidden ()
void DoShow ()
void DoNotifyShown ()
void DoAddDamage ()
ShowdesktopHandlerWindowInterface::PostPaintAction DoHandleAnimations (unsigned int ms)
void DoMoveFocusAway ()
void DoDeleteHandler ()
unsigned int GetNoCoreInstanceMask ()
compiz::WindowInputRemoverLock::Ptr GetInputRemover ()

Private Attributes

compiz::WindowInputRemoverLock::Weak input_remover_
glib::Source::UniquePtr focus_desktop_timeout_

Detailed Description

Definition at line 328 of file unityshell.h.


Member Typedef Documentation

Definition at line 394 of file unityshell.h.


Member Enumeration Documentation

Enumerator:
Wait 
Damage 
Remove 

Definition at line 39 of file UnityShowdesktopHandler.h.

                               {
      Wait = 0,
      Damage = 1,
      Remove = 2
    };

Constructor & Destructor Documentation

unity::UnityWindow::UnityWindow ( CompWindow *  window)

Definition at line 3045 of file unityshell.cpp.

  : BaseSwitchWindow (dynamic_cast<BaseSwitchScreen *> (UnityScreen::get (screen)), window)
  , PluginClassHandler<UnityWindow, CompWindow>(window)
  , window(window)
  , gWindow(GLWindow::get(window))
  , mMinimizeHandler()
  , mShowdesktopHandler(nullptr)
{
  WindowInterface::setHandler(window);
  GLWindowInterface::setHandler(gWindow);

  if (UnityScreen::get (screen)->optionGetShowMinimizedWindows () &&
      window->mapNum ())
  {
    bool wasMinimized = window->minimized ();
    if (wasMinimized)
      window->unminimize ();
    window->minimizeSetEnabled (this, true);
    window->unminimizeSetEnabled (this, true);
    window->minimizedSetEnabled (this, true);

    if (wasMinimized)
      window->minimize ();
  }
  else
  {
    window->minimizeSetEnabled (this, false);
    window->unminimizeSetEnabled (this, false);
    window->minimizedSetEnabled (this, false);
  }

  if (window->state () & CompWindowStateFullscreenMask)
    UnityScreen::get (screen)->fullscreen_windows_.push_back(window);

  /* We might be starting up so make sure that
   * we don't deref the dashcontroller that doesnt
   * exist */
  dash::Controller::Ptr dp = UnityScreen::get(screen)->dash_controller_;

  if (dp)
  {
    nux::BaseWindow* w = dp->window ();

    if (w)
    {
      if (window->resName() == "onboard")
      {
        Window xid = dp->window()->GetInputWindowId();
        XSetTransientForHint (screen->dpy(), window->id(), xid);
      }
    }
  }
}

Definition at line 3099 of file unityshell.cpp.

{
  UnityScreen* us = UnityScreen::get(screen);
  if (us->newFocusedWindow && (UnityWindow::get(us->newFocusedWindow) == this))
    us->newFocusedWindow = NULL;

  if (!window->destroyed ())
  {
    bool wasMinimized = window->minimized ();
    if (wasMinimized)
      window->unminimize ();
    window->focusSetEnabled (this, false);
    window->minimizeSetEnabled (this, false);
    window->unminimizeSetEnabled (this, false);
    if (wasMinimized)
      window->minimize ();
  }

  ShowdesktopHandler::animating_windows.remove (static_cast <ShowdesktopHandlerWindowInterface *> (this));

  if (mShowdesktopHandler)
    delete mShowdesktopHandler;

  if (window->state () & CompWindowStateFullscreenMask)
    UnityScreen::get (screen)->fullscreen_windows_.remove(window);

  PluginAdapter::Default ()->OnWindowClosed (window);
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 1058 of file unityshell.cpp.

Here is the call graph for this function:

Definition at line 68 of file UnityShowdesktopHandler.h.

{ DoAddDamage (); }

Here is the call graph for this function:

Definition at line 70 of file UnityShowdesktopHandler.h.

Here is the call graph for this function:

Definition at line 53 of file UnityShowdesktopHandler.h.

{ return IsDesktopOrDock (); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 48 of file UnityShowdesktopHandler.h.

Here is the call graph for this function:

void unity::UnityWindow::DoAddDamage ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1164 of file unityshell.cpp.

{
  cWindow->addDamage ();
}
void unity::UnityWindow::DoDeleteHandler ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1169 of file unityshell.cpp.

{
  delete mShowdesktopHandler;
  mShowdesktopHandler = NULL;

  window->updateFrameRegion ();
}
void unity::UnityWindow::DoDisableFocus ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1070 of file unityshell.cpp.

{
  window->focusSetEnabled (this, false);
}
void unity::UnityWindow::DoEnableFocus ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1065 of file unityshell.cpp.

{
  window->focusSetEnabled (this, true);
}
void unity::UnityWindow::DoHide ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1129 of file unityshell.cpp.

{
  window->changeState (window->state () | CompWindowStateHiddenMask);
}
void unity::UnityWindow::DoMoveFocusAway ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1149 of file unityshell.cpp.

{
  window->moveInputFocusToOtherWindow ();
}
void unity::UnityWindow::DoNotifyHidden ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1134 of file unityshell.cpp.

{
  window->windowNotify (CompWindowNotifyHide);
}
void unity::UnityWindow::DoNotifyShown ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1144 of file unityshell.cpp.

{
  window->windowNotify (CompWindowNotifyShow);
}
void unity::UnityWindow::DoOverrideFrameRegion ( CompRegion &  r) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1120 of file unityshell.cpp.

{
  unsigned int oldUpdateFrameRegionIndex = window->updateFrameRegionGetCurrentIndex ();

  window->updateFrameRegionSetCurrentIndex (MAXSHORT);
  window->updateFrameRegion (region);
  window->updateFrameRegionSetCurrentIndex (oldUpdateFrameRegionIndex);
}
void unity::UnityWindow::DoShow ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1139 of file unityshell.cpp.

{
  window->changeState (window->state () & ~(CompWindowStateHiddenMask));
}

Definition at line 47 of file UnityShowdesktopHandler.h.

{ DoEnableFocus (); }

Here is the call graph for this function:

Definition at line 1039 of file unityshell.cpp.

{
  if (!mShowdesktopHandler)
    mShowdesktopHandler = new ShowdesktopHandler (static_cast <ShowdesktopHandlerWindowInterface *> (this),
                                                  static_cast <compiz::WindowInputRemoverLockAcquireInterface *> (this));

  window->setShowDesktopMode (true);
  mShowdesktopHandler->FadeOut ();
}

Definition at line 2449 of file unityshell.cpp.

{
  if (!mMinimizeHandler)
    return window->focus ();

  if (window->overrideRedirect ())
    return false;

  if (!window->managed ())
    return false;

  if (!window->onCurrentDesktop ())
    return false;

  /* Only withdrawn windows
   * which are marked hidden
   * are excluded */
  if (!window->shaded () &&
      !window->minimized () &&
      (window->state () & CompWindowStateHiddenMask))
    return false;

  if (window->geometry ().x () + window->geometry ().width ()  <= 0 ||
      window->geometry ().y () + window->geometry ().height () <= 0 ||
      window->geometry ().x () >= (int) screen->width ()||
      window->geometry ().y () >= (int) screen->height ())
    return false;

  return true;
}

Implements compiz::WindowInputRemoverLockAcquireInterface.

Definition at line 1178 of file unityshell.cpp.

{
  if (!input_remover_.expired ())
    return input_remover_.lock ();

  compiz::WindowInputRemoverLock::Ptr ret (new compiz::WindowInputRemoverLock (new compiz::WindowInputRemover (screen->dpy (), window->id ())));
  input_remover_ = ret;
  return ret;
}
unsigned int unity::UnityWindow::GetNoCoreInstanceMask ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1189 of file unityshell.cpp.

{
  return PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
}
bool unity::UnityWindow::glDraw ( const GLMatrix &  matrix,
GLFragment::Attrib &  attrib,
const CompRegion &  region,
unsigned  intmask 
)

Definition at line 2366 of file unityshell.cpp.

{
  if (uScreen->doShellRepaint && !uScreen->paint_panel_ && window->type() == CompWindowTypeNormalMask)
  {
    guint32 id = window->id();
    bool maximized = WindowManager::Default()->IsWindowMaximized(id);
    bool on_current = window->onCurrentDesktop();
    bool override_redirect = window->overrideRedirect();
    bool managed = window->managed();
    CompPoint viewport = window->defaultViewport();
    int output = window->outputDevice();

    if (maximized && on_current && !override_redirect && managed && viewport == uScreen->screen->vp() && output == (int)uScreen->screen->currentOutputDev().id())
    {
      uScreen->paint_panel_ = true;
    }
  }

  if (uScreen->doShellRepaint &&
      !uScreen->forcePaintOnTop () &&
      window == uScreen->firstWindowAboveShell &&
      !uScreen->fullscreenRegion.contains(window->geometry())
     )
  {
#ifdef USE_MODERN_COMPIZ_GL
    uScreen->paintDisplay();
#else
    uScreen->paintDisplay(region, matrix, mask);
#endif
  }

  if (window->type() == CompWindowTypeDesktopMask)
    uScreen->setPanelShadowMatrix(matrix);

  Window active_window = screen->activeWindow();
  if (window->id() == active_window && window->type() != CompWindowTypeDesktopMask)
  {
    uScreen->paintPanelShadow(matrix);
  }

  bool ret = gWindow->glDraw(matrix, attrib, region, mask);

  if ((active_window == 0 || active_window == window->id()) &&
      (window->type() == CompWindowTypeDesktopMask))
  {
    uScreen->paintPanelShadow(matrix);
  }


  return ret;
}

Here is the call graph for this function:

bool unity::UnityWindow::glPaint ( const GLWindowPaintAttrib &  attrib,
const GLMatrix &  matrix,
const CompRegion &  region,
unsigned int  mask 
)

Definition at line 2292 of file unityshell.cpp.

{
  /*
   * The occlusion pass tests windows from TOP to BOTTOM. That's opposite to
   * the actual painting loop.
   *
   * Detect uScreen->fullscreenRegion here. That represents the region which
   * fully covers the shell on its output. It does not include regular windows
   * stacked above the shell like DnD icons or Onboard etc.
   */
  if (isNuxWindow(window))
  {
    if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
    {
      uScreen->nuxRegion += window->geometry();
      uScreen->nuxRegion -= uScreen->fullscreenRegion;
    }
    return false;  // Ensure nux windows are never painted by compiz
  }
  else if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
  {
    static const unsigned int nonOcclusionBits =
                              PAINT_WINDOW_TRANSLUCENT_MASK |
                              PAINT_WINDOW_TRANSFORMED_MASK |
                              PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
    if (!(mask & nonOcclusionBits) &&
        (window->state() & CompWindowStateFullscreenMask))
        // And I've been advised to test other things, but they don't work:
        // && (attrib.opacity == OPAQUE)) <-- Doesn't work; Only set in glDraw
        // && !window->alpha() <-- Doesn't work; Opaque windows often have alpha
    {
      uScreen->fullscreenRegion += window->geometry();
      uScreen->fullscreenRegion -= uScreen->nuxRegion;
    }
    if (uScreen->nuxRegion.isEmpty())
      uScreen->firstWindowAboveShell = window;
  }

  GLWindowPaintAttrib wAttrib = attrib;

  if (mMinimizeHandler)
  {
    mask |= mMinimizeHandler->getPaintMask ();
  }
  else if (mShowdesktopHandler)
  {
    mShowdesktopHandler->PaintOpacity (wAttrib.opacity);
    mask |= mShowdesktopHandler->GetPaintMask ();
  }

  std::vector<Window> const& tray_xids = uScreen->panel_controller_->GetTrayXids();
  if (std::find(tray_xids.begin(), tray_xids.end(), window->id()) != tray_xids.end() &&
      !uScreen->allowWindowPaint)
  {
    if (!uScreen->painting_tray_)
    {
      uScreen->tray_paint_mask_ = mask;
      mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
    }
  }

  return gWindow->glPaint(wAttrib, matrix, region, mask);
}

Here is the call graph for this function:

Definition at line 52 of file UnityShowdesktopHandler.h.

{ return IsGrabbed (); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool unity::UnityWindow::HandleAnimations ( unsigned int  ms)
void unity::UnityWindow::handleEvent ( XEvent *  event)

Definition at line 1194 of file unityshell.cpp.

{
  if (screen->XShape () &&
      event->type == screen->shapeEvent () + ShapeNotify &&
      !event->xany.send_event)
  {
    if (mShowdesktopHandler)
      mShowdesktopHandler->HandleShapeEvent ();
  }
}

Here is the caller graph for this function:

Definition at line 55 of file UnityShowdesktopHandler.h.

{ return IsHidden (); }

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::ShowdesktopHandlerWindowInterface::Hide ( ) [inline, inherited]

Definition at line 61 of file UnityShowdesktopHandler.h.

{ DoHide (); }

Here is the call graph for this function:

Here is the caller graph for this function:

WindowInputRemoverLock::Ptr compiz::WindowInputRemoverLockAcquireInterface::InputRemover ( ) [inline, inherited]

Definition at line 122 of file inputremover.h.

{ return GetInputRemover (); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool unity::UnityWindow::IsDesktopOrDock ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1090 of file unityshell.cpp.

{
  return (window->type () & (CompWindowTypeDesktopMask | CompWindowTypeDockMask));
}
bool unity::UnityWindow::IsGrabbed ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1085 of file unityshell.cpp.

{
  return window->grabbed ();
}
bool unity::UnityWindow::IsHidden ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1105 of file unityshell.cpp.

{
  return window->state () & CompWindowStateHiddenMask;
}
bool unity::UnityWindow::IsInShowdesktopMode ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1100 of file unityshell.cpp.

{
  return window->inShowDesktopMode ();
}
bool unity::UnityWindow::IsManaged ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1080 of file unityshell.cpp.

{
  return window->managed ();
}
bool unity::UnityWindow::IsMinimized ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1115 of file unityshell.cpp.

{
  return window->minimized ();
}
bool unity::UnityWindow::IsOverrideRedirect ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1075 of file unityshell.cpp.

{
  return window->overrideRedirect ();
}
bool unity::UnityWindow::IsShaded ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1110 of file unityshell.cpp.

{
  return window->shaded ();
}
bool unity::UnityWindow::IsSkipTaskbarOrPager ( ) [private, virtual]

Implements unity::ShowdesktopHandlerWindowInterface.

Definition at line 1095 of file unityshell.cpp.

{
  return (window->state () & (CompWindowStateSkipTaskbarMask | CompWindowStateSkipPagerMask));
}

Definition at line 1049 of file unityshell.cpp.

{
  if (mShowdesktopHandler)
  {
    mShowdesktopHandler->FadeIn ();
    window->setShowDesktopMode (false);
  }
}

Definition at line 51 of file UnityShowdesktopHandler.h.

{ return IsManaged (); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2426 of file unityshell.cpp.

{
  if (!window->managed ())
    return;

  if (!mMinimizeHandler)
  {
    mMinimizeHandler.reset (new UnityMinimizedHandler (window, this));
    mMinimizeHandler->minimize ();
  }
}

Definition at line 57 of file UnityShowdesktopHandler.h.

{ return IsMinimized (); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2481 of file unityshell.cpp.

{
  return mMinimizeHandler.get () != nullptr;
}

Definition at line 65 of file UnityShowdesktopHandler.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::UnityWindow::moveNotify ( int  x,
int  y,
bool  immediate 
)

Definition at line 2599 of file unityshell.cpp.

{
  PluginAdapter::Default()->NotifyMoved(window, x, y);
  window->moveNotify(x, y, immediate);
}

Here is the call graph for this function:

Definition at line 72 of file UnityShowdesktopHandler.h.

{ return GetNoCoreInstanceMask (); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 62 of file UnityShowdesktopHandler.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 64 of file UnityShowdesktopHandler.h.

{ DoNotifyShown (); }

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::ShowdesktopHandlerWindowInterface::OverrideFrameRegion ( CompRegion &  r) [inline, inherited]

Definition at line 59 of file UnityShowdesktopHandler.h.

{ return DoOverrideFrameRegion (r); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 50 of file UnityShowdesktopHandler.h.

{ return IsOverrideRedirect (); }

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::UnityWindow::paintThumbnail ( nux::Geometry const &  bounding,
float  alpha 
)

Definition at line 922 of file unityshell.cpp.

{
  GLMatrix matrix;
  matrix.toScreenSpace (UnityScreen::get (screen)->_last_output, -DEFAULT_Z_CAMERA);

  nux::Geometry geo = bounding;
  last_bound = geo;

  GLWindowPaintAttrib attrib = gWindow->lastPaintAttrib ();
  attrib.opacity = (GLushort) (alpha * G_MAXUSHORT);

  paintThumb (attrib,
              matrix,
              0,
              geo.x,
              geo.y,
              geo.width,
              geo.height,
              geo.width,
              geo.height);
}

Here is the caller graph for this function:

bool unity::UnityWindow::place ( CompPoint &  pos)

Definition at line 2662 of file unityshell.cpp.

{
  bool was_maximized = PluginAdapter::Default ()->MaximizeIfBigEnough(window);

  if (!was_maximized)
  {
    bool result = window->place(pos);

    if (window->type() & NO_FOCUS_MASK)
      return result;

    pos = tryNotIntersectUI(pos);
    return result;
  }

  return true;
}

Here is the call graph for this function:

void unity::UnityWindow::resizeNotify ( int  x,
int  y,
int  w,
int  h 
)

Definition at line 2605 of file unityshell.cpp.

{
  PluginAdapter::Default()->NotifyResized(window, x, y, w, h);
  window->resizeNotify(x, y, w, h);
}

Here is the call graph for this function:

Definition at line 56 of file UnityShowdesktopHandler.h.

{ return IsShaded (); }

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::ShowdesktopHandlerWindowInterface::Show ( ) [inline, inherited]

Definition at line 63 of file UnityShowdesktopHandler.h.

{ DoShow (); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 58 of file UnityShowdesktopHandler.h.

{ return IsInShowdesktopMode (); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 54 of file UnityShowdesktopHandler.h.

{ return IsSkipTaskbarOrPager (); }

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::UnityWindow::stateChangeNotify ( unsigned int  lastState)

Definition at line 2572 of file unityshell.cpp.

{
  if (window->state () & CompWindowStateFullscreenMask &&
      !(lastState & CompWindowStateFullscreenMask))
    UnityScreen::get (screen)->fullscreen_windows_.push_back(window);
  else if (lastState & CompWindowStateFullscreenMask &&
     !(window->state () & CompWindowStateFullscreenMask))
    UnityScreen::get (screen)->fullscreen_windows_.remove(window);

  PluginAdapter::Default()->NotifyStateChange(window, window->state(), lastState);
  window->stateChangeNotify(lastState);
}

Here is the call graph for this function:

CompPoint unity::UnityWindow::tryNotIntersectUI ( CompPoint &  pos)

Definition at line 2611 of file unityshell.cpp.

{
  UnityScreen* us = UnityScreen::get(screen);
  auto window_geo = window->borderRect ();
  nux::Geometry target_monitor;
  nux::Point result(pos.x(), pos.y());

  // seriously why does compiz not track monitors XRandR style???
  auto monitors = UScreen::GetDefault()->GetMonitors();
  for (auto monitor : monitors)
  {
    if (monitor.IsInside(result))
    {
      target_monitor = monitor;
      break;
    }
  }

  auto launchers = us->launcher_controller_->launchers();
  for (auto launcher : launchers)
  {
    nux::Geometry geo = launcher->GetAbsoluteGeometry();

    if (launcher->Hidden() || launcher->options()->hide_mode == LAUNCHER_HIDE_NEVER || launcher->options()->hide_mode == LAUNCHER_HIDE_AUTOHIDE)
      continue;

    if (geo.IsInside(result))
    {
      if (geo.x + geo.width + 1 + window_geo.width() < target_monitor.x + target_monitor.width)
      {
        result.x = geo.x + geo.width + 1;
      }
    }
  }

  for (nux::Geometry &geo : us->panel_controller_->GetGeometries ())
  {
    if (geo.IsInside(result))
    {
      if (geo.y + geo.height + window_geo.height() < target_monitor.y + target_monitor.height)
      {
        result.y = geo.y + geo.height;
      }
    }
  }

  pos.setX(result.x);
  pos.setY(result.y);
  return pos;
}

Here is the call graph for this function:

Definition at line 2439 of file unityshell.cpp.

{
  if (mMinimizeHandler)
  {
    mMinimizeHandler->unminimize ();
    mMinimizeHandler.reset ();
  }
}
void unity::UnityWindow::updateFrameRegion ( CompRegion &  region)

Definition at line 2585 of file unityshell.cpp.

{
  /* The minimize handler will short circuit the frame
   * region update func and ensure that the frame
   * does not have a region */

  if (mMinimizeHandler)
    mMinimizeHandler->updateFrameRegion (region);
  else if (mShowdesktopHandler)
    mShowdesktopHandler->UpdateFrameRegion (region);
  else
    window->updateFrameRegion (region);
}
void unity::UnityWindow::updateIconPos ( int &  wx,
int &  wy,
int  x,
int  y,
float  width,
float  height 
)

Definition at line 726 of file unityshell.cpp.

{
  wx = x + (last_bound.width - width) / 2;
  wy = y + (last_bound.height - height) / 2;
}
void unity::UnityWindow::windowNotify ( CompWindowNotify  n)

Definition at line 2487 of file unityshell.cpp.

{
  PluginAdapter::Default()->Notify(window, n);

  switch (n)
  {
    case CompWindowNotifyMap:
      if (window->type() == CompWindowTypeDesktopMask) {
        if (!focus_desktop_timeout_)
        {
          focus_desktop_timeout_.reset(new glib::Timeout(1000, [&] {
            for (CompWindow *w : screen->clientList())
            {
              if (!(w->type() & NO_FOCUS_MASK) && w->focus ())
              {
                focus_desktop_timeout_ = nullptr;
                return false;
              }
            }

            window->moveInputFocusTo();

            focus_desktop_timeout_ = nullptr;
            return false;
          }));
        }
      }
    /* Fall through an re-evaluate wraps on map and unmap too */
    case CompWindowNotifyUnmap:
      if (UnityScreen::get (screen)->optionGetShowMinimizedWindows () &&
          window->mapNum ())
      {
        bool wasMinimized = window->minimized ();
        if (wasMinimized)
          window->unminimize ();
        window->focusSetEnabled (this, true);
        window->minimizeSetEnabled (this, true);
        window->unminimizeSetEnabled (this, true);
        window->minimizedSetEnabled (this, true);

        if (wasMinimized)
          window->minimize ();
      }
      else
      {
        window->focusSetEnabled (this, false);
        window->minimizeSetEnabled (this, false);
        window->unminimizeSetEnabled (this, false);
        window->minimizedSetEnabled (this, false);
      }
        break;
      default:
        break;
  }


  window->windowNotify(n);

  if (mMinimizeHandler)
  {
    /* The minimize handler will short circuit the frame
     * region update func and ensure that the frame
     * does not have a region */
    mMinimizeHandler->windowNotify (n);
  }
  else if (mShowdesktopHandler)
  {
    if (n == CompWindowNotifyFocusChange)
      mShowdesktopHandler->WindowFocusChangeNotify ();
  }

  // We do this after the notify to ensure input focus has actually been moved.
  if (n == CompWindowNotifyFocusChange)
  {
    UnityScreen* us = UnityScreen::get(screen);
    CompWindow *lw;

    if (us->launcher_controller_->IsOverlayOpen())
    {
      lw = screen->findWindow(us->launcher_controller_->LauncherWindowId(0));
      lw->moveInputFocusTo();
    }
  }
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 431 of file unityshell.h.

Definition at line 341 of file unityshell.h.

Definition at line 430 of file unityshell.h.

Definition at line 343 of file unityshell.h.

Definition at line 395 of file unityshell.h.

Definition at line 397 of file unityshell.h.

Definition at line 340 of file unityshell.h.


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