Skip to content
Permalink
Browse files
gem: Check mouse focus inside mouse motion function
  • Loading branch information
pmandin committed Nov 4, 2012
1 parent 7000a49 commit d73b6f37cbcd718a8806c2503f365f523a407d9a
Showing with 10 additions and 10 deletions.
  1. +10 −10 src/video/gem/SDL_gemevents.c
@@ -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;
@@ -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;

0 comments on commit d73b6f3

Please sign in to comment.