diff options
author | Richard Grenville <[email protected]> | 2013-11-10 10:13:18 +0800 |
---|---|---|
committer | Richard Grenville <[email protected]> | 2013-11-10 10:13:18 +0800 |
commit | 640ef0437814dbc4df57a275cbadecb368ad0950 (patch) | |
tree | bb4b5ac09bd8e7acb5319a4b2211bfd859d1515f /compton.c | |
parent | ed99f1b2c9fe5c2ff5efe0af204b381aa9fdcc3e (diff) | |
download | tdebase-640ef0437814dbc4df57a275cbadecb368ad0950.tar.gz tdebase-640ef0437814dbc4df57a275cbadecb368ad0950.zip |
Misc: Add properties to the registration window
Add WM_CLASS, COMPTON_VERSION, and _NET_WM_PID properties to the
registration window, to ease the development of pcman's compton-conf.
Diffstat (limited to 'compton.c')
-rw-r--r-- | compton.c | 27 |
1 files changed, 25 insertions, 2 deletions
@@ -4543,8 +4543,31 @@ register_cm(session_t *ps) { if (ps->redirected) XCompositeUnredirectWindow(ps->dpy, ps->reg_win, CompositeRedirectManual); - Xutf8SetWMProperties(ps->dpy, ps->reg_win, "xcompmgr", "xcompmgr", - NULL, 0, NULL, NULL, NULL); + { + XClassHint *h = XAllocClassHint(); + if (h) { + h->res_name = "compton"; + h->res_class = "xcompmgr"; + } + Xutf8SetWMProperties(ps->dpy, ps->reg_win, "xcompmgr", "xcompmgr", + NULL, 0, NULL, NULL, h); + cxfree(h); + } + + // Set _NET_WM_PID + { + long pid = getpid(); + if (!XChangeProperty(ps->dpy, ps->reg_win, + get_atom(ps, "_NET_WM_PID"), XA_CARDINAL, 32, PropModeReplace, + (unsigned char *) &pid, 1)) { + printf_errf("(): Failed to set _NET_WM_PID."); + } + } + + // Set COMPTON_VERSION + if (!wid_set_text_prop(ps, ps->reg_win, get_atom(ps, "COMPTON_VERSION"), COMPTON_VERSION)) { + printf_errf("(): Failed to set COMPTON_VERSION."); + } { unsigned len = strlen(REGISTER_PROP) + 2; |