Closed Bug 52217 Opened 26 years ago Closed 26 years ago

ctrl+number-key accelerators broken on linux

Categories

(Core :: XUL, defect, P2)

x86
Linux
defect

Tracking

()

VERIFIED DUPLICATE of bug 50252

People

(Reporter: mcafee, Assigned: dr)

References

Details

(Whiteboard: [nsbeta3+][PDTP2] FIX IN HAND)

Might be releated to bug 47426. Adding key="1" to menu item puts a "Ctrl + 1" acclerator label in the menu but does not respond to Ctrl+1. Changing the key to "e" works. Keycode way of doing this is blocked by 47426. I was testing this with Navigator accelerator menu in mozilla/xpfe/communicator/resources/tasksOverlay.xul. I am checking in key="1" for now, will migrated to keycode if/when that bug gets fixed.
cc'ing dean Chris: note that the problem being handled in bug 47426 is merely that the accelerator won't show up in the menu -- it should still function properly. So you could do it the keycod way... (incidentally, I don't know why "1" wouldn't show up. It's not a special key like Home...)
keycode way wouldn't work for me, I will try again though.
Prob. a separate problem than 47426, then.
Aw crap, I hate this. I can't change any .xul and have it take effect in the app. This is more of what I was experiencing in bug 47426. And I'm loathe to recompile this mother. When I change value="&navigatorCmd.label;" to "Dean's New Window", shouldn't that change the freakin' text in the freakin' menu??! But no, I have to change the .dtd in the en-US.loc file. In fact, I can delete entire <menuitem>s out of the .xul file and the next time I start the app, they're still there! I've deleted all the .jar files and that crap, but still nothing. This is getting really frustrating. Until I figure this out, I can't get anywhere on this bug nor 47426. Too bad for me. Have I mentioned I hate this? It's taken up way too much of my time.
Dean: you should really consider building -- it's much easier now that JAR packaging is in effect. You don't have to recompile all of mozilla every time you make changes to a dtd file. You simply cd over to the directory/subdirectory in which the change was made, do nmake -f makefile.win, and start mozilla.
But in this case I'm not changing a .dtd file, I'm changing a .xul file. I'll probably end up re-building, but it sure would be nice to know why this isn't working.
just rebuild in the content tree, e.g. xpfe/communicator rebuild takes ? a few seconds. Rebuilding all of xpfe takes more time, so don't do that.
Too late. I'm doing a clobber and a build on the whole tree, with MOZ_DISABLE_JAR_PACKAGING set. If this doesn't let me change .xul files "on the fly", I'm going to give up.
Blocks: 51418
And now back to our regularly scheduled programming... I pulled and re-built this morning, and Ctrl+1 both appears in the Tasks menu and works as a shortcut key. Is this working now?
This is working for me on Win32, but not on linux.
Was the OS always linux?? Sorry, didn't see that. Just assumed that because I was cc'd, it was all or win32. I'm out, since I don't have access to a linux box.
->saari
Assignee: hyatt → saari
->dr, nsbeta3+, p2 for M18
Assignee: saari → dr
Keywords: nsbeta3
Whiteboard: [nsbeta3+]
Target Milestone: --- → M18
Priority: P3 → P2
Hrm. None of the number-key accelerators seem to be working for me (CTRL-1 to 5). Do the rest of you have this problem, or is it just 1 which doesn't work for you...?
Status: NEW → ASSIGNED
The other numbered accelerators do not work for me as well. saari suggested that perhaps the widget code is just doing a match for [a-z], and that just needed to be extended to match whatever is being matched by the mac/win32 code.
PDT will allow P2 in order to get whatever the easier fix is: either the trivial fix mentioned, or removing the control key affordances from the menu.
Whiteboard: [nsbeta3+] → [nsbeta3+][PDTP2]
fwiw, when i set my accelerator key [on linux] to use Alt instead of Ctrl, and the shortcut does work (eg, alt+1 brings up a browser, alt+2 brings up mail, alt+3 IM on comm, alt+4 composer...). ctrl+num on win32 and command+num also seem to work for me. [using 2000.09.15.08/9 opt comm bits.]
Went hunting around all over the place, and I finally figured out that the key event is getting mangled way before nsXULKeyListener gets ahold of it. The notorious handleEventUsingKeyset isn't the culprit, nor are any of its ancestors in the class. This looks like an oddity in DOM key listener code, which I don't have the balls to try tackling this late in the game. The good part is that I found out the specifics about what's broken in the actual key event (the nsIDOMKeyEvent that gets thrown around): when ctrl is one of the modifiers, the charcode returned by nsIDOMKeyEvent::GetCharCode is a null char. The other fix of using keycode rather than key doesn't work, because menus are special (they're supposed to magically use key and set up the accelerators), and I don't want to just kill the accelerators entirely... My last guess is it's a freaky bug in nsDOMEvent (which implements nsIDOMKeyEvent), maybe in GetCharCode... If I can't find it here, I don't know where else to look.
Summary: "1" menu accelerator doesn't work → ctrl+number-key accelerators broken on linux
Hey Dan. Perhaps look at bug 50252, which is/was for dealing with generating the right sequence for control modifiers on GTK. Akkana and jag just came up with a fix for their needs. Not sure if it is the fix for this (don't think so) but they have been grappling with this code too.
Yeesh. Turns out, nsDOMEvent::getCharCode returns the wrong charcode when the ctrl key is depressed, and it's not even that function or class's fault either. I'd definitely believe it if you said GTK key event handlers were the underlying culprit... There's a patch attached to that bug -- I'll try that and see if it works. If it doesn't, then another guess would be that RedHat does something really weird with key mappings (I know it does some remapping but I don't know how much). Let's see if Akkana's patch works first though.
Akkana's patch works. I am saved. Praise the lord. Consider this fixed when the fix for 50252 is checked in.
Depends on: 50252
Whiteboard: [nsbeta3+][PDTP2] → [nsbeta3+][PDTP2] FIX IN HAND
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Akkana checked in. Fixed.
i was overzealous in resolving this -- akkana's patch seems to have regressed through some black magic. trying to clear up the regression, and then this should be fixed for real.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Ok, now it's /really/ fixed. Resolving as a dup of 50252, which I should have done anyway... *** This bug has been marked as a duplicate of 50252 ***
Status: REOPENED → RESOLVED
Closed: 26 years ago → 26 years ago
Resolution: --- → DUPLICATE
vrfy dup.
Status: RESOLVED → VERIFIED
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.