I’m writing the code to go with my next article and I have run into some
very odd behavior. In my program the SDL window can be resized. I want
to put some restrictions on the size and shape of the window. I want to
enforce always having the same shape of a window. That is, I always want
height/width == 0.75. And I want to impose both a maximum size and a
minimum size on the window. It all works very well except in one case,
When I grab the corner of the window and push it down to the minimum
size allowed by the window manager (much smaller than my minimum size) I
no longer get expose events and the window does not resize even though I
am calling SDL_SetVideoMode() with a larger window size. Even if I grab
the window and move it around the screen, I get no expose events until I
make the window slightly larger, at which time it pops up to my
minimum size. Note, that this only happens if I grab the corner of the
window. If I grab an edge then this doesn’t happen. It works perfectly.
Has anyone seen behavior like this before, anyone have a guess as to
what is causing it?
The event code looks like:
case SDL_VIDEORESIZE:
eventWidth = event.resize.w;
eventHeight = event.resize.h;
deltaWidth = abs(lastWidth - eventWidth);
deltaHeight = abs(lastHeight - eventHeight);
if (0 != deltaWidth)
{
int width = min(maxWidth, max(minWidth, eventWidth));
screenWidth = width;
screenHeight = (width * 3) / 4;
}
else if (0 != deltaHeight)
{
int height = min(maxHeight, max(minHeight, eventHeight));
screenWidth = (height * 4) / 3;
screenHeight = height;
}
lastWidth = eventWidth;
lastHeight = eventHeight;
setVideoModeAndSize(screenWidth, screenHeight);
break;
I’m using SDL 1.2.6, RedHat 9.0, and Ximian desktop. I will happily send
the complete program to anyone who is interested in looking at this
problem.
Thanks
Bob Pendleton--
±--------------------------------------+
Dunno much about this, but it sounds to me more like a possible bug in
the wm rather than in SDL. Perhaps you could try it on other
programs/write a test program that uses only Xlib? If that doesn’t
resolve the problem, perhaps you’ll need to set up some diagnostic
messages in SDL’s source… if nobody else comes up witha solution,
that is.
-MicahOn Thu, Nov 13, 2003 at 04:58:31PM -0600, Bob Pendleton wrote:
I’m writing the code to go with my next article and I have run into some
very odd behavior. In my program the SDL window can be resized. I want
to put some restrictions on the size and shape of the window. I want to
enforce always having the same shape of a window. That is, I always want
height/width == 0.75. And I want to impose both a maximum size and a
minimum size on the window. It all works very well except in one case,
When I grab the corner of the window and push it down to the minimum
size allowed by the window manager (much smaller than my minimum size) I
no longer get expose events and the window does not resize even though I
am calling SDL_SetVideoMode() with a larger window size. Even if I grab
the window and move it around the screen, I get no expose events until I
make the window slightly larger, at which time it pops up to my
minimum size. Note, that this only happens if I grab the corner of the
window. If I grab an edge then this doesn’t happen. It works perfectly.
Has anyone seen behavior like this before, anyone have a guess as to
what is causing it?
I’m writing the code to go with my next article and I have run into some
very odd behavior. In my program the SDL window can be resized. I want
to put some restrictions on the size and shape of the window. I want to
enforce always having the same shape of a window. That is, I always want
height/width == 0.75. And I want to impose both a maximum size and a
minimum size on the window. It all works very well except in one case,
When I grab the corner of the window and push it down to the minimum
size allowed by the window manager (much smaller than my minimum size) I
no longer get expose events and the window does not resize even though I
am calling SDL_SetVideoMode() with a larger window size. Even if I grab
the window and move it around the screen, I get no expose events until I
make the window slightly larger, at which time it pops up to my
minimum size. Note, that this only happens if I grab the corner of the
window. If I grab an edge then this doesn’t happen. It works perfectly.
Has anyone seen behavior like this before, anyone have a guess as to
what is causing it?
Dunno much about this, but it sounds to me more like a possible bug in
the wm rather than in SDL.
Yeah, that is the direction I was going with it. I was just hoping
someone else may have seen a similar problem. Then I wouldn’t ahve to do
all the work myself :-)On Thu, 2003-11-13 at 18:15, Micah J. Cowan wrote:
On Thu, Nov 13, 2003 at 04:58:31PM -0600, Bob Pendleton wrote:
Perhaps you could try it on other
programs/write a test program that uses only Xlib? If that doesn’t
resolve the problem, perhaps you’ll need to set up some diagnostic
messages in SDL’s source… if nobody else comes up witha solution,
that is.
-Micah
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
–
±--------------------------------------+