United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7123767 Wrong tooltip location in Multi-Monitor configurations
JDK-7123767 : Wrong tooltip location in Multi-Monitor configurations

Details
Type:
Bug
Submit Date:
2011-12-21
Status:
Closed
Updated Date:
2014-02-05
Project Name:
JDK
Resolved Date:
2012-09-20
Component:
client-libs
OS:
linux,windows_7
Sub-Component:
javax.swing
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.1,6,7
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Duplicate:
Duplicate:
Duplicate:
Relates:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux 3.1.0-1-amd64 #1 SMP Sun Dec 11 20:36:41 UTC 2011 x86_64 GNU/Linux

EXTRA RELEVANT SYSTEM CONFIGURATION :
Multi-monitor setup, nVidia Corporation GF110 [GeForce GTX 580] (rev a1) 290.10 drivers

A DESCRIPTION OF THE PROBLEM :
If a java window spans over more than one monitor in a multi-monitor setup tooltips always appear on the first monitor, even for components that are displayed on other monitors. This means that the tooltip is not displayed at the location of the related component.
Issue is described also in bugs 7011796, 6453153 and 4825949.

This bug causes the application to look unprofessional to the customer and to them appears to be a bug within the application.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The issue can be reproduced with any java application that spans over more that one monitor.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
  Tooltips should appear on the monitor on which the corresponding component is located.
ACTUAL -
The tooltip appears right justified on the 1st monitor even if the component is on the 2nd monitor.

REPRODUCIBILITY :
This bug can be reproduced always.

                                    

Comments
EVALUATION

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 as component's top-left corner, which again can be of negative value. When component is streched 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 preffered location could be set
2) prefered 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
                                     
2012-07-30
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/4f519691520c
User:  lana
Date:  2012-10-12 18:08:25 +0000

                                     
2012-10-12
Verified in JDK8b117
Windows 7 Pro x64
Test test/javax/swing/ToolTipManager/7123767/bug7123767.java passed successfully
                                     
2013-11-26



Hardware and Software, Engineered to Work Together