static void handle_mousemotion(DisplayState *ds, SDL_Event *ev)

{

    int max_x, max_y;



    if (is_graphic_console() &&

        (kbd_mouse_is_absolute() || absolute_enabled)) {

        max_x = real_screen->w - 1;

        max_y = real_screen->h - 1;

        if (gui_grab && (ev->motion.x == 0 || ev->motion.y == 0 ||

            ev->motion.x == max_x || ev->motion.y == max_y)) {

            sdl_grab_end();

        }

        if (!gui_grab && SDL_GetAppState() & SDL_APPINPUTFOCUS &&

            (ev->motion.x > 0 && ev->motion.x < max_x &&

            ev->motion.y > 0 && ev->motion.y < max_y)) {

            sdl_grab_start();

        }

    }

    if (gui_grab || kbd_mouse_is_absolute() || absolute_enabled) {

        sdl_send_mouse_event(ev->motion.xrel, ev->motion.yrel, 0,

                             ev->motion.x, ev->motion.y, ev->motion.state);

    }

}

static void handle_mousemotion(DisplayState *ds, SDL_Event *ev)

{

    int max_x, max_y;



    if (is_graphic_console() &&

        (kbd_mouse_is_absolute() || absolute_enabled)) {

        max_x = real_screen->w - 1;

        max_y = real_screen->h - 1;

        if (gui_grab && (ev->motion.x == 0 || ev->motion.y == 0 ||

            ev->motion.x == max_x || ev->motion.y == max_y)) {

            sdl_grab_end();

        }

        if (!gui_grab && SDL_GetAppState() & SDL_APPINPUTFOCUS &&

            (ev->motion.x > 0 && ev->motion.x < max_x &&

            ev->motion.y > 0 && ev->motion.y < max_y)) {

            sdl_grab_start();

        }

    }

    if (gui_grab || kbd_mouse_is_absolute() || absolute_enabled) {

        sdl_send_mouse_event(ev->motion.xrel, ev->motion.yrel, 0,

                             ev->motion.x, ev->motion.y, ev->motion.state);

    }

}

static void FUNC_0(DisplayState *VAR_0, SDL_Event *VAR_1)

{

    int VAR_2, VAR_3;



    if (is_graphic_console() &&

        (kbd_mouse_is_absolute() || absolute_enabled)) {

        VAR_2 = real_screen->w - 1;

        VAR_3 = real_screen->h - 1;

        if (gui_grab && (VAR_1->motion.x == 0 || VAR_1->motion.y == 0 ||

            VAR_1->motion.x == VAR_2 || VAR_1->motion.y == VAR_3)) {

            sdl_grab_end();

        }

        if (!gui_grab && SDL_GetAppState() & SDL_APPINPUTFOCUS &&

            (VAR_1->motion.x > 0 && VAR_1->motion.x < VAR_2 &&

            VAR_1->motion.y > 0 && VAR_1->motion.y < VAR_3)) {

            sdl_grab_start();

        }

    }

    if (gui_grab || kbd_mouse_is_absolute() || absolute_enabled) {

        sdl_send_mouse_event(VAR_1->motion.xrel, VAR_1->motion.yrel, 0,

                             VAR_1->motion.x, VAR_1->motion.y, VAR_1->motion.state);

    }

}

static void FUNC_0(DisplayState *VAR_0, SDL_Event *VAR_1)
{ int VAR_2, VAR_3; if (is_graphic_console() &&
(kbd_mouse_is_absolute() || absolute_enabled)) { VAR_2 = real_screen->w - 1; VAR_3 = real_screen->h - 1; if (gui_grab && (VAR_1->motion.x == 0 || VAR_1->motion.y == 0 ||
VAR_1->motion.x == VAR_2 || VAR_1->motion.y == VAR_3)) { sdl_grab_end(); } if (!gui_grab && SDL_GetAppState() & SDL_APPINPUTFOCUS &&
(VAR_1->motion.x > 0 && VAR_1->motion.x < VAR_2 &&
VAR_1->motion.y > 0 && VAR_1->motion.y < VAR_3)) { sdl_grab_start(); } } if (gui_grab || kbd_mouse_is_absolute() || absolute_enabled) { sdl_send_mouse_event(VAR_1->motion.xrel, VAR_1->motion.yrel, 0,
VAR_1->motion.x, VAR_1->motion.y, VAR_1->motion.state); } }