client: let a server know the watch status 57/171057/2
authorBoram Park <boram1288.park@samsung.com>
Mon, 26 Feb 2018 06:32:49 +0000 (15:32 +0900)
committerBoram Park <boram1288.park@samsung.com>
Mon, 26 Feb 2018 23:50:59 +0000 (08:50 +0900)
Change-Id: I25652d7f92bb47909ef3d3873ee0df2620261d1f

client/tdm_client.c

index a257939..460cda4 100644 (file)
@@ -777,6 +777,7 @@ tdm_client_output_add_change_handler(tdm_client_output *output,
 
        if (LIST_IS_EMPTY(&private_output->change_handler_list)) {
                wl_tdm_output_watch_output_changes(private_output->output, 1);
+               wl_display_roundtrip_queue(private_client->display, private_client->queue);
 
                /* TODO: this is very tricky.
                 * If a client adds the change_handler, we might be able to guess that
@@ -823,8 +824,10 @@ tdm_client_output_remove_change_handler(tdm_client_output *output,
                free(h);
 
                if (LIST_IS_EMPTY(&private_output->change_handler_list)) {
-                       if (!CHECK_WL_PROTOCOL_ERROR(private_client))
+                       if (!CHECK_WL_PROTOCOL_ERROR(private_client)) {
                                wl_tdm_output_watch_output_changes(private_output->output, 0);
+                               wl_display_roundtrip_queue(private_client->display, private_client->queue);
+                       }
                }
 
                pthread_mutex_unlock(&private_client->lock);