summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeron Johnson <deron.johnson@sun.com>2004-12-09 21:01:10 +0000
committerDeron Johnson <deron.johnson@sun.com>2004-12-09 21:01:10 +0000
commiteec742427895a8df19c0d41cf55728402cefa5a7 (patch)
tree2be2f67fa8d4d7241a32d3ecf12fa45a1e395efe
parent0787972b64b35614a7b09fa1b2197e446b237f98 (diff)
Merged branch lg3d-event into branch lg3d-dev-0-6-1. Assorted bug fixes and
clean up for lg3d-x11-dev-0.6.1.8.
-rw-r--r--Xext/shm.c26
-rw-r--r--Xext/xevie.c26
-rw-r--r--Xprint/doc/Xprt.html115
-rw-r--r--Xprint/doc/Xprt.man.pre196
-rw-r--r--Xprint/doc/Xprt.sgml371
-rw-r--r--composite/compalloc.c2
-rwxr-xr-xdamageext/damageext.c27
-rw-r--r--dix/dispatch.c148
-rw-r--r--dix/events.c500
-rw-r--r--hw/xfree86/common/xf86Xinput.c21
-rw-r--r--mi/miwindow.c35
-rw-r--r--miext/cw/cw.c22
-rwxr-xr-xxfixes/cursor.c41
13 files changed, 1348 insertions, 182 deletions
diff --git a/Xext/shm.c b/Xext/shm.c
index 29eab06f5..7293d5b7a 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -69,6 +69,10 @@ in this Software without prior written authorization from The Open Group.
#include "modinit.h"
+#ifdef LG3D
+#include "lgeint.h"
+#endif /* LG3D */
+
typedef struct _ShmDesc {
struct _ShmDesc *next;
int shmid;
@@ -447,11 +451,22 @@ ProcShmAttach(client)
* do manual checking of access rights for the credentials
* of the client */
- if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) {
- shmdt(shmdesc->addr);
- xfree(shmdesc);
- return BadAccess;
+#ifdef LG3D
+ /*
+ ** Skip this access check when talking to the display server.
+ ** TODO: POSSIBLE SECURITY HOLE: make sure that only the
+ ** actual LG Display Server can ever set this.
+ */
+ if (!lgeDisplayServerIsAlive) {
+#endif /* LG3D */
+ if (shm_access(client, &(buf.shm_perm), stuff->readOnly) == -1) {
+ shmdt(shmdesc->addr);
+ xfree(shmdesc);
+ return BadAccess;
+ }
+#ifdef LG3D
}
+#endif /* LG3D */
shmdesc->shmid = stuff->shmid;
shmdesc->refcnt = 1;
@@ -1229,6 +1244,9 @@ SProcShmCreatePixmap(client)
REQUEST(xShmCreatePixmapReq);
swaps(&stuff->length, n);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
+#ifdef LG3D
+ swapl(&stuff->pid, n);
+#endif /* LG3D */
swapl(&stuff->drawable, n);
swaps(&stuff->width, n);
swaps(&stuff->height, n);
diff --git a/Xext/xevie.c b/Xext/xevie.c
index b024a622a..ed755f10c 100644
--- a/Xext/xevie.c
+++ b/Xext/xevie.c
@@ -127,6 +127,11 @@ int ProcQueryVersion (client)
rep.sequence_number = client->sequence;
rep.server_major_version = XEVIE_MAJOR_VERSION;
rep.server_minor_version = XEVIE_MINOR_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequence_number, n);
+ swapl(&rep.server_major_version, n);
+ swapl(&rep.server_minor_version, n);
+ }
WriteToClient (client, sizeof (xXevieQueryVersionReply), (char *)&rep);
return client->noClientException;
}
@@ -153,7 +158,11 @@ int ProcStart (client)
return BadAccess;
rep.type = X_Reply;
+ rep.length = 0;
rep.sequence_number = client->sequence;
+ if (client->swapped) {
+ swaps(&rep.sequence_number, n);
+ }
WriteToClient (client, sizeof (xXevieStartReply), (char *)&rep);
return client->noClientException;
}
@@ -163,11 +172,16 @@ int ProcEnd (client)
register ClientPtr client;
{
xXevieEndReply rep;
+ register int n;
XevieEnd(xevieClientIndex);
rep.type = X_Reply;
+ rep.length = 0;
rep.sequence_number = client->sequence;
+ if (client->swapped) {
+ swaps(&rep.sequence_number, n);
+ }
WriteToClient (client, sizeof (xXevieEndReply), (char *)&rep);
return client->noClientException;
}
@@ -181,10 +195,15 @@ int ProcSend (client)
xEvent *xE;
OsCommPtr oc;
static unsigned char lastDetail = 0, lastType = 0;
+ register int n;
xE = (xEvent *)&stuff->event;
rep.type = X_Reply;
+ rep.length = 0;
rep.sequence_number = client->sequence;
+ if (client->swapped) {
+ swaps(&rep.sequence_number, n);
+ }
WriteToClient (client, sizeof (xXevieSendReply), (char *)&rep);
switch(xE->u.u.type) {
@@ -216,10 +235,15 @@ int ProcSelectInput (client)
{
REQUEST (xXevieSelectInputReq);
xXevieSelectInputReply rep;
+ register int n;
xevieMask = (long)stuff->event_mask;
rep.type = X_Reply;
+ rep.length = 0;
rep.sequence_number = client->sequence;
+ if (client->swapped) {
+ swaps(&rep.sequence_number, n);
+ }
WriteToClient (client, sizeof (xXevieSelectInputReply), (char *)&rep);
return client->noClientException;
}
@@ -308,7 +332,7 @@ int SProcSelectInput (client)
REQUEST (xXevieSelectInputReq);
swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE (xXevieSendReq);
+ REQUEST_AT_LEAST_SIZE (xXevieSelectInputReq);
swapl(&stuff->event_mask, n);
return ProcSelectInput (client);
}
diff --git a/Xprint/doc/Xprt.html b/Xprint/doc/Xprt.html
new file mode 100644
index 000000000..f84a3c134
--- /dev/null
+++ b/Xprint/doc/Xprt.html
@@ -0,0 +1,115 @@
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Xprt</title><meta name="generator" content="DocBook XSL Stylesheets V1.62.4"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="Xprt"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>Name</h2><p>Xprt &#8212; Print server for X Version 11</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><tt class="command">Xprt</tt> [<tt class="option">-ac</tt>] [<tt class="option">-audit <i class="replaceable"><tt>level</tt></i></tt>] [<tt class="option">-pn</tt>] [<tt class="option">-fp <i class="replaceable"><tt>fontpath</tt></i></tt>] [<tt class="option">-XpFile <i class="replaceable"><tt>file</tt></i></tt>] [<tt class="option">-XpSpoolerType <i class="replaceable"><tt>spoolername</tt></i></tt>] [<tt class="option">:<i class="replaceable"><tt>display</tt></i></tt>]</p></div></div><div class="refsect1" lang="en"><a name="id2804962"></a><h2>DESCRIPTION</h2><p><span><b class="command">Xprt</b></span> is the Xprint print server
+ for version 11 of the X Window system for non display devices
+ such as printers and fax machines.</p><p>Xprint is an advanced printing system which enables X11
+ applications to use devices like printers, FAX or create
+ documents in formats like PostScript, PCL or PDF. It may be used by
+ clients such as <span class="application">mozilla</span>.
+ </p><p>Xprint is a very flexible, extensible, scaleable, client/server
+ print system based on ISO 10175 (and some other specs) and the X11
+ rendering protocol.
+ Using Xprint an application can search, query and use devices like
+ printers, FAX machines or create documents in formats like PDF.
+ In particular, an application can seek a printer, query supported
+ attributes (like paper size, trays, fonts etc.), configure the printer
+ device to match it's needs and print on it like on any other X device
+ reusing parts of the code which is used for the video card Xserver.
+ </p></div><div xmlns:ns1="" class="refsect1" lang="en"><a name="id2805117"></a><h2>USAGE</h2><p>
+ Although Xprt may be invoked from the command line, it is
+ preferable to run it as a daemon via the init script
+ <tt class="filename">/etc/init.d/xprint</tt> (where this script exists).
+ </p><p>Client programs such as mozilla will require environment
+ variable <tt class="envar">${XPSERVERLIST}</tt> to be set, identifying the
+ &quot;display&quot; on which Xprt is running. This variable may be set
+ for all users via <tt class="filename">/etc/profile</tt> (or similar), using
+ <b class="userinput"><tt>/etc/init.d/xprint get_xpserverlist</tt></b>:
+ </p><div class="informalexample"><pre class="programlisting">export XPSERVERLIST=`/etc/init.d/xprint get_xpserverlist`</pre></div></div><div class="refsect1" lang="en"><a name="id2805150"></a><h2>OPTIONS</h2><p>Many of Xprt's command line options are shared in common
+ with the usual X servers (see <span class="citerefentry"><span class="refentrytitle">Xserver</span>(1x)</span>).
+ Commonly used options include:</p><div class="variablelist"><dl><dt><span class="term"><tt class="option">:<i class="replaceable"><tt>display</tt></i></tt></span></dt><dd><p> The X server runs on the given display. If multiple X
+ servers are to run simultaneously on a host, each must
+ have a unique display number. Note that the standard X
+ server (for video displays) typically runs on display
+ :0. If <tt class="filename">/etc/init.d/xprint</tt> is used
+ to invoke Xprt, it may be configured to automatically assign an available
+ display number.</p></dd><dt><span class="term"><tt class="option">-ac</tt></span></dt><dd><p>disables host-based access control mechanisms. Enables access
+ by any host, and permits any host to modify the access control
+ list. Use with extreme caution. This option exists primarily
+ for running test suites remotely.</p></dd><dt><span class="term"><tt class="option">-audit <i class="replaceable"><tt>level</tt></i></tt></span></dt><dd><p>sets the audit trail level. The default level is 1, meaning
+ only connection rejections are reported. Level 2 additionally
+ reports all successful connections and disconnects. Level 4
+ enables messages from the SECURITY extension, if present,
+ including generation and revocation of authorizations and
+ violations of the security policy. Level 0 turns off the audit
+ trail. Audit lines are sent as standard error output.</p></dd><dt><span class="term"><tt class="option">-fp <i class="replaceable"><tt>fontpath</tt></i></tt></span></dt><dd><p>sets the search path for fonts. This path is a comma
+ separated list of directories which Xprt searches for
+ font databases.</p></dd><dt><span class="term"><tt class="option">-pn</tt></span></dt><dd><p>permits the server to continue running if it fails to
+ establish all of its well-known sockets (connection
+ points for clients), but establishes at least
+ one.</p></dd><dt><span class="term"><tt class="option">-XpFile <i class="replaceable"><tt>file</tt></i></tt></span></dt><dd><p>Sets an altername Xprinters file (see section FILES).</p></dd><dt><span class="term"><tt class="option">-XpSpoolerType <i class="replaceable"><tt>spoolername</tt></i></tt></span></dt><dd xmlns:ns2=""><p>
+ Defines the spooler system to be used for print job spooling.
+ Supported values in xprint.mozdev.org release 009 are:
+ </p><table class="simplelist" border="0" summary="Simple list"><tr><td>aix</td></tr><tr><td>aix4</td></tr><tr><td>bsd</td></tr><tr><td>osf</td></tr><tr><td>solaris</td></tr><tr><td>sysv</td></tr><tr><td>uxp</td></tr><tr><td>cups</td></tr><tr><td>lprng</td></tr><tr><td>other</td></tr><tr><td>none</td></tr></table><p>
+ (multiple values can be specified, seperated by ':', the first active spooler will be chosen).
+ The default value is platform-specific and can be obtained via
+ </p><pre class="programlisting">Xprt -h</pre><p>.
+ </p></dd></dl></div></div><div xmlns:ns3="" class="refsect1" lang="en"><a name="id2805336"></a><h2>ENVIRONMENT</h2><p>
+ The following environment variables are recognized by the X print server
+ (environment variables recognized by Xprint clients are described in
+ <span class="citerefentry"><span class="refentrytitle">Xprint</span>(7)</span>):
+
+ </p><div class="variablelist"><dl><dt><span class="term"><tt class="envar">${XPCONFIGDIR}</tt></span></dt><dd><p> This environment variable points to the root
+ of the Xprint server configuration directory hierarchy.
+ If the variable is not defined, the default
+ path is be assumed. The default path may be
+ <tt class="filename">/usr/X11R6/lib/X11/xserver/</tt>,
+ <tt class="filename">/usr/lib/X11/xserver/</tt>,
+ <tt class="filename">/usr/share/Xprint/xserver/</tt> or
+ <tt class="filename">/usr/openwin/server/etc/XpConfig</tt>, depending on the
+ system, and may be configured in <tt class="filename">/etc/init.d/xprint</tt>.</p></dd><dt><span class="term"><tt class="envar">${LANG}</tt></span></dt><dd><p>
+ This environment variable selects the locale settings used by the Xprint server.
+ Xprt allows language-specific settings (stored in <tt class="filename">${XPCONFIGDIR}/${LANG}/print/</tt>)
+ which will override the default settings (stored in <tt class="filename">${XPCONFIGDIR}/C/print/</tt>).
+ If <tt class="envar">${LANG}</tt> is not set &quot;C&quot; is assumed.
+ </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2805421"></a><h2>FILES</h2><div class="variablelist"><dl><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/${LANG}/print/Xprinters</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/Xprinters</tt></span></dt><dd><p>
+ `Xprinters' is the top most configuration file. It tells
+ Xprt which specific printer names (e.g. mylaser) should
+ be supported, and whether <span class="citerefentry"><span class="refentrytitle">lpstat</span>(1)</span> or other commands
+ should be used to automatically supplement the list of
+ printers.
+ </p></dd><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/${LANG}/print/attributes/printer</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/attributes/printer</tt></span></dt><dd><p>
+ The `printer' file maps printer names to model
+ configurations (see `model-config' below). For example,
+ &quot;mylaser&quot; could be mapped to a &quot;HPDJ1600C&quot;, and all other
+ arbitrary printers could be mapped to a default, such as
+ &quot;HPLJ4SI&quot;. When depending on <span class="citerefentry"><span class="refentrytitle">lpstat</span>(1)</span> in the Xprinters
+ file, setting up defaults in `printer' becomes all the
+ more important.
+ </p></dd><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/${LANG}/print/attributes/document</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/attributes/document</tt></span></dt><dd><p>
+ The `document' file specifies the initial document values
+ for any print jobs. For example, which paper tray to
+ use, what default resolution, etc.
+ </p></dd><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/${LANG}/print/attributes/job</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/attributes/job</tt></span></dt><dd><p>
+ The `job' file specifies the initial job values for any
+ print jobs. For example, &quot;notification-profile&quot; can be
+ set so that when a print job is successfully sent to a
+ printer, e-mail is sent to the user.
+ </p></dd><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/models/PSdefault/model-config</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/models/PSdefault/fonts/fonts.dir</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00051.pmf</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00093.pmf</tt></span></dt><dd><p>
+ The `model-config' file has attributes that describe the
+ printer model's capabilities and default settings.
+ Printer model fonts may also be present. The model-config
+ file also identifies the print ddx driver to be used.
+
+ For each printer model supported, a complete hierarchy of
+ files should exist. In most cases, these files do not
+ need to be modified.
+ </p></dd><dt><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/ddx-config/raster/pdf</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/ddx-config/raster/pcl</tt>, </span><span class="term"><tt class="filename">${XPCONFIGDIR}/C/print/ddx-config/raster/postscript</tt></span></dt><dd><p>
+ The print ddx drivers can have highly specific
+ configuration files to control their behavior. In most
+ cases, these files do not need to be modified.
+ </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2805584"></a><h2>SEE ALSO</h2><p><span class="simplelist"><span class="citerefentry"><span class="refentrytitle">Xprint</span>(7)</span>, <span class="citerefentry"><span class="refentrytitle">X11</span>(7)</span>, <span class="citerefentry"><span class="refentrytitle">xplsprinters</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xprehashprinterlist</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xphelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpxmhelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpawhelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpxthelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">xpsimplehelloworld</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">Xserver</span>(1x)</span>, <span class="citerefentry"><span class="refentrytitle">libXp</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">libXprintUtils</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">libXprintAppUtils</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">XmPrintShell</span>(3x)</span>, <span class="citerefentry"><span class="refentrytitle">XawPrintShell</span>(3x)</span>, Xprint FAQ (<a href="http://xprint.mozdev.org/docs/Xprint_FAQ.html" target="_top">http://xprint.mozdev.org/docs/Xprint_FAQ.html</a>), Xprint main site (<a href="http://xprint.mozdev.org/" target="_top">http://xprint.mozdev.org/</a>)</span></p></div><div class="refsect1" lang="en"><a name="id2805757"></a><h2>AUTHORS</h2><p>
+ This manual page was written by
+ Drew Parsons <tt class="email">&lt;<a href="mailto:dparsons@debian.org">dparsons@debian.org</a>&gt;</tt> and
+ Roland Mainz <tt class="email">&lt;<a href="mailto:roland.mainz@nrubsig.org">roland.mainz@nrubsig.org</a>&gt;</tt>,
+ with some help from the man page at
+ <a href="http://www.sins.com.au/unix/manpages/Xprt.html" target="_top">http://www.sins.com.au/unix/manpages/Xprt.html</a> and the XFree86
+ man page for <span class="citerefentry"><span class="refentrytitle">Xserver</span>(1)</span>.
+ </p></div></div></body></html>
diff --git a/Xprint/doc/Xprt.man.pre b/Xprint/doc/Xprt.man.pre
new file mode 100644
index 000000000..7599a1344
--- /dev/null
+++ b/Xprint/doc/Xprt.man.pre
@@ -0,0 +1,196 @@
+.\" -*- coding: us-ascii -*-
+.TH Xprt __appmansuffix__ "25 November 2004"
+.SH NAME
+Xprt \- Print server for X Version 11
+.SH SYNOPSIS
+.ad l
+\fBXprt\fR \kx
+.if (\nxu > (\n(.lu / 2)) .nr x (\n(.lu / 5)
+'in \n(.iu+\nxu
+[\fB\-ac\fR] [\fB\-audit \fBlevel\fR\fR] [\fB\-pn\fR] [\fB\-fp \fBfontpath\fR\fR] [\fB\-XpFile \fBfile\fR\fR] [\fB\-XpSpoolerType \fBspoolername\fR\fR] [\fB:\fBdisplay\fR\fR]
+'in \n(.iu-\nxu
+.ad b
+.SH DESCRIPTION
+Xprt is the Xprint print server
+for version 11 of the X Window system for non display devices
+such as printers and fax machines.
+.PP
+Xprint is an advanced printing system which enables X11
+applications to use devices like printers, FAX or create
+documents in formats like PostScript, PCL or PDF. It may be used by
+clients such as mozilla.
+.PP
+Xprint is a very flexible, extensible, scaleable, client/server
+print system based on ISO 10175 (and some other specs) and the X11
+rendering protocol.
+Using Xprint an application can search, query and use devices like
+printers, FAX machines or create documents in formats like PDF.
+In particular, an application can seek a printer, query supported
+attributes (like paper size, trays, fonts etc.), configure the printer
+device to match it's needs and print on it like on any other X device
+reusing parts of the code which is used for the video card Xserver.
+.SH USAGE
+Although Xprt may be invoked from the command line, it is
+preferable to run it as a daemon via the init script
+\fB/etc/init.d/xprint\fR (where this script exists).
+.PP
+Client programs such as mozilla will require environment
+variable \fB${XPSERVERLIST}\fR to be set, identifying the
+"display" on which Xprt is running. This variable may be set
+for all users via \fB/etc/profile\fR (or similar), using
+\fB/etc/init.d/xprint get_xpserverlist\fR:
+
+.nf
+export XPSERVERLIST=`/etc/init.d/xprint get_xpserverlist`
+.fi
+
+.SH OPTIONS
+Many of Xprt's command line options are shared in common
+with the usual X servers (see \fBXserver\fR(__appmansuffix__)).
+Commonly used options include:
+.TP
+\fB:\fIdisplay\fB\fR
+The X server runs on the given display. If multiple X
+servers are to run simultaneously on a host, each must
+have a unique display number. Note that the standard X
+server (for video displays) typically runs on display
+:0. If \fB/etc/init.d/xprint\fR is used
+to invoke Xprt, it may be configured to automatically assign an available
+display number.
+.TP
+\fB\-ac\fR
+disables host-based access control mechanisms. Enables access
+by any host, and permits any host to modify the access control
+list. Use with extreme caution. This option exists primarily
+for running test suites remotely.
+.TP
+\fB\-audit \fIlevel\fB\fR
+sets the audit trail level. The default level is 1, meaning
+only connection rejections are reported. Level 2 additionally
+reports all successful connections and disconnects. Level 4
+enables messages from the SECURITY extension, if present,
+including generation and revocation of authorizations and
+violations of the security policy. Level 0 turns off the audit
+trail. Audit lines are sent as standard error output.
+.TP
+\fB\-fp \fIfontpath\fB\fR
+sets the search path for fonts. This path is a comma
+separated list of directories which Xprt searches for
+font databases.
+.TP
+\fB\-pn\fR
+permits the server to continue running if it fails to
+establish all of its well-known sockets (connection
+points for clients), but establishes at least
+one.
+.TP
+\fB\-XpFile \fIfile\fB\fR
+Sets an altername Xprinters file (see section FILES).
+.TP
+\fB\-XpSpoolerType \fIspoolername\fB\fR
+Defines the spooler system to be used for print job spooling.
+Supported values in xprint.mozdev.org release 009 are:
+
+aix
+
+aix4
+
+bsd
+
+osf
+
+solaris
+
+sysv
+
+uxp
+
+cups
+
+lprng
+
+other
+
+none
+
+(multiple values can be specified, seperated by ':', the first active spooler will be chosen).
+The default value is platform-specific and can be obtained via
+
+.nf
+Xprt \-h
+.fi
+
+\&.
+.SH ENVIRONMENT
+The following environment variables are recognized by the X print server
+(environment variables recognized by Xprint clients are described in
+\fBXprint\fR(__miscmansuffix__)):
+.TP
+\fB${XPCONFIGDIR}\fR
+This environment variable points to the root
+of the Xprint server configuration directory hierarchy.
+If the variable is not defined, the default
+path is be assumed. The default path may be
+\fB/usr/X11R6/lib/X11/xserver/\fR,
+\fB/usr/lib/X11/xserver/\fR,
+\fB/usr/share/Xprint/xserver/\fR or
+\fB/usr/openwin/server/etc/XpConfig\fR, depending on the
+system, and may be configured in \fB/etc/init.d/xprint\fR.
+.TP
+\fB${LANG}\fR
+This environment variable selects the locale settings used by the Xprint server.
+Xprt allows language-specific settings (stored in \fB${XPCONFIGDIR}/${LANG}/print/\fR)
+which will override the default settings (stored in \fB${XPCONFIGDIR}/C/print/\fR).
+If \fB${LANG}\fR is not set "C" is assumed.
+.PP
+.SH FILES
+.TP
+\fB${XPCONFIGDIR}/${LANG}/print/Xprinters\fR, \fB${XPCONFIGDIR}/C/print/Xprinters\fR
+`Xprinters' is the top most configuration file. It tells
+Xprt which specific printer names (e.g. mylaser) should
+be supported, and whether \fBlpstat\fR(1) or other commands
+should be used to automatically supplement the list of
+printers.
+.TP
+\fB${XPCONFIGDIR}/${LANG}/print/attributes/printer\fR, \fB${XPCONFIGDIR}/C/print/attributes/printer\fR
+The `printer' file maps printer names to model
+configurations (see `model-config' below). For example,
+"mylaser" could be mapped to a "HPDJ1600C", and all other
+arbitrary printers could be mapped to a default, such as
+"HPLJ4SI". When depending on \fBlpstat\fR(1) in the Xprinters
+file, setting up defaults in `printer' becomes all the
+more important.
+.TP
+\fB${XPCONFIGDIR}/${LANG}/print/attributes/document\fR, \fB${XPCONFIGDIR}/C/print/attributes/document\fR
+The `document' file specifies the initial document values
+for any print jobs. For example, which paper tray to
+use, what default resolution, etc.
+.TP
+\fB${XPCONFIGDIR}/${LANG}/print/attributes/job\fR, \fB${XPCONFIGDIR}/C/print/attributes/job\fR
+The `job' file specifies the initial job values for any
+print jobs. For example, "notification-profile" can be
+set so that when a print job is successfully sent to a
+printer, e-mail is sent to the user.
+.TP
+\fB${XPCONFIGDIR}/C/print/models/PSdefault/model\-config\fR, \fB${XPCONFIGDIR}/C/print/models/PSdefault/fonts/fonts.dir\fR, \fB${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00051.pmf\fR, \fB${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00093.pmf\fR
+The `model-config' file has attributes that describe the
+printer model's capabilities and default settings.
+Printer model fonts may also be present. The model-config
+file also identifies the print ddx driver to be used.
+For each printer model supported, a complete hierarchy of
+files should exist. In most cases, these files do not
+need to be modified.
+.TP
+\fB${XPCONFIGDIR}/C/print/ddx\-config/raster/pdf\fR, \fB${XPCONFIGDIR}/C/print/ddx\-config/raster/pcl\fR, \fB${XPCONFIGDIR}/C/print/ddx\-config/raster/postscript\fR
+The print ddx drivers can have highly specific
+configuration files to control their behavior. In most
+cases, these files do not need to be modified.
+.SH "SEE ALSO"
+\fBXprint\fR(__miscmansuffix__), \fBX11\fR(__miscmansuffix__), \fBxplsprinters\fR(__appmansuffix__), \fBxprehashprinterlist\fR(__appmansuffix__), \fBxphelloworld\fR(__appmansuffix__), \fBxpxmhelloworld\fR(__appmansuffix__), \fBxpawhelloworld\fR(__appmansuffix__), \fBxpxthelloworld\fR(__appmansuffix__), \fBxpsimplehelloworld\fR(__appmansuffix__), \fBXserver\fR(__appmansuffix__), \fBlibXp\fR(__libmansuffix__), \fBlibXprintUtils\fR(__libmansuffix__), \fBlibXprintAppUtils\fR(__libmansuffix__), \fBXmPrintShell\fR(__libmansuffix__), \fBXawPrintShell\fR(__libmansuffix__), Xprint FAQ (http://xprint.mozdev.org/docs/Xprint_FAQ.html), Xprint main site (http://xprint.mozdev.org/)
+.SH AUTHORS
+This manual page was written by
+Drew Parsons <dparsons@debian.org> and
+Roland Mainz <roland.mainz@nrubsig.org>,
+with some help from the man page at
+http://www.sins.com.au/unix/manpages/Xprt.html and the XFree86
+man page for \fBXserver\fR(1).
diff --git a/Xprint/doc/Xprt.sgml b/Xprint/doc/Xprt.sgml
new file mode 100644
index 000000000..0ffa39fcb
--- /dev/null
+++ b/Xprint/doc/Xprt.sgml
@@ -0,0 +1,371 @@
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" 'http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd'>
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+ page: 'docbook-to-man manpage.sgml > manpage.1'. You may view
+ the manual page with: 'docbook-to-man manpage.sgml | nroff -man | less'.
+ A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+ docbook-to-man $< > $@
+
+HTML generation can be done like this:
+% xsltproc ==docbook /usr/share/sgml/docbook/docbook-xsl-stylesheets-1.60.1/html/docbook.xsl Xprint.sgml >Xprint.html
+ -->
+
+<refentry id="Xprt">
+ <refmeta>
+ <refentrytitle>Xprt</refentrytitle>
+ <manvolnum>__appmansuffix__</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>Xprt</refname>
+
+ <refpurpose>Print server for X Version 11</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>Xprt</command>
+
+ <arg><option>-ac</option></arg>
+
+ <arg><option>-audit <replaceable>level</replaceable></option></arg>
+
+ <arg><option>-pn</option></arg>
+
+ <arg><option>-fp <replaceable>fontpath</replaceable></option></arg>
+
+ <arg><option>-XpFile <replaceable>file</replaceable></option></arg>
+
+ <arg><option>-XpSpoolerType <replaceable>spoolername</replaceable></option></arg>
+
+ <arg><option>:<replaceable>display</replaceable></option></arg>
+
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+
+ <para><command>Xprt</command> is the Xprint print server
+ for version 11 of the X Window system for non display devices
+ such as printers and fax machines.</para>
+
+ <para>Xprint is an advanced printing system which enables X11
+ applications to use devices like printers, FAX or create
+ documents in formats like PostScript, PCL or PDF. It may be used by
+ clients such as <application>mozilla</application>.
+ </para>
+
+ <para>Xprint is a very flexible, extensible, scaleable, client/server
+ print system based on ISO 10175 (and some other specs) and the X11
+ rendering protocol.
+ Using Xprint an application can search, query and use devices like
+ printers, FAX machines or create documents in formats like PDF.
+ In particular, an application can seek a printer, query supported
+ attributes (like paper size, trays, fonts etc.), configure the printer
+ device to match it's needs and print on it like on any other X device
+ reusing parts of the code which is used for the video card Xserver.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>USAGE</title>
+
+ <para>
+ Although Xprt may be invoked from the command line, it is
+ preferable to run it as a daemon via the init script
+ <filename>/etc/init.d/xprint</filename> (where this script exists).
+ </para>
+
+ <para>Client programs such as mozilla will require environment
+ variable <envar>${XPSERVERLIST}</envar> to be set, identifying the
+ "display" on which Xprt is running. This variable may be set
+ for all users via <filename>/etc/profile</filename> (or similar), using
+ <userinput>/etc/init.d/xprint get_xpserverlist</userinput>:
+ <informalexample>
+ <programlisting>export XPSERVERLIST=`/etc/init.d/xprint get_xpserverlist`</programlisting>
+ </informalexample>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>OPTIONS</title>
+
+ <para>Many of Xprt's command line options are shared in common
+ with the usual X servers (see <citerefentry><refentrytitle>Xserver</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry>).
+ Commonly used options include:</para>
+
+ <variablelist>
+ <varlistentry>
+ <term><option>:<replaceable>display</replaceable></option>
+ </term>
+ <listitem>
+ <para> The X server runs on the given display. If multiple X
+ servers are to run simultaneously on a host, each must
+ have a unique display number. Note that the standard X
+ server (for video displays) typically runs on display
+ :0. If <filename>/etc/init.d/xprint</filename> is used
+ to invoke Xprt, it may be configured to automatically assign an available
+ display number.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-ac</option>
+ </term>
+ <listitem>
+ <para>disables host-based access control mechanisms. Enables access
+ by any host, and permits any host to modify the access control
+ list. Use with extreme caution. This option exists primarily
+ for running test suites remotely.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-audit <replaceable>level</replaceable></option>
+ </term>
+ <listitem>
+ <para>sets the audit trail level. The default level is 1, meaning
+ only connection rejections are reported. Level 2 additionally
+ reports all successful connections and disconnects. Level 4
+ enables messages from the SECURITY extension, if present,
+ including generation and revocation of authorizations and
+ violations of the security policy. Level 0 turns off the audit
+ trail. Audit lines are sent as standard error output.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-fp <replaceable>fontpath</replaceable></option>
+ </term>
+ <listitem>
+ <para>sets the search path for fonts. This path is a comma
+ separated list of directories which Xprt searches for
+ font databases.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-pn</option>
+ </term>
+ <listitem>
+ <para>permits the server to continue running if it fails to
+ establish all of its well-known sockets (connection
+ points for clients), but establishes at least
+ one.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-XpFile <replaceable>file</replaceable></option>
+ </term>
+ <listitem>
+ <para>Sets an altername Xprinters file (see section FILES).</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-XpSpoolerType <replaceable>spoolername</replaceable></option>
+ </term>
+ <listitem>
+ <para>
+ Defines the spooler system to be used for print job spooling.
+ Supported values in xprint.mozdev.org release 009 are:
+ <simplelist type="vert">
+ <member>aix</member>
+ <member>aix4</member>
+ <member>bsd</member>
+ <member>osf</member>
+ <member>solaris</member>
+ <member>sysv</member>
+ <member>uxp</member>
+ <member>cups</member>
+ <member>lprng</member>
+ <member>other</member>
+ <member>none</member>
+ </simplelist>
+ (multiple values can be specified, seperated by ':', the first active spooler will be chosen).
+ The default value is platform-specific and can be obtained via
+ <programlisting>Xprt -h</programlisting>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>ENVIRONMENT</title>
+ <para>
+ The following environment variables are recognized by the X print server
+ (environment variables recognized by Xprint clients are described in
+ <citerefentry><refentrytitle>Xprint</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry>):
+
+ <variablelist>
+ <varlistentry>
+ <term><envar>${XPCONFIGDIR}</envar></term>
+ <listitem>
+ <para> This environment variable points to the root
+ of the Xprint server configuration directory hierarchy.
+ If the variable is not defined, the default
+ path is be assumed. The default path may be
+ <filename>/usr/X11R6/lib/X11/xserver/</filename>,
+ <filename>/usr/lib/X11/xserver/</filename>,
+ <filename>/usr/share/Xprint/xserver/</filename> or
+ <filename>/usr/openwin/server/etc/XpConfig</filename>, depending on the
+ system, and may be configured in <filename>/etc/init.d/xprint</filename>.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><envar>${LANG}</envar></term>
+ <listitem>
+ <para>
+ This environment variable selects the locale settings used by the Xprint server.
+ Xprt allows language-specific settings (stored in <filename>${XPCONFIGDIR}/${LANG}/print/</filename>)
+ which will override the default settings (stored in <filename>${XPCONFIGDIR}/C/print/</filename>).
+ If <envar>${LANG}</envar> is not set "C" is assumed.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>FILES</title>
+
+ <variablelist>
+ <varlistentry>
+ <term><filename>${XPCONFIGDIR}/${LANG}/print/Xprinters</filename></term>
+ <term><filename>${XPCONFIGDIR}/C/print/Xprinters</filename></term>
+ <listitem>
+ <para>
+ `Xprinters' is the top most configuration file. It tells
+ Xprt which specific printer names (e.g. mylaser) should
+ be supported, and whether <citerefentry><refentrytitle>lpstat</refentrytitle><manvolnum>1</manvolnum></citerefentry> or other commands
+ should be used to automatically supplement the list of
+ printers.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><filename>${XPCONFIGDIR}/${LANG}/print/attributes/printer</filename></term>
+ <term><filename>${XPCONFIGDIR}/C/print/attributes/printer</filename></term>
+ <listitem>
+ <para>
+ The `printer' file maps printer names to model
+ configurations (see `model-config' below). For example,
+ "mylaser" could be mapped to a "HPDJ1600C", and all other
+ arbitrary printers could be mapped to a default, such as
+ "HPLJ4SI". When depending on <citerefentry><refentrytitle>lpstat</refentrytitle><manvolnum>1</manvolnum></citerefentry> in the Xprinters
+ file, setting up defaults in `printer' becomes all the
+ more important.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><filename>${XPCONFIGDIR}/${LANG}/print/attributes/document</filename></term>
+ <term><filename>${XPCONFIGDIR}/C/print/attributes/document</filename></term>
+ <listitem>
+ <para>
+ The `document' file specifies the initial document values
+ for any print jobs. For example, which paper tray to
+ use, what default resolution, etc.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><filename>${XPCONFIGDIR}/${LANG}/print/attributes/job</filename></term>
+ <term><filename>${XPCONFIGDIR}/C/print/attributes/job</filename></term>
+ <listitem>
+ <para>
+ The `job' file specifies the initial job values for any
+ print jobs. For example, "notification-profile" can be
+ set so that when a print job is successfully sent to a
+ printer, e-mail is sent to the user.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><filename>${XPCONFIGDIR}/C/print/models/PSdefault/model-config</filename></term>
+ <term><filename>${XPCONFIGDIR}/C/print/models/PSdefault/fonts/fonts.dir</filename></term>
+ <term><filename>${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00051.pmf</filename></term>
+ <term><filename>${XPCONFIGDIR}/C/print/models/PSdefault/fonts/9nb00093.pmf</filename></term>
+
+ <listitem>
+ <para>
+ The `model-config' file has attributes that describe the
+ printer model's capabilities and default settings.
+ Printer model fonts may also be present. The model-config
+ file also identifies the print ddx driver to be used.
+
+ For each printer model supported, a complete hierarchy of
+ files should exist. In most cases, these files do not
+ need to be modified.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><filename>${XPCONFIGDIR}/C/print/ddx-config/raster/pdf</filename></term>
+ <term><filename>${XPCONFIGDIR}/C/print/ddx-config/raster/pcl</filename></term>
+ <term><filename>${XPCONFIGDIR}/C/print/ddx-config/raster/postscript</filename></term>
+
+ <listitem>
+ <para>
+ The print ddx drivers can have highly specific
+ configuration files to control their behavior. In most
+ cases, these files do not need to be modified.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <simplelist type="inline">
+ <!-- specific references -->
+ <!-- none -->
+
+ <!-- Xprint general references -->
+ <member><citerefentry><refentrytitle>Xprint</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>X11</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>xplsprinters</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>xprehashprinterlist</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>xphelloworld</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>xpxmhelloworld</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>xpawhelloworld</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>xpxthelloworld</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>xpsimplehelloworld</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>Xserver</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
+<!--
+ <member><citerefentry><refentrytitle>Xprt</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
+-->
+ <!-- ToDO: Add manual pages for the single Xprint DDX implementations (PostScript/PDF/PCL/PCL-MONO/Raster/etc.) -->
+ <member><citerefentry><refentrytitle>libXp</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>libXprintUtils</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>libXprintAppUtils</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>XmPrintShell</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>XawPrintShell</refentrytitle><manvolnum>__libmansuffix__</manvolnum></citerefentry></member>
+ <member>Xprint FAQ (<ulink url="http://xprint.mozdev.org/docs/Xprint_FAQ.html">http://xprint.mozdev.org/docs/Xprint_FAQ.html</ulink>)</member>
+ <member>Xprint main site (<ulink url="http://xprint.mozdev.org/">http://xprint.mozdev.org/</ulink>)</member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>AUTHORS</title>
+ <para>
+ This manual page was written by
+ Drew Parsons <email>dparsons@debian.org</email> and
+ Roland Mainz <email>roland.mainz@nrubsig.org</email>,
+ with some help from the man page at
+ <ulink url="http://www.sins.com.au/unix/manpages/Xprt.html">http://www.sins.com.au/unix/manpages/Xprt.html</ulink> and the XFree86
+ man page for <citerefentry><refentrytitle>Xserver</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
+ </para>
+ </refsect1>
+</refentry>
+
+
+
diff --git a/composite/compalloc.c b/composite/compalloc.c
index 1be762fee..f6ad6a8e5 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -507,7 +507,7 @@ compAllocPixmap (WindowPtr pWin)
cw->damageRegistered = TRUE;
}
-#ifdef LG3D
+#ifdef xLG3D
/*
** Applications which use shaped windows (e.g. xeyes) don't
** always clear the entire backing pixmap. We should clear the
diff --git a/damageext/damageext.c b/damageext/damageext.c
index 6be869bec..52af7c57d 100755
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -67,6 +67,10 @@ lgeTryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
Mask filter, GrabPtr grab);
#endif /* LG3D */
+/*
+int numevent = 0;
+*/
+
static void
DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
{
@@ -76,6 +80,17 @@ DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
xDamageNotifyEvent ev;
int i;
+#ifdef LG3D
+ /*
+ ** Force damage events to go to the damage grabbing client rather
+ ** than the client who created the damage record.
+ */
+ if (lgeDisplayServerIsAlive && lgeGrabDamageEventsClient != NULL) {
+ pClient = lgeGrabDamageEventsClient;
+
+ }
+#endif /* LG3D */
+
UpdateCurrentTimeIf ();
ev.type = DamageEventBase + XDamageNotify;
ev.level = pDamageExt->level;
@@ -98,10 +113,14 @@ DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
ev.area.y = pBoxes[i].y1;
ev.area.width = pBoxes[i].x2 - pBoxes[i].x1;
ev.area.height = pBoxes[i].y2 - pBoxes[i].y1;
+/*
+ErrorF("Construct DamageNotify event %d: xywh = %d, %d, %d, %d\n",
+ ++numevent, ev.area.x, ev.area.y, ev.area.width, ev.area.height);
+*/
if (!pClient->clientGone) {
#ifdef LG3D
if (lgeDisplayServerIsAlive) {
- if (lgeTryClientEvents (NULL, (xEvent *) &ev, 1, 0, 0, NULL) == 0) {
+ if (lgeTryClientEvents (pClient, (xEvent *) &ev, 1, 0, 0, NULL) == 0) {
ErrorF("DamageExtNotify: warning: call to lgeTryWriteEventsToClients failed.\n");
ErrorF("Couldn't deliver DamageNotify event.\n");
}
@@ -120,10 +139,14 @@ DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
ev.area.y = 0;
ev.area.width = pDrawable->width;
ev.area.height = pDrawable->height;
+/*
+ErrorF("Construct DamageNotify event %d: xywh = %d, %d, %d, %d\n",
+ ++numevent, ev.area.x, ev.area.y, ev.area.width, ev.area.height);
+*/
if (!pClient->clientGone) {
#ifdef LG3D
if (lgeDisplayServerIsAlive) {
- if (lgeTryClientEvents (NULL, (xEvent *) &ev, 1, 0, 0, NULL) == 0) {
+ if (lgeTryClientEvents (pClient, (xEvent *) &ev, 1, 0, 0, NULL) == 0) {
ErrorF("DamageExtNotify: warning: call to lgeTryWriteEventsToClients failed.\n");
ErrorF("Couldn't deliver DamageNotify event.\n");
}
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 08d523441..ae203f07c 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.4 2004/07/29 18:43:58 stukreit Exp $ */
+/* $XdotOrg: xc/programs/Xserver/dix/dispatch.c,v 1.5.8.1 2004/12/09 18:59:51 deronj Exp $ */
/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */
/************************************************************
@@ -78,6 +78,138 @@ Equipment Corporation.
/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.32 2003/11/10 18:21:45 tsi Exp $ */
+#if defined(LG3D) && defined(DISPATCH_DEBUG)
+int printprocs = 0;
+int proc_num = 0;
+
+typedef char *ProcNameString;
+
+static ProcNameString procNames[] = {
+"",
+"CreateWindow",
+"ChangeWindowAttributes",
+"GetWindowAttributes",
+"DestroyWindow",
+"DestroySubwindows",
+"ChangeSaveSet",
+"ReparentWindow",
+"MapWindow",
+"MapSubwindows",
+"UnmapWindow",
+"UnmapSubwindows",
+"ConfigureWindow",
+"CirculateWindow",
+"GetGeometry",
+"QueryTree",
+"InternAtom",
+"GetAtomName",
+"ChangeProperty",
+"DeleteProperty",
+"GetProperty",
+"ListProperties",
+"SetSelectionOwner",
+"GetSelectionOwner",
+"ConvertSelection",
+"SendEvent",
+"GrabPointer",
+"UngrabPointer",
+"GrabButton",
+"UngrabButton",
+"ChangeActivePointerGrab",
+"GrabKeyboard",
+"UngrabKeyboard",
+"GrabKey",
+"UngrabKey",
+"AllowEvents",
+"GrabServer",
+"UngrabServer",
+"QueryPointer",
+"GetMotionEvents",
+"TranslateCoords",
+"WarpPointer",
+"SetInputFocus",
+"GetInputFocus",
+"QueryKeymap",
+"OpenFont",
+"CloseFont",
+"QueryFont",
+"QueryTextExtents",
+"ListFonts",
+"ListFontsWithInfo",
+"SetFontPath",
+"GetFontPath",
+"CreatePixmap",
+"FreePixmap",
+"CreateGC",
+"ChangeGC",
+"CopyGC",
+"SetDashes",
+"SetClipRectangles",
+"FreeGC",
+"ClearArea",
+"CopyArea",
+"CopyPlane",
+"PolyPoint",
+"PolyLine",
+"PolySegment",
+"PolyRectangle",
+"PolyArc",
+"FillPoly",
+"PolyFillRectangle",
+"PolyFillArc",
+"PutImage",
+"GetImage",
+"PolyText8",
+"PolyText16",
+"ImageText8",
+"ImageText16",
+"CreateColormap",
+"FreeColormap",
+"CopyColormapAndFree",
+"InstallColormap",
+"UninstallColormap",
+"ListInstalledColormaps",
+"AllocColor",
+"AllocNamedColor",
+"AllocColorCells",
+"AllocColorPlanes",
+"FreeColors",
+"StoreColors",
+"StoreNamedColor",
+"QueryColors",
+"LookupColor",
+"CreateCursor",
+"CreateGlyphCursor",
+"FreeCursor",
+"RecolorCursor",
+"QueryBestSize",
+"QueryExtension",
+"ListExtensions",
+"ChangeKeyboardMapping",
+"GetKeyboardMapping",
+"ChangeKeyboardControl",
+"GetKeyboardControl",
+"Bell",
+"ChangePointerControl",
+"GetPointerControl",
+"SetScreenSaver",
+"GetScreenSaver",
+"ChangeHosts",
+"ListHosts",
+"SetAccessControl",
+"SetCloseDownMode",
+"KillClient",
+"RotateProperties",
+"ForceScreenSaver",
+"SetPointerMapping",
+"GetPointerMapping",
+"SetModifierMapping",
+"GetModifierMapping"
+};
+
+#define NUM_PROC_NAMES (sizeof(procNames)/sizeof(char*))
+#endif /* LG3D && DISPATCH_DEBUG */
+
#ifdef PANORAMIX_DEBUG
#include <stdio.h>
int ProcInitialConnection();
@@ -449,6 +581,20 @@ Dispatch(void)
client->requestLog[client->requestLogIndex] = MAJOROP;
client->requestLogIndex++;
#endif
+
+#if defined(LG3D) && defined(DISPATCH_DEBUG)
+ if (printprocs) {
+ char *procName;
+ if (MAJOROP >= NUM_PROC_NAMES) {
+
+ procName = "Unknown";
+ } else {
+ procName = procNames[MAJOROP];
+ }
+ ErrorF("dispatcher: %d, client = %d, op = %d (%s)\n", ++proc_num, client->index, MAJOROP, procName);
+ }
+#endif /* LG3D && DISPATCH_DEBUG */
+
if (result > (maxBigRequestSize << 2))
result = BadLength;
else
diff --git a/dix/events.c b/dix/events.c
index d4a9b082e..c549e8828 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.6.4.1 2004/09/16 23:37:22 deronj Exp $ */
+/* $XdotOrg: xc/programs/Xserver/dix/events.c,v 1.6.4.1.4.1 2004/12/09 18:59:51 deronj Exp $ */
/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.51 2004/01/12 17:04:52 tsi Exp $ */
/************************************************************
@@ -151,11 +151,21 @@ xEvent *xeviexE;
#include "dispatch.h"
#ifdef LG3D
+
+/* Enable one or the other, but not both */
+#undef LG3D_EVENT_TEST_LATENCY
+#undef LG3D_EVENT_TEST_THROUGHPUT
+
#include "damagewire.h"
#include "../Xext/lgeint.h"
extern int lgeTryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
Mask filter, GrabPtr grab);
+extern WindowPtr XYToSubWindow (WindowPtr pWin, int x, int y,
+ int *xWinRel, int *yWinRel);
+
+extern Bool PointInBorderSize(WindowPtr pWin, int x, int y);
+
#endif /* LG3D */
#define EXTENSION_EVENT_BASE 64
@@ -331,33 +341,6 @@ static CARD8 criticalEvents[32] =
0x7c /* key and button events */
};
-#ifdef LG3D
-
-#define LG3D_DECLARE_WINDOW() \
- WindowPtr pEventWin = NULL
-
-#define LG3D_GET_WINDOW(e) \
- if ((e) != NULL) { \
- pEventWin = (WindowPtr) LookupIDByType((e)->u.keyButtonPointer.event, RT_WINDOW); \
- }
-
-/*
-** In LG Event Mode the sprite hotspot is calculated by taking the
-** event window local coordinates and converting them to screen
-** absolute.
-**
-*/
-#define LG3D_CALC_SPRITE_HOTXY(e) \
- sprite.hot.x = (e)->u.keyButtonPointer.rootX; \
- sprite.hot.y = (e)->u.keyButtonPointer.rootY;
-
-extern WindowPtr XYToSubWindow (WindowPtr pWin, int x, int y,
- int *xWinRel, int *yWinRel);
-
-extern Bool PointInBorderSize(WindowPtr pWin, int x, int y);
-
-#endif /* LG3D */
-
#ifdef PANORAMIX
static void ConfineToShape(RegionPtr shape, int *px, int *py);
@@ -498,19 +481,8 @@ XineramaCheckVirtualMotion(
if (qe)
{
sprite.hot.pScreen = qe->pScreen; /* should always be Screen 0 */
-#ifdef LG3D
- if (lgeDisplayServerIsAlive) {
- LG3D_DECLARE_WINDOW();
- LG3D_GET_WINDOW(qe->event);
- LG3D_CALC_SPRITE_HOTXY(qe->event);
- } else {
- sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
- sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
- }
-#else
sprite.hot.x = qe->event->u.keyButtonPointer.rootX;
sprite.hot.y = qe->event->u.keyButtonPointer.rootY;
-#endif /* LG3D */
pWin = inputInfo.pointer->grab ? inputInfo.pointer->grab->confineTo :
NullWindow;
}
@@ -678,14 +650,18 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents)
static void
XineramaChangeToCursor(CursorPtr cursor)
{
+#ifndef LG3D
if (cursor != sprite.current)
{
+#endif /* ! LG3D */
if ((sprite.current->bits->xhot != cursor->bits->xhot) ||
(sprite.current->bits->yhot != cursor->bits->yhot))
XineramaCheckPhysLimits(cursor, FALSE);
(*sprite.screen->DisplayCursor)(sprite.screen, cursor);
sprite.current = cursor;
+#ifndef LG3D
}
+#endif /* ! LG3D */
}
@@ -913,8 +889,10 @@ ChangeToCursor(CursorPtr cursor)
}
#endif
+#ifndef LG3D
if (cursor != sprite.current)
{
+#endif /* ! LG3D */
if ((sprite.current->bits->xhot != cursor->bits->xhot) ||
(sprite.current->bits->yhot != cursor->bits->yhot))
CheckPhysLimits(cursor, FALSE, sprite.confined,
@@ -922,7 +900,9 @@ ChangeToCursor(CursorPtr cursor)
(*sprite.hotPhys.pScreen->DisplayCursor) (sprite.hotPhys.pScreen,
cursor);
sprite.current = cursor;
+#ifndef LG3D
}
+#endif /* ! LG3D */
}
/* returns true if b is a descendent of a */
@@ -957,6 +937,7 @@ PostNewCursor(void)
}
else
win = sprite.win;
+
for (; win; win = win->parent)
if (win->optional && win->optional->cursor != NullCursor)
{
@@ -1123,8 +1104,7 @@ lgeTryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask,
destination = lgeDSCaresAboutEvent (pEvents, &win);
- if (client == NULL /* For XDamageNotify */ ||
- (destination != SEND_TO_NORMAL_CLIENT && win == lgeGrabAllWindowEvents.window)) {
+ if (destination != SEND_TO_NORMAL_CLIENT && win == lgeGrabAllWindowEvents.window) {
/*
** Send events to grabbing client client. Use a null grab pointer
** in order to sure that the event isn't eaten by any grabs; we want
@@ -1637,6 +1617,7 @@ ProcAllowEvents(client)
REQUEST_SIZE_MATCH(xAllowEventsReq);
time = ClientTimeToServerTime(stuff->time);
+
switch (stuff->mode)
{
case ReplayPointer:
@@ -1965,20 +1946,50 @@ MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient)
return 2;
}
+#ifdef LG3D
+
+/* Returns True if the event occurred above a 3D object rather than a native window */
+#define EVENT_IS_3D(e) \
+ ((e)->u.keyButtonPointer.event == lgeDisplayServerPRW)
+
+/*
+TODO: it's not clear whether this routine deals with grabs properly.
+Must handle the following cases:
+ 2D event grabbed and forced to go to 2D win
+ 2D event grabbed and forced to go to 3D win
+ 3D event grabbed and forced to go to 2D win
+ 3D event grabbed and forced to go to 3D win
+*/
+
static void
-FixUpEventFromWindow(
+lgeFixUpEventFromWindow(
xEvent *xE,
WindowPtr pWin,
Window child,
Bool calcChild)
{
-#ifdef LG3D
- Bool isMouseEvent = FALSE;
- Window mouseEventWinPrev = 0;
-#endif /* LG3D */
+ Window eventWindowOld;
+
+ /*
+ ErrorF("Enter FixUpEventFromWindow, event type = %d\n", xE->u.u.type);
+ if (EVENT_IS_3D(xE)) {
+ ErrorF("Event is 3D\n");
+ } else {
+ ErrorF("Event is 2D\n");
+ }
+ ErrorF("old event window = %d\n", XE_KBPTR.event);
+ ErrorF("old child window = %d\n", XE_KBPTR.child);
+ ErrorF("old eventxy = %d, %d\n", XE_KBPTR.eventX, XE_KBPTR.eventY);
+ */
+
+ /* TODO: This is merely an optimization; it is no longer functionally necessary */
+ if (EVENT_IS_3D(xE)) {
+ calcChild = False;
+ }
if (calcChild)
{
+ /*ErrorF("Calculating child\n");*/
WindowPtr w=spriteTrace[spriteTraceGood-1];
/* If the search ends up past the root should the child field be
set to none or should the value in the argument be passed
@@ -1988,7 +1999,7 @@ FixUpEventFromWindow(
while (w)
{
/* If the source window is same as event window, child should be
- none. Don't bother going all all the way back to the root. */
+ none. Don't bother going all all the way back to the root. */
if (w == pWin)
{
@@ -2005,93 +2016,112 @@ FixUpEventFromWindow(
}
}
XE_KBPTR.root = ROOT->drawable.id;
-#ifdef LG3D
- if (xE->u.u.type == ButtonPress ||
- xE->u.u.type == ButtonRelease ||
- xE->u.u.type == MotionNotify) {
- isMouseEvent = TRUE;
- mouseEventWinPrev = XE_KBPTR.event;
+
+ /* Set event field (only for non-3D events) */
+ if (!EVENT_IS_3D(xE)) {
+ eventWindowOld = XE_KBPTR.event;
+ XE_KBPTR.event = pWin->drawable.id;
+ /*ErrorF("new event window = %d\n", XE_KBPTR.event);*/
+ }
+
+ if (sprite.hot.pScreen != pWin->drawable.pScreen)
+ {
+ XE_KBPTR.sameScreen = xFalse;
+ XE_KBPTR.child = None;
+ XE_KBPTR.eventX = 0;
+ XE_KBPTR.eventY = 0;
+ return;
}
- if (lgeDisplayServerIsAlive &&
- XE_KBPTR.event == lgeDisplayServerPRW) {
+ XE_KBPTR.sameScreen = xTrue;
+
+ /* Set various fields (only for non-3D events) */
+ if (!EVENT_IS_3D(xE)) {
+
+ XE_KBPTR.child = child;
+ /*ErrorF("new child window = %d\n", XE_KBPTR.child);*/
/*
- ** Event is going to the PRW.
- ** Button and motion events already have the event
- ** window field set.
+ ** The only events needing fixup at this point are mouse events
+ ** where the event window has been changed.
*/
- if (!isMouseEvent) {
- XE_KBPTR.event = pWin->drawable.id;
+ if ((xE->u.u.type == ButtonPress ||
+ xE->u.u.type == ButtonRelease ||
+ xE->u.u.type == MotionNotify) &&
+ eventWindowOld != XE_KBPTR.event) {
+
+ /* TODO: it would be good to avoid a resource lookup here. Some sort of
+ caching might optimize this */
+ WindowPtr pOuterWin = (WindowPtr) LookupIDByType(eventWindowOld, RT_WINDOW);
+ if (pOuterWin == NULL) {
+ ErrorF("Error: FixupEventFromWindow: outer window %d, not found. No XY fix up occuring.\n",
+ eventWindowOld);
+ } else {
+ /*
+ ** Make the event coords relative to the destination window
+ ** instead of relative to the outer window.
+ */
+ XE_KBPTR.eventX -= pWin->drawable.x - pOuterWin->drawable.x;
+ XE_KBPTR.eventY -= pWin->drawable.y - pOuterWin->drawable.y;
+ /*ErrorF("new eventxy = %d, %d", XE_KBPTR.eventX, XE_KBPTR.eventY);*/
+ }
}
+ }
+}
- } else {
- /*
- ** Non-LG event mode or the event is going to an
- ** X application window. Need to set the event window
- ** field to the destination window.
- */
- XE_KBPTR.event = pWin->drawable.id;
+#endif /* LG3D */
+
+static void
+FixUpEventFromWindow(
+ xEvent *xE,
+ WindowPtr pWin,
+ Window child,
+ Bool calcChild)
+{
+#ifdef LG3D
+ if (lgeDisplayServerIsAlive) {
+ lgeFixUpEventFromWindow(xE, pWin, child, calcChild);
+ return;
}
-#else
- XE_KBPTR.event = pWin->drawable.id;
#endif /* LG3D */
+
+ if (calcChild)
+ {
+ WindowPtr w=spriteTrace[spriteTraceGood-1];
+ /* If the search ends up past the root should the child field be
+ set to none or should the value in the argument be passed
+ through. It probably doesn't matter since everyone calls
+ this function with child == None anyway. */
+
+ while (w)
+ {
+ /* If the source window is same as event window, child should be
+ none. Don't bother going all all the way back to the root. */
+
+ if (w == pWin)
+ {
+ child = None;
+ break;
+ }
+
+ if (w->parent == pWin)
+ {
+ child = w->drawable.id;
+ break;
+ }
+ w = w->parent;
+ }
+ }
+ XE_KBPTR.root = ROOT->drawable.id;
+ XE_KBPTR.event = pWin->drawable.id;
if (sprite.hot.pScreen == pWin->drawable.pScreen)
{
XE_KBPTR.sameScreen = xTrue;
XE_KBPTR.child = child;
-#ifdef LG3D
- if (lgeDisplayServerIsAlive) {
- if (XE_KBPTR.event == lgeDisplayServerPRW) {
- /*
- ** Event is going to the PRW.
- ** Button and motion events already have the event
- ** XY fields set.
- */
- if (!isMouseEvent) {
- XE_KBPTR.eventX = XE_KBPTR.rootX;
- XE_KBPTR.eventY = XE_KBPTR.rootY;
- }
- } else {
- /*
- ** Event is going to an X application
- ** window. Need to set the window relative event XY for
- ** ALL event types.
- **
- ** TODO: I don't think this code deals very well with grab cases,
- */
- if (!isMouseEvent || mouseEventWinPrev == pWin->drawable.id) {
- /*
- ** A non-button/motion event (e.g. keypress or enter/leave)
- ** or the event occurred in a top-level window.
- ** Do nothing. The event coords are already correct.
- */
- } else {
- /* TODO: it would be good to avoid a resource lookup here */
- WindowPtr pOuterWin = (WindowPtr) LookupIDByType(mouseEventWinPrev, RT_WINDOW);
- if (pOuterWin == NULL) {
- ErrorF("Error: FixupEventFromWindow: outer window %d, not found. No XY fix up occuring.\n", mouseEventWinPrev);
- } else {
- /*
- ** Make the event coords relative to the destination window
- ** instead of relative to the outer window.
- */
- XE_KBPTR.eventX -= pWin->drawable.x - pOuterWin->drawable.x;
- XE_KBPTR.eventY -= pWin->drawable.y - pOuterWin->drawable.y;
- }
- }
- }
- } else {
- /* Non-LG event mode */
- XE_KBPTR.eventX = XE_KBPTR.rootX - pWin->drawable.x;
- XE_KBPTR.eventY = XE_KBPTR.rootY - pWin->drawable.y;
- }
-#else
XE_KBPTR.eventX =
XE_KBPTR.rootX - pWin->drawable.x;
XE_KBPTR.eventY =
XE_KBPTR.rootY - pWin->drawable.y;
-#endif /* LG3D */
}
else
{
@@ -2304,12 +2334,6 @@ static Bool
CheckMotion(xEvent *xE)
{
WindowPtr prevSpriteWin = sprite.win;
-#ifdef LG3D
- LG3D_DECLARE_WINDOW();
- if (lgeDisplayServerIsAlive) {
- LG3D_GET_WINDOW(xE);
- }
-#endif /* LG3D */
#ifdef PANORAMIX
if(!noPanoramiXExtension)
@@ -2323,17 +2347,8 @@ CheckMotion(xEvent *xE)
sprite.hot.pScreen = sprite.hotPhys.pScreen;
ROOT = WindowTable[sprite.hot.pScreen->myNum];
}
-#ifdef LG3D
- if (lgeDisplayServerIsAlive) {
- LG3D_CALC_SPRITE_HOTXY(xE);
- } else {
- sprite.hot.x = XE_KBPTR.rootX;
- sprite.hot.y = XE_KBPTR.rootY;
- }
-#else
sprite.hot.x = XE_KBPTR.rootX;
sprite.hot.y = XE_KBPTR.rootY;
-#endif /* LG3D */
if (sprite.hot.x < sprite.physLimits.x1)
sprite.hot.x = sprite.physLimits.x1;
else if (sprite.hot.x >= sprite.physLimits.x2)
@@ -2359,34 +2374,38 @@ CheckMotion(xEvent *xE)
}
#ifdef LG3D
- if (pEventWin == NULL) {
- sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
- virtualSprite.hot.x = sprite.hot.x - sprite.win->drawable.x;
- virtualSprite.hot.y = sprite.hot.y - sprite.win->drawable.y;
- } else {
- WindowPtr pSpriteWin;
+ if (lgeDisplayServerIsAlive) {
- /*
- ** This is needed to decouple the virtual sprite position from
- ** the physical sprite position.
- */
- if (pEventWin->drawable.id == lgeDisplayServerPRW) {
- pSpriteWin = pEventWin;
+ if (xE == NULL) {
+ /* WindowsRestructured case */
+ /* TODO: this may change */
+ sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
+ virtualSprite.hot.x = sprite.hot.x - sprite.win->drawable.x;
+ virtualSprite.hot.y = sprite.hot.y - sprite.win->drawable.y;
+ } else if (XE_KBPTR.event == lgeDisplayServerPRW) {
+ /* 3D Event */
+ sprite.win = pLgeDisplayServerPRWWin;
virtualSprite.hot.x = sprite.hot.x;
virtualSprite.hot.y = sprite.hot.y;
} else {
- pSpriteWin = XYToSubWindow(pEventWin,
- xE->u.keyButtonPointer.eventX,
- xE->u.keyButtonPointer.eventY,
- &virtualSprite.hot.x,
- &virtualSprite.hot.y);
+ /* Normal X Event */
+ WindowPtr pEventWin = (WindowPtr) LookupIDByType(XE_KBPTR.event, RT_WINDOW);
+ if (pEventWin == NULL) {
+ /* This might happen if the window has been destroyed */
+ sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
+ virtualSprite.hot.x = sprite.hot.x - sprite.win->drawable.x;
+ virtualSprite.hot.y = sprite.hot.y - sprite.win->drawable.y;
+ return TRUE;
+ }
+ sprite.win = XYToSubWindow(pEventWin,
+ XE_KBPTR.eventX, XE_KBPTR.eventY,
+ &virtualSprite.hot.x, &virtualSprite.hot.y);
}
+ virtualSprite.win = sprite.win;
- sprite.win = pSpriteWin;
+ } else {
+ sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
}
-
- virtualSprite.win = sprite.win;
-
#else
sprite.win = XYToWindow(sprite.hot.x, sprite.hot.y);
#endif /* LG3D */
@@ -2416,6 +2435,33 @@ void
WindowsRestructured()
{
(void) CheckMotion((xEvent *)NULL);
+#ifdef xLG3D
+ /*
+ **
+ ** Bug: this code doesn't currently work. It messes up the sprite window.
+ ** Test case: freecell: click New button. Cursor jumps to upper left hand
+ ** corner because the button ends up getting sent to the DS!
+ */
+ /*
+ ** In addition, we need to send a synthetic motion event with the
+ ** last physical sprite position to the Display Server so that it
+ ** will notice that something has changed and recompute the current
+ ** pointer window.
+ **
+ ** Note: we cannot just skip the above call to CheckMotion and
+ ** send this synthetic event alone. We must call CheckMotion(NULL)
+ ** in order to the current sprite window to a valid window. Otherwise
+ ** when the synthetic event comes back to us the prevSpriteWindow
+ ** may still point to an invalid window and this will crash the server!
+ */
+ xEvent xE;
+ xE.u.u.type = MotionNotify;
+ xE.u.keyButtonPointer.event = lgeDisplayServerPRW;
+ xE.u.keyButtonPointer.rootX = sprite.hot.x;
+ xE.u.keyButtonPointer.rootY = sprite.hot.y;
+ xE.u.keyButtonPointer.time = GetTimeInMillis();
+ (*inputInfo.pointer->public.processInputProc)(&xE, inputInfo.pointer, 1);
+#endif /* LG3D */
}
#ifdef PANORAMIX
@@ -2955,6 +3001,7 @@ DeliverFocusedEvent(keybd, xE, window, count)
if (DeliverDeviceEvents(window, xE, NullGrab, focus, keybd, count))
return;
}
+
/* just deliver it to the focus window */
FixUpEventFromWindow(xE, focus, None, FALSE);
if (xE->u.u.type & EXTENSION_EVENT_BASE)
@@ -3091,7 +3138,16 @@ ProcessKeyboardEvent (xE, keybd, count)
{
xeviekb = keybd;
if(!rootWin) {
+#ifdef LG3D
+ /* TEMP Workaround */
+ WindowPtr pWin;
+ if (lgeDisplayServerIsAlive) {
+ xeviewin = pLgeDisplayServerPRWWin;
+ }
+ pWin = xeviewin->parent;
+#else
WindowPtr pWin = xeviewin->parent;
+#endif /* LG3D */
while(pWin) {
if(!pWin->parent) {
rootWin = pWin->drawable.id;
@@ -3247,6 +3303,22 @@ FixKeyState (xE, keybd)
}
#endif
+#if defined(LG3D_EVENT_TEST_LATENCY) || defined(LG3D_EVENT_TEST_THROUGHPUT)
+#include <sys/time.h>
+static int lg3dEventTestActive = 0;
+static struct timeval lg3dEventTestStartTV;
+#endif /* LG3D_EVENT_TEST_LATENCY || LG3D_EVENT_TEST_THROUGHPUT */
+
+#ifdef LG3D_EVENT_TEST_LATENCY
+#include "statbuf.h"
+static StatBuf *lg3dEventTestSb = NULL;
+#endif /* LG3D_EVENT_TEST_LATENCY */
+
+#ifdef LG3D_EVENT_TEST_THROUGHPUT
+static int lg3dEventTestReceived = 0;
+static int lg3dEventTestCount = 10000;
+#endif /* LG3D_EVENT_TEST_THROUGHPUT */
+
void
#ifdef XKB
CoreProcessPointerEvent (xE, mouse, count)
@@ -3270,12 +3342,110 @@ ProcessPointerEvent (xE, mouse, count)
xevieEventSent = 0;
else {
xeviemouse = mouse;
+
+#ifdef LG3D_EVENT_TEST_LATENCY
+ /* For latency timing: send */
+ if (xE->u.u.type == ButtonPress) {
+
+ ErrorF("Start Test\n");
+ if (lg3dEventTestSb == NULL) {
+ lg3dEventTestSb = statBufCreate();
+ if (lg3dEventTestSb == NULL) {
+ FatalError("LG3D Event Test: cannot create integer statistics buffer\n");
+ }
+ }
+ lg3dEventTestActive = 1;
+ gettimeofday(&lg3dEventTestStartTV, 0);
+ /*ErrorF("Start: sec = %d, usec = %d\n", lg3dEventTestStartTV.tv_sec,
+ lg3dEventTestStartTV.tv_usec);*/
+ }
+ if (lg3dEventTestActive) {
+ struct timeval tv;
+ int deltaSecs;
+ gettimeofday(&tv, 0);
+ deltaSecs = tv.tv_sec - lg3dEventTestStartTV.tv_sec;
+ /*ErrorF("Send: deltaSecs = %d, usec = %d\n", deltaSecs, tv.tv_usec);*/
+ xE->u.keyButtonPointer.time = deltaSecs;
+ xE->u.keyButtonPointer.child = tv.tv_usec;
+ }
+#endif /* LG3D_EVENT_TEST_LATENCY */
+
+#ifdef LG3D_EVENT_TEST_THROUGHPUT
+ /* For throughput timing */
+ if (xE->u.u.type == ButtonPress) {
+ int i;
+ ErrorF("Start Test\n");
+ lg3dEventTestActive = 1;
+ lg3dEventTestReceived = 0;
+ gettimeofday(&lg3dEventTestStartTV, 0);
+ for (i = 1; i <= lg3dEventTestCount; i++) {
+ /*ErrorF("Sending event %d\n", i);*/
+ WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE);
+ }
+ } else
+#endif /* LG3D_EVENT_TEST_THROUGHPUT */
+
WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE);
return;
}
}
#endif
+#ifdef LG3D_EVENT_TEST_LATENCY
+ /* For latency timing: receive */
+ if (lg3dEventTestActive) {
+ struct timeval tv;
+ int deltaSecs, deltaUsecs;
+ float msecs;
+
+ gettimeofday(&tv, 0);
+ /*ErrorF("Receive: sec = %d, usec = %d\n", tv.tv_sec, tv.tv_usec);*/
+
+ tv.tv_sec -= lg3dEventTestStartTV.tv_sec;
+ /*
+ ErrorF("Receive: deltaSecs = %d, usec = %d\n", tv.tv_sec, tv.tv_usec);
+ ErrorF("Receive: ev->time = %d, ev->child = %d\n",
+ xE->u.keyButtonPointer.time, xE->u.keyButtonPointer.child);
+ */
+
+ deltaSecs = tv.tv_sec - xE->u.keyButtonPointer.time;
+ deltaUsecs = tv.tv_usec - xE->u.keyButtonPointer.child;
+
+ /*
+ ErrorF("Interval: deltaSecs = %d, deltaUsec = %d\n",
+ deltaSecs, deltaUsecs);
+ */
+
+ msecs = 1000.0f * deltaSecs + deltaUsecs / 1000.0f;
+ /*ErrorF("Interval: msecs = %f\n", msecs);*/
+
+ statBufAdd(lg3dEventTestSb, msecs);
+
+ /* Discard event to avoid the additional computational load of
+ further processing */
+ return;
+ }
+
+#endif /* LG3D_EVENT_TEST_LATENCY */
+
+#ifdef LG3D_EVENT_TEST_THROUGHPUT
+ if (lg3dEventTestActive) {
+ lg3dEventTestReceived++;
+ /*ErrorF("Received event %d\n", lg3dEventTestReceived);*/
+ if (lg3dEventTestReceived == lg3dEventTestCount) {
+ struct timeval stopTV;
+ gettimeofday(&stopTV, 0);
+ int deltaSecs = stopTV.tv_sec - lg3dEventTestStartTV.tv_sec;
+ int deltaUsecs = stopTV.tv_usec - lg3dEventTestStartTV.tv_usec;
+ float msecs = deltaSecs * 1000.0f + deltaUsecs / 1000.0f;
+ float msecsPerEvent = msecs / (float)lg3dEventTestCount;
+ ErrorF("LG3D Event Test: %d events in %f ms (%f ms/event)\n",
+ lg3dEventTestCount, msecs, msecsPerEvent);
+ lg3dEventTestActive = 0;
+ }
+ }
+#endif /* LG3D_EVENT_TEST_THROUGHPUT */
+
if (!syncEvents.playingEvents)
NoticeTime(xE)
XE_KBPTR.state = (butc->state | (
@@ -4955,11 +5125,17 @@ ProcRecolorCursor(client)
return (Success);
}
+/*#define DEBUG*/
#if defined(LG3D) && defined (DEBUG)
int print_events_all = 0;
int print_events_to_ds = 0;
int print_events_to_wm = 0;
int print_events_to_app = 0;
+int damageEventsOnly = 0;
+int numDamageEvents = 0;
+/* TODO: for damage event debug only */
+#include "damageproto.h"
+
#endif /* LG3D && DEBUG */
void
@@ -5023,7 +5199,9 @@ WriteEventsToClient(pClient, count, events)
}
#if defined(LG3D) && defined (DEBUG)
+
if (print_events_all ||
+ /* TODO: these indices are now out of date; update them */
(print_events_to_ds && pClient->index == 4) ||
(print_events_to_wm && pClient->index == 5) ||
(print_events_to_app && pClient->index == 6)) {
@@ -5031,10 +5209,18 @@ WriteEventsToClient(pClient, count, events)
for(i = 0; i < count; i++) {
ev = &events[i];
- ErrorF("Send event %d to client %d, xy = %d, %d, event win = %d\n",
- ev->u.u.type, pClient->index,
- ev->u.keyButtonPointer.eventX, ev->u.keyButtonPointer.eventY,
- ev->u.keyButtonPointer.event);
+ if (ev->u.u.type == 118) {
+ xDamageNotifyEvent *damev = (xDamageNotifyEvent *) ev;
+ ErrorF("Send damage event %d, to client %d, xywh = %d, %d, %d, %d\n",
+ ++numDamageEvents, pClient->index,
+ damev->area.x, damev->area.y,
+ damev->area.width, damev->area.height);
+ } else if (!damageEventsOnly) {
+ ErrorF("Send event %d to client %d, xy = %d, %d, event win = %d\n",
+ ev->u.u.type, pClient->index,
+ ev->u.keyButtonPointer.eventX, ev->u.keyButtonPointer.eventY,
+ ev->u.keyButtonPointer.event);
+ }
}
}
#endif /* LG3D && DEBUG */
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 25b61d08b..557e14fa2 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -112,8 +112,7 @@
#include "xf86_OSproc.h" /* sigio stuff */
#ifdef LG3D
-# include "../../../dix/ds.h"
-# include "../../../Xext/lgeint.h"
+#include "../../../Xext/lgeint.h"
#endif /* LG3D */
/******************************************************************************
@@ -699,7 +698,9 @@ xf86eqEnqueue (xEvent *e)
#ifdef XINPUT
int count;
+#ifndef LG3D
xf86AssertBlockedSIGIO ("xf86eqEnqueue");
+#endif /* !LG3D */
switch (e->u.u.type) {
case KeyPress:
case KeyRelease:
@@ -735,9 +736,18 @@ xf86eqEnqueue (xEvent *e)
#endif
#ifdef LG3D
- /* If Display Server is not yet alive, do nothing to the event */
- if (lgeDisplayServerIsAlive) {
- dsProcessEvent(e);
+ if (lgeDisplayServerIsAlive &&
+ !lgeDisplayServerClient->clientGone &&
+ !lgeEventComesFromDS) {
+
+ /*
+ ErrorF("Send event XS->DS, type = %d xy = %d, %d\n",
+ e->u.u.type, e->u.keyButtonPointer.rootX,
+ e->u.keyButtonPointer.rootY);
+ */
+
+ WriteToClient(lgeDisplayServerClient, sizeof(xEvent), (char *)e);
+ return;
}
#endif /* LG3D */
@@ -1382,6 +1392,7 @@ xf86PostKeyboardEvent(DeviceIntPtr device,
#ifdef XFreeXDGA
/* if(!DGAStealKeyEvent(xf86EventQueue.pEnqueueScreen->myNum, xE)) */
#endif
+
ENQUEUE(xE);
}
diff --git a/mi/miwindow.c b/mi/miwindow.c
index 4eac9226c..ede327204 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -55,6 +55,17 @@ SOFTWARE.
#include "pixmapstr.h"
#include "mivalidate.h"
+#ifdef LG3D
+#include "../Xext/lgeint.h"
+
+extern void lg3dMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pNextSib,
+ VTKind kind);
+
+extern void lg3dSlideAndSizeWindow (WindowPtr pWin, int x, int y,
+ unsigned int w, unsigned int h, WindowPtr pSib);
+
+#endif /* LG3D */
+
void
miClearToBackground(pWin, x, y, w, h, generateExposures)
WindowPtr pWin;
@@ -503,6 +514,18 @@ miMoveWindow(pWin, x, y, pNextSib, kind)
#endif
WindowPtr pLayerWin;
+#ifdef LG3D
+ /*
+ ** TODO: I tried to do this with wrappers but it didn't work.
+ ** Is there a better way to override this function other than
+ ** just directly modifying it?
+ */
+ if (lgeDisplayServerIsAlive) {
+ lg3dMoveWindow(pWin, x, y, pNextSib, kind);
+ return;
+ }
+#endif /* LG3D */
+
/* if this is a root window, can't be moved */
if (!(pParent = pWin->parent))
return ;
@@ -637,6 +660,18 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib)
#endif
WindowPtr pLayerWin;
+#ifdef LG3D
+ /*
+ ** TODO: I tried to do this with wrappers but it didn't work.
+ ** Is there a better way to override this function other than
+ ** just directly modifying it?
+ */
+ if (lgeDisplayServerIsAlive) {
+ lg3dSlideAndSizeWindow(pWin, x, y, w, h, pSib);
+ return;
+ }
+#endif /* LG3D */
+
/* if this is a root window, can't be resized */
if (!(pParent = pWin->parent))
return ;
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index 4b6458494..357e1a5c5 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -659,13 +659,25 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
cwInitializeRender(pScreen);
#endif
+}
+
#ifdef LG3D
- if (lgeDisplayServerIsAlive) {
- SCREEN_EPILOGUE(pScreen, MoveWindow, lg3dMoveWindow);
- SCREEN_EPILOGUE(pScreen, ResizeWindow, lg3dSlideAndSizeWindow);
- }
-#endif /* LG3D */
+/*
+** This is called when the LG Display Server first notifies
+** the X server that it is alive. Note that we cannot initialize
+** these screen functions earlier than this because the composite
+** wrapper is initialized when the X server starts up and at that
+** time it is not known whether the LG Display Server will be
+** running.
+*/
+
+void
+miInitializeCompositeWrapperForLG(ScreenPtr pScreen)
+{
+ SCREEN_EPILOGUE(pScreen, MoveWindow, lg3dMoveWindow);
+ SCREEN_EPILOGUE(pScreen, ResizeWindow, lg3dSlideAndSizeWindow);
}
+#endif /* LG3D */
static Bool
cwCloseScreen (int i, ScreenPtr pScreen)
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 9baf38301..855334afb 100755
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -32,15 +32,15 @@
#include "servermd.h"
#include "inputstr.h"
#include "windowstr.h"
+#ifdef LG3D
+#include "../Xext/lgeint.h"
+#endif /* LG3D */
static RESTYPE CursorClientType;
static RESTYPE CursorWindowType;
static int CursorScreenPrivateIndex = -1;
static int CursorGeneration;
static CursorPtr CursorCurrent;
-#ifdef LG3D
-extern CursorPtr plgeDisplayServerForceThisCursor;
-#endif /* LG3D */
#define VERIFY_CURSOR(pCursor, cursor, client, access) { \
pCursor = (CursorPtr)SecurityLookupIDByType((client), (cursor), \
@@ -91,12 +91,38 @@ CursorDisplayCursor (ScreenPtr pScreen,
Unwrap (cs, pScreen, DisplayCursor);
#ifdef LG3D
- if (plgeDisplayServerForceThisCursor != NULL) {
- ret = (*pScreen->DisplayCursor) (pScreen,
- plgeDisplayServerForceThisCursor);
+ if (lgeDisplayServerIsAlive) {
+ ret = (*pScreen->DisplayCursor) (pScreen, pInvisibleCursor);
} else
#endif
ret = (*pScreen->DisplayCursor) (pScreen, pCursor);
+
+#ifdef LG3D
+ {
+ CursorEventPtr e;
+
+ CursorCurrent = pCursor;
+
+ /* Always send events, except when cursor is null */
+ if (pCursor != NULL) {
+ for (e = cursorEvents; e; e = e->next)
+ {
+ if (e->eventMask & XFixesDisplayCursorNotifyMask)
+ {
+ xXFixesCursorNotifyEvent ev;
+ ev.type = XFixesEventBase + XFixesCursorNotify;
+ ev.subtype = XFixesDisplayCursorNotify;
+ ev.sequenceNumber = e->pClient->sequence;
+ ev.window = e->pWindow->drawable.id;
+ ev.cursorSerial = pCursor->serialNumber;
+ ev.timestamp = currentTime.milliseconds;
+ ev.name = pCursor->name;
+ WriteEventsToClient (e->pClient, 1, (xEvent *) &ev);
+ }
+ }
+ }
+ }
+#else
if (pCursor != CursorCurrent)
{
CursorEventPtr e;
@@ -118,6 +144,8 @@ CursorDisplayCursor (ScreenPtr pScreen,
}
}
}
+#endif /* LG3D */
+
Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor);
return ret;
}
@@ -312,6 +340,7 @@ ProcXFixesGetCursorImage (ClientPtr client)
int x, y;
REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq);
+
pCursor = CursorCurrent;
if (!pCursor)
return BadCursor;