From: Seunghun Lee Date: Wed, 20 Apr 2022 10:54:19 +0000 (+0900) Subject: examples/tinyds: Clarify single output support X-Git-Tag: accepted/tizen/unified/20220720.034120~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F75%2F278175%2F1;p=platform%2Fcore%2Fuifw%2Flibds-tizen.git examples/tinyds: Clarify single output support tinyds doesn't support multiple outputs for now, so don't pretend to support multiple outputs. Change-Id: Ic28b275423e5618677f34373ad677ad387a7f754 --- diff --git a/src/examples/tinyds.c b/src/examples/tinyds.c index ed3ed01..0c88849 100644 --- a/src/examples/tinyds.c +++ b/src/examples/tinyds.c @@ -57,7 +57,6 @@ struct tinyds_output struct wl_listener output_destroy; struct wl_listener output_frame; - struct wl_list link; // tinyds_server::outputs int width, height; @@ -73,10 +72,9 @@ struct tinyds_server struct ds_compositor *compositor; struct ds_xdg_shell *xdg_shell; - struct tinyds_output primary_output; + struct tinyds_output output; struct wl_list views; - struct wl_list outputs; struct wl_listener new_input; struct wl_listener new_xdg_surface; @@ -127,7 +125,7 @@ main(void) assert(init_server(server, display) == true); - assert(init_output(&server->primary_output, server, + assert(init_output(&server->output, server, OUTPUT_WIDTH, OUTPUT_HEIGHT) == true); socket = wl_display_add_socket_auto(display); @@ -143,7 +141,7 @@ main(void) wl_display_run(server->display); - fini_output(&server->primary_output); + fini_output(&server->output); fini_server(server); wl_display_destroy(display); @@ -256,7 +254,6 @@ init_server(struct tinyds_server *server, struct wl_display *display) { server->display = display; - wl_list_init(&server->outputs); wl_list_init(&server->views); if (wl_display_init_shm(display) != 0) @@ -347,8 +344,6 @@ init_output(struct tinyds_output *output, struct tinyds_server *server, output->output_frame.notify = output_handle_frame; ds_output_add_frame_listener(output->ds_output, &output->output_frame); - wl_list_insert(&server->outputs, &output->link); - return true; err_output: @@ -362,7 +357,6 @@ err_swapchain: static void fini_output(struct tinyds_output *output) { - wl_list_remove(&output->link); if (output->ds_output) ds_output_destroy(output->ds_output); ds_swapchain_destroy(output->swapchain); @@ -372,21 +366,16 @@ fini_output(struct tinyds_output *output) static void draw_server(struct tinyds_server *server) { - struct tinyds_output *output; - - wl_list_for_each(output, &server->outputs, link) - draw_output(output); + draw_output(&server->output); } static void draw_server_with_damage(struct tinyds_server *server) { - struct tinyds_output *output; + struct tinyds_output *output = &server->output; - wl_list_for_each(output, &server->outputs, link) { - output->damaged = true; - draw_output(output); - } + output->damaged = true; + draw_output(output); } static void view_send_frame_done(struct tinyds_view *view);