[Bug 12106] Safari 3.x/5.x menu keyboard shortcuts (ALT + menu mnemonic character) don't work correctly

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Jul 1 11:25:12 CDT 2014


https://bugs.winehq.org/show_bug.cgi?id=12106

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|http://www.apple.com/safari |http://www.oldapps.com/appl
                   |/                           |e_safari.php?old_safari=12
                 CC|                            |focht at gmx.net
          Component|-unknown                    |comctl32
            Summary|Safari menus cannot be      |Safari 3.x/5.x menu
                   |activated with keyboard     |keyboard shortcuts (ALT +
                   |shortcuts                   |menu mnemonic character)
                   |                            |don't work correctly
           Severity|trivial                     |minor

--- Comment #8 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

confirming.

http://www.question-defense.com/2010/02/14/safari-shortcuts-for-the-safari-web-browser-on-windows-operating-system

http://dmcritchie.mvps.org/firefox/keyboard.htm (other browsers such as
'Safari' are also listed in the table)

All other non menu-navigating shortcuts ('CTRL+<option>', see links) work fine.

'ALT' alone activates the main menu
'ALT+w' -> 'File'
'ALT+h' -> 'Edit'
'ALT+f' -> 'View'
'ALT+e' -> 'History'
'ALT+v' -> 'Bookmarks'
'ALT+i' -> 'Window'
'ALT+b' -> 'Help'
'ALT+g' -> address field
'Return' -> jumps two menus right

The menu bar is owner-drawn hence it requires WM_MENUCHAR message processing
(unlike traditional accelerator translation).

WM_MENUCHAR with the ASCII character code pressed:

'ALT+h' -> WM_MENUCHAR 0x68 -> 'h' (resulting in 'Edit' selection)
'ALT+f' -> WM_MENUCHAR 0x66 -> 'f' (resulting in 'View' selection)
'ALT+e' ->  WM_MENUCHAR 0x45 -> 'e' (resulting in 'History' selection)

Safari doesn't handle this message on its own, it passes it down to common
controls, specifically menubar/toolbar control.

+toolbar gives a better overview:

--- snip ---
...
0009:trace:toolbar:TOOLBAR_DumpToolbar toolbar 0x1006e at line 1106,
exStyle=00000000, buttons=7, bitmaps=0, strings=1, style=5600984d
0009:trace:toolbar:TOOLBAR_DumpToolbar toolbar 0x1006e at line 1106,
himlInt=(nil), himlDef=0x14f010, himlHot=(nil), himlDis=(nil), redrawable=TRUE
0009:trace:toolbar:TOOLBAR_DumpButton button 0 id 0, bitmap=0, state=04,
style=18, data=00000000, stringid=0x0014ee00
0009:trace:toolbar:TOOLBAR_DumpButton string L"&File"
0009:trace:toolbar:TOOLBAR_DumpButton button 0 id 0, hot=FALSE, row=0,
rect=((0,0)-(34,20))
0009:trace:toolbar:TOOLBAR_DumpButton button 1 id 1, bitmap=0, state=04,
style=18, data=00000000, stringid=0x0014f300
0009:trace:toolbar:TOOLBAR_DumpButton string L"&Edit"
0009:trace:toolbar:TOOLBAR_DumpButton button 1 id 1, hot=FALSE, row=0,
rect=((34,0)-(70,20))
0009:trace:toolbar:TOOLBAR_DumpButton button 2 id 2, bitmap=0, state=04,
style=18, data=00000000, stringid=0x0014f318
0009:trace:toolbar:TOOLBAR_DumpButton string L"&View"
0009:trace:toolbar:TOOLBAR_DumpButton button 2 id 2, hot=FALSE, row=0,
rect=((70,0)-(110,20))
0009:trace:toolbar:TOOLBAR_DumpButton button 3 id 3, bitmap=0, state=04,
style=18, data=00000000, stringid=0x0014f1e0
0009:trace:toolbar:TOOLBAR_DumpButton string L"H&istory"
0009:trace:toolbar:TOOLBAR_DumpButton button 3 id 3, hot=FALSE, row=0,
rect=((110,0)-(165,20))
0009:trace:toolbar:TOOLBAR_DumpButton button 4 id 4, bitmap=0, state=04,
style=18, data=00000000, stringid=0x0014f200
0009:trace:toolbar:TOOLBAR_DumpButton string L"&Bookmarks"
0009:trace:toolbar:TOOLBAR_DumpButton button 4 id 4, hot=FALSE, row=0,
rect=((165,0)-(240,20))
0009:trace:toolbar:TOOLBAR_DumpButton button 5 id 5, bitmap=0, state=04,
style=18, data=00000000, stringid=0x0014f220
0009:trace:toolbar:TOOLBAR_DumpButton string L"&Window"
0009:trace:toolbar:TOOLBAR_DumpButton button 5 id 5, hot=FALSE, row=0,
rect=((240,0)-(297,20))
0009:trace:toolbar:TOOLBAR_DumpButton button 6 id 6, bitmap=0, state=04,
style=18, data=00000000, stringid=0x0014f290
0009:trace:toolbar:TOOLBAR_DumpButton string L"&Help"
0009:trace:toolbar:TOOLBAR_DumpButton button 6 id 6, hot=FALSE, row=0,
rect=((297,0)-(337,20))
0009:trace:toolbar:TOOLBAR_SendNotify to window 0x10068, code=fffffff4, via
Unicode
--- snip ---

