Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344642 - [Mac OS X] Cannot enable/disable breakpoint by clicking checkbox
Summary: [Mac OS X] Cannot enable/disable breakpoint by clicking checkbox
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X
: P3 blocker (vote)
Target Milestone: 3.7 RC1   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 17:09 EDT by Stefan Mücke CLA
Modified: 2011-05-05 11:42 EDT (History)
8 users (show)

See Also:
eclipse.felipe: review+


Attachments
fix (46.92 KB, patch)
2011-05-05 11:06 EDT, Silenio Quarti CLA
no flags Details | Diff
fix (48.81 KB, patch)
2011-05-05 11:34 EDT, Silenio Quarti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Mücke CLA 2011-05-03 17:09:02 EDT
Build id: I20110428-0848 (Eclipse 3.7 M7, Cocoa 32-bit)
Running on Mac OS X 10.5.8 and Java 1.5.0_28

1. Open a Java file and add a breakpoint
2. Switch to the Debug perspective
3. Try to disable the breakpoint by clicking the checkbox
   in the Breakpoints view --> not possible

Note that the breakpoint's table row will be deselected on mouse up. If previsouly not selected, it will be selected on mouse down and then deselected on mouse up. 

Interestingly, enabling and disabling works when holding down the alt/option key. The context menu actions also work.

Marked as a blocker, because I think 3.7 should not be shipped with this bug.
Comment 1 Dani Megert CLA 2011-05-04 03:00:04 EDT
Does it work when you click very fast? I ask because when I click slowly I can also reproduce on our Linux box but not on my Windows XP machine.

Deepak, please check whether you can reproduce on the Mac and whether this worked in 3.6.x.
Comment 2 Stefan Mücke CLA 2011-05-04 05:05:33 EDT
> Does it work when you click very fast?
No, it doesn't.
Comment 3 Dani Megert CLA 2011-05-04 06:07:46 EDT
I can reproduce on the Linux box using the ControlExample:
1. go to the Tree page
2. enable SWT.CHECK
3. enable the DragDetect listener and listen to events
4. move mouse over a Tree's check box
5. click left mouse button and hold it down
==> checkbox not checked (normally the Tree checkbox is checked on mouse down)
6. wait a bit
7. release mouse button
==> checkbox still not checked

NOTE: it works when the DragDetect event listener is not added.


>Deepak, please check whether you can reproduce on the Mac and whether this
>worked in 3.6.x.
Deepak could not reproduce on his Mac (10.6.3) but on his Linux box. It works in 3.6 on the Linux box.
Comment 4 Dani Megert CLA 2011-05-04 06:08:12 EDT
Stefan, are you working directly on the machine or do you access it via VNC? Also, are you sure you're not slightly moving the mouse while clicking?
Comment 5 Dani Megert CLA 2011-05-04 06:18:44 EDT
Filed bug 344686 to track the Linux-GTK issue so that we can focus on Mac OS X in this bug.
Comment 6 Stefan Mücke CLA 2011-05-04 06:58:55 EDT
> Stefan, are you working directly on the machine or do you access it via VNC?
> Also, are you sure you're not slightly moving the mouse while clicking?
Yes, I am directly on the machine. The mouse is definitely not moved while clicking. I tried to toggle the checkbox quite often, and it never worked.

