Closed
Bug 312225
Opened 19 years ago
Closed 17 years ago
When right-clicking for context menu in bottom-right corner of screen, last menu option is immediately selected
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: unixgabe, Assigned: roc)
References
Details
Attachments
(1 file, 2 obsolete files)
14.35 KB,
patch
|
roc
:
review+
neil
:
superreview+
beltzner
:
approval1.9+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20051004 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20051004 Firefox/1.0.7
If you right click in a browser window a context menu normally appears.
However, if you right click in the bottom-right area of the screen(not just
browser), so that the context menu appears above, and not fully to the right of
the curser, the context menu appears breifly and the bottom-most menu item is
selected. This seems to be because when you release the right-click, the curser
is actually over the last menu item, and the context menu registers this as a
mouse click release.
Reproducible: Always
Steps to Reproduce:
1. Move mouse to bottom-right corner of screen (must be screen, not just browser
window)
2. Right-click and release.
3.
Actual Results:
Context menu briefly appeard and disapeared. Last menu option was activated, in
this case the "Page Info" window was displayed.
Expected Results:
Context menu should have remained until an option was selected or I clicked
outside of context menu.
Comment 1•19 years ago
|
||
I couldn't reproduce this on Windows (2005 Oct 13 trunk and 1.5b2) or on my
version of Linux with similar versions. If I click on the exact corner, the menu
appears slightly to the left of the mouse. If I click near the corner, the menu
is aligned with the bottom of the screen (and hence, the mouse), but the border
of the menu doesn't count as the menu.
Could this be theme related on your Linux system?
Comment 2•19 years ago
|
||
This should be filed under Core - XP Toolkit/Widgets: Menus
Tweaking product and component...
Component: Menus → XP Toolkit/Widgets: Menus
Product: Firefox → Core
QA Contact: menus → xptoolkit.menus
Version: unspecified → 1.7 Branch
Comment 3•19 years ago
|
||
I got a report (http://bugzilla.mozdev.org/show_bug.cgi?id=13196) that this happens in Firefox 1.5.0.1 on Linux with the default theme. I can't confirm this however, for me the context menu works fine (Firefox 1.5.0.1 on KDE).
I can reproduce this bug on Gnome 2.12.2 with default settings (Metacity + Clearlooks). The bug seems to be caused by the fact, that the edge of context menu is always positioned a few pixels to the bottom-right from the mouse pointer. I suggest this to be changed, so the pointer is a few pixels _away_ from the menu.
The bug is also present in the current nightly [Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9a1) Gecko/20060213 Firefox/1.6a1].
Comment 5•19 years ago
|
||
So... I can't seem to reproduce this. roc, can you reproduce?
Assignee | ||
Comment 6•19 years ago
|
||
Nope. The cursor is in the menu, but I have to move it a pixel or three upwards before an item is selected.
Comment 7•19 years ago
|
||
Hmm.. For me it's not even in the menu; it really shouldn't be in the menu....
Comment 9•18 years ago
|
||
I can reproduce this on Ubuntu 6.10 with a current trunk build.
(Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a3pre) Gecko/20070222 Minefield/3.0a3pre)
When I open the context menu, the cursor is over the last item and it opens Page Info when I release the button.
I need to move the cursor one pixel upwards to get the highlight on the last menu item.
If I move the cursor at least one pixel downwards before releasing the button, the menu stays open.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: 1.7 Branch → Trunk
Comment 10•17 years ago
|
||
It has not been fixed until three years?! Nice...
CC'ing myself.
Assignee | ||
Updated•17 years ago
|
Assignee | ||
Updated•17 years ago
|
Summary: When right-clicking for context menu in bottom-right corner of screen, last menu option is imediatelly selected → When right-clicking for context menu in bottom-right corner of screen, last menu option is immediately selected
Assignee | ||
Comment 11•17 years ago
|
||
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.
Attachment #316582 -
Flags: superreview?(enndeakin)
Attachment #316582 -
Flags: review?(enndeakin)
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs review enndeakin]
Comment 12•17 years ago
|
||
Seems like it would be easier to just add the 2 pixels in nsMenuPopupFrame::SetPopupPosition as needed when mIsContextMenu is true instead.
Assignee | ||
Comment 13•17 years ago
|
||
That would change the behaviour of nsPopupBoxObject::OpenPopupAtScreen. If that's OK with you, I'll do that.
Whiteboard: [needs review enndeakin]
Assignee | ||
Comment 14•17 years ago
|
||
Okay, fixed as described.
Attachment #316582 -
Attachment is obsolete: true
Attachment #316915 -
Flags: superreview?(enndeakin)
Attachment #316915 -
Flags: review?(enndeakin)
Attachment #316582 -
Flags: superreview?(enndeakin)
Attachment #316582 -
Flags: review?(enndeakin)
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs review]
Comment 15•17 years ago
|
||
Comment on attachment 316915 [details] [diff] [review]
fix v2
>-nsMenuPopupFrame::InitializePopupAtScreen(PRInt32 aXPos, PRInt32 aYPos)
>+nsMenuPopupFrame::InitializePopupAtScreen(PRInt32 aXPos, PRInt32 aYPos,
>+ PRBool aIsContextMenu)
> {
> EnsureWidget();
>
> mPopupState = ePopupShowing;
> mAnchorContent = nsnull;
> mScreenXPos = aXPos;
> mScreenYPos = aYPos;
> mPopupAnchor = POPUPALIGNMENT_NONE;
> mPopupAlignment = POPUPALIGNMENT_NONE;
>+ mIsContextMenu = aIsContextMenu;
>+ mAdjustOffsetForContextMenu = aIsContextMenu;
mAdjustOffsetForContextMenu should be set to false for the other two InitializeX methods.
> screenViewLocY = nsPresContext::CSSPixelsToAppUnits(mScreenYPos) / factor;
>+ PRInt32 offsetForContextMenuCSS = mAdjustOffsetForContextMenu ? 2 : 0;
>+ PRInt32 offsetForContextMenuDev =
>+ nsPresContext::CSSPixelsToAppUnits(offsetForContextMenu) / factor;
You meant 'offsetForContextMenuCSS' here right?
I assume with this patch that the test for contextmenus (test_contextmenu_list.xul) works ok?
I'm not a superreviewer, so let's ask the other Neil.
Attachment #316915 -
Flags: superreview?(neil)
Attachment #316915 -
Flags: superreview?(enndeakin)
Attachment #316915 -
Flags: review?(enndeakin)
Attachment #316915 -
Flags: review+
Assignee | ||
Comment 16•17 years ago
|
||
Updated to comments.
test_contextmenu_list.xul passes on my Mac.
Attachment #316915 -
Attachment is obsolete: true
Attachment #317116 -
Flags: superreview?(neil)
Attachment #317116 -
Flags: review+
Attachment #316915 -
Flags: superreview?(neil)
Comment 17•17 years ago
|
||
Comment on attachment 317116 [details] [diff] [review]
fix v3
>+ nscoord offsetForContextMenu = 0;
>+ PRInt32 offsetForContextMenuCSS = mAdjustOffsetForContextMenu ? 2 : 0;
>+ PRInt32 offsetForContextMenuDev =
>+ nsPresContext::CSSPixelsToAppUnits(offsetForContextMenuCSS) / factor;
>+ offsetForContextMenu = presContext->DevPixelsToAppUnits(offsetForContextMenuDev);
Any reason not to do this in an if rather than possibly calculating with zero?
Attachment #317116 -
Flags: superreview?(neil) → superreview+
Assignee | ||
Comment 18•17 years ago
|
||
I guess it's about as simple to put the whole thing in an "if", sure, I'll do that.
Assignee | ||
Comment 19•17 years ago
|
||
Comment on attachment 317116 [details] [diff] [review]
fix v3
Fixes a pretty bad Linux usability issue where we fire random context menu commands in some situations (I think it's a regression). May also fix or at least narrow down blocker bug 404314. Rather safe fix too, I think.
Attachment #317116 -
Flags: approval1.9?
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs review] → [needs approval]
Comment 20•17 years ago
|
||
Comment on attachment 317116 [details] [diff] [review]
fix v3
a1.9=beltzner
Attachment #317116 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 21•17 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•17 years ago
|
Whiteboard: [needs approval]
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: xptoolkit.menus → xptoolkit.widgets
Comment 23•15 years ago
|
||
I sometimes still see this problem in 3.5 (windows)
although in much less frequency than in 3.0.9...
See Also: → https://launchpad.net/bugs/187313
You need to log in
before you can comment on or make changes to this bug.
Description
•