<AWT Dev> OS X fullscreen window and dock

Michael Hall mik3hall at gmail.com
Tue Jan 10 00:33:07 UTC 2017


> On Jan 8, 2017, at 9:04 AM, Michael Hall <mik3hall at gmail.com> wrote:
> 
> Stack overflow or someplace like that might be better for this sort of thing, feel free to point that out if so. 
> But what is the best way to get a fullscreen window, less screen offsets with a hidden dock?  While still accounting for the possible dock. I generally like to have my dock hidden but pop up when needed. That space at the bottom of the screen is valuable real estate. However, this can occasionally be a nuisance if I want to actually get to something with the mouse at the very bottom of the screen and it keeps popping up the dock in the way. 
> I am currently increasing the size of the main window of one of my application’s. Going for as big as I can get it sort of full screen, hopefully less insets for the dock. I can’t seem to get this. 
> For example using this…
> 
> Insets insets = this.getToolkit().getScreenInsets(this.getGraphicsConfiguration());


I looked at this a little more to see if there isn't some way it should work as I’m thinking it should.
Speaking of Stackoverflow, I found this…

https://stackoverflow.com/questions/4982656/programmatically-get-screen-size-in-mac-os-x <https://stackoverflow.com/questions/4982656/programmatically-get-screen-size-in-mac-os-x>

This pretty much seems to follow what java is doing in CGraphicsDevice.m 
Java_sun_awt_CGraphicsDevice_nativeGetScreenInsets

where it appears to determine the difference between the screen size and the visible screen size.

someone in the Stackoverflow post indicates that...

"visibleFrame excludes the region occupied by the Dock or (when the Dock is hidden) the show-Dock trigger region, plus the menu bar.”

I think my testing showed that this is wrong, the ‘show-Dock trigger region’ is not excluded when the dock is hidden by user preference. 
Whether they are mistaken or this is a bug for OS X Yosemite I don’t know. 

I guess it would not be a java bug either way.

I will simply go for a JFrame that’s height is some arbitrary distance from the screen bottom if the dock appears to be hidden. That is, if the bottom inset it set to 4.

Thanks,

Michael Hall



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20170109/23bca37d/attachment.html>


More information about the awt-dev mailing list