internal override void GetCursorPos(IntPtr handle, out int x, out int y) {
IntPtr use_handle;
IntPtr root;
IntPtr child;
int root_x;
int root_y;
int win_x;
int win_y;
int keys_buttons;
if (handle != IntPtr.Zero) {
use_handle = Hwnd.ObjectFromHandle(handle).client_window;
} else {
use_handle = RootWindow;
}
lock (XlibLock) {
QueryPointer (DisplayHandle, use_handle, out root, out child, out root_x, out root_y, out win_x, out win_y, out keys_buttons);
}
if (handle != IntPtr.Zero) {
x = win_x;
y = win_y;
} else {
x = root_x;
y = root_y;
}
}