summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-02-05 19:26:34 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-02-05 19:26:34 +0800
commit27085a3bed90ce58903aa41fe93ef691138dc9d3 (patch)
treeb4f9fc4d933f844638da3525c96c6de5ff42156f
parenteee60472532f565d06db15c82cf338f7c509f7cb (diff)
downloadtitleinfo-27085a3bed90ce58903aa41fe93ef691138dc9d3.tar.gz
titleinfo-27085a3bed90ce58903aa41fe93ef691138dc9d3.tar.bz2
Enable addSupportedAtoms
-rw-r--r--src/titleinfo.cpp38
-rw-r--r--src/titleinfo.h10
2 files changed, 20 insertions, 28 deletions
diff --git a/src/titleinfo.cpp b/src/titleinfo.cpp
index 7a5d244..dc9e011 100644
--- a/src/titleinfo.cpp
+++ b/src/titleinfo.cpp
@@ -208,30 +208,15 @@ TitleinfoWindow::updateMachine ()
if (ts->optionGetShowRemoteMachine ())
updateVisibleName ();
}
-/*
-static unsigned int
-titleinfoAddSupportedAtoms (CompScreen *s,
- Atom *atoms,
- unsigned int size)
-{
- unsigned int count;
-
- TITLEINFO_DISPLAY (s->display);
- TITLEINFO_SCREEN (s);
-
- UNWRAP (ts, s, addSupportedAtoms);
- count = (*s->addSupportedAtoms) (s, atoms, size);
- WRAP (ts, s, addSupportedAtoms, titleinfoAddSupportedAtoms);
-
- if ((size - count) >= 2)
- {
- atoms[count++] = td->visibleNameAtom;
- atoms[count++] = td->wmPidAtom;
- }
- return count;
+void
+TitleinfoScreen::addSupportedAtoms (std::vector<Atom> &atoms)
+{
+ screen->addSupportedAtoms (atoms);
+
+ atoms.push_back (visibleNameAtom);
+ atoms.push_back (wmPidAtom);
}
-*/
void
TitleinfoScreen::handleEvent (XEvent *event)
@@ -280,8 +265,17 @@ TitleinfoScreen::TitleinfoScreen (CompScreen *screen) :
wmPidAtom (XInternAtom (screen->dpy (), "_NET_WM_PID", 0))
{
ScreenInterface::setHandler (screen);
+
+ screen->updateSupportedWmHints ();
};
+TitleinfoScreen::~TitleinfoScreen ()
+{
+ screen->addSupportedAtomsSetEnabled (this, false);
+
+ screen->updateSupportedWmHints ();
+}
+
TitleinfoWindow::TitleinfoWindow (CompWindow *window) :
PluginClassHandler <TitleinfoWindow, CompWindow> (window),
window (window),
diff --git a/src/titleinfo.h b/src/titleinfo.h
index cc6f0de..916bfe9 100644
--- a/src/titleinfo.h
+++ b/src/titleinfo.h
@@ -48,6 +48,7 @@ class TitleinfoScreen :
public:
TitleinfoScreen (CompScreen *);
+ ~TitleinfoScreen ();
Atom visibleNameAtom;
Atom wmPidAtom;
@@ -55,12 +56,9 @@ class TitleinfoScreen :
void
handleEvent (XEvent *);
- /* FIXME:
- * Need something like this in core to be wrappable
- unsigned int
- addSupportedAtoms (Atom *atoms,
- unsigned int size);
- */
+
+ void
+ addSupportedAtoms (std::vector<Atom> &atoms);
CompString
getUtf8Property (Window id,