setResizeAble(false) doesn't work under linux !!

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
kAd
Posts: 45
Joined: Fri Jun 10, 2005 8:46 pm

setResizeAble(false) doesn't work under linux !!

Post by kAd »

hi i'm trying to make my irrlicht window not resizable un der linux but this doesn't work !!

it works well under windows but i can still resize the window under linux ??


anyone got a solution ?
[ Enzys http://enzys.online.fr ] : Un MMORPG français en dev (^_^)Y
CuteAlien
Admin
Posts: 9933
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Old message, but i got at least a partial solution (resizing can be disabled now) for it in case someone else needs it:

Code: Select all

//! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceLinux::setResizeAble(bool resize)
{
    if ( Fullscreen )
        return;

#ifdef _IRR_COMPILE_WITH_X11_
    if ( !resize )
    {
        XUnmapWindow(display, window);
        XSizeHints Hints;
        Hints.flags=PSize|PMinSize|PMaxSize;
        Hints.min_width=Hints.max_width=Hints.base_width=Width;
        Hints.min_height=Hints.max_height=Hints.base_height=Height;
        XSetWMNormalHints(display,window,&Hints);

        XMapWindow(display, window);
        XFlush(display);
    }
    else
    {
        // TODO: this is default and set anyway.
        // I don't know how to get that state back in the correct way.
        // Maybe min_sizes to a small values and max_sizes to screensizes.
        // Maybe the old values can also be received some way (XGetWMNormalHints maybe).
    }
#endif // #ifdef _IRR_COMPILE_WITH_X11_
}
Btw. i think the function should be called setResizable :-)

edit: Only allowed when not Fullscreen, otherwise keyboard focus gets lost.
Post Reply