I think that is the problem.

I think maybe the second clause should only be enabled for Mac?

On 2009-08-20, at 20:35EDT, Max Carlson wrote:

Hmm... If that's the case, perhaps adding a quirk to only register for oncontextmenu for those browsers is the way to go? I added the test in for button == 2 as part of this bug:

LPP-8142 - On a mac right click using two finger tap on the trackpad doesn't register as right click, it registers as left click

Maybe we're getting both events now that mouse events bubble the default action by default?

Henry Minsky wrote:
We were looking at http://jira.openlaszlo.org/jira/browse/LPP-8218, which had an issue with duplicate events being sent for context menu, and we were looking at this code in LzMouseKernel.js } else if (eventname == 'oncontextmenu' || (e.button == 2 && eventname == 'onmouseup') ) {
           Debug.info('mouseEvent', eventname, e);
           if (targ) {
               // update mouse position, required for Safari
               LzMouseKernel.__sendMouseMove(e);
               return LzMouseKernel.__showContextMenu(e);
           }
       } else if (e.button != 2) {
We put that debug print statement in, and in both IE7 and FF/OSX we see that both a "oncontextmenu" and "onmouseup" event are sent by the browser (although in different orders in IE7 and FF). So the question is do we really need to look for the right-button-mouseup event in this clause, or could it just look for the oncontextmenu event to decide to show a menu? This might help fix this issue with duplicate events, and get rid of the "this.__sentshowevent" check in LzCOntextMenuKernel ? And maybe that in turn might help to fix the bug where you don't get a new 'oncontextmenu' event when you right click on a menu that's already open..?
--
Henry Minsky
Software Architect
[email protected] <mailto:[email protected]>

--
Regards,
Max Carlson
OpenLaszlo.org

Reply via email to