<Swing Dev> [7] Review request for 7123767 Wrong tooltip location in Multi-Monitor configurations

Pavel Porvatov pavel.porvatov at oracle.com
Tue Aug 7 17:17:57 UTC 2012


Hi Vladislav,
> Hello,
>
> please review the fix for 7123767: Wrong tooltip location in 
> Multi-Monitor configurations
>
> jdk7 webrev: http://cr.openjdk.java.net/~vkarnauk/7123767/webrev.00/
> test source: http://cr.openjdk.java.net/~vkarnauk/7123767/test/
> bug description: 
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7123767
>
> This is also a customer escalated issue in jdk6.
>
> On multi-monitor configurations Component.getLocationOnScreen() may 
> return negative values. Additionally, ToolTipManager.showTipWindow() 
> method calculates tip window location from Component' 
> getLocationOnScreen() return data and draws tip window using the same 
> GraphicsConfiguration instance as component's top-left corner, which 
> again can be of negative value. When component is stretched across 
> multiple screen devices, this may lead to a situation when it's 
> tooltip is drawn on wrong monitor.
>
> To fix this we should count all GraphicsConfiguration instances and 
> determine correct screen device to draw on. We should also take into 
> account that:
> 1) tip window preferred location could be set
> 2) preferred location could be greater than total virtual bounds of 
> all monitors. To make tip window visible in such case we move it to 
> the corresponding corner of total virtual bounds
> 3) exact order of monitors (left-to-right and top-to-bottom) is unknown
>
> I run jtreg against ToolTipManager tests and all tests passed (I run 
> it several times with different monitor configurations). I also tested 
> the fix with custom test program (please see the link provided) with 4 
> possible monitor configurations (left-to-right, right-to-left, 
> top-to-bottom and bottom-to-top) and saw no issues.
>
> I added no new automated test(s) because this at least would require 
> multiple monitors to run.
I think you should write an automatic test, especially you are going to 
backport the fix. May be some testers have several monitors, or, e.g. I 
have two monitors and can't check the fix automatically. Moreover your 
manual test doesn't have any description about right behavior, so 
everybody have to spend a lot of time to understand which behavior is 
expected. BTW your test should work for single monitor, so the test will 
be useful for single-monitors environment as well.

Regards, Pavel



More information about the swing-dev mailing list