[RFE] Enable maximize-window together with Display.setResizable

Started by Simon Felix, December 29, 2011, 13:14:43

Previous topic - Next topic

Simon Felix

Hi everyone

It'd be nice if the window managed by LWJGL had a maximize button (WS_MAXIMIZEBOX style on Windows) when resizing is enabled.

I tested with Windows 7 (and 8 ).

Cheers,
Simon
Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

Simon Felix

I attached a diff to fix the behavior. This works at least on Windows XP, Vista, 7 and 8. I did not test any other platforms, but I made no changes there anyway. Hope you can use it!
Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

Matzon

aye, window looks easy enough to fix - dont know about mac / linux tho. Waiting for someone to chime in before applying.

Simon Felix

Ok. It shouldn't break anything on other platforms and improve the situation on Windows. But having a similar fix for other platforms (if they even show the same behavior) would be desirable.
Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

Simon Felix

Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

Matzon

I have applied the patch for windows. kappaOne mentioned on IRC it should be easy enough to add on linux and mac (although he did mention that mac was "different" in that regard).

Simon Felix

Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

kappa

I can confirm that the maximise button already works as expected on both Linux and Mac when Display.setResizable(true) is set. So no need to make further changes for those platforms.

RFE marked as complete and implemented.

princec

What about the "restore" functionality? And is there any API to retrieve extended window state a la AWT?

Cas :)

kappa

Quote from: princec on January 22, 2012, 22:46:57
What about the "restore" functionality?
If you mean the restore button once maximised (to return window to size it was before maximising), then yeh that works fine, as expected.

Quote from: princec on January 22, 2012, 22:46:57
And is there any API to retrieve extended window state a la AWT?
Extended window state? you mean like an API to detect if the window is minimised, make it flash, etc? or something else?

princec

Cool.

The extended state - eg query and set the iconified status of the window programmatically.

Cas :)

kappa

Quote from: princec on January 23, 2012, 22:15:22
The extended state - eg query and set the iconified status of the window programmatically.
Ah, as far as I'm aware there is no API currently to get the extended state of the Display window. The only API I'm aware of is Display.isActive() which will tell you if the window is focused or not (will also return false if window is minimised).

NateS

I'm necro'ing this topic (in case the OP or others interested in maximize enabled notify on this thread) to ask for a new feature: Can Display have a feature to maximize and restore (unmaximize) the window? I need to both query and set the current maximized state. I need this for a desktop app where I want to restore the application window to the same state it was in when the app was closed.

Edit: Seems to be a related problem, if I save Display.getX/Y and use the values with Display.getLocation when the app next runs, the window is not positioned in the same location. Eg:
Display.setLocation(822, 525);
Display.create(...);
System.out.println(Display.getX() + ", " + Display.getY()); // 832, 565

That is on Windows 7 Ultimate 64-bit. I can create a new thread for either or both issues if you prefer.

Matzon

Quote from: NateS on August 01, 2012, 03:36:54
I'm necro'ing this topic (in case the OP or others interested in maximize enabled notify on this thread) to ask for a new feature: Can Display have a feature to maximize and restore (unmaximize) the window? I need to both query and set the current maximized state. I need this for a desktop app where I want to restore the application window to the same state it was in when the app was closed.
Not sure if there are cross platform issues with this ?

Quote
Edit: Seems to be a related problem, if I save Display.getX/Y and use the values with Display.getLocation when the app next runs, the window is not positioned in the same location. Eg:
Display.setLocation(822, 525);
Display.create(...);
System.out.println(Display.getX() + ", " + Display.getY()); // 832, 565

That is on Windows 7 Ultimate 64-bit. I can create a new thread for either or both issues if you prefer.
Try nightly.

NateS

Quote from: Matzon on August 01, 2012, 17:11:13
Quote from: NateS on August 01, 2012, 03:36:54
I'm necro'ing this topic (in case the OP or others interested in maximize enabled notify on this thread) to ask for a new feature: Can Display have a feature to maximize and restore (unmaximize) the window? I need to both query and set the current maximized state. I need this for a desktop app where I want to restore the application window to the same state it was in when the app was closed.
Not sure if there are cross platform issues with this ?
I'm not sure either. I do think support for it is important. I would be fine if it worked on Windows, if only until it could be implemented for other OSes. The bad part without this feature is that when the user maximizes the window, all I know is that is has been resized. When they launch the app again, they get a huge window that isn't maximized.

Quote
Quote
Edit: Seems to be a related problem, if I save Display.getX/Y and use the values with Display.getLocation when the app next runs, the window is not positioned in the same location. Eg:
Display.setLocation(822, 525);
Display.create(...);
System.out.println(Display.getX() + ", " + Display.getY()); // 832, 565

That is on Windows 7 Ultimate 64-bit. I can create a new thread for either or both issues if you prefer.
Try nightly.
Verified it works correctly in nightly build #1757. Thanks!

A related feature would be to know when the application is minimized. I don't want to stop rendering if the window is not active but still visible, but if it is minimized then I do want to stop rendering.