Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 321290

Summary: [hovering][navigation] Quick Outline shows up on the wrong screen
Product: [Eclipse Project] Platform Reporter: Johannes Rieken <johannes_rieken>
Component: TextAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, markus.kell.r, remy.suen
Version: 3.6   
Target Milestone: 3.7 M2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
side 1
none
side 2 none

Description Johannes Rieken CLA 2010-07-30 02:56:27 EDT
Build Identifier: 3.6

* Have a dual monitor setup
* In a Java file open the quick outline using the corresponding short cut
 > the quick outline shows up on the other screen
* Repeat open quick outline
 > always wrong window
* Focus the editor, repeat quick outine
> outline shown in the right window


Reproducible: Sometimes
Comment 1 Johannes Rieken CLA 2010-07-30 02:58:16 EDT
Created attachment 175541 [details]
side 1
Comment 2 Johannes Rieken CLA 2010-07-30 02:58:42 EDT
Created attachment 175542 [details]
side 2
Comment 3 Deepak Azad CLA 2010-07-30 03:16:32 EDT
This works well on Win XP (didnt try on Mac)
Comment 4 Markus Keller CLA 2010-07-30 08:13:00 EDT
Do you have "Remember Location" and/or "Remember Size" checked (in the menu on top right)?

How are the two monitors placed relative to each other (e.g. side 1 on the left and side 2 on the right)?
Comment 5 Johannes Rieken CLA 2010-08-02 03:35:02 EDT
(In reply to comment #4)
> Do you have "Remember Location" and/or "Remember Size" checked (in the menu on
> top right)?

2 x no

> How are the two monitors placed relative to each other (e.g. side 1 on the left
> and side 2 on the right)?

Side 1 is left, Side 2 is right.
Comment 6 Dani Megert CLA 2010-08-02 04:08:56 EDT
Works for me too. Note that the code to place the shell is not in JDT but rather in JFace (PopupDialog which is based on Window).

Could also be an SWT bug given that it works on Windows but not on the Mac.
Comment 7 Markus Keller CLA 2010-08-05 13:33:34 EDT
Taking this back, since the bounds are actually set in org.eclipse.jface.text.AbstractInformationControlManager
 #internalShowInformationControl(Rectangle, Object).

Jo, please step by when this happens again, so that we can debug it on your machine (I don't have a dual-screen Mac). Could be a problem with monitor bounds.

Screenshots look like this is Cocoa. Please revert platform if I'm wrong.

> * Focus the editor, repeat quick outine
>   > outline shown in the right window

In the screenshot, I saw that the caret is not visible (it's about 3 pages up). That could be a necessary condition to reproduce (which is destroyed when you click into the editor).
Comment 8 Dani Megert CLA 2010-08-06 02:32:56 EDT
>bounds are actually set in AbstractInformationControlManager 
Indeed.

Jo, can you also test whether you see this with other Quick views, e.g. Ctrl+Shift+L, Spy dialogs, Quick Access?
Comment 9 Markus Keller CLA 2010-08-24 06:20:24 EDT
Wow, needs quite a few conditions to reproduce.

Steps on WinXP:
- main resolution: 1920x1200, secondary resolution: 1280x768
- position the secondary monitor on the *left* of the main monitor (comment 5 was wrong) and vertically centered
- in the Quick Outline, have both "Remember ..." menu items unchecked
- open org.eclipse.core.expressions.Expression
- maximize the editor
- put the caret to the beginning of the file
- scroll to the end of the file, but don't move the caret
- open Quick Outline
=> on wrong screen like in screenshots
Comment 10 Markus Keller CLA 2010-08-24 07:10:16 EDT
The problem is that the subjectArea passed to AbstractInformationControlManager#internalShowInformationControl(Rectangle, Object) is off-screen, and the center of that area is closer to the secondary screen's center than to the main screen's center (because the secondary screen is narrower).

Fixed in HEAD of org.eclipse.jface.text.information.InformationPresenter. This also fixes other problems with wrong positioning of popups (e.g. F2 hover is also wrong when the selection is scrolled away.

Workarounds: Make sure the caret is visible, or select "Remember Location" in the Quick Outline's menu.