## 2.7. Unresponsive Windows

While your window system is running, windows may seem to stop responding to commands or mouse clicks. Some or all of the window contents--but not necessarily the window frame itself--may go partly or completely blank. In this case, either a window or the entire window system may be "frozen" or "hung."

The best thing to do in a situation like this is to wait a little while. If the window is showing something from a network, such as a web browser showing a web page from the Internet--or, especially, if the window is from another computer across the network--the cause may be a network delay. If you can wait a minute or two (without pressing extra keys or clicking the mouse around; just wait!) and nothing happens, then it's time to take action. Here are some things to try at that point:

1. Try to find out whether just one window is frozen, or if all windows (and the entire window system) are frozen.

   If you have other windows open, try to use them. For instance, if a text editor is open, try to add a word to the text or use a command from one of its menus. If other windows seem to work normally, you can guess that the problem is only in the one window (or family of windows, from one program) that seems frozen.

   If you don't have other windows open, try to open a new window from the window manager's menu, icons, panel, etc. Try to minimize and maximize that window, move it around the screen, and so on. If this seems to work normally, the trouble is probably in the original frozen window. But, if nothing seems to work, the whole window system may be frozen.

2. Next, handle the frozen window or windows:

   - If just one window is frozen, you'll probably need to kill it. Click the first mouse button on the "close" box in the window's title bar; this box is often an X symbol. In many Unix window managers, clicking that box sends a "close" signal to the window, and it may do the trick. If it doesn't work, click the third mouse button on that box; in some cases, this will send a "destroy" signal to the window. (All this depends on the window manager you're using!) If several windows are frozen, try these techniques on each window.

     If the windows go away, there's still a chance their Unix processes (the running programs) haven't gone away. Or, if the windows don't go away, then there probably are Unix processes left over. So it's best to check for and kill any leftover processes. In Chapter 7, Section 7.3 explains how.

   - If the whole window system is frozen, the computer "underneath" it is probably still running well. Start by trying to close the window system normally from its main menu, with whatever command you normally use. If the whole window system is frozen, that probably won't work.

     The next step is to try to kill your entire X Window System server. You can do this by holding down three keyboard keys at once: CTRL ALT BACKSPACE. If you started the window system from a graphical login, you should see another login box; you can log in again. Or, if you started the window system nongraphically, you should see a shell prompt on your screen; you can repeat the same command (xinit or startx, for instance) that you used to start the window system before.

     If you can't close the window system that way, the last resort is to check for and kill the window system's processes. If you're using a PC operating system such as Linux or NetBSD, try holding down the three keys CTRL ALT F6; if you're lucky, you should get a virtual console with a nongraphical "login:" prompt where you can log in and get a shell prompt. Otherwise, you'll probably have to do a remote login from someone else's computer to yours--and get a shell prompt that way. Once you have a shell prompt, read the directions in Section 7.3, in Chapter 7; look for processes with names similar to your window manager (such as `gnome-session` for GNOME).

If you killed windows, or the whole window system--and you were doing work in any of those windows--any changes you made to a file (in a text editor, for instance) may have been lost. It's best to reopen the window, or the whole window system, and check for damage while whatever happened is still fresh in your mind.

Copyright © 2003 O'Reilly & Associates. All rights reserved.