我正在尝试处理来自XEvent的按钮事件。我的窗口管理器是mutter。我在窗口中添加了一个按钮,但每当我单击该按钮时,我得到的是PropertyNotify信号而不是ButtonPress信号。
我尝试使用XIGrabButton()抓取按钮事件,但这会阻止我的UI在mutter上运行。我尝试使用XISetMask()屏蔽事件XI_ButtonPress和XI_ButtonRelease,然后尝试获取按钮事件,但不起作用。
我遗漏了什么?
发布于 2015-03-06 09:28:23
您不能(至少直接地,如果不处于客户端和服务器之间的话)。来自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.https://stackoverflow.com/questions/28879253
复制相似问题