XorgCtrlAltBackspace

Differences between revisions 56 and 57
Revision 56 as of 2008-12-17 08:51:22
Size: 16928
Editor: pool-71-117-208-23
Comment:
Revision 57 as of 2008-12-18 00:35:32
Size: 5668
Editor: pool-71-117-208-23
Comment:
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
The Ctrl-Alt-Backspace key combination currently "zaps" (hard-restarts) the X server, and thus loses any unsaved data in applications, etc. This key combination is also largely undocumented, so users (probably ex-Windows users) may press this key combination without expecting data loss. This spec proposes to modify how this key combination works such that by default the user must hold the keys for 2 seconds in order for it to take effect. The Ctrl-Alt-Backspace key combination currently "zaps" (hard-restarts) the X server, and thus loses any unsaved data in applications, etc. This key combination is also largely undocumented, so users (probably ex-Windows users) may press this key combination without expecting data loss. This spec proposes to follow upstream's lead and disable this key combination by default in order to prevent this usability issue from occurring in normal installs.
Line 14: Line 14:
The key combination of Ctrl-Alt-Backspace, which previously immediately exited X (and thus reset the graphics system back to the login screen), has been modified to require it to be held for 2 seconds before taking effect. This should help reduce the frequency of unexpected data loss and activity interruption for users unaware of its function that strike it accidentally. The key combination of Ctrl-Alt-Backspace, which previously immediately exited X (and thus reset the graphics system back to the login screen), has been changed to disabled by default. It can be re-enabled by setting the DontZap xorg.conf option to False. This should help reduce the frequency of unexpected data loss and activity interruption for users unaware of its function that strike it accidentally.
Line 18: Line 18:
The key combination of Ctrl-Alt-Backspace terminates the user's current graphical shell, which can cause data loss if invoked accidentally. For some keyboards, backspace is in a location that can lead to accidentally hitting Ctrl-Alt-Backspace when using other Ctrl-Alt- key combinations. This can cause unexpected data loss and workflow interruption. The key combination of Ctrl-Alt-Backspace terminates the user's current graphical shell, which can cause data loss if invoked accidentally. For some keyboards, backspace is in a location that can lead to accidentally hitting Ctrl-Alt-Backspace when using other Ctrl-Alt- key combinations. This can cause unexpected data loss and workflow interruption.  It could also be seen as a form of local denial of service attack when people have access to the keyboard.
Line 20: Line 20:
However, disabling the key combination entirely would not be desirable, as it is an important way for exiting/restarting X that is useful particularly when X has locked up. A pop-up confirmation dialog is also not desirable (or even feasible really), firstly because in one of the main use-cases for the key combo (a stuck Xorg), it's highly likely the window manager could not be depended on to display a dialog, secondly because having a dialog would be an irritant both for accidental and intentional users, and thirdly because the key handling is done deep in the *server*, and "just popping up a dialog" is extremely non-trivial (and probably would be very fragile.) Upstream has recently disabled this key combination by default, for many of the same reasons above. It makes sense for Ubuntu to follow their lead on this change.
Line 22: Line 22:
Making the key combination require being held for a couple seconds seems like a reasonable compromise. Historically, it has been one mechanism for users to exit/restart X. Of course, there are other ways to restart. For "normal" logouts, the logout button on the panel or the ctrl-alt-delete combo is the preferred mechanism, as unlike ctrl-alt-backspace they are designed to shut down apps nicely and give the user several options on how to logout (hibernate, suspend, etc.) Ctrl-alt-delete includes a timeout mechanism so can work even if the display is not visible.

Another use case for ctrl-alt-backspace is to restart a locked up X session. In many of these situations, ctrl-alt-delete will work as well. In some situations where ctrl-alt-delete won't work, neither will ctrl-alt-backspace, and so the power button will be the only recourse. For many non-technical users, the power button will be the most obvious mechanism anyway.

Some users will not prefer this change. For these users, the DontZap option is available in xorg.conf to re-enable it.
Line 28: Line 33:
 * Katie is writing a guide to help people who are used to Windows to migrate over to Ubuntu. She reads the help manuals for inspiration, then later she is experimenting to find similar functionality between the two systems that she can document. She avoids pressing Ctrl-Alt-Backspace and losing the document, which she has not saved yet, because she read in the help manuals that this would lose her work and send her back to the login screen.  * Elisee presses ctrl + alt + left or right to change from one workspace to another, and realizes that he wants to erase what he was writing on his IM program just before switching workspace, and accidentally hits backspace before releasing Ctrl and Alt. Thankfully, this didn't result in X exiting as it used to. He breaths a sigh of relief.
