简体   繁体   中英

NSWindow. What is window server and window device?

I'm reading documentation for NSWindow initialization and this is what it tells about one of the initialization parameters named flag :

Specifies whether the window server creates a window device for the window immediately

And I have no idea what on Earth a window server and a window device are. Googling doesn't help. Can anybody please provide an explanation?

The window server is the graphical interface you see in macOS. It runs on top of Darwin. It draws the desktop and manages the resources and events the graphical interface uses.

I believe the window context refers to the interface between the hardware and software. For example the window server uses Core Graphics to display windows and its views on screen or a printer. When it says "Specifies whether the window server creates a window device for the window immediately" it will wait to put the window into the window hierarchy, by the window server, until it is actually displayed on screen. Without a window device, no render calls can be performed.

You can read some more about windows, in the apple documentation archive under Window Programming Guide . It is still relevant even though it was written some time ago.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM