[gtk-osx-users] trying to integrate an eventtrap into gtk-osx-application



Hello John,

I'd like to respond to multimedia keys (play-pause, next, previous)
in a Gtk application bundle for OSX.

It seems to be possible using quartz events (see CGEventTapCreate).
I've gone so far as to get running code (attached as a diff).

I register the event trap in an applicationDidFinishLaunching delegate
handler added to GtkApplicationDelegate.c.
I do intercept multimedia key and can swallow them at will.
Now there is a little problem: when I close the gtk window, the
whole screen freezes. I have to ssh from another computer and kill the
app. It would indicate that the event tap is no more processing
events. 
Is there any chance of fixing my code or is it a doomed path anyway
and I should use a separate helper app with its own pure quartz event
loop?

Thanks,
Eric

Attachment: my_patch.diff
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]