Re: [gtk-osx-users] trying to integrate an eventtrap into gtk-osx-application
- From: John Ralls <jralls ceridwen us>
- To: Eric Le Lay <kerik-sf users sourceforge net>
- Cc: gtk-osx-users-list gnome org
- Subject: Re: [gtk-osx-users] trying to integrate an eventtrap into gtk-osx-application
- Date: Wed, 8 Oct 2014 16:38:58 -0700
On Oct 8, 2014, at 7:32 AM, Eric Le Lay <kerik-sf users sourceforge net> wrote:
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?
That’s not something I’ve ever played with, but perhaps your event tap isn’t getting disabled. It’s possible
for a Gtk application to end without getting the ApplicationWillTerminate notification, so make sure that the
tap is actually getting removed. I have trouble believing that’s really the problem, though, because when the
program terminates the run loop will be destroyed and that should take the event tap with it.
I don’t see how a helper app would make any difference: You have to inject the events into the g_main_loop
somehow in order to respond to them.
Regards,
John Ralls
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]