| Summary: | SDL_VideoResize event width and heiht are off by one | ||
|---|---|---|---|
| Product: | SDL | Reporter: | PulkoMandy <pulkomandy> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | jspradlin, pulkomandy, scottmc2 |
| Version: | 1.2.14 | ||
| Hardware: | Other | ||
| OS: | BeOS | ||
| Attachments: | Small testcase program showing the video resize wrong behaviour. | ||
We now have a patch for this, done by Daniel Marth as part of the Google Code-In program.
The problem was that in the file "./src/video/bwindow/SDL_sysevents.cc" the method "SDL_BWin::DirectConnected" called "SDL_PrivateResize" with wrong parameters (1 pixel too much for width and height).
Before:
void SDL_BWin::DirectConnected(direct_buffer_info *info) {
switch (info->buffer_state & B_DIRECT_MODE_MASK) {
case B_DIRECT_START:
case B_DIRECT_MODIFY:
{
int32 width = info->window_bounds.right -
info->window_bounds.left + 1;
int32 height = info->window_bounds.bottom -
info->window_bounds.top + 1;
SDL_PrivateResize(width, height);
break;
}
default:
break;
}
}
After:
void SDL_BWin::DirectConnected(direct_buffer_info *info) {
switch (info->buffer_state & B_DIRECT_MODE_MASK) {
case B_DIRECT_START:
case B_DIRECT_MODIFY:
{
int32 width = info->window_bounds.right -
info->window_bounds.left;
int32 height = info->window_bounds.bottom -
info->window_bounds.top;
SDL_PrivateResize(width, height);
break;
}
default:
break;
}
}
Thank you for your bug report! We're busy working on getting SDL 1.3 ready for a high quality release, and want to make sure as many things are fixed there as possible. Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot? http://www.libsdl.org/tmp/SDL-1.3.zip Thanks! This was fixed in changeset 4928: http://hg.libsdl.org/SDL/annotate/930614179450/src/video/bwindow/SDL_sysevents.cc#l391 |
Created attachment 527 [details] Small testcase program showing the video resize wrong behaviour. I just installed SDL on my Haiku installation and compiled some programs (grafx2 and dcto8d). For some reason the windows of these programs (wich allow video resizing) grows when switching between workspaces or moving other windows above theirs. I think the SDL_VIDEORESIZE event width and height fields are off by one (one pixel too big); leading to an evergrowing window. I made a small test case program that exposes the issue and attached the sourcecode. Run it, and notice how the window grows when one switch workspaces.