Community
Participate
Working Groups
Build-Id: 3.6 M7'ish (as provided with recent builds of e4) I was trying the approach described in the SWT Snippet #46 to detect double-clicks in a populated composite. I've added a bunch of other widgets to Snippet46, including nested Composites and Groups, with assorted callbacks, and it continue to work. Unfortunately this approach (attaching a listener to the shell) doesn't work for an Eclipse view. I'm not sure what's different about this situation, nor what is necessary to get the equivalent behaviour. Steps to repeat: 1. From Eclipse, create a new view plugin (File > New > Plugin Project > ... > Plug-in with a view. 2. Open the view's SampleView.java. Add the following at the bottom of the createPartControl() method: parent.getShell().addListener(SWT.MouseDoubleClick, new Listener() { public void handleEvent(Event event) { System.out.println("MouseDoubleClick"); }}); parent.getShell().addListener(SWT.MouseMove, new Listener() { public void handleEvent(Event event) { System.out.println("MouseMove"); }}); On MacOS X, I see "MouseMove" only when the cursor is on the titlebar or at the very fringes of the window borders. I never see "MouseDoubleClick" printlns.
Do you know that the shell is only getting the events because the composite is disabled, right ? You can also use Display#addFilter to get all the events in the display. Please reopen this problem when you cause the problem to fail in the snippet. (I don't have any indication that you calling setEnable(false) for a composite and listening for mouse events in the composiste's parent).