简体   繁体   中英

XTestFakeButtonEvent not working on GNOME bar

I'm writing an accessibility application that mouse-clicks for the user by using the keyboard. I'm using

Display *display = XOpenDisplay(NULL);
XTestFakeButtonEvent(display, button, true, CurrentTime); // true is 'mouse down'
XFlush(display);
XCloseDisplay(display);

and it works great on any window I can see, except the GNOME upper bar (the upper bar with the date and time and to the right the icons including the "shut down" icon):

在此处输入图像描述

This bar seems to ignore completely the X11 events I'm generating with the code above.

Why is this happening? Any way to solve it?

It seems that generating a 'button release' event before the two 'button down'+'button release' events fixed it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM