summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-02-12 05:04:39 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-02-12 05:04:39 +0100
commit2bec9c876fc31b90b09af67f8d078daf11bb3497 (patch)
tree3fc8df431816471771126ab082fce8ce8ff6e5ae /plugins
parent76c31bb9542c7718db86c919446c9d4de2edeaf5 (diff)
KeyGrabber: add abstract class and implement it in GnomeKeyGrabber
(bzr r3652.3.1)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unityshell/src/unityshell.cpp14
-rw-r--r--plugins/unityshell/src/unityshell.h6
2 files changed, 9 insertions, 11 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index bfbe2edb4..ed3e226b1 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -50,6 +50,7 @@
#include "launcher/XdndManagerImp.h"
#include "launcher/XdndStartStopNotifierImp.h"
#include "CompizShortcutModeller.h"
+#include "GnomeKeyGrabber.h"
#include "decorations/DecorationsDataPool.h"
#include "decorations/DecorationsManager.h"
@@ -122,7 +123,7 @@ inline nux::Geometry NuxGeometryFromCompRect(CompRect const& rect)
return nux::Geometry(rect.x(), rect.y(), rect.width(), rect.height());
}
-inline nux::Color NuxColorFromCompizColor(unsigned short * color)
+inline nux::Color NuxColorFromCompizColor(unsigned short* color)
{
return nux::Color(color[0]/65535.0f, color[1]/65535.0f, color[2]/65535.0f, color[3]/65535.0f);
}
@@ -148,6 +149,7 @@ UnityScreen::UnityScreen(CompScreen* screen)
, cScreen(CompositeScreen::get(screen))
, gScreen(GLScreen::get(screen))
, deco_manager_(std::make_shared<decoration::Manager>())
+ , key_grabber_(std::make_shared<key::GnomeGrabber>())
, debugger_(this)
, needsRelayout(false)
, super_keypressed_(false)
@@ -171,7 +173,6 @@ UnityScreen::UnityScreen(CompScreen* screen)
, dirty_helpers_on_this_frame_(false)
, back_buffer_age_(0)
, is_desktop_active_(false)
- , grabber_(new GnomeKeyGrabber(screen))
{
Timer timer;
#ifndef USE_GLES
@@ -3554,7 +3555,7 @@ void UnityScreen::initLauncher()
/* Setup panel */
timer.Reset();
- panel_controller_ = std::make_shared<panel::Controller>(edge_barriers, grabber_);
+ panel_controller_ = std::make_shared<panel::Controller>(edge_barriers, key_grabber_);
AddChild(panel_controller_.get());
panel_controller_->SetMenuShowTimings(optionGetMenusFadein(),
optionGetMenusFadeout(),
@@ -3640,20 +3641,19 @@ void UnityScreen::InitGesturesSupport()
CompAction::Vector& UnityScreen::getActions()
{
- return grabber_->getActions();
+ return key_grabber_->getActions();
}
/* Window init */
namespace
{
-bool WindowHasInconsistentShapeRects (Display *d,
- Window w)
+bool WindowHasInconsistentShapeRects(Display *d, Window w)
{
int n;
Atom *atoms = XListProperties(d, w, &n);
- Atom unity_shape_rects_atom = XInternAtom (d, "_UNITY_SAVED_WINDOW_SHAPE", FALSE);
bool has_inconsistent_shape = false;
+ static Atom unity_shape_rects_atom = XInternAtom(d, "_UNITY_SAVED_WINDOW_SHAPE", False);
for (int i = 0; i < n; ++i)
if (atoms[i] == unity_shape_rects_atom)
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index 1b1c92aa2..72ef80c90 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -69,6 +69,7 @@
#include "UnityshellPrivate.h"
#include "UnityShowdesktopHandler.h"
#include "ThumbnailGenerator.h"
+#include "KeyGrabber.h"
#include "compizminimizedwindowhandler.h"
#include "BGHash.h"
@@ -80,8 +81,6 @@
#include "unityshell_glow.h"
-#include "GnomeKeyGrabber.h"
-
namespace unity
{
class UnityWindow;
@@ -315,6 +314,7 @@ private:
std::unique_ptr<nux::WindowThread> wt;
std::shared_ptr<decoration::Manager> deco_manager_;
+ key::Grabber::Ptr key_grabber_;
/* These must stay below the window thread, please keep the order */
launcher::Controller::Ptr launcher_controller_;
@@ -406,8 +406,6 @@ private:
bool is_desktop_active_;
- GnomeKeyGrabber::Ptr grabber_;
-
friend class UnityWindow;
friend class decoration::Manager;
};