Commit Graph

57 Commits

Author SHA1 Message Date
Masayuki Nakano
c8b0ce3150 Bug 1504963 - part 4: Make IMEHandler create native caret over our caret if it's necessary r=Jamie,m_kato
IMMHandler and TSFTextStore are good class to put native caret when they have
enough information.  However, for example, IMMHandler may not have its singleton
instance until first composition of IMM-IME starts.  Therefore, typically,
IMEHandler is a good class to put native caret without composition.

This patch adds IMEHandler::MaybeCreateNativeCaret(), and if it won't create
native caret because not yet received WM_GETOBJCT for OBJID_CARET, we should
fire window event for MSAA applications.  If there is new MSAA application
retrieves OBJID_CARET, we'll receive WM_GETOBJECT for OBJID_CARET
asynchronously.  Then, we should start to put native caret for such
applications.

Note that if we create native caret, some versions of ATOK refers the native
caret and the behavior becomes worse than usual.  Therefore, we need to
keep not using native caret as far as possible.

Differential Revision: https://phabricator.services.mozilla.com/D13962

--HG--
extra : moz-landing-system : lando
2018-12-18 08:38:23 +00:00
Masayuki Nakano
682a4d56d1 Bug 1504963 - part 3: Make TSFTextStore create native caret when it gets notified of content change r=Jamie,m_kato
If WM_GETOBJECT for OBJID_CARET is received but a11y module is not active,
IME module should create native caret over our caret because Windows will
handle the request with native caret automatically and we don't need to
enable a11y module only for it.

This patch makes IMEHandler store whether such message has been received and
makes TSFTextStore create native caret when composition, selection or layout
is changed because especially when there is composition, only TSFTextStore
knows correct position to put caret if there is composition or some dispatched
events have not been handled by content process yet.

Note that IMMHandler already does that since some legacy IMEs require native
caret to show its UI and we cannot check active IME strictly.  Therefore, this
patch does not touch IMMHandler.

Differential Revision: https://phabricator.services.mozilla.com/D13961

--HG--
extra : moz-landing-system : lando
2018-12-18 08:38:23 +00:00
Masayuki Nakano
55978ba309 Bug 1504963 - part 2: Make IMEHandler manage whether native caret is created by it r=m_kato
IMEHandler needs to create native caret later (when there is no composition).
Therefore, IMEHandler should manage whether it creates native caret or not
and IMMHandler and TSFTextStore should create/destroy native caret via
IMEHandler.

Note that this patch makes IMMHandler stops managing whether native caret
is created for plugin or not because native caret is created only one instance
and anyway IME handlers should stop managing native caret when they loses
focus.

Differential Revision: https://phabricator.services.mozilla.com/D13960

--HG--
extra : moz-landing-system : lando
2018-12-18 08:38:22 +00:00
Masayuki Nakano
fd2f9270a7 Bug 1504963 - part 1: Make IME modules not touch native caret if a11y module handles native caret r=Jamie,m_kato
If a11y module is active, it observers caret position and size, and when caret
position or size is changed, it creates/moves native caret to overlap with
our caret.

On the other hand, IME module also creates native caret if active IME requires
it.  Therefore, both of them conflicts each other.

This patch makes IME module stop touching native caret if a11y module is active.

Although, a11y module with Flush Player does not work well for IME.  Therefore,
this patch keeps the conflict between them as-is for now.

Differential Revision: https://phabricator.services.mozilla.com/D13959

--HG--
extra : moz-landing-system : lando
2018-12-18 10:40:50 +00:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Masayuki Nakano
e78b3f56ea Bug 1409155 - IMEHandler should not associate IMC with any window if active IME is ATOK 2010 or earlier with x64 build on Win8 or later r=m_kato
ATOK started to be TIP of TSF since 2011.  Older than it, i.e., ATOK 2010 and
earlier have a lot of problems even for daily use.  Perhaps, the reason is
Win 8 has a lot of changes around IMM-IME support and TSF, and ATOK 2010 is
released earlier than Win 8.

ATOK 2006 crashes while converting a word with candidate window.
ATOK 2007 doesn't paint and resize suggest window and candidate window
correctly (showing white window or too big window).
ATOK 2008 and ATOK 2009 crash when user just opens their open state.
ATOK 2010 isn't installable newly on Win 7 or later, but we have a lot of
crash reports.

Note that ATOK 2006 is the first version supporting Win XP x64.  So, ATOK 2005
must not support x64 apps.

