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

Bug 299244

Summary: [OLE] When using OleControlSite to embed MS Word 2007 in RAC view, Word commands do not react
Product: [Eclipse Project] Platform Reporter: Alex Safro <alex.safro>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact: Felipe Heidrich <eclipse.felipe>
Severity: normal    
Priority: P3 CC: damodhar.akula, spwanderer-know
Version: 4.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
Ole test view with OleControlSite to embed MS Word 2007 none

Description Alex Safro CLA 2010-01-11 04:26:57 EST
Build Identifier: I20090611-1540 (Version: 3.5.0)

Create a simple view with embedded MS Word 2007, using the OleControlSite object.  Open this view inside the RAC application.  Try clicking on different places in the view (title, toolbar, any other places).  At some point the embedded Word document will loose its focus and make all its commands (tabs) not responsive to the user clicks.  At this point try to click on the Word commands but nothing happens, the commands are not clickable.  Try clicking outside this view then click on the word document in the view again, the focus is gained and the commands are clickable again.

Reproducible: Sometimes

Steps to Reproduce:
1. Create a simple RAC view with embedded MS Word 2007 document, using the OleControlSite object.
2. Run RAC application, and open this view.
3. Try clicking on the view (not the word document) in different places.
4. At some point the Word tabs and commands become not responsive to the user clicks, as if it is not gaining focus...
5. As a workaround, click outside this view, then click in the word document itself - the Word commands and tabs are clickable again.
Comment 1 Alex Safro CLA 2010-01-11 04:29:00 EST
Created attachment 155721 [details]
Ole test view with OleControlSite to embed MS Word 2007

The problem is being recreated at most of the times (sometimes it is working, but most of the times the problem can be recreated).  the word commands and tabs are being out of focus and cannot be clicked.
Comment 2 Felipe Heidrich CLA 2010-01-14 16:16:07 EST
Can you provide a SWT only test case that reproduces this problem ?
Thank you
Comment 3 Satish CLA 2010-06-18 07:47:49 EDT
We did some more testing.
If we open a dialog (even a messagebox) on the view's toolbar commands, we do not have this issue. But say, on click of a view toolbar command, I add some content to the Word document using OleAutomation. The content gets added but Word Ribbon becomes unresponsive i.e., nothing happens on mouse click over a ribbon item.

I am not sure but I think this could be focus related. When we open a dialog and close it, the OnFocusIn(Event e) gets called and everything's fine. However, in the other case, as above, the OnFocusIn isn't called (rightly so). What I tried first was to force focus but this doesn't change anything. The OnFocusIn has a check isFocusControl() and since the OleControlSite is already in focus, it returns.
The work-around that worked for us was to set the focus onto the OleFrame of the OleControlSite. So as soon as I am done changing the Word document, I set the focus to the OleFrame object. This somehow brings back the Word Ribbon from its un-responsive state. 
The following code (taken from OleClientSite.java) was used.

int frameHnd = oleFrame.handle;
if (frameHnd != 0) {
    OS.SetFocus(frameHnd);
}

Any suggestions/comments appreciated.
Comment 4 Leo Ufimtsev CLA 2017-08-03 12:31:07 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 5 Eclipse Genie CLA 2020-02-28 02:54:23 EST
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.