mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-08 04:09:03 +02:00
Bug 1824634 hold GtkIMContext reference a little longer than preedit-changed a=diannaS
Original Revision: https://phabricator.services.mozilla.com/D182866 Differential Revision: https://phabricator.services.mozilla.com/D183445
This commit is contained in:
parent
27ce8f6da2
commit
102909885f
2 changed files with 14 additions and 1 deletions
|
|
@ -43,6 +43,7 @@ GOBJECT_TRAITS(GdkDragContext)
|
|||
GOBJECT_TRAITS(GDBusMessage)
|
||||
GOBJECT_TRAITS(GdkPixbuf)
|
||||
GOBJECT_TRAITS(GCancellable)
|
||||
GOBJECT_TRAITS(GtkIMContext)
|
||||
GOBJECT_TRAITS(GUnixFDList)
|
||||
|
||||
#ifdef MOZ_ENABLE_DBUS
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
#include "prenv.h"
|
||||
|
||||
#include "IMContextWrapper.h"
|
||||
|
||||
#include "GRefPtr.h"
|
||||
#include "nsGtkKeyUtils.h"
|
||||
#include "nsWindow.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
|
|
@ -1728,7 +1730,17 @@ void IMContextWrapper::OnEndCompositionNative(GtkIMContext* aContext) {
|
|||
/* static */
|
||||
void IMContextWrapper::OnChangeCompositionCallback(GtkIMContext* aContext,
|
||||
IMContextWrapper* aModule) {
|
||||
aModule->OnChangeCompositionNative(aContext);
|
||||
RefPtr module = aModule;
|
||||
module->OnChangeCompositionNative(aContext);
|
||||
|
||||
if (module->IsDestroyed()) {
|
||||
// A strong reference is already held during "preedit-changed" emission,
|
||||
// but _ibus_context_destroy_cb() in ibus 1.5.28 and
|
||||
// _fcitx_im_context_close_im_cb() in fcitx 4.2.9.9 want their
|
||||
// GtkIMContexts to live a little longer. See bug 1824634.
|
||||
NS_DispatchToMainThread(
|
||||
NS_NewRunnableFunction(__func__, [context = RefPtr{aContext}]() {}));
|
||||
}
|
||||
}
|
||||
|
||||
void IMContextWrapper::OnChangeCompositionNative(GtkIMContext* aContext) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue