Commit c18a7c8a authored by Patrice Mandin's avatar Patrice Mandin

Don't use both mouse events for the same task

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401090
parent 79cf651f
...@@ -142,21 +142,26 @@ void GEM_PumpEvents(_THIS) ...@@ -142,21 +142,26 @@ void GEM_PumpEvents(_THIS)
short buffer[8], kc; short buffer[8], kc;
short x2,y2,w2,h2; short x2,y2,w2,h2;
quit = 0; quit =
mouse_event =
x2=y2=w2=h2 = 0;
event_mask = MU_MESAG|MU_TIMER|MU_KEYBD; event_mask = MU_MESAG|MU_TIMER|MU_KEYBD;
if (!GEM_fullscreen && (GEM_handle>=0)) { if (!GEM_fullscreen && (GEM_handle>=0)) {
wind_get (GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2); wind_get (GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2);
event_mask |= MU_M1|MU_M2; event_mask |= MU_M1;
} else { if ( (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
x2=y2=w2=h2=0; mouse_event = MO_LEAVE;
} else {
mouse_event = MO_ENTER;
}
} }
resultat = evnt_multi( resultat = evnt_multi(
event_mask, event_mask,
0,0,0, 0,0,0,
MO_ENTER,x2,y2,w2,h2, mouse_event,x2,y2,w2,h2,
MO_LEAVE,x2,y2,w2,h2, 0,0,0,0,0,
buffer, buffer,
10, 10,
&dummy,&dummy,&dummy,&kstate,&kc,&dummy &dummy,&dummy,&dummy,&kstate,&kc,&dummy
...@@ -179,18 +184,13 @@ void GEM_PumpEvents(_THIS) ...@@ -179,18 +184,13 @@ void GEM_PumpEvents(_THIS)
/* Mouse entering/leaving window */ /* Mouse entering/leaving window */
if (resultat & MU_M1) { if (resultat & MU_M1) {
if (this->input_grab == SDL_GRAB_OFF) { if (this->input_grab == SDL_GRAB_OFF) {
if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) { if (SDL_GetAppState() & SDL_APPMOUSEFOCUS) {
SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
} else {
SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
} }
} }
} }
if (resultat & MU_M2) {
if (this->input_grab == SDL_GRAB_OFF) {
if ( (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
]
}
}
/* Timer event ? */ /* Timer event ? */
if ((resultat & MU_TIMER) || quit) if ((resultat & MU_TIMER) || quit)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment