Backed out changeset 64c6e5121479 (bug 1033483) for unexpected "Recursive GetService!" assertions

CLOSED TREE
This commit is contained in:
Phil Ringnalda 2016-10-03 20:29:27 -07:00
Родитель a416002aa7
Коммит 155ef02c4f
3 изменённых файлов: 9 добавлений и 39 удалений

Просмотреть файл

@ -8,7 +8,6 @@
#include "prlink.h"
#include "nsBidiKeyboard.h"
#include "WidgetUtils.h"
#include <gtk/gtk.h>
NS_IMPL_ISUPPORTS(nsBidiKeyboard, nsIBidiKeyboard)
@ -31,7 +30,6 @@ nsBidiKeyboard::Reset()
GdkKeymap *keymap = gdk_keymap_get_for_display(display);
mHaveBidiKeyboards = keymap && gdk_keymap_have_bidi_layouts(keymap);
mozilla::widget::WidgetUtils::SendBidiKeyboardInfoToContent();
return NS_OK;
}

Просмотреть файл

@ -19,7 +19,6 @@
#include <X11/XKBlib.h>
#include "WidgetUtils.h"
#include "keysym2ucs.h"
#include "nsContentUtils.h"
#include "nsGtkUtils.h"
#include "nsIBidiKeyboard.h"
#include "nsServiceManagerUtils.h"
@ -42,6 +41,7 @@ KeymapWrapper* KeymapWrapper::sInstance = nullptr;
guint KeymapWrapper::sLastRepeatableHardwareKeyCode = 0;
KeymapWrapper::RepeatState KeymapWrapper::sRepeatState =
KeymapWrapper::NOT_PRESSED;
nsIBidiKeyboard* sBidiKeyboard = nullptr;
static const char* GetBoolName(bool aBool)
{
@ -170,8 +170,6 @@ KeymapWrapper::KeymapWrapper() :
g_object_ref(mGdkKeymap);
g_signal_connect(mGdkKeymap, "keys-changed",
(GCallback)OnKeysChanged, this);
g_signal_connect(mGdkKeymap, "direction-changed",
(GCallback)OnDirectionChanged, this);
if (GDK_IS_X11_DISPLAY(gdk_display_get_default()))
InitXKBExtension();
@ -444,9 +442,8 @@ KeymapWrapper::~KeymapWrapper()
gdk_window_remove_filter(nullptr, FilterEvents, this);
g_signal_handlers_disconnect_by_func(mGdkKeymap,
FuncToGpointer(OnKeysChanged), this);
g_signal_handlers_disconnect_by_func(mGdkKeymap,
FuncToGpointer(OnDirectionChanged), this);
g_object_unref(mGdkKeymap);
NS_IF_RELEASE(sBidiKeyboard);
MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
("%p Destructor", this));
}
@ -522,16 +519,6 @@ KeymapWrapper::FilterEvents(GdkXEvent* aXEvent,
return GDK_FILTER_CONTINUE;
}
static void
ResetBidiKeyboard()
{
// Reset the bidi keyboard settings for the new GdkKeymap
nsCOMPtr<nsIBidiKeyboard> bidiKeyboard = nsContentUtils::GetBidiKeyboard();
if (bidiKeyboard) {
bidiKeyboard->Reset();
}
}
/* static */ void
KeymapWrapper::OnKeysChanged(GdkKeymap *aGdkKeymap,
KeymapWrapper* aKeymapWrapper)
@ -546,27 +533,14 @@ KeymapWrapper::OnKeysChanged(GdkKeymap *aGdkKeymap,
// We cannot reintialize here becasue we don't have GdkWindow which is using
// the GdkKeymap. We'll reinitialize it when next GetInstance() is called.
sInstance->mInitialized = false;
ResetBidiKeyboard();
}
// static
void
KeymapWrapper::OnDirectionChanged(GdkKeymap *aGdkKeymap,
KeymapWrapper* aKeymapWrapper)
{
// XXX
// A lot of diretion-changed signal might be fired on switching bidi
// keyboard when using both ibus (with arabic layout) and fcitx (with IME).
// See https://github.com/fcitx/fcitx/issues/257
//
// Also, when using ibus, switching to IM might not cause this signal.
// See https://github.com/ibus/ibus/issues/1848
MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
("OnDirectionChanged, aGdkKeymap=%p, aKeymapWrapper=%p",
aGdkKeymap, aKeymapWrapper));
ResetBidiKeyboard();
// Reset the bidi keyboard settings for the new GdkKeymap
if (!sBidiKeyboard) {
CallGetService("@mozilla.org/widget/bidikeyboard;1", &sBidiKeyboard);
}
if (sBidiKeyboard) {
sBidiKeyboard->Reset();
}
}
/* static */ guint

Просмотреть файл

@ -257,8 +257,6 @@ protected:
* Signal handlers.
*/
static void OnKeysChanged(GdkKeymap* aKeymap, KeymapWrapper* aKeymapWrapper);
static void OnDirectionChanged(GdkKeymap *aGdkKeymap,
KeymapWrapper* aKeymapWrapper);
/**
* GetCharCodeFor() Computes what character is inputted by the key event