Bug 1213845 - enable osk support on windows 8, but hide it behind a preference, r=jaws

--HG--
extra : commitid : HGvNNv1htDF
extra : rebase_source : 7c39d7903bfda6040a202d6784c5a4e469a7eeed
extra : amend_source : af5a54a5fe9f3120c30dfe6ac3b607da596364e9
This commit is contained in:
Gijs Kruitbosch 2015-10-16 16:28:13 +01:00
Родитель a9af7b7120
Коммит e182a0c49c
2 изменённых файлов: 15 добавлений и 14 удалений

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

@ -3268,9 +3268,9 @@ pref("ui.osk.enabled", true);
pref("ui.osk.detect_physical_keyboard", true); pref("ui.osk.detect_physical_keyboard", true);
// Path to TabTip.exe on local machine. Cached for performance reasons. // Path to TabTip.exe on local machine. Cached for performance reasons.
pref("ui.osk.on_screen_keyboard_path", ""); pref("ui.osk.on_screen_keyboard_path", "");
// Only show the on-screen keyboard when Windows is in Tablet mode. Setting // Only try to show the on-screen keyboard on Windows 10 and later. Setting
// this pref to false will allow the OSK to show in regular non-tablet mode. // this pref to false will allow the OSK to show on Windows 8 and 8.1.
pref("ui.osk.require_tablet_mode", true); pref("ui.osk.require_win10", false);
// This pref stores the "reason" that the on-screen keyboard was either // This pref stores the "reason" that the on-screen keyboard was either
// shown or not shown when focus is moved to an editable text field. It is // shown or not shown when focus is moved to an editable text field. It is
// used to help debug why the keyboard is either not appearing when expected // used to help debug why the keyboard is either not appearing when expected

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

@ -28,7 +28,7 @@
const char* kOskPathPrefName = "ui.osk.on_screen_keyboard_path"; const char* kOskPathPrefName = "ui.osk.on_screen_keyboard_path";
const char* kOskEnabled = "ui.osk.enabled"; const char* kOskEnabled = "ui.osk.enabled";
const char* kOskDetectPhysicalKeyboard = "ui.osk.detect_physical_keyboard"; const char* kOskDetectPhysicalKeyboard = "ui.osk.detect_physical_keyboard";
const char* kOskRequireTabletMode = "ui.osk.require_tablet_mode"; const char* kOskRequireWin10 = "ui.osk.require_win10";
const char* kOskDebugReason = "ui.osk.debug.keyboardDisplayReason"; const char* kOskDebugReason = "ui.osk.debug.keyboardDisplayReason";
namespace mozilla { namespace mozilla {
@ -539,21 +539,22 @@ void
IMEHandler::MaybeShowOnScreenKeyboard() IMEHandler::MaybeShowOnScreenKeyboard()
{ {
if (sPluginHasFocus || if (sPluginHasFocus ||
!IsWin10OrLater() || !IsWin8OrLater() ||
!Preferences::GetBool(kOskEnabled, true) || !Preferences::GetBool(kOskEnabled, true) ||
sShowingOnScreenKeyboard || sShowingOnScreenKeyboard ||
IMEHandler::IsKeyboardPresentOnSlate()) { IMEHandler::IsKeyboardPresentOnSlate()) {
return; return;
} }
// Tablet Mode is only supported on Windows 10 and higher. // On Windows 10 we require tablet mode, unless the user has set the relevant
// When touch-event detection within IME is better supported // Windows setting to enable the on-screen keyboard in desktop mode.
// this check may be removed, and ShowOnScreenKeyboard can // We might be disabled specifically on Win8(.1), so we check that afterwards.
// run on Windows 8 and higher (adjusting the IsWin10OrLater if (IsWin10OrLater()) {
// guard above and within MaybeDismissOnScreenKeyboard). if (!IsInTabletMode() && !AutoInvokeOnScreenKeyboardInDesktopMode()) {
if (!IsInTabletMode() && return;
Preferences::GetBool(kOskRequireTabletMode, true) && }
!AutoInvokeOnScreenKeyboardInDesktopMode()) { }
else if (Preferences::GetBool(kOskRequireWin10, true)) {
return; return;
} }
@ -565,7 +566,7 @@ void
IMEHandler::MaybeDismissOnScreenKeyboard() IMEHandler::MaybeDismissOnScreenKeyboard()
{ {
if (sPluginHasFocus || if (sPluginHasFocus ||
!IsWin10OrLater() || !IsWin8OrLater() ||
!sShowingOnScreenKeyboard) { !sShowingOnScreenKeyboard) {
return; return;
} }