mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1051842 - Part 1 - [e10s] crash in -[ChildView keyDown:]. r=smichaud
Fix Cocoa window IME focus test to work even if window has not received OSX main-window status.
This commit is contained in:
parent
9a85475001
commit
d72e351c3e
@ -830,8 +830,17 @@ public:
|
||||
void SetIMEOpenState(bool aOpen);
|
||||
void SetASCIICapableOnly(bool aASCIICapableOnly);
|
||||
|
||||
/**
|
||||
* True if OSX believes that our view has keyboard focus.
|
||||
*/
|
||||
bool IsFocused();
|
||||
|
||||
/**
|
||||
* True if our view has keyboard focus (and our window is key), or if
|
||||
* it would have keyboard focus if our window were key.
|
||||
*/
|
||||
bool IsOrWouldBeFocused();
|
||||
|
||||
static CFArrayRef CreateAllIMEModeList();
|
||||
static void DebugPrintAllIMEModes();
|
||||
|
||||
|
@ -3491,6 +3491,19 @@ IMEInputHandler::IsFocused()
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
|
||||
}
|
||||
|
||||
bool
|
||||
IMEInputHandler::IsOrWouldBeFocused()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
||||
NS_ENSURE_TRUE(!Destroyed(), false);
|
||||
NSWindow* window = [mView window];
|
||||
NS_ENSURE_TRUE(window, false);
|
||||
return [window firstResponder] == mView;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
|
||||
}
|
||||
|
||||
bool
|
||||
IMEInputHandler::IsIMEOpened()
|
||||
{
|
||||
|
@ -1623,7 +1623,7 @@ nsChildView::SetInputContext(const InputContext& aContext,
|
||||
{
|
||||
NS_ENSURE_TRUE_VOID(mTextInputHandler);
|
||||
|
||||
if (mTextInputHandler->IsFocused()) {
|
||||
if (mTextInputHandler->IsOrWouldBeFocused()) {
|
||||
if (aContext.IsPasswordEditor()) {
|
||||
TextInputHandler::EnableSecureEventInput();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user