| Summary: | Mouse Y gets 22 pixels offset after warping only if X is different to 0 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Javi Agenjo <javi.agenjo> |
| Component: | events | Assignee: | Jørgen Tjernø <jorgen> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72, sdlbug |
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X (All) | ||
| Attachments: | Simple testcase | ||
|
Description
Javi Agenjo
2014-08-05 18:53:02 UTC
Also note that the same code works perfectly in windows and linux, it seems more like a bug in OSX event handling. Can you provide a testcase? create an SDL application with a mainloop:
int x,y;
while (1)
{
//update events
while(SDL_PollEvent(&sdlEvent))
{
}
SDL_GetMouseState(&x,&y);
std::cout << x << "," << y << std::endl;
SDL_WarpMouseInWindow(window, 50,50 );
}
This will output 50,50 unless you move the mouse, then you will see that the Y has 22 pixels offset (plus your movement)
Created attachment 1809 [details]
Simple testcase
Testing showed, that the SDL_MOUSEMOTION event also returns wrong coordinates Preliminary bisect results: first known bad build 8738:354dabd2cb58 last known good build 8721:d73e451f1dc5 all builds in between, so far suggested by "hg bisect", are completely broken in terms of window coordinates definite last working version 8726:9a5a5808aa14 Bug introduced in 8729:94af945dbb57 "Mac: SDL_SetWindowPosition is now relative to the menubar." It looks like this change only exposed a bug already pressent somewhere else.. |