Closed Bug 183841 Opened 23 years ago Closed 23 years ago

[gtk2] Shortcut for "Open Context Menu" doesn't work, shift-F10

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

Sun
SunOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: jessie30, Assigned: yinbolian)

References

Details

(Keywords: helpwanted)

Attachments

(1 file, 4 obsolete files)

Build:Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.2) Gecko/20021204 OS: SunOS volleyball 5.9 Generic sun4u sparc SUNW,Sun-Blade-100 According to the mozilla keyboard plan, Shift+F10 is the general shortcut for opening context menu. But it doesn't work for Solaris OS.
Can someone from browser-china-atf take this?
Keywords: helpwanted
ok, let me try.
Assignee: aaronl → bolian.yin
works for gtk1.2 build. =>gtk2
Blocks: gtk2
Summary: Shortcut for "Open Context Menu" doesn't work. → [gtk2] Shortcut for "Open Context Menu" doesn't work.
hmmm, this is interesting: shift-F10 doesn't seem to work for me on Linux RH8. i'm using the metacity window manager --it's a new wm (and machine and OS, for that matter ;), so i'm not sure if there's some setting i'm neglecting. bryner or akkana, are you able to get shift-F10 to bring up the context menu for a focused item in a web page in RH8?
Severity: normal → major
Keywords: nsbeta1
Summary: [gtk2] Shortcut for "Open Context Menu" doesn't work. → [gtk2] Shortcut for "Open Context Menu" doesn't work, shift-F10
erk, scratch that. somehow the shortcut is now working for me. thought i had an item already in focus *mumble*grumble*...
Severity: major → normal
Keywords: nsbeta1
Attached patch patch (obsolete) — Splinter Review
deal with the context menu key.
Attachment #108459 - Flags: review?(bryner)
Attached patch patch against trunk (obsolete) — Splinter Review
Attachment #108459 - Attachment is obsolete: true
Attachment #108459 - Flags: review?(bryner)
Attachment #108462 - Flags: review?(bryner)
Attachment #108462 - Flags: review?(bryner) → review+
Attachment #108462 - Flags: superreview?(blizzard)
Comment on attachment 108462 [details] [diff] [review] patch against trunk >+inline PRBool >+nsWindow::IsContextMenuKey(const nsKeyEvent& aKeyEvent) >+{ >+ enum { kContextMenuKey = NS_VK_F10 }; You don't need to make this an enum, just compare below. >+ >+ return (aKeyEvent.keyCode == kContextMenuKey && aKeyEvent.isShift && >+ !aKeyEvent.isControl && !aKeyEvent.isMeta && !aKeyEvent.isAlt); >+} >+void >+nsWindow::ConvertKeyEventToContextMenuEvent(const nsKeyEvent* aKeyEvent, >+ nsMouseEvent* aCMEvent) >+{ >+ *(nsInputEvent *)aCMEvent = *(nsInputEvent *)aKeyEvent; Two things: we should fix signature on the function to use nsInputEvent instead of casting here. Two, can we use memcpy instead of copying the structure? It's a little more readable. >Index: nsWindow.h >=================================================================== >RCS file: /cvsroot/mozilla/widget/src/gtk2/nsWindow.h,v >retrieving revision 1.30 >diff -u -r1.30 nsWindow.h >--- nsWindow.h 16 Nov 2002 01:22:10 -0000 1.30 >+++ nsWindow.h 6 Dec 2002 08:26:49 -0000 >@@ -311,6 +311,10 @@ > static guint DragMotionTimerCallback (gpointer aClosure); > static void DragLeaveTimerCallback (nsITimer *aTimer, void *aClosure); > >+ inline PRBool IsContextMenuKey(const nsKeyEvent& inKeyEvent); >+ void ConvertKeyEventToContextMenuEvent(const nsKeyEvent* inKeyEvent, >+ nsMouseEvent* outCMEvent); These don't change any class specific data and don't need to be used outside of the class so you should just make them utility functions in nsWindow.cpp. There are examples.
Attachment #108462 - Flags: superreview?(blizzard) → superreview-
Attached patch patch (add blizzard's comments) (obsolete) — Splinter Review
Did not change ConvertKeyEventToContextMenuEvent prototype to nsInputEvent, we need to assign values of nsMouseEvent.
Attachment #108462 - Attachment is obsolete: true
Attachment #109206 - Flags: superreview?(blizzard)
Comment on attachment 109206 [details] [diff] [review] patch (add blizzard's comments) >+static PRBool IsContextMenuKey(const nsKeyEvent& inKeyEvent); >+static void ConvertKeyEventToContextMenuEvent(const nsKeyEvent* inKeyEvent, >+ nsMouseEvent* outCMEvent); Sorry, one more comment. Please use the same style for the function names as the statics functions declared above it. That is, use a function name like: is_context_menu_key() instead of IsContextMenuKey(). That way we can tell static functions from methods which usually use StudlyCaps().
Attachment #109206 - Flags: superreview?(blizzard) → superreview-
Attachment #109206 - Attachment is obsolete: true
Attachment #109296 - Flags: superreview?(blizzard)
Comment on attachment 109296 [details] [diff] [review] patch(utility function name to lower case) sr=blizzard
Attachment #109296 - Flags: superreview?(blizzard) → superreview+
Checked in. Thanks!
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
where would gtk2 verification builds reside? i checked the following location, but it's empty. ftp://ftp.mozilla.org/pub/mozilla/nightly/latest/Red_Hat_8x_RPMS/
no builds, no info -> rs vrfy.
Status: RESOLVED → VERIFIED
Component: Keyboard: Navigation → User events and focus handling

A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)

Wrong bug?

Flags: needinfo?(tschuster)

Thanks Emilio, I missed a digit in the bug# while writing the commit message. Sadly bugzilla/phabricator seem to be a bit unreliable right now, so the patch hasn't been moved yet.

Flags: needinfo?(tschuster)

Comment on attachment 9339097 [details]
WIP: Bug 183841 - Use RFPTarget::ScreenOrientation for the orientation listener

Revision D180956 was moved to bug 1838415. Setting attachment 9339097 [details] to obsolete.

Attachment #9339097 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: