#include <X11/Xlib.h>
#include <stdlib.h>
enum
{
_NET_WM_STATE_REMOVE =0,
_NET_WM_STATE_ADD = 1,
_NET_WM_STATE_TOGGLE =2
};
int main()
{
Display * pDisplay = XOpenDisplay(NULL);
int screen = DefaultScreen(pDisplay);
XSetWindowAttributes attr;
attr.border_pixel = 0;
attr.background_pixel = 0;
attr.event_mask = ExposureMask | StructureNotifyMask;
Window parentWindow = RootWindow(pDisplay, screen);
Window window = XCreateWindow(pDisplay,
parentWindow,
0,0, //left top
640, 480,
0,
0,
InputOutput,
CopyFromParent,
CWBackPixel | CWBorderPixel |
CWEventMask,
&attr);
XWarpPointer(pDisplay, None, window, 0, 0, 0, 0, 100, 100);
XGrabKeyboard(pDisplay, window, True, GrabModeAsync, GrabModeAsync,
CurrentTime);
XMapR
#include <stdlib.h>
enum
{
_NET_WM_STATE_REMOVE =0,
_NET_WM_STATE_ADD = 1,
_NET_WM_STATE_TOGGLE =2
};
int main()
{
Display * pDisplay = XOpenDisplay(NULL);
int screen = DefaultScreen(pDisplay);
XSetWindowAttributes attr;
attr.border_pixel = 0;
attr.background_pixel = 0;
attr.event_mask = ExposureMask | StructureNotifyMask;
Window parentWindow = RootWindow(pDisplay, screen);
Window window = XCreateWindow(pDisplay,
parentWindow,
0,0, //left top
640, 480,
0,
0,
InputOutput,
CopyFromParent,
CWBackPixel | CWBorderPixel |
CWEventMask,
&attr);
XWarpPointer(pDisplay, None, window, 0, 0, 0, 0, 100, 100);
XGrabKeyboard(pDisplay, window, True, GrabModeAsync, GrabModeAsync,
CurrentTime);
XMapR