Why are the coordinates of a MouseDown event different from a MenuDetect event?
<p>Background: I am trying to programmatically create a context menu on an SWT Table. I am doing it programmatically because I need to hide/show the menu based on the cell that was clicked, not the row item.</p>

<p>I was planning to use the x,y coordinates from the Event class to find the cell that was clicked on, so I am capturing both the untyped MouseDown event and the untyped MenuDetect event. I put logging messages into the event handlers so I could better see what was going on. Here's my code:</p>

<pre><code>    tree.addListener(SWT.MouseDown, new Listener() {
        @Override
        public void handleEvent(final Event event) {
            System.out.println("Mouse down: (" + event.x + ", " + event.y + ")");
            handleMouseDown(event);

        }
    });
    tree.addListener(SWT.MenuDetect, new Listener() {
        @Override
        public void handleEvent(final Event event) {
            System.out.println("Menu Detect: (" + event.x + ", " + event.y + ")");
            handleMenuDetect(event);

        }

    });
</code></pre>

<p>With the same click, I expected to see the same results, however, my output was as follows when I clicked down a column of cells:</p>

<blockquote>
  <p>Mouse down: (334, 11) Menu Detect: (1270, 255)</p>
  
  <p>Mouse down: (331, 37) Menu Detect: (1267, 281)</p>
  
  <p>Mouse down: (329, 55) Menu Detect: (1265, 299)</p>
  
  <p>Mouse down: (324, 77) Menu Detect: (1260, 321)</p>
  
  <p>Mouse down: (324, 100) Menu Detect: (1260, 344)</p>
</blockquote>

<p>What is going on here? Aren't they referring to the same exact point? Are they calculating the x,y from different origins?</p>