src/render/SDL_render.c
changeset 9673 aea5a2032785
parent 9636 ac8cd6c6d966
child 9762 5c4a85c5b648
child 11074 3d681a44723a
     1.1 --- a/src/render/SDL_render.c	Thu May 28 12:06:48 2015 -0700
     1.2 +++ b/src/render/SDL_render.c	Thu May 28 12:18:05 2015 -0700
     1.3 @@ -165,7 +165,8 @@
     1.4              }
     1.5          }
     1.6      } else if (event->type == SDL_MOUSEMOTION) {
     1.7 -        if (renderer->logical_w) {
     1.8 +        SDL_Window *window = SDL_GetWindowFromID(event->motion.windowID);
     1.9 +        if (renderer->logical_w && window == renderer->window) {
    1.10              event->motion.x -= renderer->viewport.x;
    1.11              event->motion.y -= renderer->viewport.y;
    1.12              event->motion.x = (int)(event->motion.x / renderer->scale.x);
    1.13 @@ -183,7 +184,8 @@
    1.14          }
    1.15      } else if (event->type == SDL_MOUSEBUTTONDOWN ||
    1.16                 event->type == SDL_MOUSEBUTTONUP) {
    1.17 -        if (renderer->logical_w) {
    1.18 +        SDL_Window *window = SDL_GetWindowFromID(event->button.windowID);
    1.19 +        if (renderer->logical_w && window == renderer->window) {
    1.20              event->button.x -= renderer->viewport.x;
    1.21              event->button.y -= renderer->viewport.y;
    1.22              event->button.x = (int)(event->button.x / renderer->scale.x);