Comment 31 for bug 187313

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

Created attachment 316582
fix

Here's my fix. The problem is that the context menu code tries to move the menu two pixels down and to the right so that the menu does not appear under the cursor. But sometimes --- when you're near the bottom right of the screen --- nsMenuPopupFrame decides to place the context menu above the designated position; in that case, moving the menu down two pixels was wrong, we actually need to move the menu up two pixels.

So this patch passes the 2-pixel offset down as a parameter to nsMenuPopupFrame, which can use that information to place the popup correctly if it decides to make it appear above the mouse position.