Unfortunately, we cannot block loading DLLs of them.  Therefore, IMEHandler
should disassociate IMC from active window when user changes active keyboard
layout to the legacy ATOK and not associate IME with any window when
SetInputContext() is called even with "enabled".  Additionally, when user
changes active keyboard layout from the legacy ATOK to one of the other
keyboard layouts, IMEHandler should associate IMC with current window for
new active IME.

MozReview-Commit-ID: RVYwmYxzO7

--HG--
extra : rebase_source : c237a3aca6ceb6a1f7251bd9421e4b905be5bc6c
2017-10-25 23:51:27 +09:00
Masayuki Nakano
4b414a44a2 Bug 1395876 - Initialize TSF modules after we create first normal window r=m_kato
Currently, we initialize TSF modules when there is only message window (this
started from bug 1341915).  At this time, QQ Input (Simplified Chinese TIP)
fails to initialize itself.

Therefore, we should put off to initialize TSF modules after creating first
normal window.  Then, initialize its IMC and input context for the window.

IMEHandler::InitInputContext() should be called when each normal window is
created.  Therefore, calling Initialize() from it can guarantee there is
at least one normal window when Initialize() is called.

MozReview-Commit-ID: IfR4y3pYv6J

--HG--
extra : rebase_source : 3f36acfa65567f140eea9c7fc12d6268aadbd5ef
2017-09-08 16:26:54 +09:00
Masayuki Nakano
f6dd08693e Bug 1367692 - Make IMEHandler not restore default IMC unless legacy IMM-IME is active. r=m_kato
TIPs (and normal keyboard layouts) don't need IMC on focused window.  So, in most environment, it's not necessary to restore default IMC of focused window.

Therefore, this patch makes IMEHandler not restore default IMC unless legacy IMM-IME is active and disassociate IMC from focused window when IMM-IME isn't active.

However, this is risky change.  Therefore, the new behavior is disabled in default settings.  On the other hand, we need the new behavior only when MS-IME for Japanese is active on Win10.  Therefore, this patch adds a pref to enable/disable the hack and make it true in the default settings.

MozReview-Commit-ID: KAVxVT9CrsW
2017-06-07 11:42:27 +09:00
Masayuki Nakano
61ce5526c6 Bug 1296220 Rename nsIMEUpdatePreference to mozilla::widget::IMEUpdatePreference r=m_kato
MozReview-Commit-ID: 2rIXTlwA6my

