我试图处理来自XEvent
的按钮事件。我的窗口管理器是mutter
。我在我的窗口上添加了一个按钮,但每当我点击该按钮时,我都会收到PropertyNotify
信号,而不是ButtonPress
。
我尝试使用XIGrabButton()
抓取按钮事件,但阻止了我在mutter上运行的UI。我尝试使用XI_ButtonPress
屏蔽事件XI_ButtonRelease
和XISetMask()
然后我尝试抓住按钮事件,但它无效。
我错过了什么?
答案 0 :(得分:1)
你不能(至少直接,没有坐在客户端和服务器之间)。来自x11协议规范:
Multiple clients can select input on the same window; their event-masks are
disjoint. When an event is generated, it will be reported to all interested
clients. However, only one client at a time can select for SubstructureRedirect
, only one client at a time can select for ResizeRedirect, and only one client
at a time can select for ButtonPress. An attempt to violate these restrictions
results in an Access error.