Line 30: Line 35:
 * Joel's computer interface has frozen due to a graphics driver problem. He still has daemons running which need to remain open, so he cannot reboot. He remembered that Ctrl-Alt-Backspace would restart X, and is surprised at first that it doesn't restart immediately but he holds it down just in case, and after a couple seconds X restarts and he's back in business. He's curious why it didn't restart immediately, but after investigating it he learns that he can control the delay in his xorg.conf, but he doesn't mind the new behavior so leaves it as is.  * Joel's computer interface has frozen due to a graphics driver problem. He still has daemons running which need to remain open, so he cannot reboot. He remembered that Ctrl-Alt-Backspace would restart X, and is surprised that it doesn't restart immediately. Instead, he switches to a terminal console and restarts the gdm process and is back in business. After reading up on the change, he decides to re-enable DontZap in his xorg.conf to make things work the way he's accustomed to in the future.
Line 32: Line 37:
 * Elisee presses ctrl + alt + left or right to change from one workspace to another, and realizes that he wants to erase what he was writing on his IM program just before switching workspace, and accidentally hits backspace before releasing Ctrl and Alt. Thankfully, this didn't result in X exiting as it used to. He breaths a sigh of relief.
Line 36: Line 40:
This spec assumes that users do not use the Ctrl-Alt-Backspace functionality regularly, and that those who do will not be terribly inconvenienced by having to hold it for 2 seconds. This spec assumes that users do not use the Ctrl-Alt-Backspace functionality regularly, and that those who do will be able to change it back on in xorg.conf.
Line 38: Line 42:
The implementation section assumes that imposing a delay for the keystroke is doable with the xorg special key handling infrastructure. If not, an alternate design would be to have the user strike the key combo 3 times in sequence.
Line 42: Line 45:
A 2 second delay to the Ctrl-Alt-Backspace key combination will be added to xorg-server. The DontZap option is changed to be True by default.
Line 44: Line 47:
A new 'Zap``Delay``Time' Server``Flag configuration parameter will be added for users to use in xorg.conf to control the delay before terminating the X session. Setting it to 0 will restore the old behavior, where X exits immediately.
Line 48: Line 50:
 * hw/xfree86/parser/xf86tokens.h: add ZAPDELAYTIME token
 * hw/xfree86/common/xf86Privstr.h: add zapDelayTime field
 * hw/xfree86/common/xf86Globals.c: set default value of zapDelayTime to 2
 * hw/xfree86/common/xf86Config.c: add FLAG_ZAPDELAYTIME with call to xf86GetOptValBool()
 * hw/xfree86/parser/Flags.c add to Server``Flags``Tab[] structure and xf86parseFlagsSection(void)'s case statement
 * hw/xfree86/xorgconf.cpp: Add "Zap``Delay``Time" option
 * hw/xfree86/doc/man/Xorg.man.pre man page
 * hw/xfree86/doc/man/xorg.conf.man.pre man page
 * hw/xfree86/utils/xorgconfig/xorgconfig.c xorg.conf template
 * hw/xfree86/common/xf86Events.c: Modify the KEY_BackSpace case branch in xf86CommonSpecialKey so it calls xf86ProcessActionEvent(ACTION_TERMINATE, NULL) only after zapDelayTime's configured time delay.
   * Need to record when the Press action started
   * On subsequent Press or Release actions, compare time to zapDelayTime
   * If Release happens before zapDelayTime, reset the delay timer
 * xkb/xkbActions.c: Ditto changes done to xf86Events.c
1. We simply merge the upstream xserver codebase, with no Ubuntu changes required.

2. We search through our documentation for any instances where we are using ctrl+alt+backspace. We shouldn't be recommending this anywhere.

3. As part of the Xorg.conf Options Editor specification, GUI tools will be implemented that permit re-enabling this. Tools must be available for both GNOME and KDE.
 
Line 65: Line 59:
To test the implementation the keypress should be held for < 2 sec and if nothing happens until time == 2 sec, then it is successful.

