This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 96189 - Fourth mouse button (wheel) is treated like second button
Summary: Fourth mouse button (wheel) is treated like second button
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Simonek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-21 17:05 UTC by hobel
Modified: 2008-12-22 11:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
zipped test application (nb project) (10.98 KB, application/octet-stream)
2007-03-23 16:24 UTC, David Simonek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hobel 2007-02-21 17:05:02 UTC
Linux, JDK 1.6.0, NetBeans 6.0M7, but I also experienced this with M6.  (Don't
know about before, I switched to Linux only recently.)

I have a mouse (actually trackball) with three buttons and a fourth button that
makes the mouse/trackball scroll instead of move the pointer, i.e. holding that
button transforms the trackball wheel into a scroll wheel (really nifty).

All X Window and Java/Swing applications work fine with this setup (after all,
there is nothing that sends this button press to applications; all they get is
the scroll wheel event in whatever direction), except NetBeans.  NetBeans also
scrolls fine, but after maybe half a second it pops up a context menu, as if I
pressed the second mouse button, which I didn't.  This is really annoying, as it
basically prevents me from scrolling around in files.

I'm assuming there is some logic in NB that makes it treat any mouse button
press beyond button #1,2,3 as second/right-button press (though as I mentioned,
the application shouldn't even receive notice that any button was pressed; the
button translates into scroll events).
Comment 1 David Simonek 2007-03-09 08:32:19 UTC
OK, but in which situations the popup menu comes? During scrolling in editor? In
projects view? In Nvaigator? Where? NetBeans should use Swing call
isPopupTrigger() for deciding whether to show popup, so it should work same as
other java apps.
Comment 2 hobel 2007-03-09 10:20:23 UTC
Both editor and navigator (probably in all scrollable views).

I click the button which maps the wheel to scroll-wheel, and as soon as I move
the wheel, the view scrolls and pops up the menu.

As the "scroll button" is neither the second nor third mouse button it shouldn't
have any other effect than scrolling.  For instance JEdit or Eclipse work, so
it's NetBeans specific.
Comment 3 David Simonek 2007-03-23 16:22:30 UTC
This looks more like Swing issue, let's try it - please run attached small
testing app and please let me know if problem can be reproduced with test app.
Thanks.
Comment 4 David Simonek 2007-03-23 16:24:38 UTC
Created attachment 39879 [details]
zipped test application (nb project)
Comment 5 hobel 2007-03-23 17:54:41 UTC
The Swing example DOES have the same problem, yes.

If that means that the function isPopupTrigger() is broken, is there any chance
of getting that fixed?  (or a way to work around it in NetBeans)
Comment 6 David Simonek 2007-10-31 11:19:51 UTC
I entered jdk bug 6624085 for this problem and added reporter to interest list, let's wait what JDK guys will say. See 
http://bugs.sun.com/view_bug.do?bug_id=6624085
Comment 7 David Simonek 2007-10-31 17:37:45 UTC
Reporter, could you please attach info about trackball hardware? Thanks.
Comment 8 hobel 2007-10-31 22:24:45 UTC
I'm using a Logitech Marble Mouse USB.

My xorg.conf on my Ubuntu system has this mouse config section:

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        #Option         "Protocol"              "ImPS/2"
        Option          "Protocol"              "Auto"
        Option          "ZAxisMapping"          "4 5"
        Option          "XAxisMapping"          "6 7"
        Option          "EmulateWheel"          "1"
        Option          "EmulateWheelButton"    "9"
        Option          "Emulate3Buttons"       "true"
EndSection


I.e., button '9' makes the device emulate a mouse wheel.

Via a .Xmodmap file:
pointer = 1 8 3 4 5 6 7 2 9 10 11
I turn the mouse buttons (switch buttons two and eight) so that I have left button, right button, middle button, and
wheel button.

Sorry, I don't exactly remember why the options are as they are, but it works perfectly (except for NB, obviously).