6 #define HIB_CHK(cond) {if (!(cond)) { SLOG(LOG_DEBUG, "DEVICEMGR", "[%s] : '%s' failed.\n", __func__, #cond); return; }}
9 hibernation_set (Display *dpy)
13 Window win = DefaultRootWindow(dpy);
17 hib_atom = XInternAtom (dpy, STR_ATOM_HIB_SET, False);
19 xev.xclient.window = win;
20 xev.xclient.type = ClientMessage;
21 xev.xclient.message_type = hib_atom;
22 xev.xclient.format = 32;
23 xev.xclient.data.s[0] = HIB_CMD_SET;
24 xev.xclient.data.s[1] = 0;
25 xev.xclient.data.s[2] = 0;
26 xev.xclient.data.s[3] = 0;
27 xev.xclient.data.s[4] = 0;
29 XSendEvent(dpy, win, False, StructureNotifyMask, &xev);
34 hibernation_unset (Display *dpy)
38 Window win = DefaultRootWindow(dpy);
42 hib_atom = XInternAtom (dpy, STR_ATOM_HIB_SET, False);
44 xev.xclient.window = win;
45 xev.xclient.type = ClientMessage;
46 xev.xclient.message_type = hib_atom;
47 xev.xclient.format = 32;
48 xev.xclient.data.s[0] = HIB_CMD_UNSET;
49 xev.xclient.data.s[1] = 0;
50 xev.xclient.data.s[2] = 0;
51 xev.xclient.data.s[3] = 0;
52 xev.xclient.data.s[4] = 0;
54 XSendEvent(dpy, win, False, StructureNotifyMask, &xev);