4 #include "virt_mon_set.h"
6 #define VIRT_MON_CHK(cond) {if (!(cond)) { SLOG(LOG_DEBUG, "DEVICEMGR", "[%s] : '%s' failed.\n", __func__, #cond); return; }}
8 /* set the virtual monitor to connect */
10 virtual_monitor_set_connect (Display *dpy)
14 Window win = DefaultRootWindow(dpy);
16 Atom virt_mon_atom = None;
18 virt_mon_atom = XInternAtom (dpy, STR_ATOM_VIRT_MON_SET, False);
20 xev.xclient.window = win;
21 xev.xclient.type = ClientMessage;
22 xev.xclient.message_type = virt_mon_atom;
23 xev.xclient.format = 32;
24 xev.xclient.data.s[0] = VM_CMD_SET;
25 xev.xclient.data.s[1] = 0;
26 xev.xclient.data.s[2] = 0;
27 xev.xclient.data.s[3] = 0;
28 xev.xclient.data.s[4] = 0;
30 XSendEvent(dpy, win, False, StructureNotifyMask, &xev);
34 /* set the virtual monitor to disconnect */
36 virtual_monitor_set_disconnect (Display *dpy)
40 Window win = DefaultRootWindow(dpy);
42 Atom virt_mon_atom = None;
44 virt_mon_atom = XInternAtom (dpy, STR_ATOM_VIRT_MON_SET, False);
46 xev.xclient.window = win;
47 xev.xclient.type = ClientMessage;
48 xev.xclient.message_type = virt_mon_atom;
49 xev.xclient.format = 32;
50 xev.xclient.data.s[0] = VM_CMD_UNSET;
51 xev.xclient.data.s[1] = 0;
52 xev.xclient.data.s[2] = 0;
53 xev.xclient.data.s[3] = 0;
54 xev.xclient.data.s[4] = 0;
56 XSendEvent(dpy, win, False, StructureNotifyMask, &xev);