summaryrefslogtreecommitdiff
path: root/xcompmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'xcompmgr.c')
-rw-r--r--xcompmgr.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/xcompmgr.c b/xcompmgr.c
index bf7910b..9d4072c 100644
--- a/xcompmgr.c
+++ b/xcompmgr.c
@@ -1886,9 +1886,33 @@ register_cm (void)
snprintf (net_wm_cm, sizeof (net_wm_cm), "_NET_WM_CM_S%d", scr);
a = XInternAtom (dpy, net_wm_cm, False);
- if (XGetSelectionOwner (dpy, a) != None)
- {
- fprintf (stderr, "Another composite manager is already running\n");
+ w = XGetSelectionOwner (dpy, a);
+ if (w != None)
+ {
+ XTextProperty tp;
+ char **strs;
+ int count;
+ Atom winNameAtom = XInternAtom (dpy, "_NET_WM_NAME", False);
+
+ if (!XGetTextProperty (dpy, w, &tp, winNameAtom) &&
+ !XGetTextProperty (dpy, w, &tp, XA_WM_NAME))
+ {
+ fprintf (stderr,
+ "Another composite manager is already running (0x%lx)\n",
+ (unsigned long) w);
+ return False;
+ }
+ if (XmbTextPropertyToTextList (dpy, &tp, &strs, &count) == Success)
+ {
+ fprintf (stderr,
+ "Another composite manager is already running (%s)\n",
+ strs[0]);
+
+ XFreeStringList (strs);
+ }
+
+ XFree (tp.value);
+
return False;
}