@@ -30,6 +30,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
3030#include " dispatch.h"
3131#include " eventqueue.h"
3232
33+ #include " graphics_util.h"
3334
3435// //////////////////////////////////////////////////////////////////////////////
3536
@@ -357,13 +358,20 @@ static void MCEventQueueDispatchEvent(MCEvent *p_event)
357358 {
358359 MCeventtime = t_event -> mouse . time;
359360 MCmodifierstate = t_event -> mouse . position . modifiers;
360- MCmousex = t_event -> mouse . position . x;
361- MCmousey = t_event -> mouse . position . y;
362361
363362 MCObject *t_target;
364363 t_target = t_menu != nil ? t_menu : MCmousestackptr;
364+
365+ // IM-2013-09-30: [[ FullscreenMode ]] Translate mouse location to stack coords
366+ MCPoint t_mouseloc;
367+ t_mouseloc = MCPointMake (t_event->mouse .position .x , t_event->mouse .position .y );
368+
369+ t_mouseloc = t_target->getstack ()->view_viewtostackloc (t_mouseloc);
370+
371+ MCmousex = t_mouseloc.x ;
372+ MCmousey = t_mouseloc.y ;
365373
366- t_target -> mfocus (t_event -> mouse . position . x, t_event -> mouse . position . y);
374+ t_target -> mfocus (t_mouseloc . x, t_mouseloc . y);
367375 }
368376 break ;
369377
@@ -966,6 +974,11 @@ static void handle_touch(MCStack *p_stack, MCEventTouchPhase p_phase, uint32_t p
966974
967975 MCObject *t_target;
968976 t_target = nil;
977+
978+ // IM-2013-09-30: [[ FullscreenMode ]] Translate touch location to stack coords
979+ MCPoint t_touch_loc;
980+ t_touch_loc = p_stack->view_viewtostackloc (MCPointMake (x, y));
981+
969982 if (p_phase != kMCEventTouchPhaseBegan )
970983 {
971984 for (t_touch = s_touches; t_touch != nil; t_previous_touch = t_touch, t_touch = t_touch -> next)
@@ -999,7 +1012,7 @@ static void handle_touch(MCStack *p_stack, MCEventTouchPhase p_phase, uint32_t p
9991012 t_touch -> next = s_touches;
10001013 t_touch -> id = p_id;
10011014
1002- t_target = p_stack -> getcurcard () -> hittest (x, y);
1015+ t_target = p_stack -> getcurcard () -> hittest (t_touch_loc. x , t_touch_loc. y );
10031016 t_touch -> target = t_target -> gethandle ();
10041017
10051018 s_touches = t_touch;
@@ -1013,7 +1026,7 @@ static void handle_touch(MCStack *p_stack, MCEventTouchPhase p_phase, uint32_t p
10131026 t_target -> message_with_args (MCM_touch_start, p_id);
10141027 break ;
10151028 case kMCEventTouchPhaseMoved :
1016- t_target -> message_with_args (MCM_touch_move, p_id, x, y);
1029+ t_target -> message_with_args (MCM_touch_move, p_id, t_touch_loc. x , t_touch_loc. y );
10171030 break ;
10181031 case kMCEventTouchPhaseEnded :
10191032 t_target -> message_with_args (MCM_touch_end, p_id);
0 commit comments