Reputation: 1360
I need to get the relative position of mouse pointer in the window in which it is clicked, i've coded to capture the click event, but when i use this code
result = XQueryPointer(disp, XRootWindow(disp,0),&win, &win, &root_x, &root_y, &win_x, &win_y, &mask_return);
it shows the global position of mouse when printing win_x and win_y
only window i have is "win" the display is "disp"
Upvotes: 0
Views: 1825
Reputation: 1360
Found out evt.xbutton.x and evt.xbutton.y returns window relative mouse co ordinates
Upvotes: 1