~brandontschaefer/unity/lp.1237132-fix

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/unityshell.cpp

  • Committer: Tarmac
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2013-03-08 12:46:41 UTC
  • mfrom: (3144.4.85 shutdown-view)
  • Revision ID: tarmac-20130308124641-z4d1y795mythghvf
Session: added a SessionController and View. Use the GnomeSessionManager to perform session actions

Such as suspend, hibernate, logout, lockscreen, reboot and shutdown.

Video: http://youtu.be/h_qqjOMGlrI. Fixes: https://bugs.launchpad.net/bugs/882041, https://bugs.launchpad.net/bugs/1152374.

Approved by PS Jenkins bot, Brandon Schaefer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <Nux/BaseWindow.h>
26
26
#include <Nux/WindowCompositor.h>
27
27
 
 
28
#include <UnityCore/Lens.h>
 
29
#include <UnityCore/GnomeSessionManager.h>
28
30
#include <UnityCore/Variant.h>
29
 
#include <UnityCore/Lens.h>
30
31
 
31
32
#include "BaseWindowRaiserImp.h"
32
33
#include "IconRenderer.h"
2577
2578
    paintInnerGlow(scaled_geo, matrix, attrib, mask);
2578
2579
  }
2579
2580
 
 
2581
  if (uScreen->session_controller_ && uScreen->session_controller_->Visible())
 
2582
  {
 
2583
    // Let's darken the other windows if the session dialog is visible
 
2584
    wAttrib.brightness *= 0.75f;
 
2585
  }
 
2586
 
2580
2587
  return gWindow->glPaint(wAttrib, matrix, region, mask);
2581
2588
}
2582
2589
 
3255
3262
  shortcut_controller_ = std::make_shared<shortcut::Controller>(base_window_raiser, shortcuts_modeller);
3256
3263
  AddChild(shortcut_controller_.get());
3257
3264
 
 
3265
  // Setup Session Controller
 
3266
  auto manager = std::make_shared<session::GnomeManager>();
 
3267
  session_controller_ = std::make_shared<session::Controller>(manager);
 
3268
  AddChild(session_controller_.get());
 
3269
 
3258
3270
  launcher_controller_->launcher().size_changed.connect([this] (nux::Area*, int w, int h) {
3259
3271
    /* The launcher geometry includes 1px used to draw the right margin
3260
3272
     * that must not be considered when drawing an overlay */