有没有类似Windows的XAppFocusOut事件WM_ACTIVATEAPP 或 OSX 的 applicationDidResignActive或其他方式在应用程序失去焦点时收到通知?首选 XCB 解决方案。
澄清一下:我对应用(而不是窗口)失去焦点时的事件感兴趣。
谢谢。
最佳答案
您想要FocusOut
X event .
The X server can report FocusIn or FocusOut events to clients wanting information about when the input focus changes. The keyboard is always attached to some window (typically, the root window or a top-level window), which is called the focus window. The focus window and the position of the pointer determine the window that receives keyboard input. Clients may need to know when the input focus changes to control highlighting of areas on the screen.
To receive FocusIn or FocusOut events, set the FocusChangeMask bit in the event-mask attribute of the window.
关于c - 应用程序失去焦点时的 X11 事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31438020/