Thushi
Thushi

Reputation: 188

Get x button events in mutter window manager

I'm trying to handle Button Events from XEvent. My window manager is mutter. I added a button on my window, but whenever I click that button, I am getting the PropertyNotify signal instead of ButtonPress.

I tried grabbing the button events using XIGrabButton() but that blocks my UI running on mutter. I tried masking the Events XI_ButtonPress and XI_ButtonRelease using XISetMask() and then I tried to grab the button events but it is not working.

What am I missing?

Upvotes: 0

Views: 300

Answers (1)

Andrey Sidorov
Andrey Sidorov

Reputation: 25456

You can't (at least directly, without sitting in the middle between client and server). From x11 protocol spec:

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.

Upvotes: 1

Related Questions