/* This is called when data is available on an ICE connection.  */
static gboolean
process_ice_messages (GIOChannel *channel,
                      GIOCondition condition,
                      gpointer client_data)
{
  IceConn connection = (IceConn) client_data;
  IceProcessMessagesStatus status;

  /* This blocks infinitely sometimes. I don't know what
   * to do about it. Checking "condition" just breaks
   * session management.
   */
  status = IceProcessMessages (connection, NULL, NULL);

  if (status == IceProcessMessagesIOError)
    {
#if 0
      IcePointer context = IceGetConnectionContext (connection);
#endif
      
      /* We were disconnected */
      IceSetShutdownNegotiation (connection, False);
      IceCloseConnection (connection);

      return FALSE;
    }
  
  return TRUE;
}
Beispiel #2
0
/* This is called when data is available on an ICE connection.  */
static gboolean
process_ice_messages (GIOChannel *channel,
                      GIOCondition condition,
                      gpointer client_data)
{
  IceConn connection = (IceConn) client_data;
  IceProcessMessagesStatus status;

  /* This blocks infinitely sometimes. I don't know what
   * to do about it. Checking "condition" just breaks
   * session management.
   */
  status = IceProcessMessages (connection, NULL, NULL);

  if (status == IceProcessMessagesIOError)
    {
#if 0
      IcePointer context = IceGetConnectionContext (connection);
#endif
      
      /* We were disconnected; close our connection to the
       * session manager, this will result in the ICE connection
       * being cleaned up, since it is owned by libSM.
       */
      disconnect ();
      meta_quit (META_EXIT_SUCCESS);

      return FALSE;
    }
  
  return TRUE;
}
static gboolean
process_ice_messages(IceConn connection)
{
  IceProcessMessagesStatus status;

  status = IceProcessMessages(connection, nullptr, nullptr);

  switch (status) {
  case IceProcessMessagesSuccess:
    return TRUE;

  case IceProcessMessagesIOError: {
      nsNativeAppSupportUnix *native =
        static_cast<nsNativeAppSupportUnix *>(IceGetConnectionContext(connection));
      native->DisconnectFromSM();
    }
    return FALSE;

  case IceProcessMessagesConnectionClosed:
    return FALSE;

  default:
    g_assert_not_reached ();
  }
}