/* opacity property name; sometime soon I'll write up an EWMH spec for it */
#define OPACITY_PROP "_NET_WM_WINDOW_OPACITY"
+#define REGISTER_PROP "_NET_WM_CM_S"
#define TRANSLUCENT 0xe0000000
#define OPAQUE 0xffffffff
#endif
w->damaged = 0;
-#if HAS_NAME_WINDOW_PIXMAP
- /* If the window was previously mapped and its pixmap still exists, it
- is out of date now, so force us to reacquire it. (If the window
- re-maps before the unmap fade-out finished) */
- if (w->pixmap)
- {
- XFreePixmap (dpy, w->pixmap);
- w->pixmap = None;
- }
-#endif
-
if (fade && winTypeFade[w->windowType])
set_fade (dpy, w, 0, get_opacity_percent (dpy, w), fade_in_step, 0, True, True);
}
}
static void
-register_cm (void)
+register_cm (int scr)
{
Window w;
Atom a;
+ char *buf;
+ int len, s;
+
+ if (scr < 0) return;
w = XCreateSimpleWindow (dpy, RootWindow (dpy, 0), 0, 0, 1, 1, 0, None,
None);
Xutf8SetWMProperties (dpy, w, "xcompmgr", "xcompmgr", NULL, 0, NULL, NULL,
NULL);
- /* FIXME: Don't hard code the screen number */
- a = XInternAtom (dpy, "_NET_WM_CM_S0", False);
+ len = strlen(REGISTER_PROP) + 2;
+ s = scr;
+ while (s >= 10) {
+ ++len;
+ s /= 10;
+ }
+ buf = malloc(len);
+ snprintf(buf, len, REGISTER_PROP"%d", scr);
+
+ a = XInternAtom (dpy, buf, False);
+ free(buf);
XSetSelectionOwner (dpy, a, w, 0);
}
exit (1);
}
- register_cm();
+ register_cm(scr);
/* get atoms */
opacityAtom = XInternAtom (dpy, OPACITY_PROP, False);