summaryrefslogtreecommitdiff
path: root/app/cwm/xutil.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2012-05-16 01:17:15 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2012-05-16 01:17:15 +0000
commit92c96d6f2e48b6fb7e06ab9d712da22dc8d65873 (patch)
tree8253544c0714c880a89ec64a5e9dae679aeb092d /app/cwm/xutil.c
parent290795ee7121cede5cf358c79176a205891a566b (diff)
instead of using the menu window for _NET_SUPPORTING_WM_CHECK, create a
dummy one to use instead; allows us to not have to wait for menu_init(), so re-shuffle _NET_SUPPORTED slightly. ok sthen@
Diffstat (limited to 'app/cwm/xutil.c')
-rw-r--r--app/cwm/xutil.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c
index bcd85fbfc..e6d97bb7f 100644
--- a/app/cwm/xutil.c
+++ b/app/cwm/xutil.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: xutil.c,v 1.39 2012/05/16 01:04:36 okan Exp $
+ * $OpenBSD: xutil.c,v 1.40 2012/05/16 01:17:14 okan Exp $
*/
#include <sys/param.h>
@@ -260,27 +260,31 @@ xu_getatoms(void)
}
void
-xu_setwmname(struct screen_ctx *sc)
+xu_ewmh_net_supported(struct screen_ctx *sc)
{
- /*
- * set up the _NET_SUPPORTED hint with all netwm atoms that we
- * know about.
- */
XChangeProperty(X_Dpy, sc->rootwin, _NET_SUPPORTED, XA_ATOM, 32,
PropModeReplace, (unsigned char *)&_NET_SUPPORTED,
CWM_NO_ATOMS - CWM_NETWM_START);
- /*
- * netwm spec says that to prove that the hint is not stale you must
- * provide _NET_SUPPORTING_WM_CHECK containing a window (we use the
- * menu window). The property must be set on the root window and the
- * window itself, the window also must have _NET_WM_NAME set with the
- * window manager name.
- */
+}
+
+/*
+ * The netwm spec says that to prove that the hint is not stale, one
+ * must provide _NET_SUPPORTING_WM_CHECK containing a window created by
+ * the root window. The property must be set on the root window and the
+ * window itself. This child window also must have _NET_WM_NAME set with
+ * the window manager name.
+ */
+void
+xu_ewmh_net_supported_wm_check(struct screen_ctx *sc)
+{
+ Window w;
+
+ w = XCreateSimpleWindow(X_Dpy, sc->rootwin, -1, -1, 1, 1, 0, 0, 0);
XChangeProperty(X_Dpy, sc->rootwin, _NET_SUPPORTING_WM_CHECK,
- XA_WINDOW, 32, PropModeReplace, (unsigned char *)&sc->menuwin, 1);
- XChangeProperty(X_Dpy, sc->menuwin, _NET_SUPPORTING_WM_CHECK,
- XA_WINDOW, 32, PropModeReplace, (unsigned char *)&sc->menuwin, 1);
- XChangeProperty(X_Dpy, sc->menuwin, _NET_WM_NAME, UTF8_STRING,
+ XA_WINDOW, 32, PropModeReplace, (unsigned char *)&w, 1);
+ XChangeProperty(X_Dpy, w, _NET_SUPPORTING_WM_CHECK,
+ XA_WINDOW, 32, PropModeReplace, (unsigned char *)&w, 1);
+ XChangeProperty(X_Dpy, w, _NET_WM_NAME, UTF8_STRING,
8, PropModeReplace, WMNAME, strlen(WMNAME));
}