mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-06 09:02:50 +00:00
- CPButton -setKeyEquivalent was sending CPWindow -setDefaultButton. This is not Cocoa behavior, but more importantly it was causing an infinite loop, because CPWindow -setDefaultButton does (and is supposed to) send CPButton -setKeyEquivalent. - CPButton -viewWillMoveToWindow should do nothing if the window is the same or the new window is nil. Otherwise, if the new window is nil and the button is the default button, -setDefaultButton ends up erasing the button's key equivalent. When awakening from a cib, this causes the button to never become the default, because during cib awakening -viewWillMoveToWindow is sent 3 times, the second time to a nil window. If a button does not belong to any window, there is no harm in keeping its key equivalent, and setting the default button is supposed to be an explicit operation. - NSButton -initWithCoder should not send -setKeyEquivalent because it has side effects. - CPWindow -setDefaultButton should check for a key equivalent of CPNewlineCharacter as well for consistency with CPButton.