The Zap``Delay``Time parameter should be set to several values (0, 5, 100) and verified that the behavior is delayed by that amount of time.
To test the implementation the keypress should be held, and X should not restart.
Line 73: Line 65:
 * A number of people have suggested "just pop up a dialog" out of the assumption that "popup dialogs" == "better user experience" but they do so without giving this much thought. In addition to being unimplementable, imposing a GUI dialog largely breaks the control-alt-backspace use case and leaves remaining users with an irritating UI - instead of one key combo they now would have to also hit additional keys or manipulate the mouse; assuming their keys and mice actually work, they would quickly come to loathe this change. Despite all this, if people ''still'' feel the compromise of adding a delay is insufficient and that the spec is not complete without a GUI popup, then my preference would be to leave the current behavior as-is and just have users self-educate about the key combo. -- bryce

 * While I do understand your point, I think that the delay *might* not be enough. Would have to test, but backspace is one of the very few keys you get to press for several seconds, because you actually want it to erase multiple characters. Having a popup showing up like the ones used for special volume / contrast keys, e.g. no user interaction, only display a warning and disappear quickly without requiring any user action sounds like a very good way of not getting in the way while providing the user with useful warning ("you just release that key now or you're loosing all your unsaved work!!!1"). Not sure it's technically possible of course, would certainly require interfacing with the desktop/window manager. Additionnally, providing a simple GUI way to disable / change delay of the zap behaviour (maybe "consensus rather than configuration" is not the solution in that case - but maybe it is), could prove to be good? Though I understand that if it requires editing xorg.conf, it's a no-go. -- elisee

 * Since people still feel the compromise of adding a delay is insufficient, I'm leaving the current behavior as-is for intrepid. (The preceding unsigned comment was written by BryceHarrington)

 * openSUSE has already solved the XorgCtrlAltBackspace problem in a different way. They have done it by adding a new ZapWarning option, which is enabled by default. When it is enabled, pushing Ctrl+Alt+Bksp once emits a two-second long beep; pushing Ctrl+Alt+Bksp again within two seconds kills Xorg. I have written [[http://thread.gmane.org/gmane.comp.freedesktop.xorg/32263/focus=32334|more about ZapWarning]] on the Xorg list. I don't know if Ubuntu's idea is better or worse than openSUSE's. But IMO their idea is good enough, so in the interest of standardization and making things easier for users, we should adopt their idea. Poll: Who thinks we should adopt ZapWarning for standardization reasons? Who thinks we should use our idea instead? Please vote below. --JasonSpiro

 * Consider changing nothing as an option. First, Ctrl-Alt-Backspace has restarted X for a long time. Changing well established user interfaces is bound to cause annoyance and frustration with the existing user base (even adding the delay). Generally Ctrl-Alt-Backspace is only used when the system is in a bad state and the user is already frustrated. Two seconds may not seem like long in a spec, but when you're sitting there waiting, it can seem like a long time. Second, Ctrl-Alt-Backspace isn't something you can press by accident. It's not a natural key combination nor close to another one, so this should not be a common problem (and to an extent, if the user goes pressing random key combinations, they shouldn't be suprised when something unexpected happens). Finally, this adds complexity at a time when the system is in a bad state already. If X is dead and I need to restart it, I can get back to working much more quickly from an X restart than a complete system restart, so some consideration should be given to not adding complexity here and possibly making it less likey the user actually gets X restarted. (ScottKitterman)

== An alternative solution idea from Andrew Sayers ==

I'm developing an [[https://launchpad.net/remote-help-assistant|assistant]] that helps set up remote desktop sessions over the Internet, so my concern is about security when you give access to a friend who starts fiddling with things he oughtn't to. VNC servers don't provide any easy way to kick the other user out, and zapping the system fits the problem quite nicely - it's fullproof, available by default, and hard for malicious users to disable. I'm actually quite concerned that it's possible to set DontZap at all, because it leaves users with no option short of hitting reset/power off when a friend turns out to be nasty (or just drunk). Having read all of the above, could I suggest the following (comparatively complex) solution:

The X server listens on a Unix socket named something like /var/run/Xorg-zap-:0.0. It accepts the following messages:

 * '''lock''' - Enable ctrl-alt-backspace for as long as the specified client is connected to the socket
 * '''release''' - Release a previous '''lock'''
 * '''enable-default''' - Enable zapping on this server until the next restart
 * '''disable-default''' - Disable zapping on this server until the next restart, except when '''lock'''ed by a client
 * '''enable-messages''' - This client should receive messages from the server over this socket

When '''enable-messages''' is set, the server sends the following messages to the socket:

 * '''enabled''' - Zapping has just gone from disabled to enabled, either by a '''lock''' or '''enable-default'''
 * '''disabled''' - Zapping has just gone from enabled to disabled, either by '''lock'''ed socket bing '''release'''d or closed, or by '''disable-default'''
 * '''wait N''' - ctrl-alt-backspace is being held down, and the system will be zapped in N seconds
 * '''cancel''' - ctrl-alt-backspace has been released

Additionally, the server sends either '''enabled''' or '''disabled''' in response to '''enable-messages''', to notify the client of the initial state of the server.

This would make the following use cases possible:

A VNC server (or remote help assistant) could '''lock''' the server for the duration of the VNC session and hold the socket open with only a few lines of code - in particular, it wouldn't need to bother regularly throwing away input from the socket.

A GNOME applet could listen to messages from the server, and pop a warning message up saying "your computer will restart in N seconds" without making massive architectural changes to X. The idea would be that the window pops up on '''wait''' and goes away on '''cancel''', and is just a warning message rather than a confirmation dialogue. That strikes me as a fairly nice way of notifying users what's happening without interrupting their workflow too much.

A KDE configuration program could get the zapping state of the server, update that state in real time, and allow the user to set the state.

 - AndrewSayers
Line 124: Line 76:


== bof discussion ==
= Decision =
 * Take upstream by default, make a beta release note, then if people complain enough just reenable it
 * Investigate open suse patch if feedback is too negative
 * Search through our documentation for any instances where we are using ctrl+alt+backspace
  - we probably shouldn't be recommending this anywhere
 https://wiki.ubuntu.com/XorgCtrlAltBackspace
 Alberto and Bryce will follow up with Celeste to make sure it works in KDE
 = Current X Upstream =
 * ctrl-alt-backspace disabled by default
 * edit xorg.conf to re-enable
Line 138: Line 77:
= Design Ideas =
 * Martin likes the "multiple times approach"
 * Change it so that you have to hold it down (open Suse style)
 * use a notification to tell users what to do
 * Add a pre-seed to turn it on
 
= Why not to take the default =
 * Many users know it
 * a lot of documentation tells you to do this
 * It's handy
 * There's no UI for it (in Kubuntu)
  - a KDE frontend for Xorg Options Editor is in the plans (hopefully for Jaunty)
  - if the KDe frontend is not completed in time for Jaunty, the current tools
    in system-settings can be patched to use X-Kit and Policykit to enable this
    option
 * Users depend on it for dealing with problems with X
 
= Why to take the default =
 * should encourage cntrl-alt-delete instead
 * Mitigates a denial of service attack when you have access to the keyboard
 * We could just try it, as there is a bit we could swtich back
 
 
2008-12-08 halan: If we want to remove Ctrl+Alt+Backspace we need a more stable X-Server first, where single apps can't lock up the whole screen.

2008-12-10 Owais: I'm against this one. This is the most handy shortcut in Linux. It saves you a reboot every time your X Server misbehaves. Must be documented & promoted to masses.

2008-12-10 François Terrier: I think a rule of thumb for a desktop system should be : 'should never discard any user change without a user confirmation'. If you agree with this, you agree ctrl-alt-backspace should be disabled. I think it's not acceptable for any action that discards user entered information not to ask for a confirmation before doing so, and this one is the worst of all.

2008-12-17 Christoph Burgdof: Im strongly against it. Especially in my earlier days of my linux experience I found that feature quite usefeul because it gave me a save feeling. I still have to use it sometimes when my computer hangs for some reason. Think about it, what else can be done when the x server hangs? Do you really want a beginner to switch to tty and restart the exserver via command? I guess a beginner would now have to completly restart the computer :-(

2008-12-17 tjaalton: You still have the option to change the default in your configuration!

2008-12-17 bryce: Most beginners wouldn't know about ctrl-alt-backspace and would just do a restart anyway.

Please check the status of this specification in Launchpad before editing it. If it is Approved, contact the Assignee or another knowledgeable person before making changes.

Summary

The Ctrl-Alt-Backspace key combination currently "zaps" (hard-restarts) the X server, and thus loses any unsaved data in applications, etc. This key combination is also largely undocumented, so users (probably ex-Windows users) may press this key combination without expecting data loss. This spec proposes to follow upstream's lead and disable this key combination by default in order to prevent this usability issue from occurring in normal installs.

Release Note

The key combination of Ctrl-Alt-Backspace, which previously immediately exited X (and thus reset the graphics system back to the login screen), has been changed to disabled by default. It can be re-enabled by setting the DontZap xorg.conf option to False. This should help reduce the frequency of unexpected data loss and activity interruption for users unaware of its function that strike it accidentally.

Rationale

The key combination of Ctrl-Alt-Backspace terminates the user's current graphical shell, which can cause data loss if invoked accidentally. For some keyboards, backspace is in a location that can lead to accidentally hitting Ctrl-Alt-Backspace when using other Ctrl-Alt- key combinations. This can cause unexpected data loss and workflow interruption. It could also be seen as a form of local denial of service attack when people have access to the keyboard.

Upstream has recently disabled this key combination by default, for many of the same reasons above. It makes sense for Ubuntu to follow their lead on this change.

Historically, it has been one mechanism for users to exit/restart X. Of course, there are other ways to restart. For "normal" logouts, the logout button on the panel or the ctrl-alt-delete combo is the preferred mechanism, as unlike ctrl-alt-backspace they are designed to shut down apps nicely and give the user several options on how to logout (hibernate, suspend, etc.) Ctrl-alt-delete includes a timeout mechanism so can work even if the display is not visible.

Another use case for ctrl-alt-backspace is to restart a locked up X session. In many of these situations, ctrl-alt-delete will work as well. In some situations where ctrl-alt-delete won't work, neither will ctrl-alt-backspace, and so the power button will be the only recourse. For many non-technical users, the power button will be the most obvious mechanism anyway.

Some users will not prefer this change. For these users, the DontZap option is available in xorg.conf to re-enable it.

Use Cases

  • Brian is a relatively new Ubuntu user working on a large image file in the GIMP, but also has Blender open on a different workspace which he used to render the image. Brian wants to close Blender as he is finished with it and needs to free up some memory for the GIMP. He remembers in Windows he could bring up an application list via Ctrl-Alt-Delete, but that doesn't work so he tries pressing Ctrl-Alt-Backspace. The key combination does nothing so he decides to open the System Monitor from the System > Administration menu instead. Once Blender is closed he continues to work on his image in the GIMP, saving it when he is finished.

  • Elisee presses ctrl + alt + left or right to change from one workspace to another, and realizes that he wants to erase what he was writing on his IM program just before switching workspace, and accidentally hits backspace before releasing Ctrl and Alt. Thankfully, this didn't result in X exiting as it used to. He breaths a sigh of relief.
  • Joel's computer interface has frozen due to a graphics driver problem. He still has daemons running which need to remain open, so he cannot reboot. He remembered that Ctrl-Alt-Backspace would restart X, and is surprised that it doesn't restart immediately. Instead, he switches to a terminal console and restarts the gdm process and is back in business. After reading up on the change, he decides to re-enable DontZap in his xorg.conf to make things work the way he's accustomed to in the future.

Assumptions

This spec assumes that users do not use the Ctrl-Alt-Backspace functionality regularly, and that those who do will be able to change it back on in xorg.conf.

Design

The DontZap option is changed to be True by default.

Implementation

1. We simply merge the upstream xserver codebase, with no Ubuntu changes required.

2. We search through our documentation for any instances where we are using ctrl+alt+backspace. We shouldn't be recommending this anywhere.

3. As part of the Xorg.conf Options Editor specification, GUI tools will be implemented that permit re-enabling this. Tools must be available for both GNOME and KDE.

Test/Demo Plan

To test the implementation the keypress should be held, and X should not restart.

Discussion

Previous discussion has been taken into account with this version of the spec, and is archived at XorgCtrlAltBackspace/Discussion.

See also:


CategorySpec

XorgCtrlAltBackspace (last edited 2010-06-12 04:57:24 by dhcp198-158)