Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 63353 - [browser] IE Browser.setFocus() does not give focus to first child
Summary: [browser] IE Browser.setFocus() does not give focus to first child
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-20 21:41 EDT by Mazen Faraj CLA
Modified: 2019-09-04 02:58 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mazen Faraj CLA 2004-05-20 21:41:51 EDT
I eclipse-SDK-I20040520
Chris,
I set the focus a the browser widget and it does not seem to directly get that 
focus. You have to tab like once or twice before the browser content gets the 
focus. 

Am I missing somethng? Its a simple browser.setfocus() and I konw for a fact 
its getting called. 

To see what I mean, try this: 
Open clean workbench on Intro (on windows to get the browser implementation). 
Tab, and see that you need more than one tab before content gets focus.

Now close intro, and reopen it, Tab does not work at all now. 
Any pointers on what I might be doing wrong? 

If you wanna look at the specific browser instance put a breakpoint in :
BrowserIntroPartImplementation in  
org.eclipse.ui.internal.intro.impl.presentations intro package. 

please let me know what u think.
Comment 1 Mazen Faraj CLA 2004-05-20 22:00:13 EDT
ok, better yet. Try this: 
launch Intro, right click on Browser and view source. 
Save source as a file. Launch the file in IE. IE gives the first link 
(overview) focus immediately. 

(ps: just fyi, I will disable this menu tonight from real intro, and make it 
only available if intro plugin is run in debug mode.)
Comment 2 Christophe Cornu CLA 2004-05-21 10:19:07 EDT
Confirmed this is a bug. Looking into it.
Comment 3 Christophe Cornu CLA 2004-05-21 12:11:30 EDT
Some updates on this.

This PR is now to investigate the possibility to give focus to the inner child 
of the browser content - the same way IE does as described by Mazen in comment 
1. Note that this will probably require calling setFocus after the document 
has been loaded (probably in ProgressListener.completed).

> You have to tab like once or twice before the browser content gets the 
>focus. 

The Browser actually gets focus but does not give it directly to its first 
child. This can be verified with a web page that is long enough to require 
scrollbars: the wheelmouse correctly scrolls the content of the browser 
widget - which it does not if another widget has focus.

> Now close intro, and reopen it, Tab does not work at all now.
I could reproduce it by replacing the Browser with a Composite that does not 
embed IE. The problem seems to be that you call setFocus() on the widget when 
it is not visible yet. In that case, the focus remains to whoever got it last. 
In my case, it looked like it was a Tree that is hidden by the Intro tab.
Comment 4 Christophe Cornu CLA 2004-05-21 12:12:56 EDT
note that setFocus returns false when it fails as it is the case for you 
because the widget was not visible.
Comment 5 Mazen Faraj CLA 2004-05-21 12:46:17 EDT
thanks Chris.

re: setFocus() when not visible. I'll investigate from my side.

re: giving focus to first child. Great, but would that listener trick work in 
the case where the browser is getting its content through setText()?
Comment 6 jernej srebrnic CLA 2005-12-16 05:36:09 EST
i thik that this bug case is related:
1. browser (ie) opens doc file on windows (swt browser or the browser plugin)
2. browser opse doc in activeX
3. open external ms word
4. copy test from browser
5. swicht to eord and paste
6. swich back to browser
-- error --
no the right mouse button and menu dors in activeX dont work.

if you try the same with an external browser it works fine.
Comment 7 jernej srebrnic CLA 2005-12-16 06:01:56 EST
#106394
Comment 8 Lars Vogel CLA 2019-09-04 02:58:41 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it and remove the stalebug whiteboard tag. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--