summaryrefslogtreecommitdiff
path: root/plugins/compiztoolbox
diff options
context:
space:
mode:
authorSam Spilsbury <SmSpillaz@gmail.com>2010-05-23 20:12:40 +0800
committerSam Spilsbury <SmSpillaz@gmail.com>2010-05-23 20:12:40 +0800
commit2865287d35b9d6934ecec108df1277629d80d1dd (patch)
tree39e1980fb311d60292b232bbc12d75b108752657 /plugins/compiztoolbox
parenta27614ff510929d8d7d8fa67216fb8dbd4aac82c (diff)
downloadcompiz-with-glib-mainloop-2865287d35b9d6934ecec108df1277629d80d1dd.tar.gz
compiz-with-glib-mainloop-2865287d35b9d6934ecec108df1277629d80d1dd.tar.bz2
Add getReadTemplate function and make plugins use that.
This avoids some repetitive coding when setting up values to input into the property.
Diffstat (limited to 'plugins/compiztoolbox')
-rw-r--r--plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h1
-rw-r--r--plugins/compiztoolbox/src/compiztoolbox.cpp9
2 files changed, 8 insertions, 2 deletions
diff --git a/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h b/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
index 7e6a99e..46a0b6d 100644
--- a/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
+++ b/plugins/compiztoolbox/include/compiztoolbox/compiztoolbox.h
@@ -75,6 +75,7 @@ class PropertyWriter
bool updateProperty (Window, CompOption::Vector &, bool, int);
CompOption::Vector readProperty (Window);
void setReadTemplate (const CompOption::Vector &);
+ CompOption::Vector getReadTemplate ();
private:
diff --git a/plugins/compiztoolbox/src/compiztoolbox.cpp b/plugins/compiztoolbox/src/compiztoolbox.cpp
index bba1ca5..d97e9f8 100644
--- a/plugins/compiztoolbox/src/compiztoolbox.cpp
+++ b/plugins/compiztoolbox/src/compiztoolbox.cpp
@@ -62,6 +62,12 @@ PropertyWriter::setReadTemplate (const CompOption::Vector &readTemplate)
mPropertyValues = readTemplate;
}
+CompOption::Vector
+PropertyWriter::getReadTemplate ()
+{
+ return mPropertyValues;
+}
+
bool
PropertyWriter::updateProperty (Window id,
CompOption::Vector &propertyData,
@@ -272,8 +278,7 @@ BaseSwitchScreen::setSelectedWindowHint ()
selectedWindowId = selectedWindow->id ();
v = CompOption::Value ((int) selectedWindowId);
- opts.resize (1);
- opts.at (0).setName ("id", CompOption::TypeInt);
+ opts = selectWinAtom.getReadTemplate ();
opts.at (0).set (v);
selectWinAtom.updateProperty (popupWindow, opts, false, XA_WINDOW);