United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6453153 : Tooltips are shown on wrong screen in multi-monitor setups.

Details
Type:
Bug
Submit Date:
2006-07-26
Status:
Closed
Updated Date:
2012-01-11
Project Name:
JDK
Resolved Date:
2012-01-11
Component:
client-libs
OS:
linux
Sub-Component:
javax.swing
CPU:
x86
Priority:
P4
Resolution:
Duplicate
Affected Versions:
6
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description
FULL PRODUCT VERSION :
build 1.6.0-beta-b59g
build 1.5.0_06-b05

ADDITIONAL OS VERSION INFORMATION :
2.6.15-26-k7


A DESCRIPTION OF THE PROBLEM :
If an application shares two screens on a multi-monitor setup, tooltips get shown on the wrong monitor.  Usually the tooltips of components located on the second screen are shown on the primary one.

Regression: It had worked with IBM Java 1.3

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- Open Notepad.jar from the java demos.
- Move its frame so that the "Create a new file" toolbar botton is shown on the first screen but the "Save to a file" button on the second one.
Place the mouse cursor above the "Save to a file" button until the tooltip pops up.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The tooltip should pop up on the second screen.
ACTUAL -
The tooltip pops up on the first screen.

REPRODUCIBILITY :
This bug can be reproduced always.

                                    

Comments
EVALUATION

In spite of the bug is reported for linux systems only, it is reproduced on windows as well. It seems that the problem is in the code for ToolTipManager.showTipWindow():

    // Fit as much of the tooltip on screen as possible
    if (location.x < sBounds.x) {
        location.x = sBounds.x;
    }

Here are some more details. When a window is located on both windows, its graphics config corrensponds to that screen that the window is mostly on. In the case for Notepad demo it is a secondary screen. At the same time the button is on the first screen and a tooltip for it should be shown on the primary screen too, but the check above moves the tooltip to the secondary window.

I should also mention that all the components inside a toplevel window inherit graphics config from it. This leads to the button to have the secondary screen graphics config even if it is really located on the primary one. ToolTipManager should be aware of such possible cases.
                                     
2006-07-27



Hardware and Software, Engineered to Work Together