diff -u vino-2.13.5/debian/changelog vino-2.13.5/debian/changelog --- vino-2.13.5/debian/changelog +++ vino-2.13.5/debian/changelog @@ -1,3 +1,10 @@ +vino (2.13.5-0ubuntu5) dapper; urgency=low + + * The IO socket for clients on hold should not be included in the + GTK main loop. Ubuntu: #31037 + + -- Gary Coady Fri, 31 Mar 2006 18:15:18 +0100 + vino (2.13.5-0ubuntu4) dapper; urgency=low * debian/rules: Add -Wl,--as-needed to CFLAGS to get rid of a lot of useless only in patch2: unchanged: --- vino-2.13.5.orig/server/vino-server.c +++ vino-2.13.5/server/vino-server.c @@ -201,39 +201,6 @@ return TRUE; } -static void -vino_server_set_client_on_hold (VinoServer *server, - VinoServerClientInfo *client, - gboolean on_hold) -{ - rfbClientPtr rfb_client = client->rfb_client; - - dprintf (RFB, "Setting client '%s' on hold: %s\n", - rfb_client->host, on_hold ? "(true)" : "(false)"); - - rfb_client->onHold = on_hold; - - /* We don't process any pending data from an client which is - * on hold, so don't let it starve the rest of the mainloop. - */ - g_source_set_priority (g_main_context_find_source_by_id (NULL, client->io_watch), - on_hold ? G_PRIORITY_LOW : G_PRIORITY_DEFAULT); - - if (!on_hold) - { - if (!client->update_timeout) - client->update_timeout = g_timeout_add (50, - (GSourceFunc) vino_server_update_client_timeout, - rfb_client); - } - else - { - if (client->update_timeout) - g_source_remove (client->update_timeout); - client->update_timeout = 0; - } -} - static inline gboolean more_data_pending (int fd) { @@ -257,6 +224,51 @@ return vino_server_update_client (rfb_client); } +static void +vino_server_set_client_on_hold (VinoServer *server, + VinoServerClientInfo *client, + gboolean on_hold) +{ + rfbClientPtr rfb_client = client->rfb_client; + + dprintf (RFB, "Setting client '%s' on hold: %s\n", + rfb_client->host, on_hold ? "(true)" : "(false)"); + + rfb_client->onHold = on_hold; + + if (on_hold) + { + if (client->io_watch) + { + g_source_remove(client->io_watch); + client->io_watch = 0; + } + + if (client->update_timeout) + { + g_source_remove (client->update_timeout); + client->update_timeout = 0; + } + } + else + { + if (!client->io_watch) + { + client->io_watch = g_io_add_watch (client->io_channel, + G_IO_IN|G_IO_PRI, + (GIOFunc) vino_server_client_data_pending, + rfb_client); + } + + if (!client->update_timeout) + { + client->update_timeout = g_timeout_add (50, + (GSourceFunc) vino_server_update_client_timeout, + rfb_client); + } + } +} + static enum rfbNewClientAction vino_server_handle_new_client (rfbClientPtr rfb_client) { @@ -280,11 +292,6 @@ client->io_channel = g_io_channel_unix_new (rfb_client->sock); - client->io_watch = g_io_add_watch (client->io_channel, - G_IO_IN|G_IO_PRI, - (GIOFunc) vino_server_client_data_pending, - rfb_client); - server->priv->clients = g_slist_prepend (server->priv->clients, client); vino_server_set_client_on_hold (server, client, server->priv->on_hold);