diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2017-12-22 19:26:16 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2017-12-22 19:26:16 +0000 |
commit | 392ac678b43f5ed414e5256ab9f525520639136b (patch) | |
tree | 33d400f596d21dd4315bb0ff4a46570bf0f95738 | |
parent | 0747136257c4e6b9f1a93addd448cd820b7418a1 (diff) | |
parent | ebfb06b11955a6c32500b7086be912ab96b753a7 (diff) |
Merge tag 'xorg-server-1.19.6' into cygwin-release-1.19xserver-cygwin-1.19.6-1
xorg-server-1.19.6
-rw-r--r-- | Xext/shm.c | 8 | ||||
-rw-r--r-- | composite/compositeext.h | 2 | ||||
-rw-r--r-- | composite/compwindow.c | 9 | ||||
-rw-r--r-- | config/udev.c | 65 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | dix/devices.c | 7 | ||||
-rw-r--r-- | glx/glxcmds.c | 14 | ||||
-rw-r--r-- | glx/glxdri2.c | 3 | ||||
-rw-r--r-- | glx/glxdricommon.c | 52 | ||||
-rw-r--r-- | glx/glxdriswrast.c | 3 | ||||
-rw-r--r-- | glx/glxscreens.c | 32 | ||||
-rw-r--r-- | glx/glxscreens.h | 4 | ||||
-rw-r--r-- | hw/xfree86/drivers/modesetting/drmmode_display.c | 40 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86EdidModes.c | 4 | ||||
-rw-r--r-- | hw/xfree86/ramdac/xf86HWCurs.c | 9 | ||||
-rw-r--r-- | hw/xquartz/GL/indirect.c | 2 | ||||
-rw-r--r-- | hw/xwayland/xwayland-cursor.c | 2 | ||||
-rw-r--r-- | include/misc.h | 2 | ||||
-rw-r--r-- | os/access.c | 6 | ||||
-rw-r--r-- | os/xdmcp.c | 2 | ||||
-rw-r--r-- | present/present.c | 8 | ||||
-rw-r--r-- | present/present_event.c | 5 | ||||
-rw-r--r-- | present/present_priv.h | 5 | ||||
-rw-r--r-- | present/present_request.c | 4 | ||||
-rw-r--r-- | randr/rroutput.c | 2 | ||||
-rw-r--r-- | randr/rrscreen.c | 2 | ||||
-rw-r--r-- | test/input.c | 2 | ||||
-rw-r--r-- | test/signal-logging.c | 2 | ||||
-rw-r--r-- | xfixes/cursor.c | 28 | ||||
-rw-r--r-- | xkb/ddxLoad.c | 6 | ||||
-rw-r--r-- | xkb/xkbUtils.c | 2 |
31 files changed, 219 insertions, 119 deletions
diff --git a/Xext/shm.c b/Xext/shm.c index c98d4a0c3..fe42a66d2 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -650,9 +650,8 @@ ProcShmGetImage(ClientPtr client) wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height) return BadMatch; visual = wVisual(((WindowPtr) pDraw)); - pVisibleRegion = NotClippedByChildren((WindowPtr) pDraw); - if (pVisibleRegion) - RegionTranslate(pVisibleRegion, -pDraw->x, -pDraw->y); + if (pDraw->type == DRAWABLE_WINDOW) + pVisibleRegion = &((WindowPtr) pDraw)->borderClip; } else { if (stuff->x < 0 || @@ -715,9 +714,6 @@ ProcShmGetImage(ClientPtr client) } } - if (pVisibleRegion) - RegionDestroy(pVisibleRegion); - if (client->swapped) { swaps(&xgi.sequenceNumber); swapl(&xgi.length); diff --git a/composite/compositeext.h b/composite/compositeext.h index b96cb1d68..5aad0735e 100644 --- a/composite/compositeext.h +++ b/composite/compositeext.h @@ -39,6 +39,8 @@ extern _X_EXPORT Bool CompositeRegisterImplicitRedirectionException(ScreenPtr pS VisualID parentVisual, VisualID winVisual); + +extern _X_EXPORT Bool compIsAlternateVisual(ScreenPtr pScreen, XID visual); extern _X_EXPORT RESTYPE CompositeClientWindowType; #endif /* _COMPOSITEEXT_H_ */ diff --git a/composite/compwindow.c b/composite/compwindow.c index bcd230c37..f88238146 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -320,18 +320,13 @@ compClipNotify(WindowPtr pWin, int dx, int dy) } } -/* - * Returns TRUE if the window needs server-provided automatic redirect, - * which is true if the child and parent aren't both regular or ARGB visuals - */ - -static Bool +Bool compIsAlternateVisual(ScreenPtr pScreen, XID visual) { CompScreenPtr cs = GetCompScreen(pScreen); int i; - for (i = 0; i < cs->numAlternateVisuals; i++) + for (i = 0; cs && i < cs->numAlternateVisuals; i++) if (cs->alternateVisuals[i] == visual) return TRUE; return FALSE; diff --git a/config/udev.c b/config/udev.c index 932f230c7..e198e8609 100644 --- a/config/udev.c +++ b/config/udev.c @@ -134,7 +134,8 @@ device_added(struct udev_device *udev_device) } #endif - if (!udev_device_get_property_value(udev_device, "ID_INPUT")) { + value = udev_device_get_property_value(udev_device, "ID_INPUT"); + if (value && !strcmp(value, "0")) { LogMessageVerb(X_INFO, 10, "config/udev: ignoring device %s without " "property ID_INPUT set\n", path); @@ -237,38 +238,36 @@ device_added(struct udev_device *udev_device) else if (!strcmp(key, "ID_VENDOR")) { LOG_PROPERTY(path, key, value); attrs.vendor = strdup(value); - } - else if (!strcmp(key, "ID_INPUT_KEY")) { - LOG_PROPERTY(path, key, value); - attrs.flags |= ATTR_KEY; - } - else if (!strcmp(key, "ID_INPUT_KEYBOARD")) { - LOG_PROPERTY(path, key, value); - attrs.flags |= ATTR_KEYBOARD; - } - else if (!strcmp(key, "ID_INPUT_MOUSE")) { - LOG_PROPERTY(path, key, value); - attrs.flags |= ATTR_POINTER; - } - else if (!strcmp(key, "ID_INPUT_JOYSTICK")) { - LOG_PROPERTY(path, key, value); - attrs.flags |= ATTR_JOYSTICK; - } - else if (!strcmp(key, "ID_INPUT_TABLET")) { - LOG_PROPERTY(path, key, value); - attrs.flags |= ATTR_TABLET; - } - else if (!strcmp(key, "ID_INPUT_TABLET_PAD")) { - LOG_PROPERTY(path, key, value); - attrs.flags |= ATTR_TABLET_PAD; - } - else if (!strcmp(key, "ID_INPUT_TOUCHPAD")) { - LOG_PROPERTY(path, key, value); - attrs.flags |= ATTR_TOUCHPAD; - } - else if (!strcmp(key, "ID_INPUT_TOUCHSCREEN")) { - LOG_PROPERTY(path, key, value); - attrs.flags |= ATTR_TOUCHSCREEN; + } else if (!strncmp(key, "ID_INPUT_", 9)) { + const struct pfmap { + const char *property; + unsigned int flag; + } map[] = { + { "ID_INPUT_KEY", ATTR_KEY }, + { "ID_INPUT_KEYBOARD", ATTR_KEYBOARD }, + { "ID_INPUT_MOUSE", ATTR_POINTER }, + { "ID_INPUT_JOYSTICK", ATTR_JOYSTICK }, + { "ID_INPUT_TABLET", ATTR_TABLET }, + { "ID_INPUT_TABLET_PAD", ATTR_TABLET_PAD }, + { "ID_INPUT_TOUCHPAD", ATTR_TOUCHPAD }, + { "ID_INPUT_TOUCHSCREEN", ATTR_TOUCHSCREEN }, + { NULL, 0 }, + }; + + /* Anything but the literal string "0" is considered a + * boolean true. The empty string isn't a thing with udev + * properties anyway */ + if (value && strcmp(value, "0")) { + const struct pfmap *m = map; + + while (m->property != NULL) { + if (!strcmp(m->property, key)) { + LOG_PROPERTY(path, key, value); + attrs.flags |= m->flag; + } + m++; + } + } } } diff --git a/configure.ac b/configure.ac index 434ddc45f..c3dc8f6a8 100644 --- a/configure.ac +++ b/configure.ac @@ -26,9 +26,9 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.19.5, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2017-10-12" -RELEASE_NAME="Shahi Paneer" +AC_INIT([xorg-server], 1.19.6, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2017-12-20" +RELEASE_NAME="Lousiana Gumbo" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) diff --git a/dix/devices.c b/dix/devices.c index ea3c6c8a9..4a628afb0 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -2329,10 +2329,15 @@ int ProcGetPointerControl(ClientPtr client) { DeviceIntPtr ptr = PickPointer(client); - PtrCtrl *ctrl = &ptr->ptrfeed->ctrl; + PtrCtrl *ctrl; xGetPointerControlReply rep; int rc; + if (ptr->ptrfeed) + ctrl = &ptr->ptrfeed->ctrl; + else + ctrl = &defaultPointerControl; + REQUEST_SIZE_MATCH(xReq); rc = XaceHook(XACE_DEVICE_ACCESS, client, ptr, DixGetAttrAccess); diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 5873cb49c..295857b26 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -215,6 +215,7 @@ __glXdirectContextCreate(__GLXscreen * screen, if (context == NULL) return NULL; + context->config = modes; context->destroy = __glXdirectContextDestroy; context->loseCurrent = __glXdirectContextLoseCurrent; @@ -631,7 +632,7 @@ DoMakeCurrent(__GLXclientState * cl, /* ** Flush the previous context if needed. */ - Bool need_flush = GL_TRUE; + Bool need_flush = !prevglxc->isDirect; #ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB) need_flush = GL_FALSE; @@ -1030,13 +1031,14 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) buf[p++] = modes->samples; buf[p++] = GLX_SAMPLE_BUFFERS_SGIS; buf[p++] = modes->sampleBuffers; + buf[p++] = GLX_VISUAL_SELECT_GROUP_SGIX; + buf[p++] = modes->visualSelectGroup; /* Add attribute only if its value is not default. */ if (modes->sRGBCapable != GL_FALSE) { buf[p++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT; buf[p++] = modes->sRGBCapable; } - /* Don't add visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? - * Pad the remaining place with zeroes, so that attributes count is constant. */ + /* Pad with zeroes, so that attributes count is constant. */ while (p < GLX_VIS_CONFIG_TOTAL) { buf[p++] = 0; buf[p++] = 0; @@ -1720,7 +1722,7 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId) ClientPtr client = cl->client; __GLXcontext *ctx; xGLXQueryContextInfoEXTReply reply; - int nProps = 3; + int nProps = 5; int sendBuf[nProps * 2]; int nReplyBytes; int err; @@ -1742,6 +1744,10 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId) sendBuf[3] = (int) (ctx->config->visualID); sendBuf[4] = GLX_SCREEN_EXT; sendBuf[5] = (int) (ctx->pGlxScreen->pScreen->myNum); + sendBuf[6] = GLX_FBCONFIG_ID; + sendBuf[7] = (int) (ctx->config->fbconfigID); + sendBuf[8] = GLX_RENDER_TYPE; + sendBuf[9] = (int) (ctx->config->renderType); if (client->swapped) { __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 484b4aeab..91de0476a 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -557,6 +557,7 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen, return NULL; } + context->base.config = glxConfig; context->base.destroy = __glXDRIcontextDestroy; context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent; @@ -901,7 +902,7 @@ initializeExtensions(__GLXscreen * screen) #ifdef __DRI2_FLUSH_CONTROL if (strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0) { __glXEnableExtension(screen->glx_enable_bits, - "GLX_ARB_context_flush_control\n"); + "GLX_ARB_context_flush_control"); } #endif diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c index f6c6fcdf2..d3136e87b 100644 --- a/glx/glxdricommon.c +++ b/glx/glxdricommon.c @@ -139,13 +139,15 @@ render_type_is_pbuffer_only(unsigned renderType) static __GLXconfig * createModeFromConfig(const __DRIcoreExtension * core, const __DRIconfig * driConfig, - unsigned int visualType) + unsigned int visualType, + GLboolean duplicateForComp) { __GLXDRIconfig *config; GLint renderType = 0; unsigned int attrib, value, drawableType = GLX_PBUFFER_BIT; int i; + config = calloc(1, sizeof *config); config->driConfig = driConfig; @@ -181,6 +183,13 @@ createModeFromConfig(const __DRIcoreExtension * core, config->config.bindToTextureTargets |= GLX_TEXTURE_RECTANGLE_BIT_EXT; break; + case __DRI_ATTRIB_SWAP_METHOD: + /* Workaround for broken dri drivers */ + if (value != GLX_SWAP_UNDEFINED_OML && + value != GLX_SWAP_COPY_OML && + value != GLX_SWAP_EXCHANGE_OML) + value = GLX_SWAP_UNDEFINED_OML; + /* Fall through. */ default: setScalar(&config->config, attrib, value); break; @@ -196,6 +205,28 @@ createModeFromConfig(const __DRIcoreExtension * core, config->config.drawableType = drawableType; config->config.yInverted = GL_TRUE; +#ifdef COMPOSITE + /* + * Here we decide what fbconfigs will be duplicated for compositing. + * fgbconfigs marked with duplicatedForConf will be reserved for + * compositing visuals. + * It might look strange to do this decision this late when translation + * from a __DRIConfig is already done, but using the __DRIConfig + * accessor function becomes worse both with respect to code complexity + * and CPU usage. + */ + if (duplicateForComp && + (render_type_is_pbuffer_only(renderType) || + config->config.rgbBits != 32 || + config->config.visualRating != GLX_NONE || + config->config.sampleBuffers != 0)) { + free(config); + return NULL; + } + + config->config.duplicatedForComp = duplicateForComp; +#endif + return &config->config; } @@ -210,21 +241,34 @@ glxConvertConfigs(const __DRIcoreExtension * core, head.next = NULL; for (i = 0; configs[i]; i++) { - tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR); + tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR, + GL_FALSE); if (tail->next == NULL) break; - tail = tail->next; } for (i = 0; configs[i]; i++) { - tail->next = createModeFromConfig(core, configs[i], GLX_DIRECT_COLOR); + tail->next = createModeFromConfig(core, configs[i], GLX_DIRECT_COLOR, + GL_FALSE); if (tail->next == NULL) break; tail = tail->next; } +#ifdef COMPOSITE + /* Duplicate fbconfigs for use with compositing visuals */ + for (i = 0; configs[i]; i++) { + tail->next = createModeFromConfig(core, configs[i], GLX_TRUE_COLOR, + GL_TRUE); + if (tail->next == NULL) + continue; + + tail = tail->next; + } +#endif + return head.next; } diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index ed0469fd6..e310fda75 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -244,6 +244,7 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen, if (context == NULL) return NULL; + context->base.config = glxConfig; context->base.destroy = __glXDRIcontextDestroy; context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent; @@ -413,7 +414,7 @@ initializeExtensions(__GLXscreen * screen) #ifdef __DRI2_FLUSH_CONTROL if (strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0) { __glXEnableExtension(screen->glx_enable_bits, - "GLX_ARB_context_flush_control\n"); + "GLX_ARB_context_flush_control"); } #endif diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 536c0c495..29bacd988 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -43,6 +43,7 @@ #include "glxutil.h" #include "glxext.h" #include "protocol-versions.h" +#include "compositeext.h" static DevPrivateKeyRec glxScreenPrivateKeyRec; @@ -277,7 +278,21 @@ pickFBConfig(__GLXscreen * pGlxScreen, VisualPtr visual) /* Can't use the same FBconfig for multiple X visuals. I think. */ if (config->visualID != 0) continue; - +#ifdef COMPOSITE + /* Use only duplicated configs for compIsAlternateVisuals */ + if (!!compIsAlternateVisual(pGlxScreen->pScreen, visual->vid) != + !!config->duplicatedForComp) + continue; +#endif + /* + * If possible, use the same swapmethod for all built-in visual + * fbconfigs, to avoid getting the 32-bit composite visual when + * requesting, for example, a SWAP_COPY fbconfig. + */ + if (config->swapMethod == GLX_SWAP_UNDEFINED_OML) + score += 32; + if (config->swapMethod == GLX_SWAP_EXCHANGE_OML) + score += 16; if (config->doubleBufferMode > 0) score += 8; if (config->depthBits > 0) @@ -336,6 +351,10 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) if (config) { pGlxScreen->visuals[pGlxScreen->numVisuals++] = config; config->visualID = visual->vid; +#ifdef COMPOSITE + if (compIsAlternateVisual(pScreen, visual->vid)) + config->visualSelectGroup++; +#endif } } @@ -355,7 +374,12 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) * set up above is for. */ depth = config->redBits + config->greenBits + config->blueBits; - +#ifdef COMPOSITE + if (config->duplicatedForComp) { + depth += config->alphaBits; + config->visualSelectGroup++; + } +#endif /* Make sure that our FBconfig's depth can actually be displayed * (corresponds to an existing visual). */ @@ -378,6 +402,10 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) if (visual == NULL) continue; +#ifdef COMPOSITE + if (config->duplicatedForComp) + (void) CompositeRegisterAlternateVisuals(pScreen, &visual->vid, 1); +#endif pGlxScreen->visuals[pGlxScreen->numVisuals++] = config; initGlxVisual(visual, config); } diff --git a/glx/glxscreens.h b/glx/glxscreens.h index 0f9a2b9af..c6a0c5021 100644 --- a/glx/glxscreens.h +++ b/glx/glxscreens.h @@ -39,7 +39,11 @@ typedef struct __GLXconfig __GLXconfig; struct __GLXconfig { + /* Management */ __GLXconfig *next; +#ifdef COMPOSITE + GLboolean duplicatedForComp; +#endif GLuint doubleBufferMode; GLuint stereoMode; diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index 53e1cf545..45d5e9091 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -57,34 +57,22 @@ static PixmapPtr drmmode_create_pixmap_header(ScreenPtr pScreen, int width, int static Bool drmmode_zaphod_string_matches(ScrnInfoPtr scrn, const char *s, char *output_name) { - int i = 0; - char s1[20]; - - do { - switch(*s) { - case ',': - s1[i] = '\0'; - i = 0; - if (strcmp(s1, output_name) == 0) - return TRUE; - break; - case ' ': - case '\t': - case '\n': - case '\r': - break; - default: - s1[i] = *s; - i++; - break; - } - } while(*s++); + char **token = xstrtokenize(s, ", \t\n\r"); + Bool ret = FALSE; - s1[i] = '\0'; - if (strcmp(s1, output_name) == 0) - return TRUE; + if (!token) + return FALSE; - return FALSE; + for (int i = 0; token[i]; i++) { + if (strcmp(token[i], output_name) == 0) + ret = TRUE; + + free(token[i]); + } + + free(token); + + return ret; } int diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index f0e1e974b..f903496f5 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -976,8 +976,8 @@ handle_cea_svd(struct cea_video_block *video, void *data) int vid; vid = video->video_code & 0x7f; - if (vid < CEA_VIDEO_MODES_NUM) { - Mode = xf86DuplicateMode(CEAVideoModes + vid); + if (vid >= 1 && vid <= CEA_VIDEO_MODES_NUM) { + Mode = xf86DuplicateMode(CEAVideoModes + (vid - 1)); *Modes = xf86ModesAdd(*Modes, Mode); } } diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c index 7043a9c72..4e2e587fd 100644 --- a/hw/xfree86/ramdac/xf86HWCurs.c +++ b/hw/xfree86/ramdac/xf86HWCurs.c @@ -180,9 +180,16 @@ xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); - xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; + + xf86CursorInfoPtr infoPtr; unsigned char *bits; + if (!ScreenPriv) { /* NULL if Option "SWCursor" */ + return (pCurs == NullCursor); + } + + infoPtr = ScreenPriv->CursorInfoPtr; + if (pCurs == NullCursor) { (*infoPtr->HideCursor) (infoPtr->pScrn); return TRUE; diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c index 2d88ef284..6738946ff 100644 --- a/hw/xquartz/GL/indirect.c +++ b/hw/xquartz/GL/indirect.c @@ -156,7 +156,7 @@ __glXAquaScreenCreateContext(__GLXscreen *screen, memset(context, 0, sizeof *context); context->base.pGlxScreen = screen; - + context->base.config = conf; context->base.destroy = __glXAquaContextDestroy; context->base.makeCurrent = __glXAquaContextMakeCurrent; context->base.loseCurrent = __glXAquaContextLoseCurrent; diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c index f334f1ca5..7b6a698fd 100644 --- a/hw/xwayland/xwayland-cursor.c +++ b/hw/xwayland/xwayland-cursor.c @@ -42,7 +42,7 @@ expand_source_and_mask(CursorPtr cursor, CARD32 *data) (cursor->foreGreen & 0xff00) | (cursor->foreGreen >> 8); bg = ((cursor->backRed & 0xff00) << 8) | (cursor->backGreen & 0xff00) | (cursor->backGreen >> 8); - stride = (bits->width / 8 + 3) & ~3; + stride = BitmapBytePad(bits->width); for (y = 0; y < bits->height; y++) for (x = 0; x < bits->width; x++) { i = y * stride + x / 8; diff --git a/include/misc.h b/include/misc.h index 01747fd38..2dedf6d63 100644 --- a/include/misc.h +++ b/include/misc.h @@ -248,7 +248,7 @@ padding_for_int32(const int bytes) } -extern char **xstrtokenize(const char *str, const char *separators); +extern _X_EXPORT char **xstrtokenize(const char *str, const char *separators); extern void FormatInt64(int64_t num, char *string); extern void FormatUInt64(uint64_t num, char *string); extern void FormatUInt64Hex(uint64_t num, char *string); diff --git a/os/access.c b/os/access.c index 8828e0834..97246160c 100644 --- a/os/access.c +++ b/os/access.c @@ -1137,12 +1137,12 @@ ComputeLocalClient(ClientPtr client) /* Cut off any colon and whatever comes after it, see * https://lists.freedesktop.org/archives/xorg-devel/2015-December/048164.html */ - cmd = strtok(cmd, ":"); + char *tok = strtok(cmd, ":"); #if !defined(WIN32) || defined(__CYGWIN__) - ret = strcmp(basename(cmd), "ssh") != 0; + ret = strcmp(basename(tok), "ssh") != 0; #else - ret = strcmp(cmd, "ssh") != 0; + ret = strcmp(tok, "ssh") != 0; #endif free(cmd); diff --git a/os/xdmcp.c b/os/xdmcp.c index 906c95944..7aeb393e6 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -797,7 +797,7 @@ XdmcpDeadSession(const char *reason) ErrorF("XDM: %s, declaring session dead\n", reason); state = XDM_INIT_STATE; isItTimeToYield = TRUE; - dispatchException |= DE_RESET; + dispatchException |= (OneSession ? DE_TERMINATE : DE_RESET); TimerCancel(xdmcp_timer); timeOutRtx = 0; send_packet(); diff --git a/present/present.c b/present/present.c index 7d428fca7..86743c504 100644 --- a/present/present.c +++ b/present/present.c @@ -222,13 +222,13 @@ present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, uint64_ int n; if (vblank->window) - present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset); + present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset, vblank->client); for (n = 0; n < vblank->num_notifies; n++) { WindowPtr window = vblank->notifies[n].window; CARD32 serial = vblank->notifies[n].serial; if (window) - present_send_complete_notify(window, kind, mode, serial, ust, crtc_msc - vblank->msc_offset); + present_send_complete_notify(window, kind, mode, serial, ust, crtc_msc - vblank->msc_offset, vblank->client); } } @@ -788,6 +788,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) int present_pixmap(WindowPtr window, PixmapPtr pixmap, + ClientPtr client, CARD32 serial, RegionPtr valid, RegionPtr update, @@ -898,6 +899,7 @@ present_pixmap(WindowPtr window, xorg_list_append(&vblank->window_list, &window_priv->vblank); xorg_list_init(&vblank->event_queue); + vblank->client = client; vblank->screen = screen; vblank->window = window; vblank->pixmap = pixmap; @@ -1017,6 +1019,7 @@ present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64 int present_notify_msc(WindowPtr window, + ClientPtr client, CARD32 serial, uint64_t target_msc, uint64_t divisor, @@ -1024,6 +1027,7 @@ present_notify_msc(WindowPtr window, { return present_pixmap(window, NULL, + client, serial, NULL, NULL, 0, 0, diff --git a/present/present_event.c b/present/present_event.c index c222dd5ff..ac6f2555a 100644 --- a/present/present_event.c +++ b/present/present_event.c @@ -146,7 +146,7 @@ present_register_complete_notify(present_complete_notify_proc proc) } void -present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc) +present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc, ClientPtr client) { present_window_priv_ptr window_priv = present_window_priv(window); @@ -167,7 +167,8 @@ present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 se present_event_ptr event; for (event = window_priv->events; event; event = event->next) { - if (event->mask & PresentCompleteNotifyMask) { + if (event->mask & PresentCompleteNotifyMask && + client == event->client) { cn.eid = event->id; WriteEventsToClient(event->client, 1, (xEvent *) &cn); } diff --git a/present/present_priv.h b/present/present_priv.h index dfb4bdea9..41c37af7e 100644 --- a/present/present_priv.h +++ b/present/present_priv.h @@ -52,6 +52,7 @@ struct present_notify { struct present_vblank { struct xorg_list window_list; struct xorg_list event_queue; + ClientPtr client; ScreenPtr screen; WindowPtr window; PixmapPtr pixmap; @@ -155,6 +156,7 @@ present_get_window_priv(WindowPtr window, Bool create); int present_pixmap(WindowPtr window, PixmapPtr pixmap, + ClientPtr client, CARD32 serial, RegionPtr valid, RegionPtr update, @@ -172,6 +174,7 @@ present_pixmap(WindowPtr window, int present_notify_msc(WindowPtr window, + ClientPtr client, CARD32 serial, uint64_t target_msc, uint64_t divisor, @@ -215,7 +218,7 @@ void present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling); void -present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc); +present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc, ClientPtr client); void present_send_idle_notify(WindowPtr window, CARD32 serial, PixmapPtr pixmap, present_fence_ptr idle_fence); diff --git a/present/present_request.c b/present/present_request.c index c7663fcc8..6997aa869 100644 --- a/present/present_request.c +++ b/present/present_request.c @@ -135,7 +135,7 @@ proc_present_pixmap(ClientPtr client) return ret; } - ret = present_pixmap(window, pixmap, stuff->serial, valid, update, + ret = present_pixmap(window, pixmap, client, stuff->serial, valid, update, stuff->x_off, stuff->y_off, target_crtc, wait_fence, idle_fence, stuff->options, stuff->target_msc, stuff->divisor, stuff->remainder, notifies, nnotifies); @@ -171,7 +171,7 @@ proc_present_notify_msc(ClientPtr client) } } - return present_notify_msc(window, stuff->serial, + return present_notify_msc(window, client, stuff->serial, stuff->target_msc, stuff->divisor, stuff->remainder); } diff --git a/randr/rroutput.c b/randr/rroutput.c index a8efec409..647f19a52 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -459,7 +459,7 @@ ProcRRGetOutputInfo(ClientPtr client) if (extraLen) { rep.length += bytes_to_int32(extraLen); - extra = malloc(extraLen); + extra = calloc(1, extraLen); if (!extra) return BadAlloc; } diff --git a/randr/rrscreen.c b/randr/rrscreen.c index d6c499580..0c70b28dd 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -558,7 +558,7 @@ rrGetScreenResources(ClientPtr client, Bool query) extraLen = rep.length << 2; if (extraLen) { - extra = malloc(extraLen); + extra = calloc(1, extraLen); if (!extra) { free(modes); return BadAlloc; diff --git a/test/input.c b/test/input.c index 91ee43c46..92dd8910c 100644 --- a/test/input.c +++ b/test/input.c @@ -228,7 +228,7 @@ dix_check_grab_values(void) static void dix_event_to_core(int type) { - DeviceEvent ev; + DeviceEvent ev = {}; xEvent *core; int time; int x, y; diff --git a/test/signal-logging.c b/test/signal-logging.c index 7f2972003..1af6316de 100644 --- a/test/signal-logging.c +++ b/test/signal-logging.c @@ -146,7 +146,7 @@ number_formatting(void) for (i = 0; i < sizeof(unsigned_tests) / sizeof(unsigned_tests[0]); i++) assert(check_number_format_test(unsigned_tests[i])); - for (i = 0; i < sizeof(unsigned_tests) / sizeof(signed_tests[0]); i++) + for (i = 0; i < sizeof(signed_tests) / sizeof(signed_tests[0]); i++) assert(check_signed_number_format_test(signed_tests[i])); for (i = 0; i < sizeof(float_tests) / sizeof(float_tests[0]); i++) diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 6e84d71f1..a150f450b 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -61,7 +61,6 @@ static RESTYPE CursorClientType; static RESTYPE CursorHideCountType; static RESTYPE CursorWindowType; -static CursorPtr CursorCurrent[MAXDEVICES]; static DevPrivateKeyRec CursorScreenPrivateKeyRec; @@ -132,10 +131,26 @@ typedef struct _CursorScreen { Bool CursorVisible = FALSE; Bool EnableCursor = TRUE; +static CursorPtr +CursorForDevice(DeviceIntPtr pDev) +{ + if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) + return pDev->spriteInfo->sprite->current; + + return NULL; +} + +static CursorPtr +CursorForClient(ClientPtr client) +{ + return CursorForDevice(PickPointer(client)); +} + static Bool CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { CursorScreenPtr cs = GetCursorScreen(pScreen); + CursorPtr pOldCursor = CursorForDevice(pDev); Bool ret; DisplayCursorProcPtr backupProc; @@ -150,11 +165,10 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor); } - if (pCursor != CursorCurrent[pDev->id]) { + if (pCursor != pOldCursor) { CursorEventPtr e; UpdateCurrentTimeIf(); - CursorCurrent[pDev->id] = pCursor; for (e = cursorEvents; e; e = e->next) { if ((e->eventMask & XFixesDisplayCursorNotifyMask)) { xXFixesCursorNotifyEvent ev = { @@ -351,7 +365,7 @@ ProcXFixesGetCursorImage(ClientPtr client) int npixels, width, height, rc, x, y; REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq); - pCursor = CursorCurrent[PickPointer(client)->id]; + pCursor = CursorForClient(client); if (!pCursor) return BadCursor; rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR, @@ -500,7 +514,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client) int rc, x, y; REQUEST_SIZE_MATCH(xXFixesGetCursorImageAndNameReq); - pCursor = CursorCurrent[PickPointer(client)->id]; + pCursor = CursorForClient(client); if (!pCursor) return BadCursor; rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR, @@ -874,7 +888,7 @@ ProcXFixesHideCursor(ClientPtr client) for (dev = inputInfo.devices; dev; dev = dev->next) { if (IsMaster(dev) && IsPointerDevice(dev)) CursorDisplayCursor(dev, pWin->drawable.pScreen, - CursorCurrent[dev->id]); + CursorForDevice(dev)); } } @@ -969,7 +983,7 @@ CursorFreeHideCount(void *data, XID id) deleteCursorHideCount(pChc, pChc->pScreen); for (dev = inputInfo.devices; dev; dev = dev->next) { if (IsMaster(dev) && IsPointerDevice(dev)) - CursorDisplayCursor(dev, pScreen, CursorCurrent[dev->id]); + CursorDisplayCursor(dev, pScreen, CursorForDevice(dev)); } return 1; diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index c03fa6079..cad51d68f 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -205,8 +205,10 @@ RunXkbComp(xkbcomp_buffer_callback callback, void *userdata) #endif return xnfstrdup(keymap); } - else - LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap); + else { + LogMessage(X_ERROR, "Error compiling keymap (%s) executing '%s'\n", + keymap, buf); + } #if defined(WIN32) || defined(__CYGWIN__) LogMessage(X_ERROR, "xkbcomp exit status 0x%x\n", status); diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 25b5a364e..8975ade8d 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -222,7 +222,7 @@ XkbUpdateKeyTypesFromCore(DeviceIntPtr pXDev, XkbDescPtr xkb; unsigned key, nG, explicit; int types[XkbNumKbdGroups]; - KeySym tsyms[XkbMaxSymsPerKey], *syms; + KeySym tsyms[XkbMaxSymsPerKey] = {NoSymbol}, *syms; XkbMapChangesPtr mc; xkb = pXDev->key->xkbInfo->desc; |