Qt and X11 fullscreen application , which blocks Window Manager simultaneously
i think i need to use a XEvent with QMainWindow together to make my application unable to close even by Window Manager , could any one provide an example ?
It's like a fullscreen video game , which blocks all keyboards , mouse buttons.
P.S: 开发者_如何学JAVAQWidget::grabKeyboard() && QWidget::grabMouse() doesn't work when i try to switch to other applications with key combinations like "ALT_TAB"
Thanks.
To completely block all inputs from other apps, you need to use XGrabServer
and not XGrabKeyboard
/XGrabPointer
combination. Dunno whether Qt has an API for that but you can always call the Xlib function directly.
I however recommend against it. If the application is for some reason doesn't release the grab, you're stuck and need to escape to the console to kill it.
I think you can override closeEvent() of your main window and reject the event by using ignore() method as described here.
精彩评论