[sip-comm-dev] ScreenInformation class question


Hi Thomas,

I needed these days to obtain the maximum possible window height (depending on the screen size) and noticed that you've done a utility class called ScreenInformation that computes the screen bounds taking into account multiple displays. It looks quite complete and I see it's used in SIPCommFrame and SIPCommDilaog to ensure window location and size on the screen.

However when looking at the SIPCommFrame.ensureOnScreenLocationAndSize something got my attention. Each time when we get the screen bounds we subtract from it the borderDistance (which is fixed to 10px). While it's easy to fix this by just replacing the 10px with Toolkit.getDefaultToolkit().getScreenInsets(getGraphicsConfiguration()), I was wondering why we don't just use


Its javadoc says:

Returns the maximum bounds for centered Windows. These bounds account for objects in the native windowing system such as task bars and menu bars. The returned bounds will reside on a single display with one exception: on multi-screen systems where Windows should be centered across all displays, this method returns the bounds of the entire display area.

which seems to be just what we'll need in most of the cases (on condition it works correctly of course).




To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net