Last Comment Bug 528629 - Redo Undo both use keyboard shortcut COMMAND+Z in Mail message composition
: Redo Undo both use keyboard shortcut COMMAND+Z in Mail message composition
: fixed-seamonkey2.0.1
Product: SeaMonkey
Classification: Client Software
Component: MailNews: Composition (show other bugs)
: Trunk
: All Mac OS X
-- normal (vote)
: seamonkey2.1a1
Assigned To: Stefan [:stefanh]
: 528628 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2009-11-13 15:06 PST by Cecelia S
Modified: 2009-11-29 09:43 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

possible patch (764 bytes, patch)
2009-11-15 15:54 PST, Stefan [:stefanh]
neil: superreview-
Details | Diff | Splinter Review
New approach (3.32 KB, patch)
2009-11-27 11:19 PST, Stefan [:stefanh]
neil: superreview+
Details | Diff | Splinter Review
Overlay key for linux (4.39 KB, patch)
2009-11-27 12:37 PST, Stefan [:stefanh]
no flags Details | Diff | Splinter Review
Even better (1.79 KB, patch)
2009-11-27 12:57 PST, Stefan [:stefanh]
mnyromyr: review+
neil: superreview+
mnyromyr: approval‑seamonkey2.0.1+
Details | Diff | Splinter Review

Description User image Cecelia S 2009-11-13 15:06:19 PST
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: Gecko/20090823 SeaMonkey/1.1.18 Mnenhy/
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: Gecko/20090823 SeaMonkey/1.1.18 Mnenhy/

Typical keyboard commands for Undo and Redo (with unlimited Undo) are COMMAND+Z for Undo and COMMAND+SHIFT+Z for Redo. This is the labeling in the browser component of SeaMonkey, but under Mail, the shortcuts are both COMMAND+Z. The COMMAND+Z/COMMAND+SHIFT+Z shortcuts work correctly in the subject line of the email, but not in the message area.

Reproducible: Always

Steps to Reproduce:
1. Compose mail message
2. Make several additions and deletions
3. Press COMMAND+Z a few times
Actual Results:  
Last edit is undone and redone.

Expected Results:  
Last few edits progressively undone.

I've filed the menu keyboard shortcut display as Bug#528628
Comment 1 User image Cecelia S 2009-11-13 15:11:28 PST
I just noticed that my build identifier is wrong. This is under SeaMonkey 2.0 (final release).
Comment 2 User image Stefan [:stefanh] 2009-11-15 14:44:22 PST
I guess we miss some overlay here...
Comment 3 User image Stefan [:stefanh] 2009-11-15 15:26:22 PST
Karsten, any idea what caused this? The only file I can see the right key combo in is platformCommunicatorOverlay
Comment 4 User image Stefan [:stefanh] 2009-11-15 15:52:04 PST
So... we get those keys from utilityOverlay.xul, it seems. That is overlayed by platformCommunicatorOverlay.xul.
Comment 5 User image Stefan [:stefanh] 2009-11-15 15:54:29 PST
Created attachment 412514 [details] [diff] [review]
possible patch

Not really tested this, just putting it here for reference
Comment 6 User image Stefan [:stefanh] 2009-11-17 13:39:45 PST
OK, so the <key/> in platformCommunicatorOverlay.xul doesn't work at all, but it does if I apply attachment #412514 [details] [diff] [review].
Comment 7 User image Stefan [:stefanh] 2009-11-17 13:43:34 PST
Comment on attachment 412514 [details] [diff] [review]
possible patch

I think there is more to do here - it's a bit of a mess with all the .dtd files. But this seems reasonable to me since I believe we want this on branch (no l10n impact).
Comment 8 User image Stefan [:stefanh] 2009-11-17 13:44:40 PST
We'll fix this on trunk first
Comment 9 User image Stefan [:stefanh] 2009-11-17 13:57:41 PST
*** Bug 528628 has been marked as a duplicate of this bug. ***
Comment 10 User image 2009-11-27 03:44:46 PST
Comment on attachment 412514 [details] [diff] [review]
possible patch

(As this patch stands, it looks like it breaks Linux builds.)

For some reason the key_redo attributes are being overlayed in the wrong order (i.e. the attributes from the platform overlay are getting applied first) and I have no idea why :s
Comment 11 User image 2009-11-27 07:47:11 PST
OK, so the issue seems to be the order of overlays.
messengercompose.xul includes the keyset from editorOverlay.xul that includes the key_redo element that utilityOverlay.xul overlays. However if utilityOverlay.xul is overlaid before editorOverlay.xul then its overlay temporarily misses. Now platformCommunicatorOverlay.xul is an overlay of an overlay, so it gets queued up after all of the main overlays, so that it does find the key_redo from editorOverlay.xul, but then when utilityOverlay.xul gets its second chance to overlay key_redo it overwrites the attributes that platformCommunicatorOverlay.xul set.
Comment 12 User image Stefan [:stefanh] 2009-11-27 11:19:01 PST
Created attachment 414863 [details] [diff] [review]
New approach

Thanks for the info, Neil.

On mac, the issue can be seen in the main mailnews window as well (see the dupe). Anyway, I switched the order of the overlays and it works fine for me. I think it makes sense to remove the attributes in utilityOverlay, since we're not really using them.
Comment 13 User image Stefan [:stefanh] 2009-11-27 11:19:43 PST
(like to keep this o the blocking radar, so it won't get lost)
Comment 14 User image 2009-11-27 12:07:28 PST
Comment on attachment 414863 [details] [diff] [review]
New approach

>diff --git a/suite/common/utilityOverlay.xul b/suite/common/utilityOverlay.xul
As I said already before, this change breaks Linux!

sr=me on the mailnews changes only.
Comment 15 User image Stefan [:stefanh] 2009-11-27 12:37:45 PST
Created attachment 414869 [details] [diff] [review]
Overlay key for linux

OK, if I haven't miunderstood you completely this would be better since then there won't be any confusion regarding what's overlayed and not. And this shouldn't break linux.
Comment 16 User image 2009-11-27 12:51:08 PST
Comment on attachment 414869 [details] [diff] [review]
Overlay key for linux

>+  <key id="key_redo"/>
No point just having this on its own.
Comment 17 User image Stefan [:stefanh] 2009-11-27 12:57:54 PST
Created attachment 414873 [details] [diff] [review]
Even better

Neil pointed out that I don't need the key in utilityOverlay anymore. This patch also skips the re-ordering of the overlays.
Comment 18 User image Karsten Düsterloh 2009-11-28 18:08:26 PST
Comment on attachment 414873 [details] [diff] [review]
Even better

Interestingly, shift^H does (and did) redo even under Linux, which I didn't know, becaus e it's not shown...
Comment 19 User image Stefan [:stefanh] 2009-11-29 04:47:19 PST
Comment 20 User image Stefan [:stefanh] 2009-11-29 04:49:38 PST
Comment on attachment 414873 [details] [diff] [review]
Even better

I think we want this on 2.0.1 - it's a safe patch and the problem is highly visible for mac users.
Comment 21 User image Stefan [:stefanh] 2009-11-29 09:43:41 PST
Fixed for the forthcoming 2.0.1 release:

Note You need to log in before you can comment on or make changes to this bug.