【问题标题】:Get x button events in mutter window manager在 Mutter 窗口管理器中获取 x 按钮事件
【发布时间】:2015-05-06 21:43:18
【问题描述】:

我正在尝试处理来自XEvent 的按钮事件。我的窗口管理器是mutter。我在窗口上添加了一个按钮,但每当我单击该按钮时,我都会收到PropertyNotify 信号而不是ButtonPress

我尝试使用XIGrabButton() 抓取按钮事件,但这会阻止我的 UI 在 mutter 上运行。我尝试使用XISetMask() 屏蔽事件XI_ButtonPressXI_ButtonRelease,然后尝试抓取按钮事件,但它不起作用。

我错过了什么?

【问题讨论】:

  • 你能显示一些代码吗?

标签: mouseevent x11 xlib


【解决方案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.

【讨论】:

  • 感谢您的回复。我在DISPLAY=0.0(有x 窗口管理器)上运行xoo 模拟器,在DISPLAY=1.0 上运行我的嘟嘟声。我想获取 xoo 窗口的信号...对于 mutter,我正在获取事件,我不想打扰它。无论我点击xoo,我都会将它作为 XEvents 获取。所以我需要通过获取xoo 的窗口在我的mutter 插件中获取这些事件。这可能吗?如果是,那么我该如何实现呢?请帮帮我
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-02-16
  • 2011-01-31
  • 1970-01-01
  • 2011-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多