Every newcomers to X think that servers and clients are reversed because they are

Peter Hutterer peter.hutterer at who-t.net
Wed Apr 20 20:36:47 PDT 2011


On Wed, Apr 20, 2011 at 06:21:05PM -0400, Paul Dufresne wrote:
> I'll try to give a more precise description of  how I imagine things
> works right now, and how I imagine they should work.
> 
> Currently, I believe things goes about like this:
> When you start an X application (that we call the X client), it read

There is no such thing as an "X application". Applications may be X clients
or may be not, or may be in some circumstances, or may be multiple X clients
in one application. Any proces that connects to an X server is an X client,
X has no concept of "applications".

In fact, some processes will open two client connections and the X server
doesn't even know they belong to the same process.

> the $DISPLAY environment string to know the host where the X server it
> should call is.

That is by convention (default Xlib behaviour), not by requirement. It is
perfectly valid for an application to ignore $DISPLAY and hardcode a
connection with Display *dpy = XOpenDisplay("myserver-name");

> It then goes on to connect to this host, asking to speak on the X
> server on this host.
> The X server open a new window that talk to the X application, through
> a new port.

Windows are requested by clients and there are several X clients that do not
open windows (xinput, xsetwacom and synclient being the ones I work with
frequently, there are others).
Windows in X are also not what you may perceive as window. An X "Window" is
a rectangular (ignoring the SHAPE extension) area on the screen that can be
painted into. With a bit of effort on the _client's_ behalf, this window can
be made to look like what you then perceive as window. To X, the window is
still a rectangular area that has been painted into. X has no concepts of
buttons, checkboxes, or _any_ other widgets either, they're purely
client-side.

Cheers,
  Peter

> What I would do:
> -create a new program that I would call the X server. This program
> would have a configuration that would looks like:
> User_Group       Authorized X application
> ----------------      --------------------------------
> secretary        LibreOffice
> programmer  xterm
> owner            xterm
> owner            LibreOffice
> -I would move the code that sits and wait for new clients to connect,
> from what we was calling the X server, to this new X server
> -I would move and modify a bit the code to authenticate, to this new X server
> -I would rename the program we used to call the X server, to be called
> the X Client, and make it be a program similar to xdm
> 
> So after my changes:
> When you would start the X client, you would be asked to enter your
> username, password, and select the X server you want to connect to.
> After connecting and authenticating to the X server with your
> username, the server would send you the list of authorized X
> application you are allowed to run, depending on the user group the
> username is in. Then, for each application you choose to open, the X
> client would open a new window to speak with this X application on a
> new port. It would also send a request to the X server, to request it
> to launch the X application on the host where the X application is.
> 
> Not a very big change... but I guess it does change quite a bit how
> you use the computer.
> _______________________________________________
> xorg at lists.freedesktop.org: X.Org support
> Archives: http://lists.freedesktop.org/archives/xorg
> Info: http://lists.freedesktop.org/mailman/listinfo/xorg
> Your subscription address: peter.hutterer at who-t.net
> 



More information about the xorg mailing list