summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2009-06-24 13:09:26 +0200
committerDanny Baumann <dannybaumann@web.de>2009-06-24 13:09:26 +0200
commit6cabd8fb5c3e5bd8fa52fae56d18b1cd71a90240 (patch)
tree7c52d36af64319ff5071dd9c2a33ffaecefb18eb
parent1904467e3614839c2e24142a09291c2d8cf12388 (diff)
downloadtitleinfo-6cabd8fb5c3e5bd8fa52fae56d18b1cd71a90240.tar.gz
titleinfo-6cabd8fb5c3e5bd8fa52fae56d18b1cd71a90240.tar.bz2
Advertise support for _NET_WM_VISIBLE_NAME and _NET_WM_PID.
-rw-r--r--titleinfo.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/titleinfo.c b/titleinfo.c
index 039bfb9..2873505 100644
--- a/titleinfo.c
+++ b/titleinfo.c
@@ -46,6 +46,8 @@ typedef struct _TitleinfoDisplay {
typedef struct _TitleinfoScreen {
int windowPrivateIndex;
+
+ AddSupportedAtomsProc addSupportedAtoms;
} TitleinfoScreen;
typedef struct _TitleinfoWindow {
@@ -241,6 +243,29 @@ titleinfoUpdateMachine (CompWindow *w)
titleinfoUpdateVisibleName (w);
}
+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;
+}
+
static void
titleinfoHandleEvent (CompDisplay *d,
XEvent *event)
@@ -341,6 +366,8 @@ titleinfoInitScreen (CompPlugin *p,
s->base.privates[td->screenPrivateIndex].ptr = ts;
+ WRAP (ts, s, addSupportedAtoms, titleinfoAddSupportedAtoms);
+
return TRUE;
}
@@ -350,6 +377,8 @@ titleinfoFiniScreen (CompPlugin *p,
{
TITLEINFO_SCREEN (s);
+ UNWRAP (ts, s, addSupportedAtoms);
+
freeWindowPrivateIndex (s, ts->windowPrivateIndex);
free (ts);