jdk/src/solaris/classes/sun/awt/X11/XWindow.java
changeset 2810 fa49c6a06baf
parent 2805 9f18d7e66042
child 3938 ef327bd847c0
child 4256 24d614d4764a
child 4191 ca8d3ef845c8
equal deleted inserted replaced
2809:b373581f6507 2810:fa49c6a06baf
   675         int modifiers;
   675         int modifiers;
   676         boolean popupTrigger = false;
   676         boolean popupTrigger = false;
   677         int button=0;
   677         int button=0;
   678         boolean wheel_mouse = false;
   678         boolean wheel_mouse = false;
   679         int lbutton = xbe.get_button();
   679         int lbutton = xbe.get_button();
       
   680         /*
       
   681          * Ignore the buttons above 20 due to the bit limit for
       
   682          * InputEvent.BUTTON_DOWN_MASK.
       
   683          * One more bit is reserved for FIRST_HIGH_BIT.
       
   684          */
       
   685         if (lbutton > SunToolkit.MAX_BUTTONS_SUPPORTED) {
       
   686             return;
       
   687         }
   680         int type = xev.get_type();
   688         int type = xev.get_type();
   681         when = xbe.get_time();
   689         when = xbe.get_time();
   682         long jWhen = XToolkit.nowMillisUTC_offset(when);
   690         long jWhen = XToolkit.nowMillisUTC_offset(when);
   683 
   691 
   684         int x = xbe.get_x();
   692         int x = xbe.get_x();
   793         int mouseKeyState = 0; //(xme.get_state() & (XConstants.buttonsMask[0] | XConstants.buttonsMask[1] | XConstants.buttonsMask[2]));
   801         int mouseKeyState = 0; //(xme.get_state() & (XConstants.buttonsMask[0] | XConstants.buttonsMask[1] | XConstants.buttonsMask[2]));
   794 
   802 
   795         //this doesn't work for extra buttons because Xsystem is sending state==0 for every extra button event.
   803         //this doesn't work for extra buttons because Xsystem is sending state==0 for every extra button event.
   796         // we can't correct it in MouseEvent class as we done it with modifiers, because exact type (DRAG|MOVE)
   804         // we can't correct it in MouseEvent class as we done it with modifiers, because exact type (DRAG|MOVE)
   797         // should be passed from XWindow.
   805         // should be passed from XWindow.
   798         //TODO: eliminate it with some other value obtained w/o AWTLock.
   806         final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
   799         for (int i = 0; i < XToolkit.getNumMouseButtons(); i++){
   807 
       
   808         for (int i = 0; i < buttonsNumber; i++){
   800             // TODO : here is the bug in WM: extra buttons doesn't have state!=0 as they should.
   809             // TODO : here is the bug in WM: extra buttons doesn't have state!=0 as they should.
   801             if ((i != 4) && (i != 5)) {
   810             if ((i != 4) && (i != 5)) {
   802                 mouseKeyState = mouseKeyState | (xme.get_state() & XConstants.buttonsMask[i]);
   811                 mouseKeyState = mouseKeyState | (xme.get_state() & XConstants.buttonsMask[i]);
   803             }
   812             }
   804         }
   813         }