broadway: Send window size to new clients

Tell all new clients about the current (last sent) window size.
This commit is contained in:
Alexander Larsson
2013-01-08 17:56:39 +01:00
parent 35c295da89
commit d5812de2e6
4 changed files with 40 additions and 7 deletions

View File

@ -454,11 +454,12 @@ incoming_client (GSocketService *service,
{
BroadwayClient *client;
GInputStream *input;
BroadwayInputMsg ev = { {0} };
client = g_new0 (BroadwayClient, 1);
client->id = client_id_count++;
client->connection = g_object_ref (connection);
input = g_io_stream_get_input_stream (G_IO_STREAM (client->connection));
client->in = (GBufferedInputStream *)g_buffered_input_stream_new (input);
@ -469,7 +470,18 @@ incoming_client (GSocketService *service,
0,
NULL,
client_fill_cb, client);
/* Send initial resize notify */
ev.base.type = BROADWAY_EVENT_SCREEN_SIZE_CHANGED;
ev.base.serial = broadway_server_get_next_serial (server) - 1;
ev.base.time = broadway_server_get_last_seen_time (server);
broadway_server_get_screen_size (server,
&ev.screen_resize_notify.width,
&ev.screen_resize_notify.height);
broadway_events_got_input (&ev,
client->id);
return TRUE;
}