Skip to content
Advertisement

In Linux, what piece of software is responsible for drawing the mouse cursor?

As the title states it: what software actually draws the mouse cursor? Is there a programmatic way for modifying the visual appearance?

Advertisement

Answer

The mouse cursor (or mouse pointer) is drawn by the X server. Each application that the cursor moves over may be able to modify the appearance of the mouse cursor.

Since there are different applications and those are built over different toolkits, each could use a different method for changing the cursor’s appearance.

xterm uses the X library for manipulating this:

xterm may choose a cursor-font which is small enough to hide the mouse pointer, but the X server continues to “draw” it.

Like other applications, xterm may also use cursor themes, which (in desktop systems such as GNOME, KDE, XFCE), may be configured in a desktop-settings.

But ultimately it is the X server which draws the mouse cursor. The application does not have to do anything to allow it to move around the screen. Rather, each application listens for X events to keep track of the mouse cursor.

Further reading:

Advertisement