Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312195 - "New > Untitled Text File" via wizard does not give focus to editor
Summary: "New > Untitled Text File" via wizard does not give focus to editor
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Scott Kovatch CLA
QA Contact: Silenio Quarti CLA
URL:
Whiteboard:
Keywords:
: 303677 347166 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-09 19:59 EDT by Markus Keller CLA
Modified: 2011-05-25 13:23 EDT (History)
6 users (show)

See Also:


Attachments
work in progress (2.09 KB, patch)
2010-05-12 13:31 EDT, Scott Kovatch CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-05-09 19:59:26 EDT
I20100509-0800 Cocoa

"New > Untitled Text File" via wizard does not give focus to editor. The editor is created, but the previously focused editor keeps focus.

Works fine via toolbar button menu or via File > New > submenu.
Comment 1 Dani Megert CLA 2010-05-10 02:48:26 EDT
Works fine for me on Windows XP using N20100507-2000.

Markus, can you check since when this is broken?
Comment 2 Dani Megert CLA 2010-05-11 02:23:25 EDT
Markus, please quickly debug on your Mac.
Comment 3 Markus Keller CLA 2010-05-11 18:57:21 EDT
I can only reproduce the problem with the new editor opening "behind" the active editor in my dev workspace. Will not pursue this problem further for now.

In another workspace, in the target, and in 3.5, the editor is opened and its tab comes to front, but the StyledText doesn't take keyboard focus.

Debugging this revealed that StyledText#setFocus() is called while the wizard shell is still open. On Windows, this stores the StyledText in Decorations.savedFocus, and when the wizard shell is closed, Decoration#restoreFocus() is executed.

On Cocoa, Decoration#restoreFocus() is only called from Shell#open(). That's not enough. Moving to SWT.
Comment 4 Scott Kovatch CLA 2010-05-12 13:31:34 EDT
Created attachment 168209 [details]
work in progress

This addresses the bug by adding the save/restoreFocus similar to what Carbon was doing. It probably needs more testing than we can give it for rc1, though.
Comment 5 Scott Kovatch CLA 2010-07-15 13:06:13 EDT
Fixed > 20100715, using the attached patch.
Comment 6 Scott Kovatch CLA 2010-07-15 18:32:47 EDT
*** Bug 303677 has been marked as a duplicate of this bug. ***
Comment 7 Silenio Quarti CLA 2010-08-09 14:41:06 EDT
This fix causes bug#322151.
Comment 8 Remy Suen CLA 2011-05-25 11:02:46 EDT
*** Bug 347166 has been marked as a duplicate of this bug. ***