Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does screen number and display number mean in Xlib?

Tags:

xlib

For example, the foobar:0.1 would specify screen 1 of display 0 on the machine named foobar.

But what does screen number and display number of X server mean in Xlib?

Does it mean that an X server can have many displays, and a display can have many screens, and a screen can have many windows?

like image 302
Kevin Dong Avatar asked Dec 08 '22 06:12

Kevin Dong


1 Answers

"Display" in xlib / x11 protocol terminology is one single connection between client and X server.

"Screen" is actual screen, but things get more complicated here. Each screen has its own root window ( and some more associated properties - physical width/heights, DPI etc ). Because every window on the screen is child of that root window, you can't just move window from one screen to another (all child windows under X11 always clipped by parent). This is one of the reason multiple "screens" as in your question almost never used - most people have multiple monitors configured to be part of one X11 screen using Xinerama/RANDR extensions

To summarise: one display - one connection (if over network, to a port 6000 + display number). Each screen - it's own root window. One client is allowed to have more than one connection to X ( and thus use multiple Display instances )

like image 117
Andrey Sidorov Avatar answered Jan 12 '23 23:01

Andrey Sidorov