Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All Windows/dialogs Should Repspond to Close Window Keystroke #1085

Closed
ghost opened this issue Mar 10, 2010 · 17 comments
Closed

All Windows/dialogs Should Repspond to Close Window Keystroke #1085

ghost opened this issue Mar 10, 2010 · 17 comments
Milestone

Comments

@ghost
Copy link

ghost commented Mar 10, 2010

I cannot close the Greasemonkey userscripts window using Cmd-W; I have to close the window using the mouse. While it may seem like a small thing to some, it's a semi-significant inconvenience.

@erikvold
Copy link
Contributor

cmd/control - w works for me when I view a userscript on both the http:// and file:/// protocols on mac osx and windows xp (firefox 3.6).

WCityMike can you please create a blank firefox profile and only install greasemonkey then confirm that this is an issue for you? if it is still an issue then please let us know what version of firefox, what os, and what version of your os you are using?

Otherwise I'd tag this w/ 'wontfix'..

@ghost
Copy link
Author

ghost commented Mar 18, 2010

When I spoke to the "Greasemonkey userscripts window," I meant the "Manage User Scripts" window, which does not respond to Command-W even when using a brand-new Firefox profile. Please let me know if you can't reproduce that.

@erikvold
Copy link
Contributor

Ah I see now, I can confirm that is an issue for me as well.

@erikvold
Copy link
Contributor

Hmm it looks like the "Manage User Scripts" window will be removed in 0.9, because when issue 1086 is implemented the manage window will no longer be needed and will be removed (it already is in this branch)

@erikvold
Copy link
Contributor

erikvold commented Apr 7, 2010

This issue exists for the newscript.xul and install.xul as well, so I thought I'd make a patch for it, here it is.

@arantius
Copy link
Collaborator

For suggested patches, I seem to have not made myself clear. Mac is the only platform for which XXX-W is the "close window" hotkey. No other platform should be affected. Neither Linux or Windows have an XXX-W shortcut standard to mean "close window". On Windows definitely, and most Linuxen by following, it's Alt-F4. That hotkey already works in all cases I've tested.

@erikvold
Copy link
Contributor

Neither Linux or Windows have an XXX-W shortcut standard to mean "close window".

Have you tried the FF downloads window? the addons window? the console window? they all close by ctrl+w on Windows & Linux..

@arantius
Copy link
Collaborator

Good point. Firefox is so inconsistent with when it chooses to act like programs in that OS should, and when it chooses to just do things the same regardless of platform. In that case let's mirror FF, and it's straightforward to use a < key > in the XUL rather than a bunch of JS.
https://developer.mozilla.org/en/XUL/key

@erikvold
Copy link
Contributor

Firefox is so inconsistent with when it chooses to act like programs in that OS should, and when it chooses to just do things the same regardless of platform.

I think it's a good usability feature for power users as well, and I can only guess that is why it was included in some parts of FF in the first place.

it's straightforward to use a in the XUL rather than a bunch of JS.

How do you put conditions on a xul element based on the os that the user is using? so that modifiers="meta" on mac and modifiers="control" otherwise? If you need js then I think the pure js option is better.

@arantius
Copy link
Collaborator

You don't, you use "accel" which performs that logic for you.

https://developer.mozilla.org/en/XUL/key#a-modifiers
accel: The key used for keyboard shortcuts on the user's platform, which is Control on Windows and Linux, and Command on Mac. Usually, this would be the value you would use.

@Ventero
Copy link
Contributor

Ventero commented Apr 13, 2010

Edit: Bah, got ninja'd by erik while posting this and looking up the code :/

Anyway, here's the code the error console etc. are using (shortened):

<commandset>
    <command id="cmd_close" oncommand="close();">
</commandset>
<keyset>
    <key id="key_close" key="w" modifiers="accel" command="cmd_close">
    <key id="key_close2" key="VK_ESCAPE" command="cmd_close">
<keyset>

To see the full code, take a look at the error console's xul file (view-source:chrome://global/content/console.xul).

@erikvold
Copy link
Contributor

you use "accel" which performs that logic for you.

ah cool

Also just for reference, the dialogues I mentioned all use more or less the same approach to implement the Ctrl-W/Escape functionality in their xul-files

also cool

when issue 1086 is implemented the manage window will no longer be needed and will be removed

When issue 1086 is implemented, the manage window will be removed, and the addons window already has this issue taken care of, but there will be a new global options window which I'd like to see the ctrl/cmd-w key (and esc key) close.

I'd also like to see these hotkeys close GM's newscript.xul and install.xul.

Before Ventero's edit he made a good point about how the cmd/ctrl-w & esc hotkeys seems to be a ~standard to close FF sub windows:

So in Firefox, Ctrl-W is more like a "Close tab/dialogue"-hotkey than a "Close window"-hotkey, regardless of the operating system.

He and I spoke on irc, and he also mentioned that ctrl-w doesn't close some windows on Windows, but does work on Linux, like the preferences (or also the about window I noticed) window, but the esc key still works here.

@arantius
Copy link
Collaborator

I've updated the title of this ticket a bit.

In short: Firefox has its own sort of scheme for what keyboard shortcuts should close windows/dialogs. We should make sure we're consistent with that for all windows or dialogs we control.

@erikvold
Copy link
Contributor

Here is my branch for this issue.

@arantius
Copy link
Collaborator

45ae0b4

@erikvold
Copy link
Contributor

erikvold commented Jun 2, 2010

45ae0b4

doesn't remove temporary files when you press ctrl+w on the install window.

@arantius
Copy link
Collaborator

commit 5720130

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants