How to add "Mimimize" decoration to non-resizable window?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Agent_X
Posts: 41
Joined: Sun Sep 16, 2012 3:44 am

How to add "Mimimize" decoration to non-resizable window?

Post by Agent_X »

When the IrrlichtDevice is in windowed mode, it only shows the minimize button if the window is set as resizable. I want to add the minimize window decoration/button when the window is not resizable. I want to do this for both Linux and Windows and I'm fine with modifying the source and recompiling. I've looked in CIrrDeviceLinux.cpp, CIrrDeviceWin32.cpp, and CIrrDeviceStub.cpp along with some web searches, but I can see where to set that property. I'm guessing for Linux it has something to do with XSetWindowAttributes, XSizeHints, or XVisualInfo but I'm not sure.
Agent_X
Posts: 41
Joined: Sun Sep 16, 2012 3:44 am

Re: How to add "Mimimize" decoration to non-resizable window

Post by Agent_X »

Ok I got it to work for Windows by adding WS_MINIMIZEBOX to lines 972 and 1678 of CIrrDeviceWin32.cpp:

Code: Select all

if (!CreationParams.Fullscreen)
            style = WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MINIMIZEBOX;
and

Code: Select all

if (!resize)
        style = WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MINIMIZEBOX;
Now to figure out Linux...
Agent_X
Posts: 41
Joined: Sun Sep 16, 2012 3:44 am

Re: How to add "Mimimize" decoration to non-resizable window

Post by Agent_X »

Ha Ha ha! I was trying to figure out out to add the minimize button to a non-resizable window in Linux, and I noticed it already had one :oops:
At least Ubuntu (Gnome and X Window) does. I'm not sure about other distros. But since my Irrlicht-based applications are only used in-house and not intended for public distribution, I only need it to work on Windows XP, Windows 7, and Ubuntu.
Post Reply