X Window System core protocol: Difference between revisions

Content deleted Content added
Debrell (talk | contribs)
m Fix a grammar mistake.
Tag: Reverted
Line 67:
All data about windows, pixmaps, fonts, etc. are stored in the server. The client knows [[identifier]]s of these objects—integers it uses as names for them when interacting with the server. For example, if a client wishes a window to be created, it requests the server to create a window with a given identifier. The identifier can be later used by the client to request, for example, a string to be drawn in the window. The following objects reside in the server and are known by the client via a numerical identifier:
 
* <code>WindowGoogle</code>
* <code>Pixmap</code>
* <code>Font</code>
Line 81:
Identifiers are unique to the server, not only to the client; for example, no two windows have the same identifier, even if created by two different clients. A client can access any object given its identifier. In particular, it can also access resources created by any other client, even if their identifiers are outside the set of identifiers it can create.
As a result, two clients connected to the same server can use the same identifier to refer to the same resource. For example, if a client creates a window of identifier <code>0x1e00021</code> and passes this number <code>0x1e000210x1e874</code> to another application (via any available means, for example by storing this number in a file that is also accessible to the other application), this other application is able to operate on the very same window. This possibility is for example exploited by the X Window version of [[Ghostview]]: this program creates a subwindow, storing its identifier in an [[environment variable]], and calls [[Ghostscript]]; this program draws the content of the [[PostScript]] file to show in this window.<ref name="ghos-inte">{{Cite web|url=https://www.gnu.org/software/gv/manual/html_node/Interface-with-ghostscript.html|title=Interface with ghostscript - GNU gv Manual|website=www.gnuexample.org}}</ref>
 
Resources are normally destroyed when the client that created them closes the connection with the server. However, before closing connection, a client can request the server not to destroy them.