Skip to content

Commit

Permalink
gem: Check mouse focus inside mouse motion function
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandin committed Nov 4, 2012
1 parent 7000a49 commit d73b6f3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/video/gem/SDL_gemevents.c
Expand Up @@ -117,16 +117,6 @@ void GEM_PumpEvents(_THIS)

/* Mouse motion event ? */
if (resultat & MU_M1) {
if (this->input_grab == SDL_GRAB_OFF) {
/* Switch mouse focus state */
if (!GEM_fullscreen && (GEM_handle>=0)) {
SDL_PrivateAppActive(
mouse_in_work_area(GEM_handle, mousex,mousey),
SDL_APPMOUSEFOCUS);
}
}
GEM_CheckMouseMode(this);

do_mouse_motion(this, mousex, mousey);
prevmx = mousex;
prevmy = mousey;
Expand Down Expand Up @@ -304,6 +294,16 @@ static void do_mouse_motion(_THIS, short mx, short my)
{
short x2, y2, w2, h2;

if (this->input_grab == SDL_GRAB_OFF) {
/* Switch mouse focus state */
if (!GEM_fullscreen && (GEM_handle>=0)) {
SDL_PrivateAppActive(
mouse_in_work_area(GEM_handle, mx,my),
SDL_APPMOUSEFOCUS);
}
}
GEM_CheckMouseMode(this);

/* Don't return mouse events if out of window */
if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS)==0) {
return;
Expand Down

0 comments on commit d73b6f3

Please sign in to comment.