Problem retrieving cursor size with XQueryBestCursor
Tadao Ando Jr.
tadaojr at gmail.com
Mon Aug 26 21:49:02 UTC 2024
Hi,
I'm currently having problems with the return from the
XQueryBestCursor call returning size 0x0.
I have tested the following code:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<X11/Xlib.h>
int main(int argc, char *argv[]){
unsigned int ret_h;
unsigned int ret_w;
if(argc < 3){
printf("ERROR: uses as %s [WIDTH] [HEIGHT].\n", argv[0]);
return -1;
}
Display *dis = XOpenDisplay( NULL );
Drawable drw = RootWindow(dis, DefaultScreen(dis));
Status st = XQueryBestCursor(dis, drw, atoi(argv[1]),
atoi(argv[2]), &ret_h, &ret_w);
printf("Display %lld\nDrawable %d\nXQueryBestCursor
(%u,%u)\nRet_code %d\n", (long long int) dis, (int) drw, ret_h, ret_w,
st);
return 0;
}
I get the following output:
Display 163512328
Drawable 813
XQueryBestCursor (0,0)
Ret_code 1
I've also noted the output of xdpyinfo (full output here
https://pastebin.com/UfDZ9cxV) showing this:
xdpyinfo -display :0 | grep cursor
largest cursor: 0x0
What could be the cause of this result? I've also tested the code on a
different machine and it works as expected.
This is my /var/log/Xorg.0.log (https://pastebin.com/3n7r73Q0)
More information about the xorg
mailing list