Interestingly, in the Debug Configurations dialog on the Plug-ins tab I have no problem with toggling the checkboxes.
Comment 7 Dani Megert CLA 2011-05-04 07:02:01 EDT
(In reply to comment #6)
> > Stefan, are you working directly on the machine or do you access it via VNC?
> > Also, are you sure you're not slightly moving the mouse while clicking?
> Yes, I am directly on the machine. The mouse is definitely not moved while
> clicking. I tried to toggle the checkbox quite often, and it never worked.
Also if you click very fast?


> Interestingly, in the Debug Configurations dialog on the Plug-ins tab I have
> no problem with toggling the checkboxes.
This view probably doesn't support drag&drop.
Comment 8 Stefan Mücke CLA 2011-05-04 07:12:37 EDT
(In reply to comment #7)
> Also if you click very fast?
I clicked as fast as possible, but it doesn't work.
Comment 9 Stefan Mücke CLA 2011-05-04 07:30:21 EDT
I am trying to debug this. In class Tree, I get a mouse-down event, but I never get a mouse-up event, that is, mouseUp(...) method in classes Widget and Control are never called when clicking a breakpoint row; in other widgets, they are called. Any hints?
Comment 10 Dani Megert CLA 2011-05-04 08:02:14 EDT
(In reply to comment #9)
> I am trying to debug this. In class Tree, I get a mouse-down event, but I never
> get a mouse-up event, that is, mouseUp(...) method in classes Widget and
> Control are never called when clicking a breakpoint row; in other widgets, they
> are called. Any hints?

Can you try with a different mouse? Also: could you try with Eclipse 3.6?

NOTE: it will be easier to debug in the ControlExample (http://www.eclipse.org/swt/examples.php).
Comment 11 Stefan Mücke CLA 2011-05-04 08:06:14 EDT
(In reply to comment #10)
> Can you try with a different mouse? Also: could you try with Eclipse 3.6?
Different mouse, same problem. Eclipse 3.6.2 works well.
Comment 12 Stefan Mücke CLA 2011-05-04 08:29:19 EDT
(In reply to comment #10)
> NOTE: it will be easier to debug in the ControlExample
> (http://www.eclipse.org/swt/examples.php).
This example does not exhibit the bug.
Comment 13 Lakshmi P Shanmugam CLA 2011-05-04 08:33:39 EDT
I'm unable to reproduce this on my machine which has OSX 10.6.7. I don't have access to a 10.5 machine now to verify this.

(In reply to comment #9)
> I am trying to debug this. In class Tree, I get a mouse-down event, but I never
> get a mouse-up event, that is, mouseUp(...) method in classes Widget and
> Control are never called when clicking a breakpoint row; in other widgets, they
> are called. Any hints?
mouseUp() in Control and Widget is not called in this case, but the SWT.MouseUp event will be sent from Control.sendMouseEvent().
Comment 14 Stefan Mücke CLA 2011-05-04 08:35:07 EDT
(In reply to comment #12)
> This example does not exhibit the bug.
I was wrong. The bug can be reproduced by changing from SINGLE to MULTI style.
Comment 15 Stefan Mücke CLA 2011-05-04 08:38:46 EDT
(In reply to comment #14)
> The bug can be reproduced by changing from SINGLE to MULTI style.
The bug only occurs when the DragDetect listener is installed. Without the listener, it works well.
Comment 16 Dani Megert CLA 2011-05-04 08:43:05 EDT
(In reply to comment #15)
> (In reply to comment #14)
> > The bug can be reproduced by changing from SINGLE to MULTI style.
> The bug only occurs when the DragDetect listener is installed. Without the
> listener, it works well.

Yes, see comment 3 ;-)
Comment 17 Silenio Quarti CLA 2011-05-04 11:51:15 EDT
This bug (gtk only as well) was caused by changes for Bug#336408.
Comment 18 Silenio Quarti CLA 2011-05-04 12:51:25 EDT
(In reply to comment #17)
> This bug (gtk only as well) was caused by changes for Bug#336408.

My comment above is incorrect. The changes for Bug#336408 are causing only the gtk bug (bug#344686). I am still investigating this mac problem. I can not reproduce it on 10.6, but I can reproduce it in 10.5.
Comment 19 Silenio Quarti CLA 2011-05-04 12:54:27 EDT
Simple snippet:

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;


public class PR344642 {
public static void main(String[] args) {
	Display display = new Display();
	Shell shell = new Shell(display);
	shell.setLayout(new FillLayout());

	Tree tree = new Tree(shell, SWT.CHECK | SWT.MULTI);
	for (int i = 0; i < 10; i++) {
		TreeItem item = new TreeItem(tree, SWT.NONE);
		item.setText("Item " + i);
	}
	
	tree.addListener(SWT.DragDetect, new Listener() {
		public void handleEvent(Event event) {
			System.out.println(event);
		}
	});

	shell.pack();
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
	display.dispose();
}
}
Comment 20 Silenio Quarti CLA 2011-05-05 11:06:05 EDT
Created attachment 194838 [details]
fix

This bug was caused by a combination of the fixes for bug#329840, bug#325230 and bug#337203.

It does not happen on 10.6 because outlineView:selectionIndexesForProposedSelection: is not called in 10.6 when clicking on the check.

Bug#329840 was not fixed completely: if the user clicks on a check of a row that is not selected, the row would be selected.
Comment 21 Silenio Quarti CLA 2011-05-05 11:34:27 EDT
Created attachment 194843 [details]
fix

Found a problem with previous patch  (bug#325230 was back on 10.5 only)
Comment 22 Silenio Quarti CLA 2011-05-05 11:42:35 EDT
Fixed > 20110505