如何在自定义轮询函数中结合 mac 事件处理和 gobject 事件?

发布于 2024-10-02 15:19:26 字数 742 浏览 0 评论 0原文

我正在尝试修复自定义民意调查功能(请参阅 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

新雨望断虹 2024-10-09 15:19:26

我认为没有简单的方法可以解决当前混乱情况下主循环集成的局限性。

人们应该看一下 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文