Closed
Bug 604192
Opened 15 years ago
Closed 15 years ago
IME opened into the chrome process should not be dismissed by the content process
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
fennec | 2.0b3+ | --- |
People
(Reporter: vingtetun, Assigned: vingtetun)
References
Details
(Whiteboard: [VKB])
Attachments
(1 file, 2 obsolete files)
2.51 KB,
patch
|
jchen
:
review+
|
Details | Diff | Splinter Review |
In a Fennec e10s enabled build, the virtual keyboard opened on the chrome side can be close by the content side, which is a wrong behavior.
We still want the VKB to be opened if it is not opened on the content side for now.
Updated•15 years ago
|
Summary: [VKB] IME opened into the chrome process should not be dismissed by the content process → IME opened into the chrome process should not be dismissed by the content process
Updated•15 years ago
|
Whiteboard: [VKB]
Updated•15 years ago
|
Component: DOM: Events → Event Handling
Assignee | ||
Comment 1•15 years ago
|
||
The patch prevent content process to dismiss/update any states of the virtual keyboard (IME) as long as the keyboard is already opened in chrome and the currently focused element is editable.
Attachment #482982 -
Attachment is obsolete: true
Attachment #483160 -
Flags: review?(jimnchen+bmo)
Updated•15 years ago
|
tracking-fennec: --- → 2.0b3+
Comment 2•15 years ago
|
||
Comment on attachment 483160 [details] [diff] [review]
Patch
Will this be temporary? Bug 583976 will probably fix this. It seems the problem is caused by content never losing focus (akin to Bug 599053)
> bool
> TabParent::RecvSetIMEEnabled(const PRUint32& aValue)
> {
> nsCOMPtr<nsIWidget> widget = GetWidget();
>- if (widget)
>+ if (widget && CanAlterIMEState())
> widget->SetIMEEnabled(aValue);
>+
> return true;
> }
>
> bool
> TabParent::RecvGetIMEOpenState(PRBool* aValue)
> {
> nsCOMPtr<nsIWidget> widget = GetWidget();
>- if (widget)
>+ if (widget && CanAlterIMEState())
> widget->GetIMEOpenState(aValue);
> return true;
> }
Extra line before return in RecvSetIMEEnabled
>+PRBool
>+TabParent::CanAlterIMEState()
I don't think the name is very clear. Maybe SuppressContentIME?
>+{
>+ nsCOMPtr<nsIWidget> widget = GetWidget();
>+ if (!widget)
>+ return true;
>+
>+ // if the VKB is already opened, and there is a focused, editable content in
>+ // chrome, do not react to IME request
>+ PRUint32 currentEnabledState;
>+ nsresult rv = widget->GetIMEEnabled(¤tEnabledState);
>+ if (NS_FAILED(rv))
>+ return false; // This platform doesn't support controling the IME state.
>+
>+ // don't prevent request if the VKB is already closed
>+ if (currentEnabledState == nsIWidget::IME_STATUS_DISABLED)
>+ return true;
Why do you have to check if it's open or not? I think all content calls should be prevented if chrome has control.
>+
>+ nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
Use nsFocusManager::GetFocusManager()
>+ if (fm) {
>+ nsCOMPtr<nsIDOMElement> focusedElement;
>+ fm->GetFocusedElement(getter_AddRefs(focusedElement));
>+
>+ if (focusedElement) {
>+ nsCOMPtr<nsIContent> content = do_QueryInterface(focusedElement);
Use fm->GetFocusedContent()
Thanks!
Assignee | ||
Comment 3•15 years ago
|
||
(In reply to comment #2)
> Comment on attachment 483160 [details] [diff] [review]
> Patch
>
> Will this be temporary? Bug 583976 will probably fix this. It seems the problem
> is caused by content never losing focus (akin to Bug 599053)
IMO yes it will be temporary but since 583976 is not a b2 blocker I would like to be sure the VKB is displayed when needed and not altered by content.
I would addressed your comments soon, thanks for your code review.
Assignee | ||
Comment 4•15 years ago
|
||
Addressed comments.
Assignee: nobody → 21
Attachment #483160 -
Attachment is obsolete: true
Attachment #483928 -
Flags: review?(jimnchen+bmo)
Attachment #483160 -
Flags: review?(jimnchen+bmo)
Comment 5•15 years ago
|
||
Comment on attachment 483928 [details] [diff] [review]
Patch v0.2
>
>+PRBool
>+TabParent::AllowContentIME()
>+{
>+ nsFocusManager* fm = nsFocusManager::GetFocusManager();
>+ NS_ENSURE_TRUE(fm, PR_FALSE);
>+
>+ nsCOMPtr<nsIContent> focusedContent = fm->GetFocusedContent();
>+ if (focusedContent && focusedContent->IsEditable())
>+ return false;
PR_FALSE
>+
>+ return true;
and PR_TRUE. Looks good otherwise.
Attachment #483928 -
Flags: review?(jimnchen+bmo) → review+
Assignee | ||
Comment 6•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
bug 606033 opened. Note: VKB doesn't stay open when trying to open a panel.
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•