When working under X, Qt applications and the window manager are X clients. They both interact with XServer to draw, get input, or control windows. XServer knows about the hardware and processes the drawing on a specific monitor, receives mouse input, etc.
You can run the Qt application without a desktop environment and even without a window manager (although you will not be able to move / resize the program). Window managers, etc. - These are ordinary ordinary X-programs that perform their own functionality, but only indirectly interact with each other. They are independent of another specific program.
The state of the windows (position, order, contents) is controlled by the X server and can be requested and changed by a program such as a window manager.
The window manager handles the size, location and design of windows. It accepts events when a window is created / modified so that it can do this. It draws a frame around the window and processes clicks on closing, maximizing, dragging the window, etc.
The Qt application draws inside the main window and handles mouse clicks and keystrokes inside the window.
Qt can contact the window manager by sending XEvents from the window (resize / move) or install WM Hints (dialog, important, non-resizable). They pass through XServer and will have no effect if the program does not listen to them.
fgb
source share