Some developers may wish that their Cappuccino application override browser shortcuts, like Cmd-O, Cmd-S, Cmd-P, to name a few. While that most of these shortcuts are being intercepted by the Cappuccino runtime, the browser’s default behavior is sometimes not completely blocked. This issue is prevalent under Safari 4 and recent WebKit nightly versions.
This issue is always reproducible with a Cappuccino application created using template NibApplication. A sample application is available at http://dl.dropbox.com/u/1816378/testApp.zip. Try these steps to reproduce:
Create a new Cappuccino application with a CPWindowController and a CPWindow assigned to it. Rework MainMenu.cib so that Command-O allocates and inits the window controller, while Command-W on the controller closes the window.
Under Safari 4, and WebKit Nightlies, it is found that repeatedly pressing Command-O and Command-W would cause the event “masking” to temporarily go out of order. In that sense, the intended action is carried out (e.g., a window controller is correctly allocated and initialized, therefore its window is also shown), but the browser chrome has also showed an Open window, which is default — but unintended — behavior.
Currently there is no known workaround to this issue.
After having -[CPPlatformWindow+DOM keyEvent:] dump what it receives some insight is gained. To make a command-O shortcut, one presses Command, holds it, then presses O, then releases both key.
Normally the keystrokes are interpreted as listed below:
Command is pressed Sends keydown
O is pressed Sends keydown
Both keys are released Sends keyup
After closing the window in question, keypress instead of keyup is sent, negating the need to stop the event from propagating. Interestingly the open panel is shown during the second key event instead of the third suggesting that there might be need of a set of more rigidly specified key event blocking rules.
Please provide a download with a sample app the reproduces the bug.
A sample application is made and put at http://dl.dropbox.com/u/1816378/testApp.zip. To reproduce the issue, launch the app and press command-O.
Milestone: Someday. Labels: #needs-patch, #new, AppKit, bug. What's next? This issue needs a volunteer to write and submit code to address it.
Milestone: Someday. Labels: #needs-patch, AppKit, bug. What's next? This issue needs a volunteer to write and submit code to address it.
Actually I don't think this is necessarily limited to Safari 4.
@ahankinson does the reduction still exhibit the problem when repeatedly pressing keys?
Unfortunately the reduction has gone AWOL, so I can't test it.
Milestone: Someday. Labels: #needs-patch, #needs-reduction, AppKit, bug. What's next?
you can see this in Tests/Manual/CPDocumentControllerTest/withoutNib
i see the default browser action in chrome and safari7
Milestone: Someday. Labels: #duplicate, AppKit, bug. What's next? This issue duplicates another existing issue. Refer to the duplicate issue for further information.