From 91aa32fcd49f558a78bb8fc17155da177ca09801 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 7 Nov 2011 20:54:10 +0000 Subject: Enhance -hostintitle - Add '@' to window name when it's useful to do so - Don't add host if it's already in the title - Default to enabled - Provide -nohostintitle to disable if neeeded --- hw/xwin/InitOutput.c | 2 +- hw/xwin/man/XWin.man | 3 ++- hw/xwin/winglobals.c | 2 +- hw/xwin/winmultiwindowwm.c | 13 +++++++------ hw/xwin/winprocarg.c | 5 +++++ 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index f187c88c2..7ca818c70 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -772,7 +772,7 @@ winUseMsg(void) ErrorF("-fullscreen\n" "\tRun the server in fullscreen mode.\n"); - ErrorF("-hostintitle\n" + ErrorF("-[no]hostintitle\n" "\tIn multiwindow mode, add remote host names to window titles.\n"); ErrorF("-ignoreinput\n" "\tIgnore keyboard and mouse input.\n"); diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man index 9a046d930..738818ea5 100644 --- a/hw/xwin/man/XWin.man +++ b/hw/xwin/man/XWin.man @@ -170,9 +170,10 @@ on its own is equivalent to \fB\-resize=randr\fP .SH OPTIONS FOR MULTIWINDOW MODE .TP 8 -.B \-hostintitle +.B \-[no]hostintitle Add the host name to the window title for X applications which are running on remote hosts, when that information is available and it's useful to do so. +The default is enabled. .SH OPTIONS CONTROLLING WINDOWS INTEGRATION .TP 8 diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index ad82b83f6..1382c8972 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -78,7 +78,7 @@ Bool g_fNoHelpMessageBox = FALSE; Bool g_fSoftwareCursor = FALSE; Bool g_fSilentDupError = FALSE; Bool g_fNativeGl = TRUE; -Bool g_fHostInTitle = FALSE; +Bool g_fHostInTitle = TRUE; pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER; #ifdef XWIN_CLIPBOARD diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 262f53830..75c9d6cc2 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -488,19 +488,20 @@ GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName) /* If we have a client machine name - and it's not the local host name... + and it's not the local host name + and it's not already in the window title... */ if (strlen(pszClientMachine) && !gethostname(hostname, HOST_NAME_MAX + 1) && - strcmp(hostname, pszClientMachine)) { - /* ... add ' (on )' to end of window name */ + strcmp(hostname, pszClientMachine) && + (strstr(pszWindowName, pszClientMachine) == 0)) { + /* ... add '@' to end of window name */ *ppWindowName = malloc(strlen(pszWindowName) + - strlen(pszClientMachine) + 7); + strlen(pszClientMachine) + 2); strcpy(*ppWindowName, pszWindowName); - strcat(*ppWindowName, " (on "); + strcat(*ppWindowName, "@"); strcat(*ppWindowName, pszClientMachine); - strcat(*ppWindowName, ")"); free(pszWindowName); free(pszClientMachine); diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index bb6efc3da..bff3fead9 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -1112,6 +1112,11 @@ ddxProcessArgument(int argc, char *argv[], int i) return 1; } + if (IS_OPTION("-nohostintitle")) { + g_fHostInTitle = FALSE; + return 1; + } + return 0; } -- cgit v1.2.3 From 52c385d40b6b6e70095deded586265aa4a43e565 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 28 Mar 2014 16:57:48 +0000 Subject: XGetWMNormalHints() returns non-zero on success XGetWMNormalHints() doesn't actually return a Status value. On success it returns a non-zero value, not Success. --- hw/xwin/winmultiwindowwm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 75c9d6cc2..41c80afe8 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1858,8 +1858,7 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) long supplied; if (normal_hint && - (XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied) == - Success)) { + XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied)) { if (normal_hint->flags & PMaxSize) { /* Not maximizable if a maximum size is specified */ hint |= HINT_NOMAXIMIZE; -- cgit v1.2.3 From 43fa738d0964901448076cfd1f63f4e4f28f16a4 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 30 Mar 2014 20:51:36 +0100 Subject: Don't override the server supported GL extensions string. Don't override the server supported GL extensions string. The string reported to the client is the intersection of client, server and GL implementation extensions, not this one, so we don't need to change it. --- hw/xwin/glx/indirect.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index e8e75d534..71c0f805c 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -738,9 +738,6 @@ glxWinScreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen); - // Override the GL extensions string set by __glXScreenInit() - screen->base.GLextensions = strdup(gl_extensions); - // Generate the GLX extensions string (overrides that set by __glXScreenInit()) { unsigned int buffer_size = -- cgit v1.2.3 From dd6181d50c1806acf9720d6ec038af826c732a00 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 6 Apr 2014 14:46:08 +0100 Subject: Use raise() rather than kill() MinGW portability fix for "Cause the X server to terminate if the WM internal client thread exits due to an error". Use C89 raise(SIGTERM) rather than the POSIX equivalent kill(getpid(), SIGTERM). This still isn't quite right: On Cygwin for a clean shutdown we need send the signal to the server thread so it interrupts select(), but it's unclear that can happen at all for MinGW. Restarting the WM thread seems like a better alternative. Signed-off-by: Jon TURNEY --- hw/xwin/winmultiwindowwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 41c80afe8..7833932fe 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1623,7 +1623,7 @@ static void winMultiWindowThreadExit(void *arg) { /* multiwindow client thread has exited, stop server as well */ - kill(getpid(), SIGTERM); + raise(SIGTERM); } /* -- cgit v1.2.3 From 42ad4843e65761459314dc49d498f9675ac662aa Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sun, 6 Apr 2014 04:47:15 -0500 Subject: hw/xwin: link dynamically and export symbols With my patch to fix shared libXfont to work correctly on Cygwin/Win32, there is no need for -static anymore. But, XWin.exe must export its symbols in order for them to override libXfont's stubs. Signed-off-by: Yaakov Selkowitz Reviewed-by: Jon TURNEY --- hw/xwin/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index b4fa663d3..df920eb6d 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -155,7 +155,7 @@ XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la XWin_DEPENDENCIES = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) \ $(CLIPBOARD_LIBS) $(XWIN_GLX_SYS_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) $(MULTIWINDOW_SYS_LIBS) -XWin_LDFLAGS = -mwindows -static -Wl,--disable-stdcall-fixup +XWin_LDFLAGS = -mwindows -Wl,--disable-stdcall-fixup $(LD_EXPORT_SYMBOLS_FLAG) .rc.o: $(AM_V_GEN)$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include -DHOST_TRIPLET=\"$(host)\" -- cgit v1.2.3 From 06618aac4b85d3b3af2138153a25ffbf2da8e29b Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 2 Apr 2014 16:31:43 +0100 Subject: Regnerate GLX dispatch code Fixes GL_ARB_vertex_program glGetvertex[dfi]v --- glx/indirect_dispatch.c | 109 +++++++++++++++++++++++++++++++ glx/indirect_dispatch.h | 24 +++++-- glx/indirect_dispatch_swap.c | 149 ++++++++++++++++++++++++++++++++++++++----- glx/indirect_size_get.c | 28 ++++++++ glx/indirect_size_get.h | 3 + glx/indirect_table.c | 27 ++++---- 6 files changed, 309 insertions(+), 31 deletions(-) diff --git a/glx/indirect_dispatch.c b/glx/indirect_dispatch.c index 329b2e61e..7b125b4ce 100644 --- a/glx/indirect_dispatch.c +++ b/glx/indirect_dispatch.c @@ -4020,6 +4020,99 @@ __glXDisp_DrawBuffers(GLbyte * pc) DrawBuffers(n, (const GLenum *) (pc + 4)); } +int +__glXDisp_GetVertexAttribdv(__GLXclientState * cl, GLbyte * pc) +{ + PFNGLGETVERTEXATTRIBDVPROC GetVertexAttribdv = + __glGetProcAddress("glGetVertexAttribdv"); + xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; + int error; + __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); + + pc += __GLX_VENDPRIV_HDR_SIZE; + if (cx != NULL) { + const GLenum pname = *(GLenum *) (pc + 4); + + const GLuint compsize = __glGetVertexAttribdv_size(pname); + GLdouble answerBuffer[200]; + GLdouble *params = + __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, + sizeof(answerBuffer), 8); + + if (params == NULL) + return BadAlloc; + __glXClearErrorOccured(); + + GetVertexAttribdv(*(GLuint *) (pc + 0), pname, params); + __glXSendReply(cl->client, params, compsize, 8, GL_FALSE, 0); + error = Success; + } + + return error; +} + +int +__glXDisp_GetVertexAttribfv(__GLXclientState * cl, GLbyte * pc) +{ + PFNGLGETVERTEXATTRIBFVPROC GetVertexAttribfv = + __glGetProcAddress("glGetVertexAttribfv"); + xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; + int error; + __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); + + pc += __GLX_VENDPRIV_HDR_SIZE; + if (cx != NULL) { + const GLenum pname = *(GLenum *) (pc + 4); + + const GLuint compsize = __glGetVertexAttribfv_size(pname); + GLfloat answerBuffer[200]; + GLfloat *params = + __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, + sizeof(answerBuffer), 4); + + if (params == NULL) + return BadAlloc; + __glXClearErrorOccured(); + + GetVertexAttribfv(*(GLuint *) (pc + 0), pname, params); + __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); + error = Success; + } + + return error; +} + +int +__glXDisp_GetVertexAttribiv(__GLXclientState * cl, GLbyte * pc) +{ + PFNGLGETVERTEXATTRIBIVPROC GetVertexAttribiv = + __glGetProcAddress("glGetVertexAttribiv"); + xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; + int error; + __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); + + pc += __GLX_VENDPRIV_HDR_SIZE; + if (cx != NULL) { + const GLenum pname = *(GLenum *) (pc + 4); + + const GLuint compsize = __glGetVertexAttribiv_size(pname); + GLint answerBuffer[200]; + GLint *params = + __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, + sizeof(answerBuffer), 4); + + if (params == NULL) + return BadAlloc; + __glXClearErrorOccured(); + + GetVertexAttribiv(*(GLuint *) (pc + 0), pname, params); + __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); + error = Success; + } + + return error; +} + void __glXDisp_VertexAttrib1dv(GLbyte * pc) { @@ -5100,3 +5193,19 @@ __glXDisp_ActiveStencilFaceEXT(GLbyte * pc) __glGetProcAddress("glActiveStencilFaceEXT"); ActiveStencilFaceEXT(*(GLenum *) (pc + 0)); } + +void +__glXDisp_BindFramebufferEXT(GLbyte * pc) +{ + PFNGLBINDFRAMEBUFFEREXTPROC BindFramebufferEXT = + __glGetProcAddress("glBindFramebufferEXT"); + BindFramebufferEXT(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); +} + +void +__glXDisp_BindRenderbufferEXT(GLbyte * pc) +{ + PFNGLBINDRENDERBUFFEREXTPROC BindRenderbufferEXT = + __glGetProcAddress("glBindRenderbufferEXT"); + BindRenderbufferEXT(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); +} diff --git a/glx/indirect_dispatch.h b/glx/indirect_dispatch.h index e6e3fdacf..7969e322f 100644 --- a/glx/indirect_dispatch.h +++ b/glx/indirect_dispatch.h @@ -116,6 +116,10 @@ extern _X_HIDDEN void __glXDisp_LightModeliv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_LightModeliv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs1dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs1dvNV(GLbyte * pc); +extern _X_HIDDEN int __glXDisp_GetVertexAttribfv(struct __GLXclientStateRec *, + GLbyte *); +extern _X_HIDDEN int __glXDispSwap_GetVertexAttribfv(struct __GLXclientStateRec + *, GLbyte *); extern _X_HIDDEN void __glXDisp_Normal3bv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Normal3bv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_VendorPrivate(struct __GLXclientStateRec *, @@ -413,6 +417,10 @@ extern _X_HIDDEN void __glXDisp_TexGenfv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_TexGenfv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib4dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib4dvNV(GLbyte * pc); +extern _X_HIDDEN int __glXDisp_GetVertexAttribiv(struct __GLXclientStateRec *, + GLbyte *); +extern _X_HIDDEN int __glXDispSwap_GetVertexAttribiv(struct __GLXclientStateRec + *, GLbyte *); extern _X_HIDDEN void __glXDisp_DrawBuffers(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_DrawBuffers(GLbyte * pc); extern _X_HIDDEN int __glXDisp_CreateContextWithConfigSGIX(struct @@ -552,6 +560,8 @@ extern _X_HIDDEN void __glXDisp_MultiTexCoord1sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord1sv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RasterPos3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos3sv(GLbyte * pc); +extern _X_HIDDEN void __glXDisp_BindFramebufferEXT(GLbyte * pc); +extern _X_HIDDEN void __glXDispSwap_BindFramebufferEXT(GLbyte * pc); extern _X_HIDDEN void __glXDisp_PushAttrib(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PushAttrib(GLbyte * pc); extern _X_HIDDEN int __glXDisp_DestroyPbuffer(struct __GLXclientStateRec *, @@ -676,6 +686,8 @@ extern _X_HIDDEN int __glXDisp_GetTexParameteriv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexParameteriv(struct __GLXclientStateRec *, GLbyte *); +extern _X_HIDDEN void __glXDisp_VertexAttribs4dvNV(GLbyte * pc); +extern _X_HIDDEN void __glXDispSwap_VertexAttribs4dvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttrib3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttrib3sv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_IsQuery(struct __GLXclientStateRec *, GLbyte *); @@ -776,8 +788,6 @@ extern _X_HIDDEN void __glXDisp_ColorMaterial(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_ColorMaterial(GLbyte * pc); extern _X_HIDDEN void __glXDisp_VertexAttribs1svNV(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_VertexAttribs1svNV(GLbyte * pc); -extern _X_HIDDEN void __glXDisp_VertexAttrib1fvNV(GLbyte * pc); -extern _X_HIDDEN void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetSeparableFilter(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetSeparableFilter(struct __GLXclientStateRec @@ -803,6 +813,10 @@ extern _X_HIDDEN int __glXDispSwap_RenderLarge(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN void __glXDisp_PolygonOffset(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_PolygonOffset(GLbyte * pc); +extern _X_HIDDEN int __glXDisp_GetVertexAttribdv(struct __GLXclientStateRec *, + GLbyte *); +extern _X_HIDDEN int __glXDispSwap_GetVertexAttribdv(struct __GLXclientStateRec + *, GLbyte *); extern _X_HIDDEN void __glXDisp_Normal3dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Normal3dv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Lightf(GLbyte * pc); @@ -960,6 +974,8 @@ extern _X_HIDDEN void __glXDisp_CopyTexImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_CopyTexImage1D(GLbyte * pc); extern _X_HIDDEN void __glXDisp_RasterPos2dv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_RasterPos2dv(GLbyte * pc); +extern _X_HIDDEN void __glXDisp_VertexAttrib1fvNV(GLbyte * pc); +extern _X_HIDDEN void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Fogiv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Fogiv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_EndQuery(GLbyte * pc); @@ -1010,6 +1026,8 @@ extern _X_HIDDEN void __glXDisp_MultiTexCoord1iv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_MultiTexCoord1iv(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex2fv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex2fv(GLbyte * pc); +extern _X_HIDDEN void __glXDisp_BindRenderbufferEXT(GLbyte * pc); +extern _X_HIDDEN void __glXDispSwap_BindRenderbufferEXT(GLbyte * pc); extern _X_HIDDEN void __glXDisp_Vertex3sv(GLbyte * pc); extern _X_HIDDEN void __glXDispSwap_Vertex3sv(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetQueryObjectiv(struct __GLXclientStateRec *, @@ -1156,8 +1174,6 @@ extern _X_HIDDEN int __glXDisp_GetConvolutionFilterEXT(struct extern _X_HIDDEN int __glXDispSwap_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *); -extern _X_HIDDEN void __glXDisp_VertexAttribs4dvNV(GLbyte * pc); -extern _X_HIDDEN void __glXDispSwap_VertexAttribs4dvNV(GLbyte * pc); extern _X_HIDDEN int __glXDisp_GetTexGenfv(struct __GLXclientStateRec *, GLbyte *); extern _X_HIDDEN int __glXDispSwap_GetTexGenfv(struct __GLXclientStateRec *, diff --git a/glx/indirect_dispatch_swap.c b/glx/indirect_dispatch_swap.c index 647d0c985..7bcb35385 100644 --- a/glx/indirect_dispatch_swap.c +++ b/glx/indirect_dispatch_swap.c @@ -3835,8 +3835,8 @@ __glXDispSwap_MultiTexCoord1dv(GLbyte * pc) #endif glMultiTexCoord1dvARB((GLenum) bswap_ENUM(pc + 8), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), - 1)); + (const GLdouble *) + bswap_64_array((uint64_t *) (pc + 0), 1)); } void @@ -3859,8 +3859,8 @@ void __glXDispSwap_MultiTexCoord1sv(GLbyte * pc) { glMultiTexCoord1svARB((GLenum) bswap_ENUM(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 1)); + (const GLshort *) + bswap_16_array((uint16_t *) (pc + 4), 1)); } void @@ -3874,8 +3874,8 @@ __glXDispSwap_MultiTexCoord2dv(GLbyte * pc) #endif glMultiTexCoord2dvARB((GLenum) bswap_ENUM(pc + 16), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), - 2)); + (const GLdouble *) + bswap_64_array((uint64_t *) (pc + 0), 2)); } void @@ -3898,8 +3898,8 @@ void __glXDispSwap_MultiTexCoord2sv(GLbyte * pc) { glMultiTexCoord2svARB((GLenum) bswap_ENUM(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 2)); + (const GLshort *) + bswap_16_array((uint16_t *) (pc + 4), 2)); } void @@ -3913,8 +3913,8 @@ __glXDispSwap_MultiTexCoord3dv(GLbyte * pc) #endif glMultiTexCoord3dvARB((GLenum) bswap_ENUM(pc + 24), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), - 3)); + (const GLdouble *) + bswap_64_array((uint64_t *) (pc + 0), 3)); } void @@ -3937,8 +3937,8 @@ void __glXDispSwap_MultiTexCoord3sv(GLbyte * pc) { glMultiTexCoord3svARB((GLenum) bswap_ENUM(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 3)); + (const GLshort *) + bswap_16_array((uint16_t *) (pc + 4), 3)); } void @@ -3952,8 +3952,8 @@ __glXDispSwap_MultiTexCoord4dv(GLbyte * pc) #endif glMultiTexCoord4dvARB((GLenum) bswap_ENUM(pc + 32), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), - 4)); + (const GLdouble *) + bswap_64_array((uint64_t *) (pc + 0), 4)); } void @@ -3976,8 +3976,8 @@ void __glXDispSwap_MultiTexCoord4sv(GLbyte * pc) { glMultiTexCoord4svARB((GLenum) bswap_ENUM(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 4)); + (const GLshort *) + bswap_16_array((uint16_t *) (pc + 4), 4)); } void @@ -4436,6 +4436,105 @@ __glXDispSwap_DrawBuffers(GLbyte * pc) DrawBuffers(n, (const GLenum *) bswap_32_array((uint32_t *) (pc + 4), 0)); } +int +__glXDispSwap_GetVertexAttribdv(__GLXclientState * cl, GLbyte * pc) +{ + PFNGLGETVERTEXATTRIBDVPROC GetVertexAttribdv = + __glGetProcAddress("glGetVertexAttribdv"); + xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; + int error; + __GLXcontext *const cx = + __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); + + pc += __GLX_VENDPRIV_HDR_SIZE; + if (cx != NULL) { + const GLenum pname = (GLenum) bswap_ENUM(pc + 4); + + const GLuint compsize = __glGetVertexAttribdv_size(pname); + GLdouble answerBuffer[200]; + GLdouble *params = + __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer, + sizeof(answerBuffer), 8); + + if (params == NULL) + return BadAlloc; + __glXClearErrorOccured(); + + GetVertexAttribdv((GLuint) bswap_CARD32(pc + 0), pname, params); + (void) bswap_64_array((uint64_t *) params, compsize); + __glXSendReplySwap(cl->client, params, compsize, 8, GL_FALSE, 0); + error = Success; + } + + return error; +} + +int +__glXDispSwap_GetVertexAttribfv(__GLXclientState * cl, GLbyte * pc) +{ + PFNGLGETVERTEXATTRIBFVPROC GetVertexAttribfv = + __glGetProcAddress("glGetVertexAttribfv"); + xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; + int error; + __GLXcontext *const cx = + __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); + + pc += __GLX_VENDPRIV_HDR_SIZE; + if (cx != NULL) { + const GLenum pname = (GLenum) bswap_ENUM(pc + 4); + + const GLuint compsize = __glGetVertexAttribfv_size(pname); + GLfloat answerBuffer[200]; + GLfloat *params = + __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, + sizeof(answerBuffer), 4); + + if (params == NULL) + return BadAlloc; + __glXClearErrorOccured(); + + GetVertexAttribfv((GLuint) bswap_CARD32(pc + 0), pname, params); + (void) bswap_32_array((uint32_t *) params, compsize); + __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); + error = Success; + } + + return error; +} + +int +__glXDispSwap_GetVertexAttribiv(__GLXclientState * cl, GLbyte * pc) +{ + PFNGLGETVERTEXATTRIBIVPROC GetVertexAttribiv = + __glGetProcAddress("glGetVertexAttribiv"); + xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; + int error; + __GLXcontext *const cx = + __glXForceCurrent(cl, bswap_CARD32(&req->contextTag), &error); + + pc += __GLX_VENDPRIV_HDR_SIZE; + if (cx != NULL) { + const GLenum pname = (GLenum) bswap_ENUM(pc + 4); + + const GLuint compsize = __glGetVertexAttribiv_size(pname); + GLint answerBuffer[200]; + GLint *params = + __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer, + sizeof(answerBuffer), 4); + + if (params == NULL) + return BadAlloc; + __glXClearErrorOccured(); + + GetVertexAttribiv((GLuint) bswap_CARD32(pc + 0), pname, params); + (void) bswap_32_array((uint32_t *) params, compsize); + __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); + error = Success; + } + + return error; +} + void __glXDispSwap_VertexAttrib1dv(GLbyte * pc) { @@ -5669,3 +5768,21 @@ __glXDispSwap_ActiveStencilFaceEXT(GLbyte * pc) __glGetProcAddress("glActiveStencilFaceEXT"); ActiveStencilFaceEXT((GLenum) bswap_ENUM(pc + 0)); } + +void +__glXDispSwap_BindFramebufferEXT(GLbyte * pc) +{ + PFNGLBINDFRAMEBUFFEREXTPROC BindFramebufferEXT = + __glGetProcAddress("glBindFramebufferEXT"); + BindFramebufferEXT((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4)); +} + +void +__glXDispSwap_BindRenderbufferEXT(GLbyte * pc) +{ + PFNGLBINDRENDERBUFFEREXTPROC BindRenderbufferEXT = + __glGetProcAddress("glBindRenderbufferEXT"); + BindRenderbufferEXT((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4)); +} diff --git a/glx/indirect_size_get.c b/glx/indirect_size_get.c index f87931193..a55957b79 100644 --- a/glx/indirect_size_get.c +++ b/glx/indirect_size_get.c @@ -603,7 +603,11 @@ __glGetBooleanv_size(GLenum e) case GL_OCCLUSION_TEST_RESULT_HP: case GL_LIGHT_MODEL_COLOR_CONTROL: case GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB: +/* case GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH:*/ case GL_RESET_NOTIFICATION_STRATEGY_ARB: +/* case GL_MAX_DEBUG_GROUP_STACK_DEPTH: */ +/* case GL_DEBUG_GROUP_STACK_DEPTH: */ +/* case GL_MAX_LABEL_LENGTH: */ case GL_CURRENT_FOG_COORD: case GL_FOG_COORDINATE_ARRAY_TYPE: case GL_FOG_COORDINATE_ARRAY_STRIDE: @@ -749,8 +753,11 @@ __glGetBooleanv_size(GLenum e) /* case GL_MAX_SAMPLES_EXT:*/ case GL_MAX_SERVER_WAIT_TIMEOUT: case GL_MAX_DEBUG_MESSAGE_LENGTH_ARB: +/* case GL_MAX_DEBUG_MESSAGE_LENGTH:*/ case GL_MAX_DEBUG_LOGGED_MESSAGES_ARB: +/* case GL_MAX_DEBUG_LOGGED_MESSAGES:*/ case GL_DEBUG_LOGGED_MESSAGES_ARB: +/* case GL_DEBUG_LOGGED_MESSAGES:*/ case GL_RASTER_POSITION_UNCLIPPED_IBM: return 1; case GL_SMOOTH_POINT_SIZE_RANGE: @@ -928,7 +935,9 @@ __glGetPointerv_size(GLenum e) { switch (e) { case GL_DEBUG_CALLBACK_FUNCTION_ARB: +/* case GL_DEBUG_CALLBACK_FUNCTION:*/ case GL_DEBUG_CALLBACK_USER_PARAM_ARB: +/* case GL_DEBUG_CALLBACK_USER_PARAM:*/ return 1; default: return 0; @@ -1104,6 +1113,23 @@ __glGetQueryiv_size(GLenum e) } } +_X_INTERNAL PURE FASTCALL GLint +__glGetVertexAttribdv_size(GLenum e) +{ + switch (e) { + case GL_VERTEX_PROGRAM_ARB: + case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB: + case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB: + case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB: + case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB: + case GL_CURRENT_VERTEX_ATTRIB_ARB: + case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: + return 1; + default: + return 0; + } +} + _X_INTERNAL PURE FASTCALL GLint __glGetProgramivARB_size(GLenum e) { @@ -1216,5 +1242,7 @@ ALIAS(Fogiv, Fogfv) ALIAS(GetMinmaxParameteriv, GetMinmaxParameterfv) ALIAS(PointParameteriv, PointParameterfv) ALIAS(GetQueryObjectuiv, GetQueryObjectiv) + ALIAS(GetVertexAttribfv, GetVertexAttribdv) + ALIAS(GetVertexAttribiv, GetVertexAttribdv) #undef PURE #undef FASTCALL diff --git a/glx/indirect_size_get.h b/glx/indirect_size_get.h index 9b6203669..2358e249b 100644 --- a/glx/indirect_size_get.h +++ b/glx/indirect_size_get.h @@ -83,6 +83,9 @@ extern _X_INTERNAL PURE FASTCALL GLint __glGetMinmaxParameteriv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryObjectiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryObjectuiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetQueryiv_size(GLenum); +extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribdv_size(GLenum); +extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribfv_size(GLenum); +extern _X_INTERNAL PURE FASTCALL GLint __glGetVertexAttribiv_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetProgramivARB_size(GLenum); extern _X_INTERNAL PURE FASTCALL GLint __glGetFramebufferAttachmentParameteriv_size(GLenum); diff --git a/glx/indirect_table.c b/glx/indirect_table.c index 33e3d6a22..8061e17fb 100644 --- a/glx/indirect_table.c +++ b/glx/indirect_table.c @@ -636,8 +636,10 @@ static const void *Render_function_table[408][2] = { /* [ 232] = 232 */ {__glXDisp_EndQuery, __glXDispSwap_EndQuery}, /* [ 233] = 233 */ {__glXDisp_DrawBuffers, __glXDispSwap_DrawBuffers}, /* [ 234] = 234 */ {__glXDisp_ClampColor, __glXDispSwap_ClampColor}, - /* [ 235] = 235 */ {NULL, NULL}, - /* [ 236] = 236 */ {NULL, NULL}, + /* [ 235] = 235 */ {__glXDisp_BindRenderbuffer, + __glXDispSwap_BindRenderbuffer}, + /* [ 236] = 236 */ {__glXDisp_BindFramebuffer, + __glXDispSwap_BindFramebuffer}, /* [ 237] = 237 */ {__glXDisp_FramebufferTextureLayer, __glXDispSwap_FramebufferTextureLayer}, /* [ 238] = 238 */ {NULL, NULL}, @@ -903,14 +905,14 @@ static const void *Render_function_table[408][2] = { /* [ 401] = 4313 */ {NULL, NULL}, /* [ 402] = 4314 */ {NULL, NULL}, /* [ 403] = 4315 */ {NULL, NULL}, - /* [ 404] = 4316 */ {__glXDisp_BindRenderbuffer, - __glXDispSwap_BindRenderbuffer}, + /* [ 404] = 4316 */ {__glXDisp_BindRenderbufferEXT, + __glXDispSwap_BindRenderbufferEXT}, /* [ 405] = 4317 */ {__glXDisp_DeleteRenderbuffers, __glXDispSwap_DeleteRenderbuffers}, /* [ 406] = 4318 */ {__glXDisp_RenderbufferStorage, __glXDispSwap_RenderbufferStorage}, - /* [ 407] = 4319 */ {__glXDisp_BindFramebuffer, - __glXDispSwap_BindFramebuffer}, + /* [ 407] = 4319 */ {__glXDisp_BindFramebufferEXT, + __glXDispSwap_BindFramebufferEXT}, }; static const int_fast16_t Render_size_table[408][2] = { @@ -1149,8 +1151,8 @@ static const int_fast16_t Render_size_table[408][2] = { /* [232] = 232 */ {8, ~0}, /* [233] = 233 */ {8, 36}, /* [234] = 234 */ {12, ~0}, - /* [235] = 235 */ {0, ~0}, - /* [236] = 236 */ {0, ~0}, + /* [235] = 235 */ {12, ~0}, + /* [236] = 236 */ {12, ~0}, /* [237] = 237 */ {24, ~0}, /* [238] = 238 */ {0, ~0}, /* [239] = 239 */ {0, ~0}, @@ -1697,9 +1699,12 @@ static const void *VendorPriv_function_table[104][2] = { /* [ 26] = 1298 */ {NULL, NULL}, /* [ 27] = 1299 */ {NULL, NULL}, /* [ 28] = 1300 */ {NULL, NULL}, - /* [ 29] = 1301 */ {NULL, NULL}, - /* [ 30] = 1302 */ {NULL, NULL}, - /* [ 31] = 1303 */ {NULL, NULL}, + /* [ 29] = 1301 */ {__glXDisp_GetVertexAttribdv, + __glXDispSwap_GetVertexAttribdv}, + /* [ 30] = 1302 */ {__glXDisp_GetVertexAttribfv, + __glXDispSwap_GetVertexAttribfv}, + /* [ 31] = 1303 */ {__glXDisp_GetVertexAttribiv, + __glXDispSwap_GetVertexAttribiv}, /* [ 32] = 1304 */ {__glXDisp_IsProgramARB, __glXDispSwap_IsProgramARB}, /* [ 33] = 1305 */ {__glXDisp_GetProgramLocalParameterfvARB, __glXDispSwap_GetProgramLocalParameterfvARB}, -- cgit v1.2.3 From b4d1e3f9065ecac8d75be604d912cc165ce7a250 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 15 Apr 2014 12:45:19 +0100 Subject: Improvements to crash logging - cosmetic fix to backtrace logging - allow environment to pass to xorg-backtrace for $TEMP --- os/backtrace.c | 18 ++++++++++++++++-- os/log.c | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/os/backtrace.c b/os/backtrace.c index 3100d1a13..fcc8274e4 100644 --- a/os/backtrace.c +++ b/os/backtrace.c @@ -267,7 +267,7 @@ xorg_backtrace_exec_wrapper(const char *path) close(pipefd[1]); snprintf(parent, sizeof(parent), "%d", getppid()); - execle(path, path, parent, NULL, NULL); + execl(path, path, parent, NULL); exit(1); } else { @@ -280,7 +280,21 @@ xorg_backtrace_exec_wrapper(const char *path) close(pipefd[1]); while (!done) { - bytesread = read(pipefd[0], btline, sizeof(btline) - 1); + bytesread = 0; + + do + { + int n = read(pipefd[0], &btline[bytesread], 1); + + if (n <= 0) + break; + + bytesread = bytesread + n; + + if (btline[bytesread-1] == '\n') + break; + } + while (bytesread < sizeof(btline)); if (bytesread > 0) { btline[bytesread] = 0; diff --git a/os/log.c b/os/log.c index 976f90f40..80ed19833 100644 --- a/os/log.c +++ b/os/log.c @@ -883,7 +883,7 @@ FatalError(const char *f, ...) if (beenhere) ErrorFSigSafe("FatalError re-entered, aborting\n"); else - ErrorFSigSafe("Fatal server error: "); + ErrorFSigSafe("Fatal server error:\n"); va_start(args, f); -- cgit v1.2.3 From 687aef64cc7144b5f8a2725f31e612214fee2f34 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 15 Apr 2014 14:14:54 +0100 Subject: Disable PrimaryDD and ShadowDD DirectDraw2 drawing engines Disable the PrimaryDD and ShadowDD DirectDraw2 drawing engines. I don't think there is anywhere these are useful, but the ShadowDDNL DirectDraw4 drawing engine isn't available. --- hw/xwin/InitOutput.c | 2 +- hw/xwin/man/XWin.man | 10 ++++------ hw/xwin/winengine.c | 15 --------------- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 7ca818c70..b5e18c226 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -760,7 +760,7 @@ winUseMsg(void) ErrorF("-engine engine_type_id\n" "\tOverride the server's automatically selected engine type:\n" "\t\t1 - Shadow GDI\n" - "\t\t2 - Shadow DirectDraw\n" + "\t\t2 - Shadow DirectDraw - obsolete\n" "\t\t4 - Shadow DirectDraw4 Non-Locking\n" #ifdef XWIN_PRIMARYFB "\t\t8 - Primary DirectDraw - obsolete\n" diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man index 738818ea5..5f2d2eabc 100644 --- a/hw/xwin/man/XWin.man +++ b/hw/xwin/man/XWin.man @@ -243,14 +243,12 @@ clipping region is then used to do a single bit block transfer that is constrained to the updated area by the clipping region. There is some overhead involved in creating, installing, destroying, and removing the clipping region, thus there may not be much benefit for a small -number of boxes (less than 10). It is even possible that this +number of boxes. It is even possible that this functionality does not provide a benefit at any number of boxes; we can only determine the usefulness of this feature through testing. This option probably has limited effect on current \fIWindows\fP versions as they already perform GDI batching. -This parameter works in conjunction with engines 1, 2, and 4 (Shadow -GDI, Shadow DirectDraw, and Shadow DirectDraw Non-Locking, -respectively). +This parameter only has any effect when a Shadow drawing engine is selected. .TP 8 .B "\-engine \fIengine_type_id\fP" This option, which is intended for Cygwin/X developers, @@ -266,11 +264,11 @@ The engine type ids are: .IP 1 4 Shadow GDI .IP 2 4 -Shadow DirectDraw +Shadow DirectDraw (obsolete, disabled) .IP 4 4 Shadow DirectDraw Non-Locking .IP 8 4 -Primary DirectDraw (unsupported, obsolete) +Primary DirectDraw (unsupported, obsolete, disabled) .IP 16 4 Native GDI (unsupported, experimental and barely functional) .RE diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c index 1f55ada58..94e5e36e9 100644 --- a/hw/xwin/winengine.c +++ b/hw/xwin/winengine.c @@ -89,21 +89,6 @@ winDetectSupportedEngines(void) "winDetectSupportedEngines - DirectDraw not installed\n"); return; } - else { - /* We have DirectDraw */ - winErrorFVerb(2, - "winDetectSupportedEngines - DirectDraw installed, allowing ShadowDD\n"); - g_dwEnginesSupported |= WIN_SERVER_SHADOW_DD; - -#ifdef XWIN_PRIMARYFB - /* Allow PrimaryDD engine if NT */ - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { - g_dwEnginesSupported |= WIN_SERVER_PRIMARY_DD; - winErrorFVerb(2, - "winDetectSupportedEngines - Windows NT, allowing PrimaryDD\n"); - } -#endif - } /* Try to query for DirectDraw4 interface */ ddrval = IDirectDraw_QueryInterface(lpdd, -- cgit v1.2.3 From 58573e141706404e3799f2cb258c6cd0a9bfebfd Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 16 Apr 2014 14:22:07 +0100 Subject: Fix a crash using OpenGL on the root window in multiwindow mode Fix a crash which occurs when trying to use OpenGL on the root window in multiwindow mode. (OpenGL drawing still doesn't do anything because the root window is hidden, but now it doesn't crash) Testcase: ogl.c from fd.o bug #8443 Signed-off-by: Jon TURNEY --- hw/xwin/glx/winpriv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c index 11612f905..46d33c15e 100644 --- a/hw/xwin/glx/winpriv.c +++ b/hw/xwin/glx/winpriv.c @@ -26,6 +26,8 @@ winCreateWindowsWindowHierarchy(WindowPtr pWin) if (pWin->parent) { if (pWin->parent != pWin->drawable.pScreen->root) winCreateWindowsWindowHierarchy(pWin->parent); + } else { + return; } /* ensure this window exists */ -- cgit v1.2.3 From 4c219c4e18d0d439de29460ccc542050e495b3b3 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 16 Apr 2014 18:08:45 +0100 Subject: Fix appearance of windows with only WM_NORMAL_HINTS Now that XGetWMNormalHints() is actually being used, we can have a window with default style, but HINT_NOMAXIMIZE, but this doesn't get given the default style. (Testcase: Xephyr) This is just a quick workaround. To fix this properly, we should probably rewrite winApplyHints() so it starts from a default and then modifies it depending on the hints, rather than trying to set the default style at the end if we guess no other style has been set. Signed-off-by: Jon TURNEY --- hw/xwin/winmultiwindowwm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 7833932fe..c9f0b304b 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1860,6 +1860,10 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) if (normal_hint && XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied)) { if (normal_hint->flags & PMaxSize) { + /* Ensure default style is used if no other styling */ + if (!(hint & ~HINT_SKIPTASKBAR)) + hint |= HINT_BORDER | HINT_SIZEBOX | HINT_CAPTION; + /* Not maximizable if a maximum size is specified */ hint |= HINT_NOMAXIMIZE; -- cgit v1.2.3