This is just a dummy confirmation question but I really want to make sure the values I receive from calling the function XQueryPointer
are in pixels for the X and Y screen coordinates.
extern Bool XQueryPointer(
Display* /* display */,
Window /* w */,
Window* /* root_return */,
Window* /* child_return */,
int* /* root_x_return */,
int* /* root_y_return */,
int* /* win_x_return */,
int* /* win_y_return */,
unsigned int* /* mask_return */
);
This is because I will need to perform some operations once I get the whole resolution of my screen using the following functions, i.e. I'll filter out some pixels from the entire screen but need to know the values returned by XQueryPointer
are also pixels.
xVal = DisplayWidth(display, screen_number);
yVal = DisplayHeight(display, screen_number);
I'm assuming root_x_return
and root_y_return
are in pixels. Am I correct?
Yes. From the Xlib documentation:
Each window and pixmap has its own coordinate system. The coordinate system has the X axis horizontal and the Y axis vertical with the origin [0, 0] at the upper-left corner. Coordinates are integral, in terms of pixels, and coincide with pixel centers. For a window, the origin is inside the border at the inside, upper-left corner.