diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-04-23 11:55:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-23 11:55:27 -0400 |
commit | c5f7c9ccf33fac4bf2c1750e7040b76216fc912c (patch) | |
tree | f04f4b80566b6acea2323e9fceedbd2aab9a97b2 /components/compositing/compositor_thread.rs | |
parent | 05fe8fa08d507836ce5659ff56f83022a90b241a (diff) | |
parent | 42886613d32f2daff25f1f3ce7a7328bcc2306f7 (diff) | |
download | servo-c5f7c9ccf33fac4bf2c1750e7040b76216fc912c.tar.gz servo-c5f7c9ccf33fac4bf2c1750e7040b76216fc912c.zip |
Auto merge of #20676 - fabricedesre:ime-embedding, r=cbrewster
Notify the embedder when it should display or hide an IME
<!-- Please describe your changes on the following line: -->
This adds a couple of embedder messages triggered when an editable element is focused or blured. The embedder also gets the type of data to edit so it can display a different keyboard type or a custom input method eg. for color choosing.
This is a partial fix for issue #12127
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because there are no tests for the embedding api :(
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20676)
<!-- Reviewable:end -->
Diffstat (limited to 'components/compositing/compositor_thread.rs')
-rw-r--r-- | components/compositing/compositor_thread.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/compositing/compositor_thread.rs b/components/compositing/compositor_thread.rs index 3d9a320c897..0b042ec5350 100644 --- a/components/compositing/compositor_thread.rs +++ b/components/compositing/compositor_thread.rs @@ -8,7 +8,7 @@ use SendableFrameTree; use compositor::CompositingReason; use gfx_traits::Epoch; use ipc_channel::ipc::IpcSender; -use msg::constellation_msg::{Key, KeyModifiers, KeyState, PipelineId, TopLevelBrowsingContextId}; +use msg::constellation_msg::{InputMethodType, Key, KeyModifiers, KeyState, PipelineId, TopLevelBrowsingContextId}; use net_traits::image::base::Image; use profile_traits::mem; use profile_traits::time; @@ -143,6 +143,10 @@ pub enum EmbedderMsg { Panic(TopLevelBrowsingContextId, String, Option<String>), /// Open dialog to select bluetooth device. GetSelectedBluetoothDevice(Vec<String>, IpcSender<Option<String>>), + /// Request to present an IME to the user when an editable element is focused. + ShowIME(TopLevelBrowsingContextId, InputMethodType), + /// Request to hide the IME when the editable element is blurred. + HideIME(TopLevelBrowsingContextId), /// Servo has shut down Shutdown, } @@ -244,6 +248,8 @@ impl Debug for EmbedderMsg { EmbedderMsg::LoadComplete(..) => write!(f, "LoadComplete"), EmbedderMsg::Panic(..) => write!(f, "Panic"), EmbedderMsg::GetSelectedBluetoothDevice(..) => write!(f, "GetSelectedBluetoothDevice"), + EmbedderMsg::ShowIME(..) => write!(f, "ShowIME"), + EmbedderMsg::HideIME(..) => write!(f, "HideIME"), EmbedderMsg::Shutdown => write!(f, "Shutdown"), } } |