Closed Bug 547261 Opened 10 years ago Closed 10 years ago
Initial focus handling is broken with Qt
Example: Start Firefox Click into URL Bar -> the bar does not get the focus, it is not possible to type anything Click into webpage area Click into URL bar -> now the bar has the focus and it is possible to enter a URL
This seems to be related to the fact that every MozQWidget is deemed focusable in its constructor. The attached patch removes the flags from MozQWidgets constructor and instead sets them after nsWindow's creation of the MozQWidget object, but only for child windows/paintareas. Also removed is the whole sceneEvent() method which had some code in it that was modelled after the fix for a similar problem with pure QWidgets.
Attachment #427789 - Flags: review?
Interestingly, the JS popup case did not work with or without the patch. But the investigation revealed a few problems, so here is the updated patch that should do everything. In addition to making only child (and plugin) windows focusable, the activation handling is also moved to the hopefully right place by grabbing the events on the MozQGraphicsView and triggering Mozilla's Dispatch(De)ActiveEvent on nsWindow via MozQWidget so that Mozilla's internal focus is also set correctly. This works for me in Qt Fennec and Firefox builds. I'm not 100% sure about all corner cases but from what I can see it's definitely an improvement.
steffen, please make sure that your review request assigned to some persone, not just "review?"
Comment on attachment 428461 [details] [diff] [review] Updated patch to fix the focus handling Strange, I was quite sure I put Doug as the reviewer?!
Attachment #428461 - Flags: review? → review?(dougt)
Added a small fix to SetFocus() when a raise is needed.
Comment on attachment 428740 [details] [diff] [review] Update patch to fix focus handling http://hg.mozilla.org/mozilla-central/rev/e0819ee45f5b3b
Attachment #428740 - Flags: review?(dougt) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.