Bug 542841 - Eclipse context menu misbehaves
Eclipse context menu misbehaves
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: eclipse (Show other bugs)
12
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Andrew Overholt
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-30 17:45 EST by István Tóth
Modified: 2009-12-02 13:43 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-02 13:43:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
SWT test case (1.44 KB, application/octet-stream)
2009-12-01 12:55 EST, István Tóth
no flags Details

  None (edit)
Description István Tóth 2009-11-30 17:45:45 EST
Description of problem:

First of all, this is NOT the unpressable button bug, though it may also be GTK related. It is also not cured by the GDK_NATIVE_WINDOW workaround.

Since upgrading to Fedora 12, The context menu in eclipse is not working reliably.

Often, when I single right-click in the editor window, the context menu pops up, but instead of staying on screen, it executes whatever is next to the 
cursor when the menu pops up, then disappears

Needless to say, this makes using eclipse incredibly annoying.

To reproduce, you have to position the cursor before clicking around the middle of the screen, so that the when the popup menu appears, the cursor is positoned over a directly selectable (not submenu) menu option to reproduce this. 

Try to move the cursor up and down between right clicks a few lines to achieve the right relative postion of the cursor and the menu to trigger the bug.

My theory is that when I right-click, the popup menu appears somewhat UNDER the cursor, and when I release the button It interprets this as if I was holding down the RMB to bring up the menu, then selecting the menu option by releasing RMB.

Also, if move the mouse slightly left while clicking the RMB, the bug does not trigger, the popup menu shows up as it should.

This happens both on the eclipse shipped with Fedora, and on eclipse downloaded from eclipse.org.

I have installed a Fedora 11 VM to try to reproduce the bug there, with the latest  eclipse.org eclipse, but the popup menu worked as expected there, this bug is new as of F12.


Version-Release number of selected component (if applicable):
eclipse-platform-3.5.1-4.fc12.x86_64

How reproducible:

always

Steps to Reproduce:
1. Start eclipse
2. Open a program file in the editor
3. To reproduce, you have to position the cursor before clicking around the middle of the screen, so that the when the popup menu appears, the cursor is postioned on a directly selectable (not submenu) menu option to reproduce this. 

Try to move the cursor up and down between right clicks a few lines to achieve the right relative postion of the cursor and the menu to trigger the bug.
  
Actual results:

Context menu pops up, select whatever option is under the cursos, the disappears 

Expected results:

Context menu pops up, and stays on screen until I select an option

Additional info:
Comment 1 István Tóth 2009-12-01 02:46:02 EST
I've tried to repoduce this on my other F12 machine, and bug does not appear here.

The only difference I can think of is that this machine (where the bug is not reproducible) uses the binary nvidia X drivers, while the other machine (where the bug alway shows up) uses the default open source ati driver from Fedora.

It seems that the menu here does not appear under the mouse cursor, but a few pixels to the right of it (as it should).
Comment 2 Andrew Overholt 2009-12-01 10:41:27 EST
I can't reproduce either but I don't have any machines with the binary Nvidia drivers.  It may be worth seeing if you can reproduce it with other Gtk apps or a smaller SWT example.  Perhaps try one of the snippets under "Menu" here:

http://www.eclipse.org/swt/snippets/
Comment 3 István Tóth 2009-12-01 12:55:47 EST
Created attachment 375134 [details]
SWT test case
Comment 4 István Tóth 2009-12-01 13:33:07 EST
I was not clear. 

The machine with the binary nvidia driver usually works.

The machine with the open source ati driver is where I can reliably reproduce the bug. ( Driver      "radeon")

I've attached the test case.

It seems that a normal gtk popup always positions the menu so that mouse pointer is in one of the corners of the popup. That may be why most applications work right.

The popup positioning in eclipse seems to use a different algorithm, and near the middle of the screen it displays the popup so that the cursor somewhere on the side of the menu.

That's why I had to make the popup so big, that when it pops up the cursor is definitely not in the corner, but on the side.

When I start it on F11 (in a VirtualBox session), and right click, the menu pops up, the item under the cursor is lit up, and i can select normally.

When I start it on F12, and right click, the menu pops up, then disappears instantly.

I also noticed, that on F12 the menu item is lit up as soon as I put the cursor on the border, while on F11 it is lit up only when I move it two pixels to the left the menu border. (I had to do the move mouse left while right clicking trick to get the popup stay up long enough to test on F12 though)

I'll test tomorrow if this test case triggers the bug on my other machine as well.
Comment 5 Andrew Overholt 2009-12-01 14:17:19 EST
I see what you mean.  The problem seems to occur if I move my mouse slightly during/after right-clicking.  If I right-click and hold in other apps and then let go of the mouse button while hovering over a context menu entry, whatever that entry does will be executed so I don't think that's unique to SWT.  It appears that it's just too easy to right-click, move a bit, execute whatever entry was under the cursor.

It's worth filing a bug at eclipse.org with Platform -> SWT to get the SWT committers' opinions.  I highly doubt this behaviour is Fedora-specific since we don't patch anything that would affect this.  Judging from your F11 experience, it sounds like it may be a GTK 2.18 change.

Thanks for helping narrow this down.
Comment 6 István Tóth 2009-12-02 13:26:44 EST
I've experimented some more, and I think I've found the root of the problem.

My mouse (!) seems to be incompatible with the X server.

I've switched to a different mouse, and I can not reproduce the issue any more even on F12.

My wild guess (I don't know how to test mouse events under X) is that my mouse sends some extra events during right click that X/GTK/SWT interprets as a movement between down and up events or something. 
I tested it with mev against a mouse that works, though, and the output was exactly the same with both mice.
The mouse is not physically broken, I can use it everywhere else, even play FPS games with it without a hitch.

It seems that the change in GTK that puts the mouse pointer on the sensitive part of the pop-up in conjunction with my magic mouse has enabled this bug.

So in the end there is no eclipse bug, no SWT bug, and no GTK bug, but there may be a Xorg bug or hardware incompatibility.

Thanks for your time and sorry for the red herrings.

If someone needs me to do some testing with this mouse  I am happy to help.
Comment 7 Andrew Overholt 2009-12-02 13:43:52 EST
Crazy!  Good luck getting it sorted out.

Note You need to log in before you can comment on or make changes to this bug.