NEW DATE! Bugzilla will undergo maintenance 2024-03-28 18h00 CET. Bugzilla will be placed in read-only mode at that time.

Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 405735 - [visualizer] Using context menu prevents next selection
Summary: [visualizer] Using context menu prevents next selection
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.2   Edit
Assignee: Marc Dumais CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-15 10:59 EDT by Marc Dumais CLA
Modified: 2013-05-06 09:14 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Dumais CLA 2013-04-15 10:59:00 EDT
After using the context-menu in the Multicore Visualizer (right-click), the next click on the visualizer does not work.  I have to click a second time to do a selection.
Comment 1 Marc Dumais CLA 2013-04-15 11:07:35 EDT
It seems that the context menu might be interfering with the mouseUp event, which is not triggered for right mouse clicks.  

Because of this, the MouseMonitor is left in a strange state, where it thinks that a mouse drag is in progress.  

If the next (left) click is to select something, the mouseUpHandler() will not go into the selection code because m_mouseDrag is true.  The following (left) click will work as expected to select something.
Comment 2 Marc Dumais CLA 2013-04-26 10:51:55 EDT
I had the chance to debug this problem a bit further.   If I add printouts, in MouseMonitor, methods:  mouseDownHandler() and mouseUpHandler(), I can see that the printouts are generated in succession when I left-click and release, in the multicore visualizer.

But when I right-click and release, only the mouseDownHandler() is called.  It seems that the mouseUp event is somehow lost.  

If I set breakpoints in both methods, then the context menu does not pop-up upon right-clicking and both breakpoints actually hit.  This made me think that the context menu coming-up might be responsible for the lost event.   So I tried to comment-out the line "menu.setVisible(true);" in VisualizerView.showContextMenu().  Then obviously the context menu does not show when right-clicking, but both mouse events are sent.

So the conclusion is that it seems that the context menu being made visible interferes with the mouseUp event.
Comment 3 Marc Dumais CLA 2013-04-26 11:12:09 EDT
Here is a tentative Patch for this bug:

https://git.eclipse.org/r/12237

It's very simple and works-around the issue of the missing mouseUp event by making the drag-detection logic of MouseMonitor not apply for a right-click.  

Bill, what do you think?  

Regards,

Marc
Comment 4 Marc Dumais CLA 2013-04-26 11:14:17 EDT
w/r to the patch submitted in this bug, I declare the following:

1) that I am authorized to submit this code change
2) that the code is 100% my own work

Marc Dumais
Comment 5 Marc-André Laperle CLA 2013-05-06 09:14:09 EDT
The patch has been merged.