Tests: Mir needs the window to swap at lease 1 frame for the cursor to show. So render in testwm2
authorBrandon Schaefer <brandon.schaefer@canonical.com>
Wed, 13 Jul 2016 07:07:46 -0700
changeset 10193 75cd0fc3fec2
parent 10192 3a5779b13f69
child 10194 a4eb7861e89c
Tests: Mir needs the window to swap at lease 1 frame for the cursor to show. So render in testwm2
test/testwm2.c
--- a/test/testwm2.c	Wed Jul 13 07:07:08 2016 -0700
+++ b/test/testwm2.c	Wed Jul 13 07:07:46 2016 -0700
@@ -50,6 +50,7 @@
 void
 loop()
 {
+    int i;
     SDL_Event event;
         /* Check for events */
         while (SDL_PollEvent(&event)) {
@@ -100,6 +101,12 @@
                 }
             }
         }
+
+        for (i = 0; i < state->num_windows; ++i) {
+            SDL_Renderer *renderer = state->renderers[i];
+            SDL_RenderClear(renderer);
+            SDL_RenderPresent(renderer);
+        }
 #ifdef __EMSCRIPTEN__
     if (done) {
         emscripten_cancel_main_loop();
@@ -122,7 +129,6 @@
     if (!state) {
         return 1;
     }
-    state->skip_renderer = SDL_TRUE;
     for (i = 1; i < argc;) {
         int consumed;
 
@@ -140,6 +146,12 @@
         quit(2);
     }
 
+    for (i = 0; i < state->num_windows; ++i) {
+        SDL_Renderer *renderer = state->renderers[i];
+        SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
+        SDL_RenderClear(renderer);
+    }
+ 
     /* Main render loop */
     done = 0;
 #ifdef __EMSCRIPTEN__