Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_VideoResize event width and heiht are off by one #579

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

SDL_VideoResize event width and heiht are off by one #579

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.14
Reported for operating system, platform: BeOS, Other

Comments on the original bug report:

On 2010-07-27 13:41:51 +0000, PulkoMandy wrote:

Created attachment 527
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.

On 2010-11-28 14:11:47 +0000, PulkoMandy wrote:

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;
}
}

On 2011-04-12 20:24:46 +0000, Jen Spradlin wrote:

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!

On 2011-08-10 12:32:53 +0000, Scott McCreary wrote:

This was fixed in changeset 4928:
http://hg.libsdl.org/SDL/annotate/930614179450/src/video/bwindow/SDL_sysevents.cc#l391

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant