Login  Register

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

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

On 02/23/2012 10:24 AM, Sven Gothel wrote:

> 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
Sorry .. so you knew that already - good :)

No, I don't think we should pollute the API with all possible queries
and as demonstrated - you can do it easily.

As Julien mentioned I have polluted the API with 'setTopLevel..()'
methods already .. and I should have not, since those things just let
people ask for more redundancy, which is hard to maintain.

If you or others really want such API entries
wich are *already* possible to implement,
please file a bug report 'enhancement' and let's see how many folks
would love to have such functions .. -> democracy.

If something is *not* possible to implement
I love to add reasonable features right away, ofc.
However, it's always best to have an bug report.
Then you may like to add it yourself (after it's discussed a bit
and I pull from your repository.

~Sven

>
> 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