Atom state, above; state = XInternAtom(display, "_NET_WM_STATE", 1); above = XInternAtom(display, "_NET_WM_STATE_ABOVE", 1); XChangeProperty(display, window, state, XA_ATOM, 32, PropModeReplace, (unsigned char*)&above, 1); XEvent xev; xev.xclient.type = ClientMessage; xev.xclient.serial = 0; xev.xclient.send_event = True; xev.xclient.window = window; xev.xclient.message_type = state; xev.xclient.format = 32; xev.xclient.data.l[0] = 1; xev.xclient.data.l[1] = above; xev.xclient.data.l[2] = 0; XSendEvent ( display, window, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);