Community
Participate
Working Groups
Hello, I have git an inconsitency between SWT-Win32 and SWT-Linux-GTK. I attached a MouseListener and a MenuDetectListener. If I have a Mouse button 3 event, on Windows first the MouseDown Event is fired than the menuDetected event, on linux-gtk it is the other way around. I think the windows behaviour is the expected behaviour because i.e. one can prevent the context menu when a mouse drag is detected. Code for reproduction: public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Shell"); shell.setSize(200, 200); shell.setLayout(new GridLayout()); Canvas canvas = new Canvas(shell, SWT.NONE); canvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); canvas.addMenuDetectListener(new MenuDetectListener() { public void menuDetected(MenuDetectEvent e) { System.out.println("MenuDetectedEvent"); System.out.println("Pos: X:" + e.x + " Y "+ e.y); }}); canvas.addMouseListener(new MouseListener() { public void mouseDoubleClick(MouseEvent e) { // TODO Auto-generated method stub } public void mouseDown(MouseEvent e) { if (e.button == 3) { System.out.println("Mouse button 3 down"); System.out.println("Pos: X:" + e.x + " Y "+ e.y); } } public void mouseUp(MouseEvent e) { if (e.button == 3) System.out.println("Mouse button 3 up"); }}); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
This is a duplicate of bug#79925.
Thanks Praveen - closing as a DUPLICATE. *** This bug has been marked as a duplicate of bug 79925 ***