Bug 1468670 - Enablel Alt modifier key on Wayland r=stransky

MozReview-Commit-ID: 3nxxJabsTkx

--HG--
extra : rebase_source : 11b19f1fce05714177c9782485b9a1cb5fadd491
extra : source : 5b0768baf0b7cb2fe1728ba1dcce1344b8e4bcfd
This commit is contained in:
Takuro Ashie 2018-06-20 16:24:27 +09:00
Родитель 5a9a9cdd6b
Коммит 06d69fd42b
2 изменённых файлов: 21 добавлений и 4 удалений

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

@ -195,7 +195,11 @@ KeymapWrapper::Init()
memset(mModifierMasks, 0, sizeof(mModifierMasks));
if (GDK_IS_X11_DISPLAY(gdk_display_get_default()))
InitBySystemSettings();
InitBySystemSettingsX11();
#ifdef MOZ_WAYLAND
else
InitBySystemSettingsWayland();
#endif
gdk_window_add_filter(nullptr, FilterEvents, this);
@ -275,10 +279,10 @@ KeymapWrapper::InitXKBExtension()
}
void
KeymapWrapper::InitBySystemSettings()
KeymapWrapper::InitBySystemSettingsX11()
{
MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
("%p InitBySystemSettings, mGdkKeymap=%p",
("%p InitBySystemSettingsX11, mGdkKeymap=%p",
this, mGdkKeymap));
Display* display =
@ -439,6 +443,16 @@ KeymapWrapper::InitBySystemSettings()
XFree(xkeymap);
}
#ifdef MOZ_WAYLAND
void
KeymapWrapper::InitBySystemSettingsWayland()
{
// Not implemented yet, but at least Alt modifier should be handled to save
// popular usage.
mModifierMasks[INDEX_ALT] = 1 << 3;
}
#endif
KeymapWrapper::~KeymapWrapper()
{
gdk_window_remove_filter(nullptr, FilterEvents, this);

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

@ -174,7 +174,10 @@ protected:
*/
void Init();
void InitXKBExtension();
void InitBySystemSettings();
void InitBySystemSettingsX11();
#ifdef MOZ_WAYLAND
void InitBySystemSettingsWayland();
#endif
/**
* mModifierKeys stores each hardware key information.