I am trying to get Wayland events in a program’s event handler. I need to use gdk_window_add_filter () to do this because that’s what the program’s existing event handler uses.
Is it possible to get the Wayland events and the objects associated with them from inside a GdkFilterFunc?
For example:
static GdkFilterReturn filter_func (GdkXEvent *xevent, GdkEvent *event, gpointer data) { //process my Wayland event here }
int main () { gdk_window_add_filter (NULL, filter_func, data); }
This is not really possible as libwayland currently doesn’t have any similar concept of “global events”. Maybe it would make more sense to ask for such a filter function to be added there.
But possibly this may be unnecessary, can you explain what you’re trying to do and why you would need this? There might be another way to accomplish it that doesn’t require writing X or Wayland specific code.
On second thoughts it’s possible that the program’s event handler is already quite abstracted, and that most of it is display-server-agnostic, and that all I may need to do is create a Wayland-specific entrypoint to the event handler.