Window resized after lost focus, and clicked inside

Hello guys,

I’m initializing a Window like this:

Uint32 flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_MOUSE_FOCUS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_OPENGL;
SDL_Window* MainWindow = SDL_CreateWindow(“Name”, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, WindowMaxWidth, WindowMaxHeight, flags);

SDL_MaximizeWindow(MainWindow);
SDL_SetWindowMinimumSize(MainWindow, WindowMaxWidth, WindowMaxHeight);

This starts up fine, and sets the Window to be maximized. However, when I open up another window (any other program), and then click it, so the SDL program loses focus, when I click back inside the window of the SDL program, it receives a Window event:

event.type = SDL_WINDOWEVENT
event.window.event = SDL_WINDOWEVENT_RESIZED

And being resized to the minimum size I’ve set. Is there a way to prevent this functionality, and only have the window resized when the actual resize button pressed, or the screen borders are dragged?

Thank you!------------------------
ePic Character Generator - endless character stream in your games using SDL 2.0:

Teaser video:

SDL_WINDOWEVENT_RESIZED has with and height parameters, you could be
surprised it is the actual window size. A chance to refresh,to redraw the
window, by the window manager. If you don’t honor that arguments and just
resize to min you know what is unexpected behaviour.

On another interpretation, dude, an UNMAXIMIZE event being received, that
would be an error in the window events core parser.

P.S.: Epic is a Registered Trademark by Epic. Epic is owner of the Epic
Registered Trademark. Epic owns Epic. Epic is owned by Epic. All other
trademarks are owned by their other respective owners. All other owners own
their other respective trademarks. :slight_smile:
El 31/07/2015 23:35, “LBandy” escribi?:> Hello guys,

I’m initializing a Window like this:

Uint32 flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_MOUSE_FOCUS |
SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_OPENGL;
SDL_Window* MainWindow = SDL_CreateWindow(“Name”, SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, WindowMaxWidth, WindowMaxHeight, flags);

SDL_MaximizeWindow(MainWindow);
SDL_SetWindowMinimumSize(MainWindow, WindowMaxWidth, WindowMaxHeight);

This starts up fine, and sets the Window to be maximized. However, when I
open up another window (any other program), and then click it, so the SDL
program loses focus, when I click back inside the window of the SDL
program, it receives a Window event:

event.type = SDL_WINDOWEVENT
event.window.event = SDL_WINDOWEVENT_RESIZED

And being resized to the minimum size I’ve set. Is there a way to prevent
this functionality, and only have the window resized when the actual resize
button pressed, or the screen borders are dragged?

Thank you!


ePic Character Generator - endless character stream in your games using
SDL 2.0:
http://www.epicgenerator.net

Teaser video:
https://www.youtube.com/watch?v=giFIO1vFw1o&hd=1


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’m not sure you understand my question correctly, but appreciate your efforts.

In other words: is there a way to prevent the window from receiving an UNMAXIMIZE event, without the unmaximize button being pressed, or the borders are being touched?------------------------
ePic Character Generator - endless character stream in your games using SDL 2.0:

Teaser video:

Hi,

Maybe SDL_SetEventFilter could be of some use ? https://wiki.libsdl.org/SDL_SetEventFilter?highlight=(\bCategoryAPI\b)|(SDLFunctionTemplate)

Cheers,
Jeffrey Carpenter <@Jeffrey_Carpenter>

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1572 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20150805/239ace74/attachment.bin