Hello Guest

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

  • 24 Replies
  • 24623 Views
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
« Last Edit: January 22, 2012, 18:24:24 by kappa »
Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

Re: [RFE] Enable maximize-window together with Display.setResizable
« Reply #1 on: December 30, 2011, 00:06:37 »
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/

*

Offline Matzon

  • *****
  • 2242
Re: [RFE] Enable maximize-window together with Display.setResizable
« Reply #2 on: December 30, 2011, 08:36:28 »
aye, window looks easy enough to fix - dont know about mac / linux tho. Waiting for someone to chime in before applying.

Re: [RFE] Enable maximize-window together with Display.setResizable
« Reply #3 on: December 30, 2011, 21:42:47 »
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/

Re: [RFE] Enable maximize-window together with Display.setResizable
« Reply #4 on: January 09, 2012, 20:08:30 »
Anybody chiming in?
Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

*

Offline Matzon

  • *****
  • 2242
Re: [RFE] Enable maximize-window together with Display.setResizable
« Reply #5 on: January 11, 2012, 20:47:54 »
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).

Re: [RFE] Enable maximize-window together with Display.setResizable
« Reply #6 on: January 14, 2012, 21:53:20 »
Cool, thanks!
Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

*

Offline kappa

  • *****
  • 1313
Re: [RFE] Enable maximize-window together with Display.setResizable
« Reply #7 on: January 22, 2012, 18:23:19 »
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.

*

Offline princec

  • *****
  • 1929
    • Puppygames
Re: [FIXED] Enable maximize-window together with Display.setResizable
« Reply #8 on: January 22, 2012, 22:46:57 »
What about the "restore" functionality? And is there any API to retrieve extended window state a la AWT?

Cas :)

*

Offline kappa

  • *****
  • 1313
Re: [FIXED] Enable maximize-window together with Display.setResizable
« Reply #9 on: January 23, 2012, 20:58:29 »
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.

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?

*

Offline princec

  • *****
  • 1929
    • Puppygames
Re: [FIXED] Enable maximize-window together with Display.setResizable
« Reply #10 on: January 23, 2012, 22:15:22 »
Cool.

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

Cas :)

*

Offline kappa

  • *****
  • 1313
Re: [FIXED] Enable maximize-window together with Display.setResizable
« Reply #11 on: January 24, 2012, 09:51:29 »
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).
« Last Edit: January 24, 2012, 09:54:49 by kappa »

*

Offline NateS

  • **
  • 91
    • Esoteric Software
Re: [FIXED] Enable maximize-window together with Display.setResizable
« Reply #12 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.

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:
Code: [Select]
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.
« Last Edit: August 01, 2012, 03:52:26 by NateS »

*

Offline Matzon

  • *****
  • 2242
Re: [FIXED] Enable maximize-window together with Display.setResizable
« Reply #13 on: August 01, 2012, 17:11:13 »
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:
Code: [Select]
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.

*

Offline NateS

  • **
  • 91
    • Esoteric Software
Re: [FIXED] Enable maximize-window together with Display.setResizable
« Reply #14 on: August 09, 2012, 13:13:18 »
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:
Code: [Select]
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.
« Last Edit: August 09, 2012, 13:16:42 by NateS »