如何在自定义轮询函数中结合 mac 事件处理和 gobject 事件?
我正在尝试修复自定义民意调查功能(请参阅 http://pastie.org/1298915 )。 它来自 clutter 库 的 OS X 后端代码。 它的设置如下:
void
_clutter_events_osx_init (void)
{
g_assert (old_poll_func == NULL);
old_poll_func = g_main_context_get_poll_func (NULL);
g_main_context_set_poll_func (NULL, clutter_event_osx_poll_func);
}
void
_clutter_events_osx_uninit (void)
{
if (old_poll_func)
{
g_main_context_set_poll_func (NULL, old_poll_func);
old_poll_func = NULL;
}
}
它从套接字获取事件并将其转发到本机 mac os x 应用程序。问题是我希望 libsoup 库事件由 libsoup 正确处理,这就是为什么我需要使用 old_poll_func() 的行为。但我不知道如何过滤非混乱事件以及如何仅对它们使用 old_poll_func 。
I'm trying to fix a custom poll function ( see http://pastie.org/1298915 ).
It is from OS X backend code of clutter library.
It is set like this:
void
_clutter_events_osx_init (void)
{
g_assert (old_poll_func == NULL);
old_poll_func = g_main_context_get_poll_func (NULL);
g_main_context_set_poll_func (NULL, clutter_event_osx_poll_func);
}
void
_clutter_events_osx_uninit (void)
{
if (old_poll_func)
{
g_main_context_set_poll_func (NULL, old_poll_func);
old_poll_func = NULL;
}
}
It is taking events from sockets and forwarding it to native mac os x app. The problem is I want libsoup library events to be handled by libsoup correctly which is why I need to use a behavior of old_poll_func(). But I don't know how to filter non-clutter events and how to use the old_poll_func only on them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为没有简单的方法可以解决当前混乱情况下主循环集成的局限性。
人们应该看一下 gdk/quartz 中的主循环集成,我相信它可以正确处理 libsoup 等。调整 gdk 代码以应对混乱应该很简单,只是耗时。
I think there is no simple way to work around the limitations of mainloop integration in current clutter.
One should take a look at the mainloop integration in gdk/quartz, I believe it would handle libsoup and such correctly. It ought to be straightforward to adapt the gdk code for clutter, just time consuming.