don't dismiss menubar and sip button while focused on a text box

RESOLVED FIXED

Status

()

Core
Widget: Win32
RESOLVED FIXED
9 years ago
8 years ago

People

(Reporter: blassey, Assigned: blassey)

Tracking

Trunk
ARM
Windows Mobile 6 Professional
Points:
---

Firefox Tracking Flags

(status1.9.2 .2-fixed, fennec1.0a4-wm+)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Created attachment 423852 [details] [diff] [review]
patch

with bug 532929 we show the sip button when the keyboard is displayed, but if you click the sip button to dismiss the keyboard the sip button also hides. This means there is no way to bring back the keyboard.

Also, on start up, we are currently dismissing the keyboard without taking the focus from the url bar. As a result, the only way to enter a url is to dismiss the awesome panel and reopen it by clicking on the url bar, which is less than obvious.
Attachment #423852 - Flags: review?(mozbugz)
(Assignee)

Updated

9 years ago
Attachment #423852 - Flags: review?(alexp)
Comment on attachment 423852 [details] [diff] [review]
patch

>@@ -89,33 +90,30 @@ void nsWindowCE::OnSoftKbSettingsChange(
...
>     if (winRect.bottom != visRect->bottom) {
>-      if (winRect.bottom < visRect->bottom) {
>-        // Soft keyboard has been hidden, have to hide the SIP button as well
>-        if (sSoftKeyMenuBarHandle)
>-          ShowWindow(sSoftKeyMenuBarHandle, SW_HIDE);
>-
>-        SHFullScreen(wndMain, SHFS_HIDESIPBUTTON);
>-      }

I don't think deleting this code from here is correct.
Now with this change the SIP button frequently stays visible when it's supposed to hide - for example when an edit box loses its focus.

I tried different combinations and found that having this stuff in OnSoftKbSettingsChange rather than in ToggleSoftKB worked better for me. I cannot say for sure if it's the best solution though.

All this SIP stuff is a bit shaky - it works most of the time, but sometimes the same code in the same conditions behaves completely differently. It seems to depend on the timings of IM/SIP and other events received by the window.
Attachment #423852 - Flags: review?(alexp) → review-
Created attachment 423960 [details] [diff] [review]
patch v.2

you're right, since we're using the async shell function to raise and lower the softkb now, the keyboard hasn't made its move by the time we leave ToggleSoftKB() and when it does move it brings the SIP button up with it.

ToggleSoftKB() authoritatively knows when an editable element has focus and when it looses it (if that's wrong, our IME code is busted).  Therefore, that is where were should be determining where to show and hide the SIP button and menu bar.  This patch adds code to hide the SIP button back in to the OnSoftKbSettingsChange() if the static set by ToggleSoftKB() is true.  It also calls OnSoftKbSettingsChange() directly when hiding the keyboard since its possible that the keyboard is already hidden and we won't get an event through the message loop.

We don't have to worry about the menu bar in OnSoftKbSettingsChange() since the keyboard coming and going doesn't effect that.
Assignee: nobody → bugmail
Attachment #423852 - Attachment is obsolete: true
Attachment #423960 - Flags: review?(mozbugz)
Attachment #423960 - Flags: review?(alexp)
Attachment #423852 - Flags: review?(mozbugz)
Now the SIP button seems to be hiding properly.

But the autocomplete popup is resized incorrectly sometimes. See a screenshot here: http://people.mozilla.org/~alexp/542623-sip-menubar/resized-window.png
It happens for example when after dismissal of that popup opened on the start up,
you tap in the awesome bar the first time, and the keyboard appears.
Comment on attachment 423960 [details] [diff] [review]
patch v.2

OK, it works with SoftKeyboardObserver disabled in the browser.js.
We just need that patch in addition to this.
Attachment #423960 - Flags: review?(alexp) → review+

Comment 5

9 years ago
Comment on attachment 423960 [details] [diff] [review]
patch v.2

okay; land together.

it would be helpful to have comments as to what you are doing.
Attachment #423960 - Flags: review?(mozbugz) → review+
pushed http://hg.mozilla.org/mozilla-central/rev/18672730444e

leaving bug open for the mobile-browser patch
sorry for the bug spam, the mobile-browser patch is actually on bug 542884, closing this one
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
(Assignee)

Updated

9 years ago
Attachment #423960 - Flags: approval1.9.2.1?

Updated

9 years ago
Blocks: 516468
(Assignee)

Updated

9 years ago
tracking-fennec: --- → 1.0a4-wm+
Attachment #423960 - Flags: approval1.9.2.2?
You need to log in before you can comment on or make changes to this bug.