Mouse motion event

Greetings.

Calling SDL_WarpMouseInWindow() upon window creation with [0,0]
coordinates results in mouse position change, however the
SDL_MOUSEMOTION event does not seem to be fired as expected.
It is however fired when setting the position to [1,1].
Any consecutive [0,0] calls will fire an event.

I have attached a test case for this (tried it at Windows 7 so far)

Regards,
Matej
-------------- next part --------------
#include <SDL2/SDL.h>

int main(int argc, char * argv[])
{
SDL_Init(SDL_INIT_EVERYTHING);

SDL_Window * window = SDL_CreateWindow(“Untitled”,
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
640, 480, SDL_WINDOW_SHOWN);

SDL_WarpMouseInWindow(window, 0, 0);
//SDL_WarpMouseInWindow(window, 1, 1);

bool running = true;
while (running) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_KEYDOWN:
running = (event.key.keysym.sym != SDLK_ESCAPE);
break;
case SDL_QUIT:
running = false;
break;
case SDL_MOUSEMOTION:
SDL_Log(“MOUSE MOTION: %d %d”, event.motion.x, event.motion.y);
}
}
}

SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}

Greetings.

Calling SDL_WarpMouseInWindow() upon window creation with [0,0]
coordinates results in mouse position change, however the
SDL_MOUSEMOTION event does not seem to be fired as expected.
It is however fired when setting the position to [1,1].
Any consecutive [0,0] calls will fire an event.

I have created a test case for this below (tried it at Windows 7 so far)

Regards,
Matej----

#include <SDL2/SDL.h>

int main(int argc, char * argv[])
{
SDL_Init(SDL_INIT_EVERYTHING);

SDL_Window * window = SDL_CreateWindow(“Untitled”,
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
640, 480, SDL_WINDOW_SHOWN);

SDL_WarpMouseInWindow(window, 0, 0);
//SDL_WarpMouseInWindow(window, 1, 1);

bool running = true;
while (running) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_KEYDOWN:
running = (event.key.keysym.sym != SDLK_ESCAPE);
break;
case SDL_QUIT:
running = false;
break;
case SDL_MOUSEMOTION:
SDL_Log(“MOUSE MOTION: %d %d”, event.motion.x, event.motion.y);
}
}
}

SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}