What are the differences between XDefaultScreen and XDefaultScreenOfDisplay?

StackOverflow https://stackoverflow.com/questions/23154955

  •  05-07-2023
  •  | 
  •  

Pergunta

What are the differences between XDefaultScreen and XDefaultScreenOfDisplay? I can see they respectively return an integer and a struct pointer, but:

  • What are those return values used for?
  • When would you choose one over the other?
  • Why are there 2 functions anyway?
Foi útil?

Solução

  • XDefaultScreen (usually called by the macro DefaultScreen) returns the screen number which is used in most xlib functions where you want to specify a screen e.g. DefaultGC.

  • XDefaultScreenOfDisplay (usually called by the macro DefaultScreenOfDisplay) returns a Screen pointer and is generally used when you want to find out information about a screen e.g. WidthOfScreen.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top