jezek / xgb

The X Go Binding is a low-level API to communicate with the X server. It is modeled on XCB and supports many X extensions.
Other
130 stars 13 forks source link

Could you add an api or example for XMaskEvent or XCheckMaskEvent logic? #12

Closed bvk closed 1 year ago

bvk commented 1 year ago

I am a newbie to X11 development, so I may have gotten this wrong...

It seems xgb.Conn doesn't have out-of-order retrieval of events buffered in the event channel. X11 xlib has functions like XCheckMaskEvent and XCheckWindowEvent that seem to allow you to pick certain events out of order from the event queue. How do I implement this behavior using xgb.Conn?

To be specific, this functionality seems to be useful when implementing drag-window with mouse feature. For example, dwm window manager from suckless project uses these functions for moving and resizing windows with mouse. See https://github.com/LukeSmithxyz/dwm/blob/master/dwm.c#L1420

jezek commented 1 year ago

This is a low level library for communication with X11. Something like xcb, but in golang. For event queue manipulation it is advised to use higher level library, like xgbuitl. Maybe there is something similar to what are you looking for.