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

Bug 36441

Summary: [OLE] OLE/DHTMLEdit focus problems
Product: [Eclipse Project] Platform Reporter: Stefan Matthias Aust <sma>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact: Felipe Heidrich <eclipse.felipe>
Severity: normal    
Priority: P3 CC: greg.amerson, snorthov, veronika_irvine
Version: 2.1Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard: stalebug
Attachments:
Description Flags
Demonstration for the problem described
none
C# demo dhmlt edit application (needs .NET Fw 1.0) none

Description Stefan Matthias Aust CLA 2003-04-14 05:31:02 EDT
I tried to embed the Microsoft DHTML edit control (part of IE5+) into an
OleControlSite object and noticed focus problems. The control gets only a
"partial" input focus... cursor keys or ctrl-key-combinations work, but there's
no blinking caret and you cannot enter normal text. If you press TAB or click
into the edit control, the caret is shown and text input is possible.  If the
shell window is inactivated (for example by pressing Ctrl+F to open the built-in
search dialog) and is then reactivated, the focus is again partially lost.

The attached java program demonstrates the problem.  Please notice that the
controlSite fires one focus lost and two focus gained events.  I'm not sure
whether this is relevant but it looks suspicious.  Please also note the
"focus-event-storm" that occurs if the shell window is closed.

If you uncomment [1], for some reason the control get its complete focus. Again,
note the "event-storm".  That's only a crude workaround and it doesn't work any
more if you add more controls to the window, unfortunately.

As pressing TAB solves the problem, I tried to send a synthetic TAB key event
but nothing I tried worked.  I hoped that 

 OS.SendMessage(controlSide.handle, OS.WM_CHAR, '\t', 0);

would do the trick - sending this in the focus gained event was my idea - but it
didn't.  A similar workaround would be all I need...

It might be possible that the problem lays inside the edit control. If you
search google -> http://groups.google.com/groups?q=dhtml+edit+focus+problem, you
find a lot of people having problems, but I didn't find a posting with exact the
same problem.

I've also attached a tiny C# program (source and EXE) that shows the correct
behavior.  The edit control gets the focus, it keeps it focus (if you press
Ctrl+F for example) regardless of other controls or the phase of the moon.
Comment 1 Stefan Matthias Aust CLA 2003-04-14 05:32:46 EDT
Created attachment 4573 [details]
Demonstration for the problem described
Comment 2 Stefan Matthias Aust CLA 2003-04-14 05:34:32 EDT
Created attachment 4574 [details]
C# demo dhmlt edit application (needs .NET Fw 1.0)
Comment 3 Steve Northover CLA 2003-04-14 17:13:40 EDT
Thanks Stefan!  VI to investigate and advise.  SN to help.
Comment 4 Felipe Heidrich CLA 2009-08-12 12:12:31 EDT
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
Comment 5 Leo Ufimtsev CLA 2017-08-03 12:27:39 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 6 Eclipse Genie CLA 2020-07-17 13:10:54 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.