aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/Xext/xf86bigfont.c4
-rw-r--r--xorg-server/Xi/exevents.c2
-rw-r--r--xorg-server/Xi/xiselectev.c9
-rw-r--r--xorg-server/autogen.sh24
-rw-r--r--xorg-server/configure.ac7
-rw-r--r--xorg-server/dix/dispatch.c19
-rw-r--r--xorg-server/dix/events.c9
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrdriext.c4
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrglxext.c179
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrhostglx.c121
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrhostglx.h9
-rw-r--r--xorg-server/hw/kdrive/src/kinput.c2
-rw-r--r--xorg-server/hw/xfree86/common/xf86DGA.c2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Module.h2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Opt.h2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Option.c2
-rw-r--r--xorg-server/hw/xfree86/common/xf86vmode.c6
-rw-r--r--xorg-server/hw/xfree86/dri/xf86dri.c4
-rw-r--r--xorg-server/hw/xfree86/dri2/dri2ext.c2
-rw-r--r--xorg-server/hw/xfree86/int10/generic.c3
-rw-r--r--xorg-server/hw/xquartz/applewm.c4
-rw-r--r--xorg-server/hw/xquartz/xpr/appledri.c6
-rw-r--r--xorg-server/hw/xwin/winwindowswm.c4
-rw-r--r--xorg-server/include/dixstruct.h37
-rw-r--r--xorg-server/include/os.h3
-rw-r--r--xorg-server/include/windowstr.h4
-rw-r--r--xorg-server/mi/mipointer.c5
-rw-r--r--xorg-server/os/access.c10
-rw-r--r--xorg-server/os/connection.c16
-rw-r--r--xorg-server/os/io.c22
-rw-r--r--xorg-server/os/osdep.h19
-rw-r--r--xorg-server/xkeyboard-config/rules/base.xml.in6
-rw-r--r--xorg-server/xkeyboard-config/symbols/it43
33 files changed, 426 insertions, 165 deletions
diff --git a/xorg-server/Xext/xf86bigfont.c b/xorg-server/Xext/xf86bigfont.c
index b4ef5e460..faf81f7dc 100644
--- a/xorg-server/Xext/xf86bigfont.c
+++ b/xorg-server/Xext/xf86bigfont.c
@@ -288,7 +288,7 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
.gid = getegid(),
#ifdef HAS_SHM
.signature = signature,
- .capabilities = (LocalClient(client) && !client->swapped)
+ .capabilities = (client->local && !client->swapped)
? XF86Bigfont_CAP_LocalShm : 0
#else
.signature = 0,
@@ -357,7 +357,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
#else
switch (client->req_len) {
case 2: /* client with version 1.0 libX11 */
- stuff_flags = (LocalClient(client) &&
+ stuff_flags = (client->local &&
!client->swapped ? XF86Bigfont_FLAGS_Shm : 0);
break;
case 3: /* client with version 1.1 libX11 */
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index 494d07e20..6ed499142 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -949,8 +949,6 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
if (!(event->flags & TOUCH_POINTER_EMULATED))
return DONT_PROCESS;
- if (!(event->flags & TOUCH_END))
- return DONT_PROCESS;
DecreaseButtonCount(device, key, &t->buttonsDown, &t->motionMask,
&t->state);
diff --git a/xorg-server/Xi/xiselectev.c b/xorg-server/Xi/xiselectev.c
index 0e45cb8cb..ab1b6245f 100644
--- a/xorg-server/Xi/xiselectev.c
+++ b/xorg-server/Xi/xiselectev.c
@@ -180,8 +180,13 @@ ProcXISelectEvents(ClientPtr client)
if (CLIENT_ID(iclient->resource) == client->index)
continue;
- dixLookupDevice(&tmp, evmask->deviceid, serverClient,
- DixReadAccess);
+ if (evmask->deviceid == XIAllDevices)
+ tmp = inputInfo.all_devices;
+ else if (evmask->deviceid == XIAllMasterDevices)
+ tmp = inputInfo.all_master_devices;
+ else
+ dixLookupDevice(&tmp, evmask->deviceid, serverClient,
+ DixReadAccess);
if (!tmp)
return BadImplementation; /* this shouldn't happen */
diff --git a/xorg-server/autogen.sh b/xorg-server/autogen.sh
index 588fef395..8b6f58f69 100644
--- a/xorg-server/autogen.sh
+++ b/xorg-server/autogen.sh
@@ -1,12 +1,12 @@
-#! /bin/sh
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-ORIGDIR=`pwd`
-cd $srcdir
-
-autoreconf --force -v --install || exit 1
-cd $ORIGDIR || exit $?
-
-$srcdir/configure --enable-maintainer-mode "$@"
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf --force -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure "$@"
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac
index ac3bf26f1..e6866140e 100644
--- a/xorg-server/configure.ac
+++ b/xorg-server/configure.ac
@@ -26,12 +26,11 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.13.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2012-09-05"
-RELEASE_NAME="Iced Tea"
+AC_INIT([xorg-server], 1.13.99.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2012-10-04"
+RELEASE_NAME="Horchata"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
# Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS
m4_ifndef([XORG_MACROS_VERSION],
diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c
index 0ce10c2f7..2df1a6ea5 100644
--- a/xorg-server/dix/dispatch.c
+++ b/xorg-server/dix/dispatch.c
@@ -3499,14 +3499,16 @@ ProcInitialConnection(ClientPtr client)
REQUEST(xReq);
xConnClientPrefix *prefix;
int whichbyte = 1;
+ char order;
- prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq);
- if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B'))
- return client->noClientException = -1;
- if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) ||
- (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l'))) {
- client->swapped = TRUE;
- SwapConnClientPrefix(prefix);
+ prefix = (xConnClientPrefix *) ((char *)stuff + sz_xReq);
+ order = prefix->byteOrder;
+ if (order != 'l' && order != 'B' && order != 'r' && order != 'R')
+ return client->noClientException = -1;
+ if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) ||
+ (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) {
+ client->swapped = TRUE;
+ SwapConnClientPrefix(prefix);
}
stuff->reqType = 2;
stuff->length += bytes_to_int32(prefix->nbytesAuthProto) +
@@ -3514,6 +3516,9 @@ ProcInitialConnection(ClientPtr client)
if (client->swapped) {
swaps(&stuff->length);
}
+ if (order == 'r' || order == 'R') {
+ client->local = FALSE;
+ }
ResetCurrentRequest(client);
return Success;
}
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index 3b40446bc..c0e330b85 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -1555,11 +1555,13 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
WindowPtr oldWin;
/* slave devices need to float for the duration of the grab. */
- if (grab->grabtype == XI2 &&
+ if (grab->grabtype == XI2 && keybd->enabled &&
!(passive & ImplicitGrabMask) && !IsMaster(keybd))
DetachFromMaster(keybd);
- if (grabinfo->grab)
+ if (!keybd->enabled)
+ oldWin = NULL;
+ else if (grabinfo->grab)
oldWin = grabinfo->grab->window;
else if (keybd->focus)
oldWin = keybd->focus->win;
@@ -1569,7 +1571,8 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
oldWin = keybd->focus->win;
if (keybd->valuator)
keybd->valuator->motionHintWindow = NullWindow;
- DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
+ if (oldWin)
+ DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
if (syncEvents.playingEvents)
grabinfo->grabTime = syncEvents.time;
else
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrdriext.c b/xorg-server/hw/kdrive/ephyr/ephyrdriext.c
index a42be07d5..1a98a2dff 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrdriext.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrdriext.c
@@ -561,7 +561,7 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client)
return BadValue;
}
- if (!LocalClient(client) || client->swapped)
+ if (!client->local || client->swapped)
isCapable = 0;
rep = (xXF86DRIQueryDirectRenderingCapableReply) {
@@ -1229,7 +1229,7 @@ ProcXF86DRIDispatch(register ClientPtr client)
}
}
- if (!LocalClient(client))
+ if (!client->local)
return DRIErrorBase + XF86DRIClientNotLocal;
switch (stuff->data) {
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrglxext.c b/xorg-server/hw/kdrive/ephyr/ephyrglxext.c
index df285cfcb..22d510891 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrglxext.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrglxext.c
@@ -61,10 +61,16 @@ int ephyrGLXGetFBConfigsSGIX(__GLXclientState * a_cl, GLbyte * a_pc);
int ephyrGLXGetFBConfigsSGIXSwap(__GLXclientState * a_cl, GLbyte * a_pc);
int ephyrGLXCreateContext(__GLXclientState * a_cl, GLbyte * a_pc);
int ephyrGLXCreateContextSwap(__GLXclientState * a_cl, GLbyte * a_pc);
+int ephyrGLXCreateNewContext(__GLXclientState * a_cl, GLbyte * a_pc);
+int ephyrGLXCreateNewContextSwap(__GLXclientState * a_cl, GLbyte * a_pc);
int ephyrGLXDestroyContext(__GLXclientState * a_cl, GLbyte * a_pc);
int ephyrGLXDestroyContextSwap(__GLXclientState * a_cl, GLbyte * a_pc);
int ephyrGLXMakeCurrent(__GLXclientState * a_cl, GLbyte * a_pc);
int ephyrGLXMakeCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc);
+int ephyrGLXMakeCurrentReadSGI(__GLXclientState * a_cl, GLbyte * a_pc);
+int ephyrGLXMakeCurrentReadSGISwap(__GLXclientState * a_cl, GLbyte * a_pc);
+int ephyrGLXMakeContextCurrent(__GLXclientState * a_cl, GLbyte * a_pc);
+int ephyrGLXMakeContextCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc);
int ephyrGLXGetString(__GLXclientState * a_cl, GLbyte * a_pc);
int ephyrGLXGetStringSwap(__GLXclientState * a_cl, GLbyte * a_pc);
int ephyrGLXGetIntegerv(__GLXclientState * a_cl, GLbyte * a_pc);
@@ -108,6 +114,9 @@ ephyrHijackGLXExtension(void)
dispatch_functions[X_GLXCreateContext][0] = ephyrGLXCreateContext;
dispatch_functions[X_GLXCreateContext][1] = ephyrGLXCreateContextSwap;
+ dispatch_functions[X_GLXCreateNewContext][0] = ephyrGLXCreateNewContext;
+ dispatch_functions[X_GLXCreateNewContext][1] = ephyrGLXCreateNewContextSwap;
+
dispatch_functions[X_GLXDestroyContext][0] = ephyrGLXDestroyContext;
dispatch_functions[X_GLXDestroyContext][1] = ephyrGLXDestroyContextSwap;
@@ -123,14 +132,24 @@ ephyrHijackGLXExtension(void)
dispatch_functions[61][0] = ephyrGLXGetIntegerv;
dispatch_functions[61][1] = ephyrGLXGetIntegervSwap;
+ dispatch_functions[X_GLXMakeContextCurrent][0] =
+ ephyrGLXMakeContextCurrent;
+ dispatch_functions[X_GLXMakeContextCurrent][1] =
+ ephyrGLXMakeContextCurrentSwap;
+
/*
* hijack some vendor priv entry point dispatch functions
*/
dispatch_functions = VendorPriv_dispatch_info.dispatch_functions;
dispatch_functions[92][0] = ephyrGLXGetFBConfigsSGIX;
dispatch_functions[92][1] = ephyrGLXGetFBConfigsSGIXSwap;
+
+ dispatch_functions[89][0] = ephyrGLXMakeCurrentReadSGI;
+ dispatch_functions[89][1] = ephyrGLXMakeCurrentReadSGISwap;
+
EPHYR_LOG("hijacked glx entry points to forward requests to host X\n");
+
return TRUE;
}
@@ -445,7 +464,8 @@ ephyrGLXCreateContextReal(xGLXCreateContextReq * a_req, Bool a_do_swap)
if (!ephyrHostGLXCreateContext(a_req->screen,
host_w_attrs.visualid,
a_req->context,
- a_req->shareList, a_req->isDirect)) {
+ a_req->shareList, 0,
+ a_req->isDirect, X_GLXCreateContext)) {
EPHYR_LOG_ERROR("ephyrHostGLXCreateContext() failed\n");
goto out;
}
@@ -455,6 +475,45 @@ ephyrGLXCreateContextReal(xGLXCreateContextReq * a_req, Bool a_do_swap)
return res;
}
+static int
+ephyrGLXCreateNewContextReal(xGLXCreateNewContextReq * a_req, Bool a_do_swap)
+{
+ int res = BadImplementation;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ EPHYR_RETURN_VAL_IF_FAIL(a_req, BadValue);
+ EPHYR_LOG("enter\n");
+
+ if (a_do_swap) {
+ __GLX_SWAP_SHORT(&a_req->length);
+ __GLX_SWAP_INT(&a_req->context);
+ __GLX_SWAP_INT(&a_req->fbconfig);
+ __GLX_SWAP_INT(&a_req->screen);
+ __GLX_SWAP_INT(&a_req->renderType);
+ __GLX_SWAP_INT(&a_req->shareList);
+ }
+
+ EPHYR_LOG("context creation requested. localid:%d, "
+ "screen:%d, fbconfig:%d, renderType:%d, direct:%d\n",
+ (int) a_req->context, (int) a_req->screen,
+ (int) a_req->fbconfig, (int) a_req->renderType,
+ (int) a_req->isDirect);
+
+ if (!ephyrHostGLXCreateContext(a_req->screen,
+ a_req->fbconfig,
+ a_req->context,
+ a_req->shareList, a_req->renderType,
+ a_req->isDirect, X_GLXCreateNewContext)) {
+ EPHYR_LOG_ERROR("ephyrHostGLXCreateNewContext() failed\n");
+ goto out;
+ }
+ res = Success;
+ out:
+ EPHYR_LOG("leave\n");
+ return res;
+}
+
int
ephyrGLXCreateContext(__GLXclientState * cl, GLbyte * pc)
{
@@ -471,6 +530,22 @@ ephyrGLXCreateContextSwap(__GLXclientState * cl, GLbyte * pc)
return ephyrGLXCreateContextReal(req, TRUE);
}
+int
+ephyrGLXCreateNewContext(__GLXclientState * cl, GLbyte * pc)
+{
+ xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
+
+ return ephyrGLXCreateNewContextReal(req, FALSE);
+}
+
+int
+ephyrGLXCreateNewContextSwap(__GLXclientState * cl, GLbyte * pc)
+{
+ xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
+
+ return ephyrGLXCreateNewContextReal(req, TRUE);
+}
+
static int
ephyrGLXDestroyContextReal(__GLXclientState * a_cl,
GLbyte * a_pc, Bool a_do_swap)
@@ -505,26 +580,34 @@ ephyrGLXDestroyContextSwap(__GLXclientState * a_cl, GLbyte * a_pc)
}
static int
-ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap)
+ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLXDrawable write,
+ GLXDrawable read, GLXContextTag ctx,
+ GLXContextTag old_ctx, Bool a_do_swap)
{
int res = BadImplementation;
- xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc;
xGLXMakeCurrentReply reply;
- DrawablePtr drawable = NULL;
- GLXContextTag contextTag = 0;
- int rc = 0;
+ DrawablePtr drawableR = NULL, drawableW = NULL;
+ GLXContextTag new_ctx = 0;
EPHYR_LOG("enter\n");
- rc = dixLookupDrawable(&drawable,
- req->drawable, a_cl->client, 0, DixReadAccess);
- EPHYR_RETURN_VAL_IF_FAIL(drawable, BadValue);
- EPHYR_RETURN_VAL_IF_FAIL(drawable->pScreen, BadValue);
- EPHYR_LOG("screen nummber requested:%d\n", drawable->pScreen->myNum);
-
- if (!ephyrHostGLXMakeCurrent(hostx_get_window(drawable->pScreen->myNum),
- req->context,
- req->oldContextTag,
- (int *) &contextTag)) {
+ res = dixLookupDrawable(&drawableW, write, a_cl->client, 0, DixReadAccess);
+ EPHYR_RETURN_VAL_IF_FAIL(drawableW, BadValue);
+ EPHYR_RETURN_VAL_IF_FAIL(drawableW->pScreen, BadValue);
+ EPHYR_LOG("screen nummber requested:%d\n", drawableW->pScreen->myNum);
+
+ if (read != write) {
+ res = dixLookupDrawable(&drawableR, read, a_cl->client, 0,
+ DixReadAccess);
+ EPHYR_RETURN_VAL_IF_FAIL(drawableR, BadValue);
+ EPHYR_RETURN_VAL_IF_FAIL(drawableR->pScreen, BadValue);
+ }
+ else {
+ drawableR = drawableW;
+ }
+
+ if (!ephyrHostGLXMakeCurrent(hostx_get_window(drawableW->pScreen->myNum),
+ hostx_get_window(drawableR->pScreen->myNum),
+ ctx, old_ctx, (int *) &new_ctx)) {
EPHYR_LOG_ERROR("ephyrHostGLXMakeCurrent() failed\n");
goto out;
}
@@ -532,7 +615,7 @@ ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap)
.type = X_Reply,
.sequenceNumber = a_cl->client->sequence,
.length = 0,
- .contextTag = contextTag
+ .contextTag = new_ctx
};
if (a_do_swap) {
__GLX_DECLARE_SWAP_VARIABLES;
@@ -551,13 +634,71 @@ ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap)
int
ephyrGLXMakeCurrent(__GLXclientState * a_cl, GLbyte * a_pc)
{
- return ephyrGLXMakeCurrentReal(a_cl, a_pc, FALSE);
+ xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc;
+ return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->drawable,
+ req->context, req->oldContextTag, FALSE);
}
int
ephyrGLXMakeCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc)
{
- return ephyrGLXMakeCurrentReal(a_cl, a_pc, TRUE);
+ xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->oldContextTag);
+
+ return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->drawable,
+ req->context, req->oldContextTag, TRUE);
+}
+
+int
+ephyrGLXMakeCurrentReadSGI(__GLXclientState * a_cl, GLbyte * a_pc)
+{
+ xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) a_pc;
+
+ return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readable,
+ req->context, req->oldContextTag, FALSE);
+}
+
+int
+ephyrGLXMakeCurrentReadSGISwap(__GLXclientState * a_cl, GLbyte * a_pc)
+{
+ xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) a_pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->readable);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->oldContextTag);
+
+ return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readable,
+ req->context, req->oldContextTag, TRUE);
+}
+
+int
+ephyrGLXMakeContextCurrent(__GLXclientState * a_cl, GLbyte * a_pc)
+{
+ xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) a_pc;
+
+ return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readdrawable,
+ req->context, req->oldContextTag, FALSE);
+}
+
+int
+ephyrGLXMakeContextCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc)
+{
+ xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) a_pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+
+ __GLX_SWAP_INT(&req->drawable);
+ __GLX_SWAP_INT(&req->readdrawable);
+ __GLX_SWAP_INT(&req->context);
+ __GLX_SWAP_INT(&req->oldContextTag);
+
+ return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readdrawable,
+ req->context, req->oldContextTag, TRUE);
}
static int
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrhostglx.c b/xorg-server/hw/kdrive/ephyr/ephyrhostglx.c
index 6b9da6fb1..392489a00 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrhostglx.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrhostglx.c
@@ -52,6 +52,8 @@
#include "ephyrlog.h"
#include "hostx.h"
+static int glx_major, glx_minor;
+
enum VisualConfRequestType {
EPHYR_GET_FB_CONFIG,
EPHYR_VENDOR_PRIV_GET_FB_CONFIG_SGIX,
@@ -99,6 +101,12 @@ ephyrHostGLXQueryVersion(int *a_major, int *a_minor)
EPHYR_RETURN_VAL_IF_FAIL(a_major && a_minor, FALSE);
EPHYR_LOG("enter\n");
+ if (glx_major) {
+ *a_major = glx_major;
+ *a_minor = glx_minor;
+ return TRUE;
+ }
+
if (!ephyrHostGLXGetMajorOpcode(&major_opcode)) {
EPHYR_LOG_ERROR("failed to get major opcode\n");
goto out;
@@ -117,8 +125,8 @@ ephyrHostGLXQueryVersion(int *a_major, int *a_minor)
UnlockDisplay(dpy);
SyncHandle();
- *a_major = reply.majorVersion;
- *a_minor = reply.minorVersion;
+ *a_major = glx_major = reply.majorVersion;
+ *a_minor = glx_minor = reply.minorVersion;
EPHYR_LOG("major:%d, minor:%d\n", *a_major, *a_minor);
@@ -431,17 +439,20 @@ ephyrHostGLXSendClientInfo(int32_t a_major, int32_t a_minor,
Bool
ephyrHostGLXCreateContext(int a_screen,
- int a_visual_id,
+ int a_generic_id,
int a_context_id,
- int a_share_list_ctxt_id, Bool a_direct)
+ int a_share_list_ctxt_id,
+ int a_render_type,
+ Bool a_direct,
+ int code)
{
Bool is_ok = FALSE;
Display *dpy = hostx_get_display();
int major_opcode = 0, remote_context_id = 0;
- xGLXCreateContextReq *req;
- EPHYR_LOG("enter. screen:%d, visual:%d, contextid:%d, direct:%d\n",
- a_screen, a_visual_id, a_context_id, a_direct);
+ EPHYR_LOG("enter. screen:%d, generic_id:%d, contextid:%d, rendertype:%d, "
+ "direct:%d\n", a_screen, a_generic_id, a_context_id,
+ a_render_type, a_direct);
if (!hostx_allocate_resource_id_peer(a_context_id, &remote_context_id)) {
EPHYR_LOG_ERROR("failed to peer the context id %d host X",
@@ -456,15 +467,38 @@ ephyrHostGLXCreateContext(int a_screen,
LockDisplay(dpy);
- /* Send the glXCreateContext request */
- GetReq(GLXCreateContext, req);
- req->reqType = major_opcode;
- req->glxCode = X_GLXCreateContext;
- req->context = remote_context_id;
- req->visual = a_visual_id;
- req->screen = DefaultScreen(dpy);
- req->shareList = a_share_list_ctxt_id;
- req->isDirect = a_direct;
+ switch (code) {
+ case X_GLXCreateContext: {
+ /* Send the glXCreateContext request */
+ xGLXCreateContextReq *req;
+ GetReq(GLXCreateContext, req);
+ req->reqType = major_opcode;
+ req->glxCode = X_GLXCreateContext;
+ req->context = remote_context_id;
+ req->visual = a_generic_id;
+ req->screen = DefaultScreen(dpy);
+ req->shareList = a_share_list_ctxt_id;
+ req->isDirect = a_direct;
+ }
+
+ case X_GLXCreateNewContext: {
+ /* Send the glXCreateNewContext request */
+ xGLXCreateNewContextReq *req;
+ GetReq(GLXCreateNewContext, req);
+ req->reqType = major_opcode;
+ req->glxCode = X_GLXCreateNewContext;
+ req->context = remote_context_id;
+ req->fbconfig = a_generic_id;
+ req->screen = DefaultScreen(dpy);
+ req->renderType = a_render_type;
+ req->shareList = a_share_list_ctxt_id;
+ req->isDirect = a_direct;
+ }
+
+ default:
+ /* This should never be reached !*/
+ EPHYR_LOG("Internal error! Invalid CreateContext code!\n");
+ }
UnlockDisplay(dpy);
SyncHandle();
@@ -512,20 +546,19 @@ ephyrHostDestroyContext(int a_ctxt_id)
}
Bool
-ephyrHostGLXMakeCurrent(int a_drawable,
+ephyrHostGLXMakeCurrent(int a_drawable, int a_readable,
int a_glx_ctxt_id, int a_old_ctxt_tag, int *a_ctxt_tag)
{
Bool is_ok = FALSE;
Display *dpy = hostx_get_display();
int32_t major_opcode = 0;
int remote_glx_ctxt_id = 0;
- xGLXMakeCurrentReq *req;
xGLXMakeCurrentReply reply;
EPHYR_RETURN_VAL_IF_FAIL(a_ctxt_tag, FALSE);
- EPHYR_LOG("enter. drawable:%d, context:%d, oldtag:%d\n",
- a_drawable, a_glx_ctxt_id, a_old_ctxt_tag);
+ EPHYR_LOG("enter. drawable:%d, read:%d, context:%d, oldtag:%d\n",
+ a_drawable, a_readable, a_glx_ctxt_id, a_old_ctxt_tag);
if (!ephyrHostGLXGetMajorOpcode(&major_opcode)) {
EPHYR_LOG_ERROR("failed to get major opcode\n");
@@ -538,12 +571,48 @@ ephyrHostGLXMakeCurrent(int a_drawable,
LockDisplay(dpy);
- GetReq(GLXMakeCurrent, req);
- req->reqType = major_opcode;
- req->glxCode = X_GLXMakeCurrent;
- req->drawable = a_drawable;
- req->context = remote_glx_ctxt_id;
- req->oldContextTag = a_old_ctxt_tag;
+ /* If both drawables are the same, use the old MakeCurrent request.
+ * Otherwise, if we have GLX 1.3 or higher, use the MakeContextCurrent
+ * request which supports separate read and draw targets. Failing that,
+ * try the SGI MakeCurrentRead extension. Logic cribbed from Mesa. */
+ if (a_drawable == a_readable) {
+ xGLXMakeCurrentReq *req;
+
+ GetReq(GLXMakeCurrent, req);
+ req->reqType = major_opcode;
+ req->glxCode = X_GLXMakeCurrent;
+ req->drawable = a_drawable;
+ req->context = remote_glx_ctxt_id;
+ req->oldContextTag = a_old_ctxt_tag;
+ }
+ else if (glx_major > 1 || glx_minor >= 3) {
+ xGLXMakeContextCurrentReq *req;
+
+ GetReq(GLXMakeContextCurrent, req);
+ req->reqType = major_opcode;
+ req->glxCode = X_GLXMakeContextCurrent;
+ req->drawable = a_drawable;
+ req->readdrawable = a_readable;
+ req->context = remote_glx_ctxt_id;
+ req->oldContextTag = a_old_ctxt_tag;
+ }
+ else {
+ xGLXVendorPrivateWithReplyReq *vpreq;
+ xGLXMakeCurrentReadSGIReq *req;
+
+ GetReqExtra(GLXVendorPrivateWithReply,
+ (sz_xGLXMakeCurrentReadSGIReq -
+ sz_xGLXVendorPrivateWithReplyReq),
+ vpreq);
+ req = (xGLXMakeCurrentReadSGIReq *) vpreq;
+ req->reqType = major_opcode;
+ req->glxCode = X_GLXVendorPrivateWithReply;
+ req->vendorCode = X_GLXvop_MakeCurrentReadSGI;
+ req->drawable = a_drawable;
+ req->readable = a_readable;
+ req->context = remote_glx_ctxt_id;
+ req->oldContextTag = a_old_ctxt_tag;
+ }
memset(&reply, 0, sizeof(reply));
if (!_XReply(dpy, (xReply *) & reply, 0, False)) {
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrhostglx.h b/xorg-server/hw/kdrive/ephyr/ephyrhostglx.h
index 9c6012070..7ff515dc2 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrhostglx.h
+++ b/xorg-server/hw/kdrive/ephyr/ephyrhostglx.h
@@ -55,13 +55,16 @@ Bool ephyrHostGLXGetMajorOpcode(int32_t * a_opcode);
Bool ephyrHostGLXSendClientInfo(int32_t a_major, int32_t a_minor,
const char *a_extension_list);
Bool ephyrHostGLXCreateContext(int a_screen,
- int a_visual_id,
+ int a_generic_id,
int a_context_id,
- int a_shared_list_ctx_id, Bool a_direct);
+ int a_share_list_ctxt_id,
+ int a_render_type,
+ Bool a_direct,
+ int code);
Bool ephyrHostDestroyContext(int a_ctxt_id);
-Bool ephyrHostGLXMakeCurrent(int a_drawable, int a_glx_ctxt_id,
+Bool ephyrHostGLXMakeCurrent(int a_drawable, int a_readable, int a_glx_ctxt_id,
int a_olg_ctxt_tag, int *a_ctxt_tag);
Bool ephyrHostGetIntegerValue(int a_current_context_tag, int a_int, int *a_val);
diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c
index d35dcf848..b1068bbee 100644
--- a/xorg-server/hw/kdrive/src/kinput.c
+++ b/xorg-server/hw/kdrive/src/kinput.c
@@ -1034,7 +1034,7 @@ KdGetOptions(InputOption **options, char *string)
if (strchr(string, '=')) {
tam_key = (strchr(string, '=') - string);
- key = strndup(string, tam_key + 1);
+ key = strndup(string, tam_key);
if (!key)
goto out;
diff --git a/xorg-server/hw/xfree86/common/xf86DGA.c b/xorg-server/hw/xfree86/common/xf86DGA.c
index a441dee99..c25a2747b 100644
--- a/xorg-server/hw/xfree86/common/xf86DGA.c
+++ b/xorg-server/hw/xfree86/common/xf86DGA.c
@@ -2095,7 +2095,7 @@ ProcXDGADispatch(ClientPtr client)
{
REQUEST(xReq);
- if (!LocalClient(client))
+ if (!client->local)
return DGAErrorBase + XF86DGAClientNotLocal;
#ifdef DGA_REQ_DEBUG
diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h
index 83f9790d2..fd90aac54 100644
--- a/xorg-server/hw/xfree86/common/xf86Module.h
+++ b/xorg-server/hw/xfree86/common/xf86Module.h
@@ -80,7 +80,7 @@ typedef enum {
* mask is 0xFFFF0000.
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
-#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(13, 0)
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(14, 0)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(18, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(7, 0)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
diff --git a/xorg-server/hw/xfree86/common/xf86Opt.h b/xorg-server/hw/xfree86/common/xf86Opt.h
index 0d808de14..c3ba2d75c 100644
--- a/xorg-server/hw/xfree86/common/xf86Opt.h
+++ b/xorg-server/hw/xfree86/common/xf86Opt.h
@@ -85,7 +85,7 @@ extern _X_EXPORT int xf86CheckIntOption(XF86OptionPtr optlist, const char *name,
extern _X_EXPORT double xf86CheckRealOption(XF86OptionPtr optlist,
const char *name, double deflt);
extern _X_EXPORT char *xf86CheckStrOption(XF86OptionPtr optlist,
- const char *name, char *deflt);
+ const char *name, const char *deflt);
extern _X_EXPORT int xf86CheckBoolOption(XF86OptionPtr list, const char *name,
int deflt);
extern _X_EXPORT double xf86CheckPercentOption(XF86OptionPtr list,
diff --git a/xorg-server/hw/xfree86/common/xf86Option.c b/xorg-server/hw/xfree86/common/xf86Option.c
index 7cc744029..c2ec79a53 100644
--- a/xorg-server/hw/xfree86/common/xf86Option.c
+++ b/xorg-server/hw/xfree86/common/xf86Option.c
@@ -276,7 +276,7 @@ xf86CheckRealOption(XF86OptionPtr optlist, const char *name, double deflt)
}
char *
-xf86CheckStrOption(XF86OptionPtr optlist, const char *name, char *deflt)
+xf86CheckStrOption(XF86OptionPtr optlist, const char *name, const char *deflt)
{
return LookupStrOption(optlist, name, deflt, FALSE);
}
diff --git a/xorg-server/hw/xfree86/common/xf86vmode.c b/xorg-server/hw/xfree86/common/xf86vmode.c
index 7cd2eedb3..cad0e6a21 100644
--- a/xorg-server/hw/xfree86/common/xf86vmode.c
+++ b/xorg-server/hw/xfree86/common/xf86vmode.c
@@ -1590,7 +1590,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
return BadValue;
if (xf86GetVidModeEnabled() &&
- (xf86GetVidModeAllowNonLocal() || LocalClient(client))) {
+ (xf86GetVidModeAllowNonLocal() || client->local)) {
rep.permissions |= XF86VM_WRITE_PERMISSION;
}
if (client->swapped) {
@@ -1659,7 +1659,7 @@ ProcXF86VidModeDispatch(ClientPtr client)
default:
if (!xf86GetVidModeEnabled())
return VidModeErrorBase + XF86VidModeExtensionDisabled;
- if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
+ if (xf86GetVidModeAllowNonLocal() || client->local) {
switch (stuff->data) {
case X_XF86VidModeAddModeLine:
return ProcXF86VidModeAddModeLine(client);
@@ -2083,7 +2083,7 @@ SProcXF86VidModeDispatch(ClientPtr client)
default:
if (!xf86GetVidModeEnabled())
return VidModeErrorBase + XF86VidModeExtensionDisabled;
- if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
+ if (xf86GetVidModeAllowNonLocal() || client->local) {
switch (stuff->data) {
case X_XF86VidModeAddModeLine:
return SProcXF86VidModeAddModeLine(client);
diff --git a/xorg-server/hw/xfree86/dri/xf86dri.c b/xorg-server/hw/xfree86/dri/xf86dri.c
index ba74bb04f..0b2e8fa1b 100644
--- a/xorg-server/hw/xfree86/dri/xf86dri.c
+++ b/xorg-server/hw/xfree86/dri/xf86dri.c
@@ -118,7 +118,7 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client)
return BadValue;
}
- if (!LocalClient(client) || client->swapped)
+ if (!client->local || client->swapped)
isCapable = 0;
rep = (xXF86DRIQueryDirectRenderingCapableReply) {
@@ -528,7 +528,7 @@ ProcXF86DRIDispatch(register ClientPtr client)
return ProcXF86DRIQueryDirectRenderingCapable(client);
}
- if (!LocalClient(client))
+ if (!client->local)
return DRIErrorBase + XF86DRIClientNotLocal;
switch (stuff->data) {
diff --git a/xorg-server/hw/xfree86/dri2/dri2ext.c b/xorg-server/hw/xfree86/dri2/dri2ext.c
index ee610c0ec..e1decec9e 100644
--- a/xorg-server/hw/xfree86/dri2/dri2ext.c
+++ b/xorg-server/hw/xfree86/dri2/dri2ext.c
@@ -588,7 +588,7 @@ ProcDRI2Dispatch(ClientPtr client)
return ProcDRI2QueryVersion(client);
}
- if (!LocalClient(client))
+ if (!client->local)
return BadRequest;
switch (stuff->data) {
diff --git a/xorg-server/hw/xfree86/int10/generic.c b/xorg-server/hw/xfree86/int10/generic.c
index 4633120fd..d7594def2 100644
--- a/xorg-server/hw/xfree86/int10/generic.c
+++ b/xorg-server/hw/xfree86/int10/generic.c
@@ -178,7 +178,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
*/
vbiosMem = (char *) base + V_BIOS;
memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
- if (pci_device_read_rom(pInt->dev, vbiosMem) < V_BIOS_SIZE) {
+ if (pci_device_read_rom(pInt->dev, vbiosMem) != 0
+ || pInt->dev->rom_size < V_BIOS_SIZE) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Unable to retrieve all of segment 0x0C0000.\n");
}
diff --git a/xorg-server/hw/xquartz/applewm.c b/xorg-server/hw/xquartz/applewm.c
index d41a81db3..aea0a45f2 100644
--- a/xorg-server/hw/xquartz/applewm.c
+++ b/xorg-server/hw/xquartz/applewm.c
@@ -612,7 +612,7 @@ ProcAppleWMDispatch(register ClientPtr client)
return ProcAppleWMQueryVersion(client);
}
- if (!LocalClient(client))
+ if (!client->local)
return WMErrorBase + AppleWMClientNotLocal;
switch (stuff->data) {
@@ -684,7 +684,7 @@ SProcAppleWMDispatch(register ClientPtr client)
REQUEST(xReq);
/* It is bound to be non-local when there is byte swapping */
- if (!LocalClient(client))
+ if (!client->local)
return WMErrorBase + AppleWMClientNotLocal;
/* only local clients are allowed WM access */
diff --git a/xorg-server/hw/xquartz/xpr/appledri.c b/xorg-server/hw/xquartz/xpr/appledri.c
index f77848f13..9aac07240 100644
--- a/xorg-server/hw/xquartz/xpr/appledri.c
+++ b/xorg-server/hw/xquartz/xpr/appledri.c
@@ -129,7 +129,7 @@ ProcAppleDRIQueryDirectRenderingCapable(register ClientPtr client)
}
rep.isCapable = isCapable;
- if (!LocalClient(client))
+ if (!client->local)
rep.isCapable = 0;
if (client->swapped) {
@@ -354,7 +354,7 @@ ProcAppleDRIDispatch(register ClientPtr client)
return ProcAppleDRIQueryDirectRenderingCapable(client);
}
- if (!LocalClient(client))
+ if (!client->local)
return DRIErrorBase + AppleDRIClientNotLocal;
switch (stuff->data) {
@@ -469,7 +469,7 @@ SProcAppleDRIDispatch(register ClientPtr client)
return SProcAppleDRIQueryDirectRenderingCapable(client);
}
- if (!LocalClient(client))
+ if (!client->local)
return DRIErrorBase + AppleDRIClientNotLocal;
switch (stuff->data) {
diff --git a/xorg-server/hw/xwin/winwindowswm.c b/xorg-server/hw/xwin/winwindowswm.c
index 5d513a893..88c375733 100644
--- a/xorg-server/hw/xwin/winwindowswm.c
+++ b/xorg-server/hw/xwin/winwindowswm.c
@@ -525,7 +525,7 @@ ProcWindowsWMDispatch(ClientPtr client)
return ProcWindowsWMQueryVersion(client);
}
- if (!LocalClient(client))
+ if (!client->local)
return WMErrorBase + WindowsWMClientNotLocal;
switch (stuff->data) {
@@ -575,7 +575,7 @@ SProcWindowsWMDispatch(ClientPtr client)
REQUEST(xReq);
/* It is bound to be non-local when there is byte swapping */
- if (!LocalClient(client))
+ if (!client->local)
return WMErrorBase + WindowsWMClientNotLocal;
/* only local clients are allowed WM access */
diff --git a/xorg-server/include/dixstruct.h b/xorg-server/include/dixstruct.h
index b2a168aa8..c1236f5c9 100644
--- a/xorg-server/include/dixstruct.h
+++ b/xorg-server/include/dixstruct.h
@@ -56,8 +56,7 @@ ReplyNotSwappd(ClientPtr /* pClient */ ,
void * /* pbuf */ ) _X_NORETURN;
typedef enum { ClientStateInitial,
- /* 1 is unused now, was ClientStateAuthenticating */
- ClientStateRunning = 2,
+ ClientStateRunning,
ClientStateRetained,
ClientStateGone
} ClientState;
@@ -86,26 +85,29 @@ typedef struct _Window *SaveSetElt;
#endif
typedef struct _Client {
- int index;
- Mask clientAsMask;
pointer requestBuffer;
pointer osPrivate; /* for OS layer, including scheduler */
- Bool swapped;
+ Mask clientAsMask;
+ short index;
+ unsigned char majorOp, minorOp;
+ int swapped:1;
+ int local:1;
+ int big_requests:1; /* supports large requests */
+ int clientGone:1;
+ int closeDownMode:2;
+ int clientState:2;
+ char smart_priority;
+ short noClientException; /* this client died or needs to be killed */
+ int priority;
ReplySwapPtr pSwapReplyFunc;
XID errorValue;
int sequence;
- int closeDownMode;
- int clientGone;
- int noClientException; /* this client died or needs to be
- * killed */
int ignoreCount; /* count for Attend/IgnoreClient */
- SaveSetElt *saveSet;
int numSaved;
+ SaveSetElt *saveSet;
int (**requestVector) (ClientPtr /* pClient */ );
CARD32 req_len; /* length of current request */
- Bool big_requests; /* supports large requests */
- int priority;
- ClientState clientState;
+ unsigned int replyBytesRemaining;
PrivateRec *devPrivates;
unsigned short xkbClientFlags;
unsigned short mapNotifyMask;
@@ -113,15 +115,12 @@ typedef struct _Client {
unsigned short vMajor, vMinor;
KeyCode minKC, maxKC;
- unsigned long replyBytesRemaining;
- int smart_priority;
- long smart_start_tick;
- long smart_stop_tick;
- long smart_check_tick;
+ int smart_start_tick;
+ int smart_stop_tick;
+ int smart_check_tick;
DeviceIntPtr clientPtr;
ClientIdPtr clientIds;
- unsigned short majorOp, minorOp;
} ClientRec;
/*
diff --git a/xorg-server/include/os.h b/xorg-server/include/os.h
index 9e323f331..e32421610 100644
--- a/xorg-server/include/os.h
+++ b/xorg-server/include/os.h
@@ -407,9 +407,6 @@ extern _X_EXPORT int
InvalidHost(sockaddrPtr /*saddr */ , int /*len */ , ClientPtr client);
extern _X_EXPORT int
-LocalClient(ClientPtr /* client */ );
-
-extern _X_EXPORT int
LocalClientCred(ClientPtr, int *, int *);
#define LCC_UID_SET (1 << 0)
diff --git a/xorg-server/include/windowstr.h b/xorg-server/include/windowstr.h
index 9caafba41..a1e608f09 100644
--- a/xorg-server/include/windowstr.h
+++ b/xorg-server/include/windowstr.h
@@ -86,8 +86,8 @@ typedef struct _WindowOpt {
struct _OtherClients *otherClients; /* default: NULL */
struct _GrabRec *passiveGrabs; /* default: NULL */
PropertyPtr userProps; /* default: NULL */
- unsigned long backingBitPlanes; /* default: ~0L */
- unsigned long backingPixel; /* default: 0 */
+ CARD32 backingBitPlanes; /* default: ~0L */
+ CARD32 backingPixel; /* default: 0 */
RegionPtr boundingShape; /* default: NULL */
RegionPtr clipShape; /* default: NULL */
RegionPtr inputShape; /* default: NULL */
diff --git a/xorg-server/mi/mipointer.c b/xorg-server/mi/mipointer.c
index 4defaf5ec..f34506326 100644
--- a/xorg-server/mi/mipointer.c
+++ b/xorg-server/mi/mipointer.c
@@ -575,13 +575,8 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx,
miPointerPtr pPointer;
- if (!pDev)
- return NULL;
-
pPointer = MIPOINTER(pDev);
pScreen = pPointer->pScreen;
- if (!pScreen)
- return NULL; /* called before ready */
x = trunc(*screenx);
y = trunc(*screeny);
diff --git a/xorg-server/os/access.c b/xorg-server/os/access.c
index 550f2ed8c..104b6a713 100644
--- a/xorg-server/os/access.c
+++ b/xorg-server/os/access.c
@@ -1007,14 +1007,6 @@ ComputeLocalClient(ClientPtr client)
return FALSE;
}
-Bool
-LocalClient(ClientPtr client)
-{
- if (!client->osPrivate)
- return FALSE;
- return ((OsCommPtr) client->osPrivate)->local_client;
-}
-
/*
* Return the uid and gid of a connected local client
*
@@ -1176,7 +1168,7 @@ AuthorizedClient(ClientPtr client)
if (rc != Success)
return rc;
- return LocalClient(client) ? Success : BadAccess;
+ return client->local ? Success : BadAccess;
}
/* Add a host to the access control list. This is the external interface
diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c
index 721ad65b3..6cd8bcf43 100644
--- a/xorg-server/os/connection.c
+++ b/xorg-server/os/connection.c
@@ -764,7 +764,7 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time)
free(oc);
return NullClient;
}
- oc->local_client = ComputeLocalClient(client);
+ client->local = ComputeLocalClient(client);
#if !defined(WIN32)
ConnectionTranslation[fd] = client->index;
#else
@@ -894,7 +894,7 @@ ErrorConnMax(XtransConnInfo trans_conn)
xConnSetupPrefix csp;
char pad[3] = { 0, 0, 0 };
struct iovec iov[3];
- char byteOrder = 0;
+ char order = 0;
int whichbyte = 1;
struct timeval waittime;
fd_set mask;
@@ -907,15 +907,15 @@ ErrorConnMax(XtransConnInfo trans_conn)
FD_SET(fd, &mask);
(void) Select(fd + 1, &mask, NULL, NULL, &waittime);
/* try to read the byte-order of the connection */
- (void) _XSERVTransRead(trans_conn, &byteOrder, 1);
- if ((byteOrder == 'l') || (byteOrder == 'B')) {
+ (void) _XSERVTransRead(trans_conn, &order, 1);
+ if (order == 'l' || order == 'B' || order == 'r' || order == 'R') {
csp.success = xFalse;
csp.lengthReason = sizeof(NOROOM) - 1;
csp.length = (sizeof(NOROOM) + 2) >> 2;
csp.majorVersion = X_PROTOCOL;
csp.minorVersion = X_PROTOCOL_REVISION;
- if (((*(char *) &whichbyte) && (byteOrder == 'B')) ||
- (!(*(char *) &whichbyte) && (byteOrder == 'l'))) {
+ if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) ||
+ (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) {
swaps(&csp.majorVersion);
swaps(&csp.minorVersion);
swaps(&csp.length);
@@ -1038,8 +1038,8 @@ CloseDownConnection(ClientPtr client)
if (FlushCallback)
CallCallbacks(&FlushCallback, NULL);
- if (oc->output && oc->output->count)
- FlushClient(client, oc, (char *) NULL, 0);
+ if (oc->output)
+ FlushClient(client, oc, (char *) NULL, 0);
#ifdef XDMCP
XdmcpCloseDisplay(oc->fd);
#endif
diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c
index e44db3933..2f091c417 100644
--- a/xorg-server/os/io.c
+++ b/xorg-server/os/io.c
@@ -82,6 +82,23 @@ SOFTWARE.
CallbackListPtr ReplyCallback;
CallbackListPtr FlushCallback;
+typedef struct _connectionInput {
+ struct _connectionInput *next;
+ char *buffer; /* contains current client input */
+ char *bufptr; /* pointer to current start of data */
+ int bufcnt; /* count of bytes in buffer */
+ int lenLastReq;
+ int size;
+ unsigned int ignoreBytes; /* bytes to ignore before the next request */
+} ConnectionInput;
+
+typedef struct _connectionOutput {
+ struct _connectionOutput *next;
+ unsigned char *buf;
+ int size;
+ int count;
+} ConnectionOutput;
+
static ConnectionInputPtr AllocateInputBuffer(void);
static ConnectionOutputPtr AllocateOutputBuffer(void);
@@ -846,10 +863,13 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
long todo;
if (!oco)
- return 0;
+ return 0;
written = 0;
padsize = padding_for_int32(extraCount);
notWritten = oco->count + extraCount + padsize;
+ if (!notWritten)
+ return 0;
+
todo = notWritten;
while (notWritten) {
long before = written; /* amount of whole thing written */
diff --git a/xorg-server/os/osdep.h b/xorg-server/os/osdep.h
index fff088701..0ccdb62ef 100644
--- a/xorg-server/os/osdep.h
+++ b/xorg-server/os/osdep.h
@@ -107,22 +107,8 @@ typedef Bool (*AddAuthorFunc) (unsigned name_length, const char *name,
unsigned data_length, char *data);
#endif
-typedef struct _connectionInput {
- struct _connectionInput *next;
- char *buffer; /* contains current client input */
- char *bufptr; /* pointer to current start of data */
- int bufcnt; /* count of bytes in buffer */
- int lenLastReq;
- int size;
- unsigned int ignoreBytes; /* bytes to ignore before the next request */
-} ConnectionInput, *ConnectionInputPtr;
-
-typedef struct _connectionOutput {
- struct _connectionOutput *next;
- int size;
- unsigned char *buf;
- int count;
-} ConnectionOutput, *ConnectionOutputPtr;
+typedef struct _connectionInput *ConnectionInputPtr;
+typedef struct _connectionOutput *ConnectionOutputPtr;
struct _osComm;
@@ -162,7 +148,6 @@ typedef struct _osComm {
XID auth_id; /* authorization id */
CARD32 conn_time; /* timestamp if not established, else 0 */
struct _XtransConnInfo *trans_conn; /* transport connection object */
- Bool local_client;
} OsCommRec, *OsCommPtr;
extern int FlushClient(ClientPtr /*who */ ,
diff --git a/xorg-server/xkeyboard-config/rules/base.xml.in b/xorg-server/xkeyboard-config/rules/base.xml.in
index 87943048e..712ddabf6 100644
--- a/xorg-server/xkeyboard-config/rules/base.xml.in
+++ b/xorg-server/xkeyboard-config/rules/base.xml.in
@@ -3433,6 +3433,12 @@
</languageList>
</configItem>
</variant>
+ <variant>
+ <configItem>
+ <name>ibm</name>
+ <_description>Italian (IBM 142)</_description>
+ </configItem>
+ </variant>
</variantList>
</layout>
<layout>
diff --git a/xorg-server/xkeyboard-config/symbols/it b/xorg-server/xkeyboard-config/symbols/it
index 1d26a044b..d70e49755 100644
--- a/xorg-server/xkeyboard-config/symbols/it
+++ b/xorg-server/xkeyboard-config/symbols/it
@@ -255,3 +255,46 @@ xkb_symbols "htcdream" {
include "level3(alt_switch)"
};
+
+partial alphanumeric_keys
+xkb_symbols "ibm" {
+
+ // Modifies the basic italian layout to match IBM 142 variant
+
+ include "us"
+
+ name[Group1]="Italian (IBM 142)";
+
+ key <TLDE> { [ backslash, bar ] };
+
+ key <AE02> { [ 2, quotedbl ] };
+ key <AE03> { [ 3, sterling, numbersign ] };
+ key <AE06> { [ 6, ampersand ] };
+ key <AE07> { [ 7, slash, braceleft ] };
+ key <AE08> { [ 8, parenleft, bracketleft ] };
+ key <AE09> { [ 9, parenright, bracketright ] };
+ key <AE10> { [ 0, equal, braceright ] };
+ key <AE11> { [apostrophe, question ] };
+ key <AE12> { [ igrave, asciicircum ] };
+
+ key <AD01> { [ q, Q, at ] };
+ key <AD03> { [ e, E, EuroSign ] };
+ key <AD11> { [ egrave, eacute ] };
+ key <AD12> { [ plus, asterisk, asciitilde ] };
+
+ key <AC10> { [ ograve, ccedilla ] };
+ key <AC11> { [ agrave, degree ] };
+
+ key <AB08> { [ comma, semicolon ] };
+ key <AB09> { [ period, colon ] };
+ key <AB10> { [ minus, underscore ] };
+
+ key <BKSL> { [ ugrave, section, grave ] };
+
+ key <LSGT> { [ less, greater ] };
+
+ include "level3(ralt_switch)"
+ include "kpdl(comma)"
+
+};
+