Does an X client necessarily need a window manager to work?

No, you don't need to be running a window manager to allow an X client to work. Some systems provide an option to just run a terminal at startup, and from that you can start additional programs, including window managers. Some kiosk setups which only want one application to run don't need a window manager. Some implementations of X for microsoft windows avoid an X window manager by letting the OS manage the windows.

Without a window manager you typically need to specify the geometry to the programs so you don't have everything placed in the top left corner.

In X, the window manager is just another X client. This was unusual at the time, but made it easy to have different window managers.

Another way to look at the question is to observe that you can change window managers on the fly, so there is a time between the first one stopping and the second one taking control, but as all your applications don't crash they must be able to work without.


No. Well written apps don't need a window manager.

But some "modern" broken apps will not work fine without a window manager (eg. firefox and its address bar suggestions which won't drop down [1]).

Many other subpar apps not only assume a window manager, but to add insult to injury, a click to focus window manager. For instance, it used to be that any java app will simply steal the focus on startup.

If you want to test, install Xephyr (a "nested" X11 server), run it with Xephyr :1, and then start your apps with DISPLAY=:1 in their environment.

[1] the "awesome bar" of Firefox won't open its suggestions pane when typed into or clicked on the history button unless there's a window manager running. The auto-hide menu won't work either.


A window manager is a convenience for users.

In the good^Wbad old days, I used to have a ~/.Xclients file that read:

#!/bin/sh

HOST=`uname -n | sed 's/\..*$//'`

xv -root -rmode 5 $HOME/misc/millennium/theme/Wallpaper.gif -quit &

xterm -geometry 80x24+0+85 \#52x71-104+0 -n $HOST -T $HOST &
xterm -geometry 80x24+510+429 \#52x71-52+0  -n $HOST -T $HOST &
xclock -digital -update 1 -geometry +1059+982 &
xscreensaver -nosplash &
exec /usr/local/lib/X11/fvwm/fvwm

This file would be run when I started X with startx. When this script finishes then the X server will shut down.

Note the last line: exec .../fvwm. This is the line that started my window manager (fvwm). All the previous applications (xv, xterm, xclock, xscreensaver) were running before the window manager started. Because the call to fvwm was the last line and not put in the background it meant that when fvwm terminated then X would close down.

The X startup even had a "fall back" default... if there were no configuration files then start X with a single xterm running. Closing that xterm would end the X session.