Pressing 'ALT' key correctly gives 'File' selection ('hot=true'):

--- snip ---
0009:trace:toolbar:TOOLBAR_DumpButton button 0 id 0, bitmap=0, state=04,
style=18, data=00000000, stringid=0x0014ee00
0009:trace:toolbar:TOOLBAR_DumpButton string L"&File"
0009:trace:toolbar:TOOLBAR_DumpButton button 0 id 0, hot=TRUE, row=0,
rect=((0,0)-(34,20))
--- snip ---

Pressing 'ALT+e' also maps it correctly to button id=1 ('Edit' menu)

--- snip ---
Wine-dbg>bt
Backtrace:
=>0 0x7dedb123 TOOLBAR_MapAccelerator+0x130(infoPtr=0x14dc40, wAccel=0x65,
pIDButton=0x33ed0c)
[/home/focht/projects/wine/wine.repo/src/dlls/comctl32/toolbar.c:3846] in
comctl32 (0x0033e9a8)
  1 0x7dee295f ToolbarWindowProc+0xc5d(hwnd=<couldn't compute location>,
uMsg=<couldn't compute location>, wParam=<couldn't compute location>,
lParam=<couldn't compute location>)
[/home/focht/projects/wine/wine.repo/src/dlls/comctl32/toolbar.c:6560] in
comctl32 (0x0033ea08)
  2 0x7ebbeb5a WINPROC_wrapper+0x19() in user32 (0x0033ea48)
  3 0x7ebbeccf call_window_proc+0xcc(hwnd=0x10068, msg=0x45a, wp=0x65,
lp=0x33ed0c, result=0x33eab8, arg=0x7dee1d01)
[/home/focht/projects/wine/wine.repo/src/dlls/user32/winproc.c:244] in user32
(0x0033ea88)
  4 0x7ebc1123 CallWindowProcW+0x69(func=0x7dee1d01, hwnd=0x10068, msg=0x45a,
wParam=0x65, lParam=0x33ed0c)
[/home/focht/projects/wine/wine.repo/src/dlls/user32/winproc.c:981] in user32
(0x0033eacc)
  5 0x00494175 in safari (+0x94174) (0x0033ed0c)

...

Wine-dbg>info locals
0x7dedb123 TOOLBAR_MapAccelerator+0x130: (0033e9a8)
    TOOLBAR_INFO* infoPtr=0x14dc40 (parameter [EBP+8])
    WCHAR wAccel=0x65 (parameter [EBP-44])
    UINT* pIDButton=0x33ed0c (parameter [EBP+16])
    WCHAR --none--[3] wszAccel={0x26, 0x65, 0} (local [EBP-38])
    int i=0x1 (local [EBP-12])
    TBUTTON_INFO* btnPtr=0x14de44 (local [EBP-28])
    int iLen=0x2 (local [EBP-32])
    LPCWSTR lpszStr="&Edit" (local [EBP-16])

Wine-dbg>p *btnPtr
{iBitmap=0, idCommand=0x1, fsState=4, fsStyle=24, bHot=0, bDropDownPressed=0,
dwData=0, iString=0x14d3b0, nRow=0, rect={left=0x22, top=0, right=0x46,
bottom=0x14}, cx=0}
--- snip ---

Remembering toolbar notifications as important part I looked around for
information on NM_xxx and TBN_xxx notifications:

http://msdn.microsoft.com/en-us/library/windows/desktop/bb760435%28v=vs.85%29.aspx

On a whim I tried 'winetricks -q comctl32' ... jackpot.
It makes the menu keyboard shortcut handling fully functional.

I have the gut feeling we are missing notifications here that need to be sent
to parent as part of accelerator mapping handling.

$ sha1sum SafariSetup323.exe 
54b707e636557720d52526e33262e1a44e8093a6  SafariSetup323.exe

$ du -sh SafariSetup323.exe 
20M    SafariSetup323.exe

$ wine --version
wine-1.7.21-19-g8812193

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list