diff --git a/src/video/toaru/SDL_toaruevents.c b/src/video/toaru/SDL_toaruevents.c index 4222619..0d3bef0 100644 --- a/src/video/toaru/SDL_toaruevents.c +++ b/src/video/toaru/SDL_toaruevents.c @@ -193,6 +193,8 @@ void TOARU_PumpEvents(_THIS) { case YUTANI_MSG_SESSION_END: fprintf(stderr, "[sdl-toaru] Need to implement: %u\n", (unsigned int)m->type); break; + case YUTANI_MSG_WINDOW_MOVE: + break; default: fprintf(stderr, "[sdl-toaru] Unhandled message from Yutani server: type=0x%x\n", (unsigned int)m->type); break; diff --git a/src/video/toaru/SDL_toarumouse.c b/src/video/toaru/SDL_toarumouse.c index febba31..d2a42aa 100644 --- a/src/video/toaru/SDL_toarumouse.c +++ b/src/video/toaru/SDL_toarumouse.c @@ -25,6 +25,9 @@ #include "../../events/SDL_events_c.h" #include "SDL_toarumouse_c.h" +#include "../SDL_cursor_c.h" + +#include /* The implementation dependent data for the window manager cursor */ @@ -45,17 +48,24 @@ WMcursor *TOARU_CreateWMCursor(_THIS, return((WMcursor *)0x01); } -static void TOARU_MoveCursor(_THIS, SDL_Cursor *cursor, int x, int y) +void TOARU_MoveWMCursor(_THIS, int x, int y) { /* do nothing */ } -void TOARU_MoveWMCursor(_THIS, int x, int y) -{ - /* do nothing */ +void TOARU_WarpWMCursor(_THIS, Uint16 x, Uint16 y) { + yutani_window_warp_mouse(this->hidden->yctx, this->hidden->window, x + this->hidden->o_w, y + this->hidden->o_h); } int TOARU_ShowWMCursor(_THIS, WMcursor *wmcursor) { return (1); } + +void TOARU_CheckMouseMode(_THIS) { + int showing; + + showing = (SDL_cursorstate & CURSOR_VISIBLE); + + yutani_window_show_mouse(this->hidden->yctx, this->hidden->window, showing); +} diff --git a/src/video/toaru/SDL_toarumouse_c.h b/src/video/toaru/SDL_toarumouse_c.h index d614e49..41d1ff6 100644 --- a/src/video/toaru/SDL_toarumouse_c.h +++ b/src/video/toaru/SDL_toarumouse_c.h @@ -28,4 +28,6 @@ extern void TOARU_FreeWMCursor(_THIS, WMcursor *cursor); extern WMcursor *TOARU_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); extern void TOARU_MoveWMCursor(_THIS, int x, int y); +extern void TOARU_WarpWMCursor(_THIS, Uint16 x, Uint16 y); extern int TOARU_ShowWMCursor(_THIS, WMcursor *cursor); +extern void TOARU_CheckMouseMode(_THIS); diff --git a/src/video/toaru/SDL_toaruvideo.c b/src/video/toaru/SDL_toaruvideo.c index 0a6a726..695b26e 100644 --- a/src/video/toaru/SDL_toaruvideo.c +++ b/src/video/toaru/SDL_toaruvideo.c @@ -128,10 +128,11 @@ static SDL_VideoDevice *TOARU_CreateDevice(int devindex) device->FreeWMCursor = TOARU_FreeWMCursor; device->CreateWMCursor = TOARU_CreateWMCursor; device->ShowWMCursor = TOARU_ShowWMCursor; - device->MoveWMCursor = TOARU_MoveWMCursor; + device->WarpWMCursor = TOARU_WarpWMCursor; device->InitOSKeymap = TOARU_InitOSKeymap; device->PumpEvents = TOARU_PumpEvents; device->SetCaption = TOARU_SetCaption; + device->CheckMouseMode = TOARU_CheckMouseMode; device->free = TOARU_DeleteDevice;