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 1019375cd0fc3fec2
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
     1.1 --- a/test/testwm2.c	Wed Jul 13 07:07:08 2016 -0700
     1.2 +++ b/test/testwm2.c	Wed Jul 13 07:07:46 2016 -0700
     1.3 @@ -50,6 +50,7 @@
     1.4  void
     1.5  loop()
     1.6  {
     1.7 +    int i;
     1.8      SDL_Event event;
     1.9          /* Check for events */
    1.10          while (SDL_PollEvent(&event)) {
    1.11 @@ -100,6 +101,12 @@
    1.12                  }
    1.13              }
    1.14          }
    1.15 +
    1.16 +        for (i = 0; i < state->num_windows; ++i) {
    1.17 +            SDL_Renderer *renderer = state->renderers[i];
    1.18 +            SDL_RenderClear(renderer);
    1.19 +            SDL_RenderPresent(renderer);
    1.20 +        }
    1.21  #ifdef __EMSCRIPTEN__
    1.22      if (done) {
    1.23          emscripten_cancel_main_loop();
    1.24 @@ -122,7 +129,6 @@
    1.25      if (!state) {
    1.26          return 1;
    1.27      }
    1.28 -    state->skip_renderer = SDL_TRUE;
    1.29      for (i = 1; i < argc;) {
    1.30          int consumed;
    1.31  
    1.32 @@ -140,6 +146,12 @@
    1.33          quit(2);
    1.34      }
    1.35  
    1.36 +    for (i = 0; i < state->num_windows; ++i) {
    1.37 +        SDL_Renderer *renderer = state->renderers[i];
    1.38 +        SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
    1.39 +        SDL_RenderClear(renderer);
    1.40 +    }
    1.41 + 
    1.42      /* Main render loop */
    1.43      done = 0;
    1.44  #ifdef __EMSCRIPTEN__