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

Bug 530036

Summary: Mouse listener down up exclusion
Product: [Eclipse Project] Platform Reporter: Roman Knoell <mail>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: gautier.desaintmartinlacaze, lshanmug
Version: 4.6Keywords: triaged
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard: stalebug

Description Roman Knoell CLA 2018-01-19 07:20:06 EST
I use SWT 4.628 on Mac OS 10.13.2 (can‘t upgrade to Java 8 / SWT 4.72 / Scala IDE 4.7 since the latter does not work on Mac OS 10.13)

When I use both mouseDown and mouseUp, no mouseUp event at all is initiated. mouseUp works only when I disable mouseDown. The time span I hold the mouse down has no effect on that (i.e. whether I just “click” or keep it pressed for a while). For key events all seems to work normal (press/release).

Please help!

Just the most simple example code for this:

import org.eclipse.swt.SWT
import org.eclipse.swt.widgets._
import org.eclipse.swt.events._

object swt_test extends App {
   val display = Display.getDefault

   val shell = new Shell(display)
   shell.setSize(200, 200)

   val label = new Label(shell, SWT.NONE)
   label.setSize(100, 100); label.setBackground(display.getSystemColor(SWT.COLOR_WHITE))
   label.setText("test box")

   label.addMouseListener(new MouseAdapter {
      override def mouseDown(event: MouseEvent) = { label.setText("down"); println("down") }
      override def mouseUp(event: MouseEvent) = { label.setText("up"); println("up") }
   })

   shell.open
   while (!shell.isDisposed) if (!display.readAndDispatch) display.sleep
   display.dispose

}
Comment 1 Lakshmi P Shanmugam CLA 2018-12-21 02:01:07 EST
I can reproduce this. Doesn't happen with other widgets such as Text or Button, happens only with Label.
Comment 2 Eclipse Genie CLA 2020-12-11 00:07:47 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.