Closed
Bug 463802
Opened 16 years ago
Closed 16 years ago
"keyup" event for Ctrl key not dispatched when focusing the Ctrl+Tab panel
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.1b3
People
(Reporter: dao, Assigned: smichaud)
References
Details
(Keywords: fixed1.9.1, platform-parity, Whiteboard: [See comment 19 fo verification steps])
Attachments
(2 files, 1 obsolete file)
8.36 KB,
patch
|
masayuki
:
review+
jaas
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
10.45 KB,
patch
|
Details | Diff | Splinter Review |
The keypress event for Tab (with event.ctrlKey == true) opens the Ctrl+Tab panel. Releasing the Ctrl key should close it again. This doesn't happen if focus was moved to the panel. This can be tested with the patch in bug 463799.
Reporter | ||
Updated•16 years ago
|
Flags: blocking1.9.1?
Assignee | ||
Comment 1•16 years ago
|
||
I'm afraid I don't understand. Could you give a more detailed description (and STR)?
Reporter | ||
Comment 2•16 years ago
|
||
STR: With the patch in bug 463799, hit Ctrl+Tab, release Tab, release Ctrl. Expected: Different tab selected Actual: No different tab selected and the Ctrl+Tab panel stays open. (At least, that used to be the case, see e.g. the last paragraph of bug 436304 comment 77.)
Reporter | ||
Comment 3•16 years ago
|
||
See also bug 465076 comment 12 and bug 465076 comment 13.
blocking1.9.1+ for now, we need to sort this out
Flags: blocking1.9.1? → blocking1.9.1+
Reporter | ||
Updated•16 years ago
|
Updated•16 years ago
|
Assignee | ||
Comment 5•16 years ago
|
||
Turns out this *is* a Cocoa widgets bug ... or at least that it's triggered by one. Here's a patch that fixes it. The keyboard modifier state is global (not per-view or per-window). So the variable that stores the previous modifier state should also be global. Prior to my patch, mLastModifierState was per-ChildView. But the ChildView that has the keyboard focus when the Control key is first pressed is different from the ChildView that has the keyboard focus when the Control key is released (after the Tab key has been pressed and released). So the value of mLastModifierState (for the currently focused ChildView) is '0' when the Control key is released, when it should be 0x00040000 (== NSControlKeyMask). This means fireKeyEventForFlagsChanged doesn't get called when the Control key is released. A tryserver build of this patch plus the patch for bug 463799 will follow in a bit.
Attachment #352331 -
Flags: review?(joshmoz)
Assignee | ||
Comment 6•16 years ago
|
||
Comment on attachment 352331 [details] [diff] [review] Fix Masayuki, it seems you're the last one who touched this code. So I'm also asking you to review my patch.
Attachment #352331 -
Flags: review?(masayuki)
Updated•16 years ago
|
Attachment #352331 -
Flags: review?(masayuki) → review+
Comment 7•16 years ago
|
||
Comment on attachment 352331 [details] [diff] [review] Fix Looks ok for now... However, should not we initialize sLastModifierStat at every application activating time? E.g., if Ctrl or something is down on another application and switched the active application to us by mouse click, then, we cannot handle the Ctrl keyup event correctly. But it's really rare case, and it can be separated to another bug.
Assignee | ||
Comment 8•16 years ago
|
||
(In reply to comment #7) > However, should not we initialize sLastModifierStat at every > application activating time? Good point. But if flagsChanged: is called (by the OS) on a ChildView when the browser isn't active, we might not have to explicitly set sLastModifierState when the browser becomes active. I'll look into this further (later this afternoon).
Assignee | ||
Comment 9•16 years ago
|
||
Here's another patch that incorporates Masayuki's suggestion ... which wasn't difficult. There's still one (very minor) problem: If you hold down the Option key while making Firefox active (by left-clicking on a browser window), gLastModifierState gets set to '0' in [AppShellDelegate applicationDidBecomeActive:] (instead of to 0x00080000 as it should). This is presumably some kind of OS bug. But I don't think it matters (I can't think of a scenario where it does matter).
Assignee | ||
Updated•16 years ago
|
Attachment #352331 -
Attachment is obsolete: true
Attachment #352331 -
Flags: review?(joshmoz)
Assignee | ||
Updated•16 years ago
|
Attachment #352437 -
Flags: review?(masayuki)
Assignee | ||
Updated•16 years ago
|
Attachment #352437 -
Flags: review?(joshmoz)
Assignee | ||
Comment 10•16 years ago
|
||
(Following up comment #8) > But if flagsChanged: is called (by the OS) on a ChildView when the > browser isn't active, Forgot to mention that I did some tests and never saw [ChildView flagsChanged:] called while the browser was inactive.
Assignee | ||
Comment 11•16 years ago
|
||
A tryserver build of my rev1 patch plus the patch for bug 463799 will follow in several hours. The Mac tryserver is a bit slooooow today.
Assignee | ||
Comment 12•16 years ago
|
||
And here's a tryserver build: https://build.mozilla.org/tryserver-builds/2008-12-10_16:29-smichaud@pobox.com-bugzilla463802-rev1-debug/smichaud@pobox.com-bugzilla463802-rev1-debug-firefox-try-mac.dmg
Comment 13•16 years ago
|
||
Comment on attachment 352437 [details] [diff] [review] Fix rev1 (follow Masayuki's suggestion) Great!
Attachment #352437 -
Flags: review?(masayuki) → review+
Attachment #352437 -
Flags: review?(joshmoz) → review+
Assignee | ||
Updated•16 years ago
|
Attachment #352437 -
Flags: superreview?(roc)
Attachment #352437 -
Flags: superreview?(roc) → superreview+
Assignee | ||
Comment 14•16 years ago
|
||
Landed on mozilla-central http://hg.mozilla.org/mozilla-central/rev/4497c86397f4
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 15•16 years ago
|
||
Hi Steven: Since this is plussed for 3.1, when will it get checked into that branch? I am just back from PTO and trying to figure out the workflow for these types of bugs.
Assignee | ||
Comment 16•16 years ago
|
||
I'm hoping to do that right now, Marcia :-)
Assignee | ||
Comment 17•16 years ago
|
||
Landed on the 1.9.1 branch: http://hg.mozilla.org/releases/mozilla-1.9.1/rev/0ad98cc73f7c
Keywords: fixed1.9.1
Comment 18•16 years ago
|
||
I don't see a way how to verify the fix. The STR from comment 0 are also working with a 081215 trunk nightly. Do we have another STR which are more visible?
Target Milestone: --- → mozilla1.9.2a1
Updated•16 years ago
|
Target Milestone: mozilla1.9.2a1 → mozilla1.9.1b3
Assignee | ||
Comment 19•16 years ago
|
||
(In reply to comment #18) Unfortunately, this bug's STR (from comment #2) only "works" in a build that also has the patch for bug 463799. So to see this bug (unfixed) you'll need to create a build with the patch for bug 463799 but without this bug's patch.
Comment 20•15 years ago
|
||
Anyone up to the verifying task? :p
Keywords: verifyme
Whiteboard: [See comment 19 fo verification steps]
You need to log in
before you can comment on or make changes to this bug.
Description
•