--HG--
extra : rebase_source : a51be3edd717092738c2b5e8ccc4f60540712bfd
2017-04-11 21:24:55 +09:00
Masayuki Nakano
af9e084206 Bug 1137561 part.1 Implement WinTextEventDispatcherListener as a singleton class for using TextEventDispatcher at handling native keyboard and IME events r=m_kato 2016-03-16 13:47:48 +09:00
Gijs Kruitbosch
b499a37faf Bug 1239744 - no longer automatically show an on-screen keyboard for programmatic focus changes, tidy up osk logic in IMEHandler, r=masayuki
--HG--
extra : rebase_source : 013c2759f4faca65ed3de79ca1d7f0b97e6375cb
2016-02-09 19:39:55 +00:00
Gijs Kruitbosch
957a33f4d4 Bug 1240208 - use inputmode in XUL to get better hinting for IME and on-screen keyboards, r=masayuki,smaug
--HG--
extra : commitid : KANhgN15KJK
extra : rebase_source : 0b640769e92d9d8c01e972c2b526ea56cc56d1df
2016-02-01 17:57:29 +00:00
Gijs Kruitbosch
7488564c2e Bug 1226148 - reduce flickering and closing when using the OSK tab key, r=masayuki
--HG--
extra : commitid : Fifze4dqIng
extra : rebase_source : 2df99a8315ff1c7b3a78572787c1dff6357f312c
2016-01-18 12:14:43 +00:00
Makoto Kato
d2c2d37a8b Bug 1208944 - Part 10-b. Call DefaultProc When CompositionEvent isn't handled correctly by plugin. r=masayuki 2015-12-29 22:57:38 +09:00
Makoto Kato
000416b7b5 Bug 1208944 - Part 9. Hook IMM32 APIs on plugin process. r=masayuki 2015-12-29 22:57:38 +09:00
Sebastian Hengst
e082884d78 Backed out 15 changesets (bug 1208944) for failing tests M(2,5) on OSX. r=backout
Backed out changeset c29de223de2f (bug 1208944)
Backed out changeset 3d99da255be1 (bug 1209844)
Backed out changeset 3c915942af38 (bug 1209844)
Backed out changeset 759b425b5503 (bug 1208944)
Backed out changeset bf73cf8f0fda (bug 1208944)
Backed out changeset 0e337d912b7d (bug 1208944)
Backed out changeset 31c47f2980b5 (bug 1208944)
Backed out changeset 3e0d70a6e809 (bug 1208944)
Backed out changeset 7685dcb63e5f (bug 1208944)
Backed out changeset 3c2b9372dd36 (bug 1208944)
Backed out changeset 18160d306493 (bug 1208944)
Backed out changeset 4974e397b655 (bug 1208944)
Backed out changeset fde7e439844d (bug 1208944)
Backed out changeset 4213a355fbdc (bug 1208944)
Backed out changeset 33cfddbbf5f2 (bug 1208944)
2015-12-29 17:42:02 +01:00
Makoto Kato
da206c5192 Bug 1208944 - Part 10-b. Call DefaultProc When CompositionEvent isn't handled correctly by plugin. r=masayuki 2015-12-29 22:57:38 +09:00
Makoto Kato
836a9aee5c Bug 1208944 - Part 9. Hook IMM32 APIs on plugin process. r=masayuki 2015-12-29 22:57:38 +09:00
Gijs Kruitbosch
9757fdf7d6 Bug 1226145 - actually check whether the on-screen keyboard is up rather than relying on internal state, r=masayuki
--HG--
extra : commitid : EueuAKZjsz2
extra : rebase_source : aed92d3b3415c9a1c5b652cb78877583c21bb0ff
extra : amend_source : ba3462abaa6cef77e9a7d44d8d5f7d96ebf78e63
2015-12-16 12:48:12 +00:00
Masayuki Nakano
6cad726628 Bug 1179632 part.1 native IME context should not be stored in InputContext but should be able to retrieve with nsIWidget::GetNativeData() r=smaug 2015-12-11 15:15:57 +09:00
Masayuki Nakano
be8f7a8cb3 Bug 1224454 part.1 IMEHandler should generate NOTIFY_IME_OF_BLUR in e10s mode if the focused widget is being destroyed before receiving NOTIFY_IME_OF_BLUR r=m_kato 2015-11-17 16:47:06 +09:00
Gijs Kruitbosch
aaf54987f1 Bug 1221947 - part 2: add TOUCH cause to IME Handling and use it to avoid checking for a keyboard, r=masayuki
--HG--
extra : commitid : 210bhfz78Nm
extra : rebase_source : a3ee068abd8cb0fc2c83be7d5e5442bf74979ecd
extra : histedit_source : 29daad4b99ad4d41663cc026983dffa7449029dc
2015-11-12 16:36:19 +00:00
Masayuki Nakano
c892b229d9 Bug 1211352 part.3 nsIWidget::GetIMEupdatePreference() for each platform should not request any notifications while a plugin has focus r=m_kato 2015-10-10 10:21:02 +09:00
Jared Wein
daaa0935bb Bug 1197722 - Respect Win10 pref about bringing up the touch keyboard outside of tablet mode. r=masayuki
--HG--
extra : rebase_source : 9b8172ded24f0054c714a6626dfb7f2eb3e2e3c9
2015-09-02 12:12:10 -04:00
Jared Wein
05a882f177 Bug 1007063 - Show virtual (on-screen) keyboard in Windows 8 and higher when text fields are focused if physical keyboards are not present. r=jimm r=masayuki r=m_kato 2015-08-05 10:38:51 -04:00
Ryan VanderMeulen
2d6a73be6b Backed out changeset 621a6c6aa375 (bug 1007063) for Windows XP test failures/crashes.
CLOSED TREE
2015-08-05 12:20:17 -04:00
Jared Wein
d34f31a7e4 Bug 1007063 - Show virtual (on-screen) keyboard in Windows 8 and higher when text fields are focused if physical keyboards are not present. r=jimm r=masayuki r=m_kato 2015-08-05 10:38:51 -04:00
Ehsan Akhgari
883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Masayuki Nakano
2bcb359d40 Bug 1081993 WinIMEHandler should notify nsIMM32Handler of some notifications even in TSF mode when IMM IME is active r=emk 2014-10-16 10:02:29 +09:00
Masayuki Nakano
e173e98fbd Bug 965685 Use IMENotification struct for nsIWidget::NotifyIME() and merge NotifyIMEOfTextChange() with it r=smaug, sr=roc 2014-02-18 09:00:15 +09:00
Masatoshi Kimura
8ddf7de8a5 Bug 969918 - Use decltype to declare pointers for dynamic-loaded functions. r=jimm sr=roc 2014-02-18 07:32:52 +09:00
Masayuki Nakano
e213d2ddd5 Bug 951966 part.2 Associate or disassociate IME context to focused window even in TSF mode r=jimm 2014-01-14 11:00:59 +09:00
Masayuki Nakano
6915530fae Bug 951966 part.1 Add new pref to support IMM-IME even in TSF mode and rename intl.enable_tsf_support to intl.tsf.enable r=jimm 2014-01-14 11:00:59 +09:00
Masayuki Nakano
0fbfe07d7e Bug 912956 part.2 Rename nsEvent.h to mozilla/EventForwards.h and sort out it r=roc
--HG--
rename : widget/nsEvent.h => widget/EventForwards.h
2013-09-24 19:04:14 +09:00
Masayuki Nakano
d5144e0a9b Bug 891316 part.5 Use widget::MSGResult in widget::IMEHandler r=jimm 2013-07-18 17:12:31 +09:00
Masayuki Nakano
8d873a6af1 Bug 866736 part.3 Replace CRLF in WinIMEHandler.(h|cpp) with LF r=jimm 2013-06-28 01:06:45 +09:00
Masayuki Nakano
22ab5a3d5b Bug 855975 part.17 Move nsWindow::OnKeyDown() to widget::NativeKey::HandleKeyDownMessage() r=jimm 2013-05-29 15:34:49 +09:00
Masayuki Nakano
0b76a23565 Bug 855975 part.12 Move special keypress event handling from nsWindow::OnKeyDown() to widget::NativeKey::DispatchKeyPressEventsAndDiscardsCharMessages r=jimm 2013-05-29 15:34:48 +09:00
Yohei Yukawa
e6ec2cbe7a Bug 866736 Use SetInputScopes to support InputScope on IMM32 r=masayuki 2013-04-30 00:41:45 +09:00
Masayuki Nakano
d068300221 Bug 848672 Redesign focus handling of nsTextStore r=jimm 2013-03-27 09:04:02 +09:00
Masayuki Nakano
67da4d273e Bug 849647 Get rid of message order optimization on Windows r=jimm 2013-03-23 23:18:52 +09:00
Masayuki Nakano
8818d46337 Bug 807241 Use ITfMessagePump and ITfKeystrokeMgr r=jimm 2013-03-18 13:41:24 +09:00
Masayuki Nakano
5f44ab0ead Bug 840409 part.16 Use IMM even in TSF mode when plugin has focus r=jimm 2013-02-25 13:00:07 +09:00
Masayuki Nakano
ffde20f09f Bug 840409 part.15 Implement widget::IMEHandler::CanOptimizeKeyAndIMEMessages() r=jimm 2013-02-25 13:00:07 +09:00
Masayuki Nakano
9683bb0a0e Bug 840409 part.14 Implement widget::IMEHandler::GetNativeData() r=jimm 2013-02-25 13:00:07 +09:00
Masayuki Nakano
bc51162884 Bug 840409 part.13 Implement widget::IMEHandler::IsIMEEnabled() which checks whether the state indicates IME available or not r=jimm 2013-02-25 13:00:07 +09:00
Masayuki Nakano
053ccfc3c4 Bug 840409 part.12 Implement widget::IMEHandler::InitInputContext() and widget::IMEHandler::SetInputContext() r=jimm 2013-02-25 13:00:06 +09:00
Masayuki Nakano
a75d2bc49f Bug 840409 part.11 Implement nsIMEContext::AssociateDefaultContext() and nsIMEContext::Disassociate() r=jimm 2013-02-25 13:00:06 +09:00
Masayuki Nakano
d5fcbc0600 Bug 840409 part.10 Implement widget::IMEHandler::SetOpenState() and widget::IMEHandler::GetOpenState() r=jimm 2013-02-25 13:00:06 +09:00
Masayuki Nakano
60933117b1 Bug 840409 part.9 Implement widget::IMEHandler::GetUpdatePreference() r=jimm 2013-02-25 13:00:06 +09:00