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

Bug 88600

Summary: embedded AWT - Difficulties receiving keyboard event on Linux
Product: [Eclipse Project] Platform Reporter: Jesse Eichar <jeichar>
Component: SWTAssignee: Silenio Quarti <Silenio_Quarti>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, CWNL-Eclipse-Bugs, ericwill
Version: 3.1Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
example attempting to reproduce bug. none

Description Jesse Eichar CLA 2005-03-20 17:09:49 EST
I want to embed a java.awt.Frame in a Embedded widget and then set that
widget as disabled.  According to books and articles I've read I am
supposed to be able to listen to the parent and receive all the events
raised in the child.  Keyboard events are the ones I am mostly
interested in (mainly because mouse events work in my case).

  I am using eclipse 3.1 M4.

 I used the following code to embed a java.awt.Frame in and RCP app.


 >        parent=new Composite(comp, SWT.EMBEDDED | SWT.NO_BACKGROUND);
 >        parent.setEnabled(false);
 >        SWT_AWT.new_Frame(parent).add(this); //the this object is a
 >java.awt.Canvas
 >        parent=comp;


 This is a fragment from the constructor of a implementation of
 java.awt.Canvas.


 When the canvas object has been created the keyboard events do not seem
 to be processed.  Eclipse commands are not processed and if I put a key
 listener on comp no keyboard events are received.

 However if I switch to another window then back to the app the keyboard
 events are processed correctly.


 I will attach an example where I'm attempting to reproduce the
 behaviour. but it is not working correctly.  In the view I've named
 "view that accepts keyboard event"  mouse events work but it seems to me
 that keyboard events should work as well.  In the other view no events
 are being handled and I don't know why.
Comment 1 Jesse Eichar CLA 2005-03-20 17:11:43 EST
Created attachment 19028 [details]
example attempting to reproduce bug.  

Example doesn't quite work as I had hoped but may shed light on the problem.
Comment 2 Jesse Eichar CLA 2005-03-20 17:14:55 EST
The UDIG RCP application manifests the original bug I wished to report.  The
keyboard events work fine when no map has been created but after a map is
opened, (Even a blank map) no keyboard events are received until the focus is
removed from the application to another then returned to the application.  Once
the focus has been shifted then the application works correctly until another
map is created.  Perhaps it has to do with creating a SWT_AWT widget?
Comment 3 Jesse Eichar CLA 2005-03-20 17:17:29 EST
UDIG can be downloaded from http://udig.refractions.net/download.  Only on linux
does this bug manifest.  I run on GNOME 2.8 and haven't tested KDE.
Comment 4 Alexander Kurtakov CLA 2018-07-13 05:28:13 EDT
Is this still an issue for you?
Comment 5 Eric Williams CLA 2019-02-15 15:41:49 EST
(In reply to Alexander Kurtakov from comment #4)
> Is this still an issue for you?

No response in 2005, closing this ticket now. Please reopen the bug if the issue occurs on SWT 4.10 or newer with GTK3.22 or newer.