Login  Register

Re: How to tell if a newt window is maximized?

Posted by Sven Gothel on Feb 23, 2012; 9:24am
URL: https://forum.jogamp.org/How-to-tell-if-a-newt-window-is-maximized-tp3767837p3769157.html

On 02/22/2012 09:52 PM, GiGurra [via jogamp] wrote:

>
>
> On windows:
>
> Is there any way to tell if a decorated newt window (created with
> GlWindow.create(....)) is maximized on a monitor?
> I cant just ask if size + decoration == screen size because windows adds
> some wierd padding to the reported size when in a "maximized" state.
>
> Tell me if you need more info, but an "isMaximized()" method would be really
> good here
So you don't want to query 'isFullscreen()' - ok.

- The NEWT window size (getWidth()/getHeight() reflects
  client area excluding insets (window decorations),
  see API doc.

- You can get the decoration size of a visible window:
 'InsetsImmutable getInsets()'

- You can get the Screen's size:
  getScreen().getWidth() ...

- You can make your own query:
  if( screen.getWidth() <= window.getWidth() + insets.getTotalWidth() &&
      .. same for Height ..
    ) then I am maximized :)

~Sven


signature.asc (910 bytes) Download Attachment