summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-03-15 14:04:07 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-03-15 14:04:07 +0100
commit5fc2793d98a49517bc12248c4db2c5633a9fde98 (patch)
tree08728be8929d73c302384d1a6937920785375597 /plugins
parent35933ff4153668161c548b41efc993be11fe89a2 (diff)
parent6cae0ec593521ce5cc638ec4a975be2af283f1a2 (diff)
Merging with trunk
(bzr r4067.8.2)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/networkarearegion/CMakeLists.txt5
-rw-r--r--plugins/unity-mt-grab-handles/CMakeLists.txt5
-rw-r--r--plugins/unityshell/CMakeLists.txt7
-rw-r--r--plugins/unityshell/src/inputremover.cpp22
-rw-r--r--plugins/unityshell/src/inputremover.h1
-rw-r--r--plugins/unityshell/src/unityshell.cpp26
6 files changed, 48 insertions, 18 deletions
diff --git a/plugins/networkarearegion/CMakeLists.txt b/plugins/networkarearegion/CMakeLists.txt
index ea1ece005..7d7af425b 100644
--- a/plugins/networkarearegion/CMakeLists.txt
+++ b/plugins/networkarearegion/CMakeLists.txt
@@ -8,6 +8,11 @@ if(CMAKE_BUILD_TYPE STREQUAL "")
set(revert_compiz TRUE)
endif()
+set (libdir ${CMAKE_INSTALL_LIBDIR})
+set (includedir ${CMAKE_INSTALL_INCLUDEDIR})
+set (libdir ${CMAKE_INSTALL_LIBDIR})
+set (datadir ${CMAKE_INSTALL_FULL_DATADIR})
+
compiz_plugin (networkarearegion)
if(revert_compiz)
diff --git a/plugins/unity-mt-grab-handles/CMakeLists.txt b/plugins/unity-mt-grab-handles/CMakeLists.txt
index ec13c9f0d..acaaa8db3 100644
--- a/plugins/unity-mt-grab-handles/CMakeLists.txt
+++ b/plugins/unity-mt-grab-handles/CMakeLists.txt
@@ -8,6 +8,11 @@ if(CMAKE_BUILD_TYPE STREQUAL "")
set(revert_compiz TRUE)
endif()
+set (libdir ${CMAKE_INSTALL_LIBDIR})
+set (includedir ${CMAKE_INSTALL_INCLUDEDIR})
+set (libdir ${CMAKE_INSTALL_LIBDIR})
+set (datadir ${CMAKE_INSTALL_FULL_DATADIR})
+
compiz_plugin (unitymtgrabhandles PKGDEPS nux-4.0>=4.0.0 PLUGINDEPS composite opengl CFLAGSADD -std=c++0x)
if(revert_compiz)
diff --git a/plugins/unityshell/CMakeLists.txt b/plugins/unityshell/CMakeLists.txt
index 01a300589..b7e5b5f78 100644
--- a/plugins/unityshell/CMakeLists.txt
+++ b/plugins/unityshell/CMakeLists.txt
@@ -10,6 +10,11 @@ if(CMAKE_BUILD_TYPE STREQUAL "")
set(revert_compiz TRUE)
endif()
+set (libdir ${CMAKE_INSTALL_LIBDIR})
+set (includedir ${CMAKE_INSTALL_INCLUDEDIR})
+set (libdir ${CMAKE_INSTALL_LIBDIR})
+set (datadir ${CMAKE_INSTALL_FULL_DATADIR})
+
compiz_plugin (unityshell
PKGDEPS ${UNITY_PLUGIN_DEPS}
PLUGINDEPS composite opengl compiztoolbox scale
@@ -50,4 +55,4 @@ set_target_properties(unityshell
#
# Data
#
-install (FILES plugin-unityshell.png DESTINATION ${DATADIR}/ccsm/icons/hicolor/64x64/apps)
+install (FILES plugin-unityshell.png DESTINATION ${COMPIZ_DATADIR}/ccsm/icons/hicolor/64x64/apps)
diff --git a/plugins/unityshell/src/inputremover.cpp b/plugins/unityshell/src/inputremover.cpp
index b28e7a1e2..c24639c81 100644
--- a/plugins/unityshell/src/inputremover.cpp
+++ b/plugins/unityshell/src/inputremover.cpp
@@ -19,12 +19,12 @@
* Sam Spilsbury <sam.spilsbury@canonical.com>
*/
-#include <cstdlib>
-#include <boost/scoped_array.hpp>
#include "inputremover.h"
+#include <cstdlib>
#include <X11/Xregion.h>
#include <cstdio>
#include <cstring>
+#include <vector>
namespace
{
@@ -88,6 +88,7 @@ compiz::WindowInputRemover::WindowInputRemover (Display *dpy,
Window shapeWindow,
Window propWindow) :
mDpy (dpy),
+ mProperty (XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", False)),
mShapeWindow (shapeWindow),
mPropWindow (propWindow),
mShapeMask (0),
@@ -328,7 +329,6 @@ compiz::WindowInputRemover::writeProperty (XRectangle *input,
int nInput,
int inputOrdering)
{
- Atom prop = XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", FALSE);
Atom type = XA_CARDINAL;
int fmt = 32;
@@ -347,8 +347,7 @@ compiz::WindowInputRemover::writeProperty (XRectangle *input,
*/
const size_t dataSize = headerSize + (nInput * 4);
- boost::scoped_array<unsigned long> data(new unsigned long[dataSize]);
-
+ std::vector<unsigned long> data(dataSize);
data[0] = propVersion;
data[1] = nInput;
data[2] = inputOrdering;
@@ -366,11 +365,11 @@ compiz::WindowInputRemover::writeProperty (XRectangle *input,
/* No need to check return code, always returns 0 */
XChangeProperty(mDpy,
mPropWindow,
- prop,
+ mProperty,
type,
fmt,
PropModeReplace,
- reinterpret_cast<unsigned char*>(data.get()),
+ reinterpret_cast<unsigned char*>(data.data()),
dataSize);
return true;
@@ -382,7 +381,6 @@ compiz::WindowInputRemover::queryProperty(XRectangle **input,
int *inputOrdering)
{
- Atom prop = XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", FALSE);
Atom type = XA_CARDINAL;
int fmt = 32;
@@ -400,7 +398,7 @@ compiz::WindowInputRemover::queryProperty(XRectangle **input,
* long the rest of the property is going to be */
if (!XGetWindowProperty(mDpy,
mPropWindow,
- prop,
+ mProperty,
0L,
headerLength,
FALSE,
@@ -439,7 +437,7 @@ compiz::WindowInputRemover::queryProperty(XRectangle **input,
if (!XGetWindowProperty(mDpy,
mPropWindow,
- prop,
+ mProperty,
0L,
fullLength,
FALSE,
@@ -487,9 +485,7 @@ compiz::WindowInputRemover::queryProperty(XRectangle **input,
void
compiz::WindowInputRemover::clearProperty()
{
- Atom prop = XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", FALSE);
-
- XDeleteProperty(mDpy, mPropWindow, prop);
+ XDeleteProperty(mDpy, mPropWindow, mProperty);
}
bool
diff --git a/plugins/unityshell/src/inputremover.h b/plugins/unityshell/src/inputremover.h
index d5c6f5a45..764327acb 100644
--- a/plugins/unityshell/src/inputremover.h
+++ b/plugins/unityshell/src/inputremover.h
@@ -97,6 +97,7 @@ private:
void clearRectangles ();
Display *mDpy;
+ Atom mProperty;
Window mShapeWindow;
Window mPropWindow;
unsigned long mShapeMask;
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 8e7809346..131580fea 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -175,6 +175,13 @@ const std::string HUD_UNGRAB_WAIT = "hud-ungrab-wait";
const std::string FIRST_RUN_STAMP = "first_run.stamp";
const std::string LOCKED_STAMP = "locked.stamp";
} // namespace local
+
+namespace atom
+{
+Atom _UNITY_SHELL = 0;
+Atom _UNITY_SAVED_WINDOW_SHAPE = 0;
+}
+
} // anon namespace
UnityScreen::UnityScreen(CompScreen* screen)
@@ -311,6 +318,9 @@ UnityScreen::UnityScreen(CompScreen* screen)
CompositeScreenInterface::setHandler(cScreen);
GLScreenInterface::setHandler(gScreen);
ScaleScreenInterface::setHandler(sScreen);
+
+ atom::_UNITY_SHELL = XInternAtom(screen->dpy(), "_UNITY_SHELL", False);
+ atom::_UNITY_SAVED_WINDOW_SHAPE = XInternAtom(screen->dpy(), "_UNITY_SAVED_WINDOW_SHAPE", False);
screen->updateSupportedWmHints();
nux::NuxInitialize(0);
@@ -504,8 +514,10 @@ UnityScreen::~UnityScreen()
QuicklistManager::Destroy();
decoration::DataPool::Reset();
SaveLockStamp(false);
-
reset_glib_logging();
+
+ screen->addSupportedAtomsSetEnabled(this, false);
+ screen->updateSupportedWmHints();
}
void UnityScreen::InitAltTabNextWindow()
@@ -1768,6 +1780,8 @@ void UnityScreen::determineNuxDamage(CompRegion& nux_damage)
void UnityScreen::addSupportedAtoms(std::vector<Atom>& atoms)
{
screen->addSupportedAtoms(atoms);
+ atoms.push_back(atom::_UNITY_SHELL);
+ atoms.push_back(atom::_UNITY_SAVED_WINDOW_SHAPE);
deco_manager_->AddSupportedAtoms(atoms);
}
@@ -4180,13 +4194,17 @@ bool WindowHasInconsistentShapeRects(Display *d, Window w)
int n;
Atom *atoms = XListProperties(d, w, &n);
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)
+ {
+ if (atoms[i] == atom::_UNITY_SAVED_WINDOW_SHAPE)
+ {
has_inconsistent_shape = true;
+ break;
+ }
+ }
- XFree (atoms);
+ XFree(atoms);
return has_inconsistent_shape;
}
}