зеркало из https://github.com/mozilla/gecko-dev.git
bug 142873
Can't turn on IM after a popup window opens Call SetFocus() of XIC again to the current focused widget r=blizzard,sr=shaver,a=asa(for1.0branch)
This commit is contained in:
Родитель
a33d4fd81d
Коммит
f27b386052
|
@ -54,6 +54,7 @@ static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CI
|
||||||
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
|
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
|
||||||
|
|
||||||
nsIMEStatus *nsIMEGtkIC::gStatus = 0;
|
nsIMEStatus *nsIMEGtkIC::gStatus = 0;
|
||||||
|
nsWindow *nsIMEGtkIC::gGlobalFocusWindow = 0;
|
||||||
#endif // USE_XIM
|
#endif // USE_XIM
|
||||||
|
|
||||||
nsGtkIMEHelper* nsGtkIMEHelper::gSingleton = nsnull;
|
nsGtkIMEHelper* nsGtkIMEHelper::gSingleton = nsnull;
|
||||||
|
@ -987,6 +988,12 @@ nsIMEGtkIC::GetFocusWindow()
|
||||||
return mFocusWindow;
|
return mFocusWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsWindow *
|
||||||
|
nsIMEGtkIC::GetGlobalFocusWindow()
|
||||||
|
{
|
||||||
|
return gGlobalFocusWindow;
|
||||||
|
}
|
||||||
|
|
||||||
// workaround for kinput2/over-the-spot/ic-per-shell
|
// workaround for kinput2/over-the-spot/ic-per-shell
|
||||||
// http://bugzilla.mozilla.org/show_bug.cgi?id=28022
|
// http://bugzilla.mozilla.org/show_bug.cgi?id=28022
|
||||||
//
|
//
|
||||||
|
@ -1010,6 +1017,8 @@ void
|
||||||
nsIMEGtkIC::SetFocusWindow(nsWindow * aFocusWindow)
|
nsIMEGtkIC::SetFocusWindow(nsWindow * aFocusWindow)
|
||||||
{
|
{
|
||||||
mFocusWindow = aFocusWindow;
|
mFocusWindow = aFocusWindow;
|
||||||
|
gGlobalFocusWindow = aFocusWindow;
|
||||||
|
|
||||||
GdkWindow *gdkWindow = (GdkWindow*)aFocusWindow->GetNativeData(NS_NATIVE_WINDOW);
|
GdkWindow *gdkWindow = (GdkWindow*)aFocusWindow->GetNativeData(NS_NATIVE_WINDOW);
|
||||||
if (!gdkWindow) return;
|
if (!gdkWindow) return;
|
||||||
|
|
||||||
|
|
|
@ -139,6 +139,7 @@ class nsIMEGtkIC {
|
||||||
static nsIMEStatus *gStatus;
|
static nsIMEStatus *gStatus;
|
||||||
nsWindow *mClientWindow;
|
nsWindow *mClientWindow;
|
||||||
nsWindow *mFocusWindow;
|
nsWindow *mFocusWindow;
|
||||||
|
static nsWindow *gGlobalFocusWindow;
|
||||||
nsIMEGtkIC(nsWindow*, GdkFont*, GdkFont*);
|
nsIMEGtkIC(nsWindow*, GdkFont*, GdkFont*);
|
||||||
nsIMEGtkIC(nsWindow*, GdkFont*);
|
nsIMEGtkIC(nsWindow*, GdkFont*);
|
||||||
GdkICPrivate *mIC;
|
GdkICPrivate *mIC;
|
||||||
|
@ -152,6 +153,7 @@ class nsIMEGtkIC {
|
||||||
static nsIMEGtkIC *GetXIC(nsWindow*, GdkFont*);
|
static nsIMEGtkIC *GetXIC(nsWindow*, GdkFont*);
|
||||||
void SetFocusWindow(nsWindow * aFocusWindow);
|
void SetFocusWindow(nsWindow * aFocusWindow);
|
||||||
nsWindow* GetFocusWindow();
|
nsWindow* GetFocusWindow();
|
||||||
|
nsWindow* GetGlobalFocusWindow();
|
||||||
static void UnsetFocusWindow();
|
static void UnsetFocusWindow();
|
||||||
static GdkIMStyle GetInputStyle();
|
static GdkIMStyle GetInputStyle();
|
||||||
|
|
||||||
|
|
|
@ -3746,7 +3746,7 @@ nsWindow::IMEDestroyIC()
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset parent window for status window
|
// reset parent window for status window
|
||||||
if (xic->mInputStyle & GDK_IM_PREEDIT_CALLBACKS) {
|
if (xic->mInputStyle & GDK_IM_STATUS_CALLBACKS) {
|
||||||
xic->ResetStatusWindow(this);
|
xic->ResetStatusWindow(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3757,11 +3757,26 @@ nsWindow::IMEDestroyIC()
|
||||||
delete xic;
|
delete xic;
|
||||||
} else {
|
} else {
|
||||||
// xic and mIMEShellWindow are valid
|
// xic and mIMEShellWindow are valid
|
||||||
// see discussion in bug 53989
|
|
||||||
|
nsWindow *gwin = xic->GetGlobalFocusWindow();
|
||||||
nsWindow *fwin = xic->GetFocusWindow();
|
nsWindow *fwin = xic->GetFocusWindow();
|
||||||
|
|
||||||
|
// bug 53989
|
||||||
|
// if the current focused widget in xic is being destroyed,
|
||||||
|
// we need to change focused window to mIMEShellWindow
|
||||||
if (fwin && fwin == this) {
|
if (fwin && fwin == this) {
|
||||||
xic->SetFocusWindow(mIMEShellWindow);
|
xic->SetFocusWindow(mIMEShellWindow);
|
||||||
xic->UnsetFocusWindow();
|
xic->UnsetFocusWindow();
|
||||||
|
|
||||||
|
// bug 142873
|
||||||
|
// if focus is already changed before, we need to change
|
||||||
|
// focus window to the current focused window again for XIC
|
||||||
|
if (gwin && gwin != this && sFocusWindow == gwin) {
|
||||||
|
nsIMEGtkIC *focused_xic = gwin->IMEGetInputContext(PR_FALSE);
|
||||||
|
if (focused_xic) {
|
||||||
|
focused_xic->SetFocusWindow(gwin);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче