diff options
author | marha <marha@users.sourceforge.net> | 2012-11-29 07:56:51 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-11-29 07:56:51 +0100 |
commit | d2d73da59e64acdc4718e4e6790a69d967bee875 (patch) | |
tree | 5c0148abbbb1473bb80ddc7da286beae9c1f2c3d | |
parent | 38eb7612c4b39dd69df4baf4450ba512e888effa (diff) | |
download | vcxsrv-d2d73da59e64acdc4718e4e6790a69d967bee875.tar.gz vcxsrv-d2d73da59e64acdc4718e4e6790a69d967bee875.tar.bz2 vcxsrv-d2d73da59e64acdc4718e4e6790a69d967bee875.zip |
fontconfig xserver mesa git update 29 nov 2012
xserver: 1712a45422a63f11b2146541279616fcfda09ec6
fontconfig: faea1cac85ac3b0fd6a983e1c0adeb68e115e06c
mesa: c1023608002c985b9d72edc64732cd666de2a206
69 files changed, 1684 insertions, 308 deletions
diff --git a/fontconfig/README b/fontconfig/README index 02f4f27d6..5c666b0f6 100644 --- a/fontconfig/README +++ b/fontconfig/README @@ -1,12 +1,35 @@ Fontconfig Font configuration and customization library - Version 2.10.1 + Version 2.10.2 2012-03-11 Check INSTALL for compilation and installation instructions. Report bugs to https://bugs.freedesktop.org in the fontconfig module. +2.10.2 + +Akira TAGOH (13): + Bug 53585 - Two highly-visible typos in src/fcxml.c + Fix for libtoolize's warnings + Bug 54138 - X_OK permission is invalid for win32 access(..) calls + Bug 52573 - patch required to build 2.10.x with oldish GNU C library headers + deal with warnings as errors for the previous change + Fix wrongly squashing for the network path on Win32. + Fix syntax errors in fonts.dtd. + autogen.sh: Add -I option to tell aclocal a place for external m4 files + Use automake variable instead of cleaning files in clean-local + Bug 56531 - autogen.sh fails due to missing 'm4' directory + Bug 57114 - regression on FcFontMatch with namelang + Update CaseFolding.txt to Unicode 6.2 + Bug 57286 - Remove UnBatang and Baekmuk Batang from monospace in 65-nonlatin.conf + +Behdad Esfahbod (1): + Fix N'ko orthography + +Jeremy Huddleston Sequoia (1): + Remove _CONFIG_FIXUPS_H_ guards, so multiple includes of "config.h" result in the correct values + 2.10.1 Akira TAGOH (2): diff --git a/fontconfig/configure.ac b/fontconfig/configure.ac index 870979df8..6d5ce7e77 100644 --- a/fontconfig/configure.ac +++ b/fontconfig/configure.ac @@ -34,7 +34,7 @@ dnl This is the package version number, not the shared library dnl version. This same version number must appear in fontconfig/fontconfig.h dnl Yes, it is a pain to synchronize version numbers. Unfortunately, it's dnl not possible to extract the version number here from fontconfig.h -AM_INIT_AUTOMAKE(fontconfig, 2.10.1) +AM_INIT_AUTOMAKE(fontconfig, 2.10.2) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) dnl libtool versioning @@ -126,6 +126,7 @@ dnl ========================================================================== AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h regex.h stdlib.h string.h unistd.h sys/vfs.h sys/statfs.h sys/param.h sys/mount.h]) +AX_CREATE_STDINT_H([src/fcstdint.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/fontconfig/fc-case/Makefile.am b/fontconfig/fc-case/Makefile.am index ad5dc74be..691482468 100644 --- a/fontconfig/fc-case/Makefile.am +++ b/fontconfig/fc-case/Makefile.am @@ -23,7 +23,7 @@ # PERFORMANCE OF THIS SOFTWARE. # -INCLUDES=-I${top_srcdir}/src -I${top_srcdir} $(WARN_CFLAGS) +INCLUDES=-I${top_builddir}/src -I${top_srcdir}/src -I${top_srcdir} $(WARN_CFLAGS) TMPL=fccase.tmpl.h STMPL=${top_srcdir}/fc-case/${TMPL} diff --git a/fontconfig/fc-glyphname/Makefile.am b/fontconfig/fc-glyphname/Makefile.am index 697b5c3b9..fdba146c9 100644 --- a/fontconfig/fc-glyphname/Makefile.am +++ b/fontconfig/fc-glyphname/Makefile.am @@ -23,7 +23,7 @@ # PERFORMANCE OF THIS SOFTWARE. # -INCLUDES=-I${top_srcdir}/src -I${top_srcdir} $(WARN_CFLAGS) +INCLUDES=-I${top_builddir}/src -I${top_srcdir}/src -I${top_srcdir} $(WARN_CFLAGS) TMPL=fcglyphname.tmpl.h STMPL=${top_srcdir}/fc-glyphname/${TMPL} diff --git a/fontconfig/fc-lang/Makefile.am b/fontconfig/fc-lang/Makefile.am index d2eca5ba8..5c2d1bfe7 100644 --- a/fontconfig/fc-lang/Makefile.am +++ b/fontconfig/fc-lang/Makefile.am @@ -23,7 +23,7 @@ # PERFORMANCE OF THIS SOFTWARE. # -INCLUDES=-I${top_srcdir}/src -I${top_srcdir} $(WARN_CFLAGS) +INCLUDES=-I${top_builddir}/src -I${top_srcdir}/src -I${top_srcdir} $(WARN_CFLAGS) TMPL=fclang.tmpl.h STMPL=${top_srcdir}/fc-lang/fclang.tmpl.h diff --git a/fontconfig/fontconfig/fontconfig.h b/fontconfig/fontconfig/fontconfig.h index d3aeaf359..266986c87 100644 --- a/fontconfig/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig/fontconfig.h @@ -52,7 +52,7 @@ typedef int FcBool; #define FC_MAJOR 2 #define FC_MINOR 10 -#define FC_REVISION 1 +#define FC_REVISION 2 #define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION)) diff --git a/fontconfig/m4/ax_create_stdint_h.m4 b/fontconfig/m4/ax_create_stdint_h.m4 new file mode 100644 index 000000000..1e4106149 --- /dev/null +++ b/fontconfig/m4/ax_create_stdint_h.m4 @@ -0,0 +1,695 @@ +dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] +dnl +dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the +dnl existence of an include file <stdint.h> that defines a set of +dnl typedefs, especially uint8_t,int32_t,uintptr_t. Many older +dnl installations will not provide this file, but some will have the +dnl very same definitions in <inttypes.h>. In other enviroments we can +dnl use the inet-types in <sys/types.h> which would define the typedefs +dnl int8_t and u_int8_t respectivly. +dnl +dnl This macros will create a local "_stdint.h" or the headerfile given +dnl as an argument. In many cases that file will just "#include +dnl <stdint.h>" or "#include <inttypes.h>", while in other environments +dnl it will provide the set of basic 'stdint's definitions/typedefs: +dnl +dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t +dnl int_least32_t.. int_fast32_t.. intmax_t +dnl +dnl which may or may not rely on the definitions of other files, or +dnl using the AC_CHECK_SIZEOF macro to determine the actual sizeof each +dnl type. +dnl +dnl if your header files require the stdint-types you will want to +dnl create an installable file mylib-int.h that all your other +dnl installable header may include. So if you have a library package +dnl named "mylib", just use +dnl +dnl AX_CREATE_STDINT_H(mylib-int.h) +dnl +dnl in configure.ac and go to install that very header file in +dnl Makefile.am along with the other headers (mylib.h) - and the +dnl mylib-specific headers can simply use "#include <mylib-int.h>" to +dnl obtain the stdint-types. +dnl +dnl Remember, if the system already had a valid <stdint.h>, the +dnl generated file will include it directly. No need for fuzzy +dnl HAVE_STDINT_H things... (oops, GCC 4.2.x has deliberatly +dnl disabled its stdint.h for non-c99 compilation and the c99-mode +dnl is not the default. Therefore this macro will not use the +dnl compiler's stdint.h - please complain to the GCC developers). +dnl +dnl @category C +dnl @author Guido U. Draheim <guidod@gmx.de> +dnl @version 2003-12-07 +dnl @license GPLWithACException + +AC_DEFUN([AX_CHECK_DATA_MODEL],[ + AC_CHECK_SIZEOF(char) + AC_CHECK_SIZEOF(short) + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + AC_CHECK_SIZEOF(void*) + ac_cv_char_data_model="" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" + ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" + ac_cv_long_data_model="" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" + ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" + AC_MSG_CHECKING([data model]) + case "$ac_cv_char_data_model/$ac_cv_long_data_model" in + 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; + 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; + 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; + 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; + 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; + 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; + 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; + 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; + 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; + 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; + 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; + 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; + 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; + 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; + 222/*|333/*|444/*|666/*|888/*) : + ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; + *) ac_cv_data_model="none" ; n="very unusual model" ;; + esac + AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)]) +]) + +dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF]) +AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[ +AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ + ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h sys/types.h]) + do + unset ac_cv_type_uintptr_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + done + AC_MSG_CHECKING([for stdint uintptr_t]) + ]) +]) + +AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[ +AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ + ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h sys/types.h stdint.h]) + do + unset ac_cv_type_uint32_t + unset ac_cv_type_uint64_t + AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + break; + done + AC_MSG_CHECKING([for stdint uint32_t]) + ]) +]) + +AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[ +AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ + ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) + AC_MSG_RESULT([(..)]) + for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do + unset ac_cv_type_u_int32_t + unset ac_cv_type_u_int64_t + AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>]) + AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) + m4_ifvaln([$2],[$2]) break + break; + done + AC_MSG_CHECKING([for stdint u_int32_t]) + ]) +]) + +AC_DEFUN([AX_CREATE_STDINT_H], +[# ------ AX CREATE STDINT H ------------------------------------- +AC_MSG_CHECKING([for stdint types]) +ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` +# try to shortcircuit - if the default include path of the compiler +# can find a "stdint.h" header then we assume that all compilers can. +AC_CACHE_VAL([ac_cv_header_stdint_t],[ +old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" +old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" +old_CFLAGS="$CFLAGS" ; CFLAGS="" +AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;], +[ac_cv_stdint_result="(assuming C99 compatible system)" + ac_cv_header_stdint_t="stdint.h"; ], +[ac_cv_header_stdint_t=""]) +if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then +CFLAGS="-std=c99" +AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;], +[AC_MSG_WARN(your GCC compiler has a defunct stdint.h for its default-mode)]) +fi +CXXFLAGS="$old_CXXFLAGS" +CPPFLAGS="$old_CPPFLAGS" +CFLAGS="$old_CFLAGS" ]) + +v="... $ac_cv_header_stdint_h" +if test "$ac_stdint_h" = "stdint.h" ; then + AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) +elif test "$ac_stdint_h" = "inttypes.h" ; then + AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) +elif test "_$ac_cv_header_stdint_t" = "_" ; then + AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) +else + ac_cv_header_stdint="$ac_cv_header_stdint_t" + AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) +fi + +if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. + +dnl .....intro message done, now do a few system checks..... +dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, +dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW +dnl instead that is triggered with 3 or more arguments (see types.m4) + +inttype_headers=`echo $2 | sed -e 's/,/ /g'` + +ac_cv_stdint_result="(no helpful system typedefs seen)" +AX_CHECK_HEADER_STDINT_X(dnl + stdint.h inttypes.h sys/inttypes.h $inttype_headers, + ac_cv_stdint_result="(seen uintptr_t$and64 in $i)") + +if test "_$ac_cv_header_stdint_x" = "_" ; then +AX_CHECK_HEADER_STDINT_O(dnl, + inttypes.h sys/inttypes.h stdint.h $inttype_headers, + ac_cv_stdint_result="(seen uint32_t$and64 in $i)") +fi + +if test "_$ac_cv_header_stdint_x" = "_" ; then +if test "_$ac_cv_header_stdint_o" = "_" ; then +AX_CHECK_HEADER_STDINT_U(dnl, + sys/types.h inttypes.h sys/inttypes.h $inttype_headers, + ac_cv_stdint_result="(seen u_int32_t$and64 in $i)") +fi fi + +dnl if there was no good C99 header file, do some typedef checks... +if test "_$ac_cv_header_stdint_x" = "_" ; then + AC_MSG_CHECKING([for stdint datatype model]) + AC_MSG_RESULT([(..)]) + AX_CHECK_DATA_MODEL +fi + +if test "_$ac_cv_header_stdint_x" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_x" +elif test "_$ac_cv_header_stdint_o" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_o" +elif test "_$ac_cv_header_stdint_u" != "_" ; then + ac_cv_header_stdint="$ac_cv_header_stdint_u" +else + ac_cv_header_stdint="stddef.h" +fi + +AC_MSG_CHECKING([for extra inttypes in chosen header]) +AC_MSG_RESULT([($ac_cv_header_stdint)]) +dnl see if int_least and int_fast types are present in _this_ header. +unset ac_cv_type_int_least32_t +unset ac_cv_type_int_fast32_t +AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) +AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) +AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) + +fi # shortcircut to system "stdint.h" +# ------------------ PREPARE VARIABLES ------------------------------ +if test "$GCC" = "yes" ; then +ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` +else +ac_cv_stdint_message="using $CC" +fi + +AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl +$ac_cv_stdint_result]) + +dnl ----------------------------------------------------------------- +# ----------------- DONE inttypes.h checks START header ------------- +AC_CONFIG_COMMANDS([$ac_stdint_h],[ +AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) +ac_stdint=$tmp/_stdint.h + +echo "#ifndef" $_ac_stdint_h >$ac_stdint +echo "#define" $_ac_stdint_h "1" >>$ac_stdint +echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint +echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint +echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint +if test "_$ac_cv_header_stdint_t" != "_" ; then +echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint +echo "#include <stdint.h>" >>$ac_stdint +echo "#endif" >>$ac_stdint +echo "#endif" >>$ac_stdint +else + +cat >>$ac_stdint <<STDINT_EOF + +/* ................... shortcircuit part ........................... */ + +#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H +#include <stdint.h> +#else +#include <stddef.h> + +/* .................... configured part ............................ */ + +STDINT_EOF + +echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint +if test "_$ac_cv_header_stdint_x" != "_" ; then + ac_header="$ac_cv_header_stdint_x" + echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint +fi + +echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint +if test "_$ac_cv_header_stdint_o" != "_" ; then + ac_header="$ac_cv_header_stdint_o" + echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint +fi + +echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint +if test "_$ac_cv_header_stdint_u" != "_" ; then + ac_header="$ac_cv_header_stdint_u" + echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint +else + echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint +fi + +echo "" >>$ac_stdint + +if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then + echo "#include <$ac_header>" >>$ac_stdint + echo "" >>$ac_stdint +fi fi + +echo "/* which 64bit typedef has been found */" >>$ac_stdint +if test "$ac_cv_type_uint64_t" = "yes" ; then +echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint +fi +if test "$ac_cv_type_u_int64_t" = "yes" ; then +echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint +fi +echo "" >>$ac_stdint + +echo "/* which type model has been detected */" >>$ac_stdint +if test "_$ac_cv_char_data_model" != "_" ; then +echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint +echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint +else +echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint +echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint +fi +echo "" >>$ac_stdint + +echo "/* whether int_least types were detected */" >>$ac_stdint +if test "$ac_cv_type_int_least32_t" = "yes"; then +echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint +fi +echo "/* whether int_fast types were detected */" >>$ac_stdint +if test "$ac_cv_type_int_fast32_t" = "yes"; then +echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint +fi +echo "/* whether intmax_t type was detected */" >>$ac_stdint +if test "$ac_cv_type_intmax_t" = "yes"; then +echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint +else +echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint +fi +echo "" >>$ac_stdint + + cat >>$ac_stdint <<STDINT_EOF +/* .................... detections part ............................ */ + +/* whether we need to define bitspecific types from compiler base types */ +#ifndef _STDINT_HEADER_INTPTR +#ifndef _STDINT_HEADER_UINT32 +#ifndef _STDINT_HEADER_U_INT32 +#define _STDINT_NEED_INT_MODEL_T +#else +#define _STDINT_HAVE_U_INT_TYPES +#endif +#endif +#endif + +#ifdef _STDINT_HAVE_U_INT_TYPES +#undef _STDINT_NEED_INT_MODEL_T +#endif + +#ifdef _STDINT_CHAR_MODEL +#if _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124 +#ifndef _STDINT_BYTE_MODEL +#define _STDINT_BYTE_MODEL 12 +#endif +#endif +#endif + +#ifndef _STDINT_HAVE_INT_LEAST32_T +#define _STDINT_NEED_INT_LEAST_T +#endif + +#ifndef _STDINT_HAVE_INT_FAST32_T +#define _STDINT_NEED_INT_FAST_T +#endif + +#ifndef _STDINT_HEADER_INTPTR +#define _STDINT_NEED_INTPTR_T +#ifndef _STDINT_HAVE_INTMAX_T +#define _STDINT_NEED_INTMAX_T +#endif +#endif + + +/* .................... definition part ............................ */ + +/* some system headers have good uint64_t */ +#ifndef _HAVE_UINT64_T +#if defined _STDINT_HAVE_UINT64_T || defined HAVE_UINT64_T +#define _HAVE_UINT64_T +#elif defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T +#define _HAVE_UINT64_T +typedef u_int64_t uint64_t; +#endif +#endif + +#ifndef _HAVE_UINT64_T +/* .. here are some common heuristics using compiler runtime specifics */ +#if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; + +#elif !defined __STRICT_ANSI__ +#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ +#define _HAVE_UINT64_T +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ +/* note: all ELF-systems seem to have loff-support which needs 64-bit */ +#if !defined _NO_LONGLONG +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#elif defined __alpha || (defined __mips && defined _ABIN32) +#if !defined _NO_LONGLONG +typedef long int64_t; +typedef unsigned long uint64_t; +#endif + /* compiler/cpu type to define int64_t */ +#endif +#endif +#endif + +#if defined _STDINT_HAVE_U_INT_TYPES +/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ +typedef u_int8_t uint8_t; +typedef u_int16_t uint16_t; +typedef u_int32_t uint32_t; + +/* glibc compatibility */ +#ifndef __int8_t_defined +#define __int8_t_defined +#endif +#endif + +#ifdef _STDINT_NEED_INT_MODEL_T +/* we must guess all the basic types. Apart from byte-adressable system, */ +/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ +/* (btw, those nibble-addressable systems are way off, or so we assume) */ + +dnl /* have a look at "64bit and data size neutrality" at */ +dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ +dnl /* (the shorthand "ILP" types always have a "P" part) */ + +#if defined _STDINT_BYTE_MODEL +#if _STDINT_LONG_MODEL+0 == 242 +/* 2:4:2 = IP16 = a normal 16-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef long int32_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 +/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ +/* 4:4:4 = ILP32 = a normal 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 +/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ +/* 4:8:8 = LP64 = a normal 64-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +/* this system has a "long" of 64bit */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +typedef unsigned long uint64_t; +typedef long int64_t; +#endif +#elif _STDINT_LONG_MODEL+0 == 448 +/* LLP64 a 64-bit system derived from a 32-bit system */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#ifndef __int8_t_defined +#define __int8_t_defined +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif +/* assuming the system has a "long long" */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +#define _HAVE_LONGLONG_UINT64_T +typedef unsigned long long uint64_t; +typedef long long int64_t; +#endif +#else +#define _STDINT_NO_INT32_T +#endif +#else +#define _STDINT_NO_INT8_T +#define _STDINT_NO_INT32_T +#endif +#endif + +/* + * quote from SunOS-5.8 sys/inttypes.h: + * Use at your own risk. As of February 1996, the committee is squarely + * behind the fixed sized types; the "least" and "fast" types are still being + * discussed. The probability that the "fast" types may be removed before + * the standard is finalized is high enough that they are not currently + * implemented. + */ + +#if defined _STDINT_NEED_INT_LEAST_T +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +#ifdef _HAVE_UINT64_T +typedef int64_t int_least64_t; +#endif + +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +#ifdef _HAVE_UINT64_T +typedef uint64_t uint_least64_t; +#endif + /* least types */ +#endif + +#if defined _STDINT_NEED_INT_FAST_T +typedef int8_t int_fast8_t; +typedef int int_fast16_t; +typedef int32_t int_fast32_t; +#ifdef _HAVE_UINT64_T +typedef int64_t int_fast64_t; +#endif + +typedef uint8_t uint_fast8_t; +typedef unsigned uint_fast16_t; +typedef uint32_t uint_fast32_t; +#ifdef _HAVE_UINT64_T +typedef uint64_t uint_fast64_t; +#endif + /* fast types */ +#endif + +#ifdef _STDINT_NEED_INTMAX_T +#ifdef _HAVE_UINT64_T +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; +#else +typedef long intmax_t; +typedef unsigned long uintmax_t; +#endif +#endif + +#ifdef _STDINT_NEED_INTPTR_T +#ifndef __intptr_t_defined +#define __intptr_t_defined +/* we encourage using "long" to store pointer values, never use "int" ! */ +#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 +typedef unsigned int uintptr_t; +typedef int intptr_t; +#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 +typedef unsigned long uintptr_t; +typedef long intptr_t; +#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T +typedef uint64_t uintptr_t; +typedef int64_t intptr_t; +#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ +typedef unsigned long uintptr_t; +typedef long intptr_t; +#endif +#endif +#endif + +/* The ISO C99 standard specifies that in C++ implementations these + should only be defined if explicitly requested. */ +#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS +#ifndef UINT32_C + +/* Signed. */ +# define INT8_C(c) c +# define INT16_C(c) c +# define INT32_C(c) c +# ifdef _HAVE_LONGLONG_UINT64_T +# define INT64_C(c) c ## L +# else +# define INT64_C(c) c ## LL +# endif + +/* Unsigned. */ +# define UINT8_C(c) c ## U +# define UINT16_C(c) c ## U +# define UINT32_C(c) c ## U +# ifdef _HAVE_LONGLONG_UINT64_T +# define UINT64_C(c) c ## UL +# else +# define UINT64_C(c) c ## ULL +# endif + +/* Maximal type. */ +# ifdef _HAVE_LONGLONG_UINT64_T +# define INTMAX_C(c) c ## L +# define UINTMAX_C(c) c ## UL +# else +# define INTMAX_C(c) c ## LL +# define UINTMAX_C(c) c ## ULL +# endif + + /* literalnumbers */ +#endif +#endif + +/* These limits are merily those of a two complement byte-oriented system */ + +/* Minimum of signed integral types. */ +# define INT8_MIN (-128) +# define INT16_MIN (-32767-1) +# define INT32_MIN (-2147483647-1) +# define INT64_MIN (-__INT64_C(9223372036854775807)-1) +/* Maximum of signed integral types. */ +# define INT8_MAX (127) +# define INT16_MAX (32767) +# define INT32_MAX (2147483647) +# define INT64_MAX (__INT64_C(9223372036854775807)) + +/* Maximum of unsigned integral types. */ +# define UINT8_MAX (255) +# define UINT16_MAX (65535) +# define UINT32_MAX (4294967295U) +# define UINT64_MAX (__UINT64_C(18446744073709551615)) + +/* Minimum of signed integral types having a minimum size. */ +# define INT_LEAST8_MIN INT8_MIN +# define INT_LEAST16_MIN INT16_MIN +# define INT_LEAST32_MIN INT32_MIN +# define INT_LEAST64_MIN INT64_MIN +/* Maximum of signed integral types having a minimum size. */ +# define INT_LEAST8_MAX INT8_MAX +# define INT_LEAST16_MAX INT16_MAX +# define INT_LEAST32_MAX INT32_MAX +# define INT_LEAST64_MAX INT64_MAX + +/* Maximum of unsigned integral types having a minimum size. */ +# define UINT_LEAST8_MAX UINT8_MAX +# define UINT_LEAST16_MAX UINT16_MAX +# define UINT_LEAST32_MAX UINT32_MAX +# define UINT_LEAST64_MAX UINT64_MAX + + /* shortcircuit*/ +#endif + /* once */ +#endif +#endif +STDINT_EOF +fi + if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then + AC_MSG_NOTICE([$ac_stdint_h is unchanged]) + else + ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` + AS_MKDIR_P(["$ac_dir"]) + rm -f $ac_stdint_h + mv $ac_stdint $ac_stdint_h + fi +],[# variables for create stdint.h replacement +PACKAGE="$PACKAGE" +VERSION="$VERSION" +ac_stdint_h="$ac_stdint_h" +_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) +ac_cv_stdint_message="$ac_cv_stdint_message" +ac_cv_header_stdint_t="$ac_cv_header_stdint_t" +ac_cv_header_stdint_x="$ac_cv_header_stdint_x" +ac_cv_header_stdint_o="$ac_cv_header_stdint_o" +ac_cv_header_stdint_u="$ac_cv_header_stdint_u" +ac_cv_type_uint64_t="$ac_cv_type_uint64_t" +ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" +ac_cv_char_data_model="$ac_cv_char_data_model" +ac_cv_long_data_model="$ac_cv_long_data_model" +ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" +ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" +ac_cv_type_intmax_t="$ac_cv_type_intmax_t" +]) +]) diff --git a/fontconfig/src/Makefile.am b/fontconfig/src/Makefile.am index 3dd69dde9..dc082b7df 100644 --- a/fontconfig/src/Makefile.am +++ b/fontconfig/src/Makefile.am @@ -80,14 +80,15 @@ INCLUDES = \ EXTRA_DIST = makealias -noinst_HEADERS=fcint.h fcftint.h fcdeprecate.h +noinst_HEADERS=fcint.h fcftint.h fcdeprecate.h fcstdint.h ALIAS_FILES = fcalias.h fcaliastail.h fcftalias.h fcftaliastail.h BUILT_SOURCES = $(ALIAS_FILES) \ ../fc-case/fccase.h \ ../fc-glyphname/fcglyphname.h \ - ../fc-lang/fclang.h + ../fc-lang/fclang.h \ + stamp-fcstdint noinst_PROGRAMS = fcarch @@ -158,7 +159,13 @@ fcftaliastail.h: fcftalias.h fcftalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FT_FILES) $(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcftalias.h fcftaliastail.h $(PUBLIC_FT_FILES) +stamp-fcstdint: $(top_builddir)/config.status + $(AM_V_GEN) cd $(top_builddir) && \ + $(SHELL) ./config.status src/fcstdint.h + @touch $@ + CLEANFILES = $(ALIAS_FILES) +DISTCLEANFILES = stamp-fcstdint fcstdint.h fontconfig.def: $(PUBLIC_FILES) $(PUBLIC_FT_FILES) echo Generating $@ diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h index e9f315f6b..7125f2e5e 100644 --- a/fontconfig/src/fcint.h +++ b/fontconfig/src/fcint.h @@ -29,15 +29,10 @@ #include <config.h> #endif +#include "fcstdint.h" + #include <stdlib.h> #include <stdio.h> -#ifdef HAVE_INTTYPES_H -#include <inttypes.h> -#elif defined(HAVE_STDINT_H) -#include <stdint.h> -#else -#error missing C99 integer data types -#endif #include <string.h> #include <ctype.h> #include <errno.h> diff --git a/mesalib/.gitignore b/mesalib/.gitignore index f481dc47e..8f39b5334 100644 --- a/mesalib/.gitignore +++ b/mesalib/.gitignore @@ -39,5 +39,6 @@ manifest.txt Makefile.in .dir-locals.el .deps/ +.dirstamp .libs/ /Makefile diff --git a/mesalib/Makefile.am b/mesalib/Makefile.am index b22458ec8..1f4fcac3a 100644 --- a/mesalib/Makefile.am +++ b/mesalib/Makefile.am @@ -85,57 +85,7 @@ EXTRA_FILES = \ src/mesa/program/lex.yy.c \ src/mesa/program/program_parse.tab.c \ src/mesa/program/program_parse.tab.h \ - src/gallium/drivers/r600/Makefile.in \ - src/gallium/drivers/r300/Makefile.in \ - src/gallium/drivers/Makefile.in \ - src/gallium/Makefile.in \ - src/gallium/auxiliary/pipe-loader/Makefile.in \ - src/gallium/targets/opencl/Makefile.in \ - src/gallium/state_trackers/clover/Makefile.in \ - src/mapi/glapi/tests/Makefile.in \ - src/mapi/glapi/Makefile.in \ - src/mapi/glapi/gen/Makefile.in \ - src/mapi/es1api/Makefile.in \ - src/mapi/shared-glapi/tests/Makefile.in \ - src/mapi/shared-glapi/Makefile.in \ - src/mapi/vgapi/Makefile.in \ - src/mapi/es2api/Makefile.in \ - src/glsl/tests/Makefile.in \ - src/glsl/glcpp/Makefile.in \ - src/glsl/builtin_compiler/Makefile.in \ - src/glsl/Makefile.in \ - src/gtest/Makefile.in \ - src/egl/drivers/Makefile.in \ - src/egl/drivers/glx/Makefile.in \ - src/egl/drivers/dri2/Makefile.in \ - src/egl/Makefile.in \ - src/egl/main/Makefile.in \ - src/egl/wayland/Makefile.in \ - src/egl/wayland/wayland-drm/Makefile.in \ - src/egl/wayland/wayland-egl/Makefile.in \ - src/Makefile.in \ - src/glx/tests/Makefile.in \ - src/glx/Makefile.in \ - src/gbm/Makefile.in \ - src/mesa/drivers/Makefile.in \ - src/mesa/drivers/dri/common/Makefile.in \ - src/mesa/drivers/dri/i965/Makefile.in \ - src/mesa/drivers/dri/r200/Makefile.in \ - src/mesa/drivers/dri/Makefile.in \ - src/mesa/drivers/dri/radeon/Makefile.in \ - src/mesa/drivers/dri/swrast/Makefile.in \ - src/mesa/drivers/dri/nouveau/Makefile.in \ - src/mesa/drivers/dri/i915/Makefile.in \ - src/mesa/drivers/osmesa/Makefile.in \ - src/mesa/drivers/x11/Makefile.in \ - src/mesa/Makefile.in \ - src/mesa/libdricore/Makefile.in \ - src/mesa/x86-64/Makefile.in \ - src/mesa/program/Makefile.in \ - src/mesa/main/tests/Makefile.in \ - src/mesa/main/tests/hash_table/Makefile.in \ - src/mesa/x86/Makefile.in \ - Makefile.in + `git ls-files | grep "Makefile.am" | sed -e "s/Makefile.am/Makefile.in/"` IGNORE_FILES = \ diff --git a/mesalib/configure.ac b/mesalib/configure.ac index f484dc4d6..4fb454407 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -1641,6 +1641,21 @@ AC_ARG_WITH([llvm-prefix], [llvm_prefix=""]) +# Call this inside ` ` to get the return value. +# $1 is the llvm-config command with arguments. +strip_unwanted_llvm_flags() { + # Use \> (marks the end of the word) + echo `$1` | sed \ + -e 's/-DNDEBUG\>//g' \ + -e 's/-pedantic\>//g' \ + -e 's/-Wcovered-switch-default\>//g' \ + -e 's/-O.\>//g' \ + -e 's/-g\>//g' \ + -e 's/-Wall\>//g' \ + -e 's/-fomit-frame-pointer\>//g' +} + + if test "x$with_gallium_drivers" = x; then enable_gallium_llvm=no fi @@ -1658,7 +1673,6 @@ if test "x$enable_gallium_llvm" = xyes; then if test "x$LLVM_CONFIG" != xno; then LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'` - LLVM_CFLAGS=`$LLVM_CONFIG --cppflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g' -e 's/-Wcovered-switch-default//g'` if test "x$with_llvm_shared_libs" = xyes; then dnl We can't use $LLVM_VERSION because it has 'svn' stripped out, LLVM_LIBS="-lLLVM-`$LLVM_CONFIG --version`" @@ -1675,8 +1689,9 @@ if test "x$enable_gallium_llvm" = xyes; then fi LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags` LLVM_BINDIR=`$LLVM_CONFIG --bindir` - LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g' -e 's/-Wcovered-switch-default//g'` - LLVM_CPPFLAGS=`$LLVM_CONFIG --cppflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g' -e 's/-Wcovered-switch-default//g'` + LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"` + LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient + LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"` LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir` LLVM_LIBDIR=`$LLVM_CONFIG --libdir` DEFINES="${DEFINES} -DHAVE_LLVM=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/0x0\10\2/g'`" @@ -2134,6 +2149,12 @@ echo " CFLAGS: $cflags" echo " CXXFLAGS: $cxxflags" echo " Macros: $defines" echo "" +if test "x$MESA_LLVM" = x1; then + echo " LLVM_CFLAGS: $LLVM_CFLAGS" + echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS" + echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS" + echo "" +fi echo " PYTHON2: $PYTHON2" echo "" diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt index 9b87e8b02..ba1b0d1a1 100644 --- a/mesalib/docs/GL3.txt +++ b/mesalib/docs/GL3.txt @@ -23,12 +23,12 @@ GL_EXT_texture_shared_exponent DONE (i965, r600, swrast) Float depth buffers (GL_ARB_depth_buffer_float) DONE (i965, r600) Framebuffer objects (GL_ARB_framebuffer_object) DONE (i965, r300, r600, swrast) Half-float DONE -Non-normalized Integer texture/framebuffer formats DONE (i965) +Non-normalized Integer texture/framebuffer formats DONE (i965, r600)
1D/2D Texture arrays DONE Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE (i965, r600, swrast) GL_EXT_texture_compression_rgtc DONE (i965, r300, r600, swrast) Red and red/green texture formats DONE (i965, swrast, gallium) -Transform feedback (GL_EXT_transform_feedback) DONE (i965) +Transform feedback (GL_EXT_transform_feedback) DONE (i965, r600)
Vertex array objects (GL_APPLE_vertex_array_object) DONE (i965, r300, r600, swrast) sRGB framebuffer format (GL_EXT_framebuffer_sRGB) DONE (i965, r600) glClearBuffer commands DONE @@ -79,9 +79,9 @@ GL_ARB_sampler_objects DONE (i965, r300, r600) GL_ARB_shader_bit_encoding DONE GL_ARB_texture_rgb10_a2ui DONE (i965, r600) GL_ARB_texture_swizzle DONE (same as EXT version) (i965, r300, r600, swrast) -GL_ARB_timer_query DONE (i965) +GL_ARB_timer_query DONE (i965, r600)
GL_ARB_instanced_arrays DONE (i965, r300, r600) -GL_ARB_vertex_type_2_10_10_10_rev DONE (r600) +GL_ARB_vertex_type_2_10_10_10_rev DONE (i965, r600) GL 4.0: diff --git a/mesalib/src/gallium/auxiliary/util/u_debug_memory.c b/mesalib/src/gallium/auxiliary/util/u_debug_memory.c index e24a8bc0b..4bf26a524 100644 --- a/mesalib/src/gallium/auxiliary/util/u_debug_memory.c +++ b/mesalib/src/gallium/auxiliary/util/u_debug_memory.c @@ -48,6 +48,16 @@ #define DEBUG_MEMORY_MAGIC 0x6e34090aU #define DEBUG_MEMORY_STACK 0 /* XXX: disabled until we have symbol lookup */ +/** + * Set to 1 to enable checking of freed blocks of memory. + * Basically, don't really deallocate freed memory; keep it in the list + * but mark it as freed and do extra checking in debug_memory_check(). + * This can detect some cases of use-after-free. But note that since we + * never really free anything this will use a lot of memory. + */ +#define DEBUG_FREED_MEMORY 0 +#define DEBUG_FREED_BYTE 0x33 + struct debug_memory_header { @@ -61,7 +71,10 @@ struct debug_memory_header struct debug_stack_frame backtrace[DEBUG_MEMORY_STACK]; #endif size_t size; - +#if DEBUG_FREED_MEMORY + boolean freed; /**< Is this a freed block? */ +#endif + unsigned magic; }; @@ -127,6 +140,9 @@ debug_malloc(const char *file, unsigned line, const char *function, hdr->function = function; hdr->size = size; hdr->magic = DEBUG_MEMORY_MAGIC; +#if DEBUG_FREED_MEMORY + hdr->freed = FALSE; +#endif #if DEBUG_MEMORY_STACK debug_backtrace_capture(hdr->backtrace, 0, DEBUG_MEMORY_STACK); @@ -169,6 +185,17 @@ debug_free(const char *file, unsigned line, const char *function, debug_assert(0); } +#if DEBUG_FREED_MEMORY + /* Check for double-free */ + assert(!hdr->freed); + /* Mark the block as freed but don't really free it */ + hdr->freed = TRUE; + /* Save file/line where freed */ + hdr->file = file; + hdr->line = line; + /* set freed memory to special value */ + memset(ptr, DEBUG_FREED_BYTE, hdr->size); +#else pipe_mutex_lock(list_mutex); LIST_DEL(&hdr->head); pipe_mutex_unlock(list_mutex); @@ -176,6 +203,7 @@ debug_free(const char *file, unsigned line, const char *function, ftr->magic = 0; os_free(hdr); +#endif } void * @@ -235,6 +263,9 @@ debug_realloc(const char *file, unsigned line, const char *function, new_hdr->function = old_hdr->function; new_hdr->size = new_size; new_hdr->magic = DEBUG_MEMORY_MAGIC; +#if DEBUG_FREED_MEMORY + new_hdr->freed = FALSE; +#endif new_ftr = footer_from_header(new_hdr); new_ftr->magic = DEBUG_MEMORY_MAGIC; @@ -314,3 +345,52 @@ debug_memory_end(unsigned long start_no) debug_printf("No memory leaks detected.\n"); } } + + +/** + * We can periodically call this from elsewhere to do a basic sanity + * check of the heap memory we've allocated. + */ +void +debug_memory_check(void) +{ + struct list_head *entry; + + entry = list.prev; + for (; entry != &list; entry = entry->prev) { + struct debug_memory_header *hdr; + struct debug_memory_footer *ftr; + const char *ptr; + + hdr = LIST_ENTRY(struct debug_memory_header, entry, head); + ftr = footer_from_header(hdr); + ptr = (const char *) data_from_header(hdr); + + if (hdr->magic != DEBUG_MEMORY_MAGIC) { + debug_printf("%s:%u:%s: bad or corrupted memory %p\n", + hdr->file, hdr->line, hdr->function, ptr); + debug_assert(0); + } + + if (ftr->magic != DEBUG_MEMORY_MAGIC) { + debug_printf("%s:%u:%s: buffer overflow %p\n", + hdr->file, hdr->line, hdr->function, ptr); + debug_assert(0); + } + +#if DEBUG_FREED_MEMORY + /* If this block is marked as freed, check that it hasn't been touched */ + if (hdr->freed) { + int i; + for (i = 0; i < hdr->size; i++) { + if (ptr[i] != DEBUG_FREED_BYTE) { + debug_printf("Memory error: byte %d of block at %p of size %d is 0x%x\n", + i, ptr, hdr->size, ptr[i]); + debug_printf("Block was freed at %s:%d\n", hdr->file, hdr->line); + } + assert(ptr[i] == DEBUG_FREED_BYTE); + } + } +#endif + } +} diff --git a/mesalib/src/gallium/auxiliary/util/u_format.c b/mesalib/src/gallium/auxiliary/util/u_format.c index f572a612e..ddce95601 100644 --- a/mesalib/src/gallium/auxiliary/util/u_format.c +++ b/mesalib/src/gallium/auxiliary/util/u_format.c @@ -147,9 +147,12 @@ util_format_is_array(const struct util_format_description *desc) } for (chan = 0; chan < desc->nr_channels; ++chan) { - if (desc->swizzle[chan] != chan) + if (desc->channel[chan].size != desc->channel[0].size) return FALSE; + if (desc->channel[chan].type == UTIL_FORMAT_TYPE_VOID && (chan + 1) == desc->nr_channels) + continue; + if (desc->channel[chan].type != desc->channel[0].type) return FALSE; @@ -158,9 +161,16 @@ util_format_is_array(const struct util_format_description *desc) if (desc->channel[chan].pure_integer != desc->channel[0].pure_integer) return FALSE; + } - if (desc->channel[chan].size != desc->channel[0].size) + if (desc->nr_channels == 4) { + if (desc->swizzle[3] < 3) return FALSE; + } else { + for (chan = 0; chan < desc->nr_channels; ++chan) { + if (desc->swizzle[chan] != chan) + return FALSE; + } } return TRUE; diff --git a/mesalib/src/gallium/auxiliary/util/u_format.h b/mesalib/src/gallium/auxiliary/util/u_format.h index a718389dd..25bfd234b 100644 --- a/mesalib/src/gallium/auxiliary/util/u_format.h +++ b/mesalib/src/gallium/auxiliary/util/u_format.h @@ -592,7 +592,10 @@ util_format_is_pure_uint(enum pipe_format format); /** * Whether the format is a simple array format where all channels - * are of the same type and can be loaded from memory as a vector + * are of the same type and can be loaded from memory as a vector. + * + * If format is 4 channel it can be swizzled (eg BGRA) as long + * as the alpha is the 3rd channel. */ boolean util_format_is_array(const struct util_format_description *desc); diff --git a/mesalib/src/gallium/auxiliary/util/u_format_pack.py b/mesalib/src/gallium/auxiliary/util/u_format_pack.py index 0b3a890d5..565d059c3 100644 --- a/mesalib/src/gallium/auxiliary/util/u_format_pack.py +++ b/mesalib/src/gallium/auxiliary/util/u_format_pack.py @@ -383,7 +383,7 @@ def conversion_expr(src_channel, if dst_channel.norm or dst_channel.type == FIXED: dst_one = get_one(dst_channel) if dst_channel.size <= 23: - value = '(%s * 0x%x)' % (value, dst_one) + value = 'util_iround(%s * 0x%x)' % (value, dst_one) else: # bigger than single precision mantissa, use double value = '(%s * (double)0x%x)' % (value, dst_one) diff --git a/mesalib/src/gallium/auxiliary/util/u_rect.c b/mesalib/src/gallium/auxiliary/util/u_rect.c index 59bebbcb7..d00568f1f 100644 --- a/mesalib/src/gallium/auxiliary/util/u_rect.c +++ b/mesalib/src/gallium/auxiliary/util/u_rect.c @@ -144,11 +144,7 @@ util_fill_rect(ubyte * dst, dst += dst_stride; } break; - case 8: - case 12: - case 16: - case 24: - case 32: + default: for (i = 0; i < height; i++) { ubyte *row = dst; for (j = 0; j < width; j++) { @@ -158,8 +154,5 @@ util_fill_rect(ubyte * dst, dst += dst_stride; } break; - default: - assert(0); - break; } } diff --git a/mesalib/src/glsl/glcpp/glcpp-lex.l b/mesalib/src/glsl/glcpp/glcpp-lex.l index 783c54549..fd28711d1 100644 --- a/mesalib/src/glsl/glcpp/glcpp-lex.l +++ b/mesalib/src/glsl/glcpp/glcpp-lex.l @@ -120,7 +120,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return SPACE; } -{HASH}version { +{HASH}version{HSPACE}+ { yylval->str = ralloc_strdup (yyextra, yytext); yyextra->space_tokens = 0; return HASH_VERSION; @@ -135,7 +135,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return OTHER; } -{HASH}line { +{HASH}line{HSPACE}+ { return HASH_LINE; } @@ -158,7 +158,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return HASH_IF; } -{HASH}elif { +{HASH}elif/[^_a-zA-Z0-9] { yyextra->lexing_if = 1; yyextra->space_tokens = 0; return HASH_ELIF; diff --git a/mesalib/src/glsl/glsl_parser.yy b/mesalib/src/glsl/glsl_parser.yy index a0665067d..407dbbeeb 100644 --- a/mesalib/src/glsl/glsl_parser.yy +++ b/mesalib/src/glsl/glsl_parser.yy @@ -238,6 +238,7 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) %type <node> conditionopt %type <node> for_init_statement %type <for_rest_statement> for_rest_statement +%type <n> integer_constant %% translation_unit: @@ -1122,6 +1123,10 @@ layout_qualifier_id_list: } ; +integer_constant: + INTCONSTANT { $$ = $1; } + | UINTCONSTANT { $$ = $1; } + layout_qualifier_id: any_identifier { @@ -1191,7 +1196,7 @@ layout_qualifier_id: YYERROR; } } - | any_identifier '=' INTCONSTANT + | any_identifier '=' integer_constant { memset(& $$, 0, sizeof($$)); diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index 417dbd041..7d58281c1 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -684,9 +684,11 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) _mesa_LoadIdentity(); _mesa_MatrixMode(GL_PROJECTION); _mesa_LoadIdentity(); - _mesa_Ortho(0.0, ctx->DrawBuffer->Width, - 0.0, ctx->DrawBuffer->Height, - -1.0, 1.0); + if (ctx->DrawBuffer->Initialized) { + _mesa_Ortho(0.0, ctx->DrawBuffer->Width, + 0.0, ctx->DrawBuffer->Height, + -1.0, 1.0); + } } if (state & MESA_META_CLIP) { diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index 223aef18d..891ec5dce 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -2799,11 +2799,41 @@ get_nongeneric_internalformat(GLenum format) } +static GLenum +get_linear_internalformat(GLenum format) +{ + switch (format) { + case GL_SRGB: + return GL_RGB; + + case GL_SRGB_ALPHA: + return GL_RGBA; + + case GL_SRGB8: + return GL_RGB8; + + case GL_SRGB8_ALPHA8: + return GL_RGBA8; + + case GL_SLUMINANCE: + return GL_LUMINANCE8; + + case GL_SLUMINANCE_ALPHA: + return GL_LUMINANCE8_ALPHA8; + + default: + return format; + } +} + + static GLboolean compatible_resolve_formats(const struct gl_renderbuffer *colorReadRb, const struct gl_renderbuffer *colorDrawRb) { - /* The simple case where we know the backing formats are the same. + GLenum readFormat, drawFormat; + + /* The simple case where we know the backing Mesa formats are the same. */ if (_mesa_get_srgb_format_linear(colorReadRb->Format) == _mesa_get_srgb_format_linear(colorDrawRb->Format)) { @@ -2817,9 +2847,15 @@ compatible_resolve_formats(const struct gl_renderbuffer *colorReadRb, * textures and get two entirely different Mesa formats like RGBA8888 and * ARGB8888. Drivers behaving like that should be able to cope with * non-matching formats by themselves, because it's not the user's fault. + * + * Blits between linear and sRGB formats are also allowed. */ - if (get_nongeneric_internalformat(colorReadRb->InternalFormat) == - get_nongeneric_internalformat(colorDrawRb->InternalFormat)) { + readFormat = get_nongeneric_internalformat(colorReadRb->InternalFormat); + drawFormat = get_nongeneric_internalformat(colorDrawRb->InternalFormat); + readFormat = get_linear_internalformat(readFormat); + drawFormat = get_linear_internalformat(drawFormat); + + if (readFormat == drawFormat) { return GL_TRUE; } diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c index 727115015..5c0a923e4 100644 --- a/mesalib/src/mesa/main/shaderapi.c +++ b/mesalib/src/mesa/main/shaderapi.c @@ -180,25 +180,6 @@ validate_shader_target(const struct gl_context *ctx, GLenum type) } -/** - * Find the length of the longest transform feedback varying name - * which was specified with glTransformFeedbackVaryings(). - */ -static GLint -longest_feedback_varying_name(const struct gl_shader_program *shProg) -{ - GLuint i; - GLint max = 0; - for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) { - GLint len = strlen(shProg->TransformFeedback.VaryingNames[i]); - if (len > max) - max = len; - } - return max; -} - - - static GLboolean is_program(struct gl_context *ctx, GLuint name) { @@ -538,11 +519,24 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param break; *params = shProg->TransformFeedback.NumVarying; return; - case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH: + case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH: { + unsigned i; + GLint max_len = 0; if (!has_xfb) break; - *params = longest_feedback_varying_name(shProg) + 1; + + for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) { + /* Add one for the terminating NUL character. + */ + const GLint len = strlen(shProg->TransformFeedback.VaryingNames[i]) + 1; + + if (len > max_len) + max_len = len; + } + + *params = max_len; return; + } case GL_TRANSFORM_FEEDBACK_BUFFER_MODE: if (!has_xfb) break; diff --git a/mesalib/src/mesa/main/shaderobj.c b/mesalib/src/mesa/main/shaderobj.c index 1706cac55..59daff5bf 100644 --- a/mesalib/src/mesa/main/shaderobj.c +++ b/mesalib/src/mesa/main/shaderobj.c @@ -247,6 +247,8 @@ _mesa_init_shader_program(struct gl_context *ctx, struct gl_shader_program *prog prog->Geom.InputType = GL_TRIANGLES; prog->Geom.OutputType = GL_TRIANGLE_STRIP; + prog->TransformFeedback.BufferMode = GL_INTERLEAVED_ATTRIBS; + prog->InfoLog = ralloc_strdup(prog, ""); } diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c index 6476f118e..da7725964 100644 --- a/mesalib/src/mesa/main/texcompress_s3tc.c +++ b/mesalib/src/mesa/main/texcompress_s3tc.c @@ -362,7 +362,6 @@ static void fetch_texel_2d_rgb_dxt1(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLubyte *texel) { - (void) k; if (fetch_ext_rgb_dxt1) { GLint sliceOffset = k ? texImage->ImageOffsets[k] / 2 : 0; fetch_ext_rgb_dxt1(texImage->RowStride, @@ -391,7 +390,6 @@ static void fetch_texel_2d_rgba_dxt1(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLubyte *texel) { - (void) k; if (fetch_ext_rgba_dxt1) { GLint sliceOffset = k ? texImage->ImageOffsets[k] / 2 : 0; fetch_ext_rgba_dxt1(texImage->RowStride, @@ -420,7 +418,6 @@ static void fetch_texel_2d_rgba_dxt3(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLubyte *texel) { - (void) k; if (fetch_ext_rgba_dxt3) { GLint sliceOffset = k ? texImage->ImageOffsets[k] : 0; fetch_ext_rgba_dxt3(texImage->RowStride, @@ -449,7 +446,6 @@ static void fetch_texel_2d_rgba_dxt5(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLubyte *texel) { - (void) k; if (fetch_ext_rgba_dxt5) { GLint sliceOffset = k ? texImage->ImageOffsets[k] : 0; fetch_ext_rgba_dxt5(texImage->RowStride, diff --git a/mesalib/src/mesa/main/transformfeedback.c b/mesalib/src/mesa/main/transformfeedback.c index e0dd4e886..22060c34c 100644 --- a/mesalib/src/mesa/main/transformfeedback.c +++ b/mesalib/src/mesa/main/transformfeedback.c @@ -622,14 +622,14 @@ _mesa_GetTransformFeedbackVarying(GLuint program, GLuint index, shProg = _mesa_lookup_shader_program(ctx, program); if (!shProg) { _mesa_error(ctx, GL_INVALID_VALUE, - "glGetTransformFeedbackVaryings(program=%u)", program); + "glGetTransformFeedbackVarying(program=%u)", program); return; } linked_xfb_info = &shProg->LinkedTransformFeedback; if (index >= (GLuint) linked_xfb_info->NumVarying) { _mesa_error(ctx, GL_INVALID_VALUE, - "glGetTransformFeedbackVaryings(index=%u)", index); + "glGetTransformFeedbackVarying(index=%u)", index); return; } diff --git a/mesalib/src/mesa/state_tracker/st_manager.c b/mesalib/src/mesa/state_tracker/st_manager.c index 88b886de8..5576a0d6c 100644 --- a/mesalib/src/mesa/state_tracker/st_manager.c +++ b/mesalib/src/mesa/state_tracker/st_manager.c @@ -624,6 +624,8 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi, api = API_OPENGLES2; break; case ST_PROFILE_OPENGL_CORE: + api = API_OPENGL_CORE; + break; default: *error = ST_CONTEXT_ERROR_BAD_API; return NULL; @@ -644,16 +646,18 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi, return NULL; } + if (attribs->flags & ST_CONTEXT_FLAG_DEBUG) + st->ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT; + if (attribs->flags & ST_CONTEXT_FLAG_FORWARD_COMPATIBLE) + st->ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT; + /* need to perform version check */ if (attribs->major > 1 || attribs->minor > 0) { _mesa_compute_version(st->ctx); - /* Is the actual version less than the requested version? Mesa can't - * yet enforce the added restrictions of a forward-looking context, so - * fail that too. + /* Is the actual version less than the requested version? */ - if (st->ctx->Version < attribs->major * 10 + attribs->minor - || (attribs->flags & ~ST_CONTEXT_FLAG_DEBUG) != 0) { + if (st->ctx->Version < attribs->major * 10 + attribs->minor) { *error = ST_CONTEXT_ERROR_BAD_VERSION; st_destroy_context(st); return NULL; @@ -884,6 +888,7 @@ static const struct st_api st_gl_api = { ST_API_OPENGL, #if FEATURE_GL ST_PROFILE_DEFAULT_MASK | + ST_PROFILE_OPENGL_CORE_MASK | #endif #if FEATURE_ES1 ST_PROFILE_OPENGL_ES1_MASK | diff --git a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h index 6bc53bab3..02c283da4 100644 --- a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h +++ b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h @@ -113,18 +113,54 @@ static inline float conv_i2_to_i(int i2) return (float)val.x; } -static inline float conv_i10_to_norm_float(int i10) +static inline float conv_i10_to_norm_float(const struct gl_context *ctx, int i10) { struct attr_bits_10 val; val.x = i10; - return (2.0F * (float)val.x + 1.0F) * (1.0F / 511.0F); -} -static inline float conv_i2_to_norm_float(int i2) + /* Traditionally, OpenGL has had two equations for converting from + * normalized fixed-point data to floating-point data. In the OpenGL 3.2 + * specification, these are equations 2.2 and 2.3, respectively: + * + * f = (2c + 1)/(2^b - 1). (2.2) + * + * Comments below this equation state: "In general, this representation is + * used for signed normalized fixed-point parameters in GL commands, such + * as vertex attribute values." Which is what we're doing here. + * + * f = max{c/(2^(b-1) - 1), -1.0} (2.3) + * + * Comments below this equation state: "In general, this representation is + * used for signed normalized fixed-point texture or floating point values." + * + * OpenGL 4.2+ and ES 3.0 remedy this and state that equation 2.3 (above) + * is used in every case. They remove equation 2.2 completely. + */ + if (_mesa_is_gles3(ctx) || + (ctx->API == API_OPENGL_CORE && ctx->Version >= 42)) { + /* Equation 2.3 above. */ + float f = ((float) val.x) / 511.0F; + return MAX2(f, -1.0); + } else { + /* Equation 2.2 above. */ + return (2.0F * (float)val.x + 1.0F) * (1.0F / 1023.0F); + } +} + +static inline float conv_i2_to_norm_float(const struct gl_context *ctx, int i2) { struct attr_bits_2 val; val.x = i2; - return (float)val.x; + + if (_mesa_is_gles3(ctx) || + (ctx->API == API_OPENGL_CORE && ctx->Version >= 42)) { + /* Equation 2.3 above. */ + float f = (float) val.x; + return MAX2(f, -1.0); + } else { + /* Equation 2.2 above. */ + return (2.0F * (float)val.x + 1.0F) * (1.0F / 3.0F); + } } #define ATTRI10_1( A, I10 ) ATTR( A, 1, GL_FLOAT, conv_i10_to_i((I10) & 0x3ff), 0, 0, 1 ) @@ -142,30 +178,30 @@ static inline float conv_i2_to_norm_float(int i2) conv_i2_to_i(((I10) >> 30) & 0x3)) -#define ATTRI10N_1( A, I10 ) ATTR( A, 1, GL_FLOAT, conv_i10_to_norm_float((I10) & 0x3ff), 0, 0, 1 ) -#define ATTRI10N_2( A, I10 ) ATTR( A, 2, GL_FLOAT, \ - conv_i10_to_norm_float((I10) & 0x3ff), \ - conv_i10_to_norm_float(((I10) >> 10) & 0x3ff), 0, 1 ) -#define ATTRI10N_3( A, I10 ) ATTR( A, 3, GL_FLOAT, \ - conv_i10_to_norm_float((I10) & 0x3ff), \ - conv_i10_to_norm_float(((I10) >> 10) & 0x3ff), \ - conv_i10_to_norm_float(((I10) >> 20) & 0x3ff), 1 ) -#define ATTRI10N_4( A, I10 ) ATTR( A, 4, GL_FLOAT, \ - conv_i10_to_norm_float((I10) & 0x3ff), \ - conv_i10_to_norm_float(((I10) >> 10) & 0x3ff), \ - conv_i10_to_norm_float(((I10) >> 20) & 0x3ff), \ - conv_i2_to_norm_float(((I10) >> 30) & 0x3)) - -#define ATTR_UI(val, type, normalized, attr, arg) do { \ +#define ATTRI10N_1(ctx, A, I10) ATTR(A, 1, GL_FLOAT, conv_i10_to_norm_float(ctx, (I10) & 0x3ff), 0, 0, 1 ) +#define ATTRI10N_2(ctx, A, I10) ATTR(A, 2, GL_FLOAT, \ + conv_i10_to_norm_float(ctx, (I10) & 0x3ff), \ + conv_i10_to_norm_float(ctx, ((I10) >> 10) & 0x3ff), 0, 1 ) +#define ATTRI10N_3(ctx, A, I10) ATTR(A, 3, GL_FLOAT, \ + conv_i10_to_norm_float(ctx, (I10) & 0x3ff), \ + conv_i10_to_norm_float(ctx, ((I10) >> 10) & 0x3ff), \ + conv_i10_to_norm_float(ctx, ((I10) >> 20) & 0x3ff), 1 ) +#define ATTRI10N_4(ctx, A, I10) ATTR(A, 4, GL_FLOAT, \ + conv_i10_to_norm_float(ctx, (I10) & 0x3ff), \ + conv_i10_to_norm_float(ctx, ((I10) >> 10) & 0x3ff), \ + conv_i10_to_norm_float(ctx, ((I10) >> 20) & 0x3ff), \ + conv_i2_to_norm_float(ctx, ((I10) >> 30) & 0x3)) + +#define ATTR_UI(ctx, val, type, normalized, attr, arg) do { \ if ((type) == GL_UNSIGNED_INT_2_10_10_10_REV) { \ if (normalized) { \ ATTRUI10N_##val((attr), (arg)); \ } else { \ ATTRUI10_##val((attr), (arg)); \ } \ - } else if ((type) == GL_INT_2_10_10_10_REV) { \ + } else if ((type) == GL_INT_2_10_10_10_REV) { \ if (normalized) { \ - ATTRI10N_##val((attr), (arg)); \ + ATTRI10N_##val(ctx, (attr), (arg)); \ } else { \ ATTRI10_##val((attr), (arg)); \ } \ @@ -173,11 +209,11 @@ static inline float conv_i2_to_norm_float(int i2) ERROR(GL_INVALID_VALUE); \ } while(0) -#define ATTR_UI_INDEX(val, type, normalized, index, arg) do { \ +#define ATTR_UI_INDEX(ctx, val, type, normalized, index, arg) do { \ if ((index) == 0) { \ - ATTR_UI(val, (type), normalized, 0, (arg)); \ + ATTR_UI(ctx, val, (type), normalized, 0, (arg)); \ } else if ((index) < MAX_VERTEX_GENERIC_ATTRIBS) { \ - ATTR_UI(val, (type), normalized, VBO_ATTRIB_GENERIC0 + (index), (arg)); \ + ATTR_UI(ctx, val, (type), normalized, VBO_ATTRIB_GENERIC0 + (index), (arg)); \ } else \ ERROR(GL_INVALID_VALUE); \ } while(0) @@ -799,103 +835,122 @@ TAG(VertexAttrib4fvNV)(GLuint index, const GLfloat * v) ATTR4FV(index, v); } +#define ERROR_IF_NOT_PACKED_TYPE(ctx, type, func) \ + if (type != GL_INT_2_10_10_10_REV && type != GL_UNSIGNED_INT_2_10_10_10_REV) { \ + _mesa_error(ctx, GL_INVALID_ENUM, "%s(type)", func); \ + return; \ + } static void GLAPIENTRY TAG(VertexP2ui)(GLenum type, GLuint value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(2, type, 0, VBO_ATTRIB_POS, value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP2ui"); + ATTR_UI(ctx, 2, type, 0, VBO_ATTRIB_POS, value); } static void GLAPIENTRY TAG(VertexP2uiv)(GLenum type, const GLuint *value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(2, type, 0, VBO_ATTRIB_POS, value[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP2uiv"); + ATTR_UI(ctx, 2, type, 0, VBO_ATTRIB_POS, value[0]); } static void GLAPIENTRY TAG(VertexP3ui)(GLenum type, GLuint value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(3, type, 0, VBO_ATTRIB_POS, value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP3ui"); + ATTR_UI(ctx, 3, type, 0, VBO_ATTRIB_POS, value); } static void GLAPIENTRY TAG(VertexP3uiv)(GLenum type, const GLuint *value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(3, type, 0, VBO_ATTRIB_POS, value[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP3uiv"); + ATTR_UI(ctx, 3, type, 0, VBO_ATTRIB_POS, value[0]); } static void GLAPIENTRY TAG(VertexP4ui)(GLenum type, GLuint value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(4, type, 0, VBO_ATTRIB_POS, value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP4ui"); + ATTR_UI(ctx, 4, type, 0, VBO_ATTRIB_POS, value); } static void GLAPIENTRY TAG(VertexP4uiv)(GLenum type, const GLuint *value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(4, type, 0, VBO_ATTRIB_POS, value[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexP4uiv"); + ATTR_UI(ctx, 4, type, 0, VBO_ATTRIB_POS, value[0]); } static void GLAPIENTRY TAG(TexCoordP1ui)(GLenum type, GLuint coords) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(1, type, 0, VBO_ATTRIB_TEX0, coords); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP1ui"); + ATTR_UI(ctx, 1, type, 0, VBO_ATTRIB_TEX0, coords); } static void GLAPIENTRY TAG(TexCoordP1uiv)(GLenum type, const GLuint *coords) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(1, type, 0, VBO_ATTRIB_TEX0, coords[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP1uiv"); + ATTR_UI(ctx, 1, type, 0, VBO_ATTRIB_TEX0, coords[0]); } static void GLAPIENTRY TAG(TexCoordP2ui)(GLenum type, GLuint coords) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(2, type, 0, VBO_ATTRIB_TEX0, coords); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP2ui"); + ATTR_UI(ctx, 2, type, 0, VBO_ATTRIB_TEX0, coords); } static void GLAPIENTRY TAG(TexCoordP2uiv)(GLenum type, const GLuint *coords) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(2, type, 0, VBO_ATTRIB_TEX0, coords[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP2uiv"); + ATTR_UI(ctx, 2, type, 0, VBO_ATTRIB_TEX0, coords[0]); } static void GLAPIENTRY TAG(TexCoordP3ui)(GLenum type, GLuint coords) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(3, type, 0, VBO_ATTRIB_TEX0, coords); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP3ui"); + ATTR_UI(ctx, 3, type, 0, VBO_ATTRIB_TEX0, coords); } static void GLAPIENTRY TAG(TexCoordP3uiv)(GLenum type, const GLuint *coords) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(3, type, 0, VBO_ATTRIB_TEX0, coords[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP3uiv"); + ATTR_UI(ctx, 3, type, 0, VBO_ATTRIB_TEX0, coords[0]); } static void GLAPIENTRY TAG(TexCoordP4ui)(GLenum type, GLuint coords) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(4, type, 0, VBO_ATTRIB_TEX0, coords); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP4ui"); + ATTR_UI(ctx, 4, type, 0, VBO_ATTRIB_TEX0, coords); } static void GLAPIENTRY TAG(TexCoordP4uiv)(GLenum type, const GLuint *coords) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(4, type, 0, VBO_ATTRIB_TEX0, coords[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glTexCoordP4uiv"); + ATTR_UI(ctx, 4, type, 0, VBO_ATTRIB_TEX0, coords[0]); } static void GLAPIENTRY @@ -903,7 +958,8 @@ TAG(MultiTexCoordP1ui)(GLenum target, GLenum type, GLuint coords) { GET_CURRENT_CONTEXT(ctx); GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR_UI(1, type, 0, attr, coords); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP1ui"); + ATTR_UI(ctx, 1, type, 0, attr, coords); } static void GLAPIENTRY @@ -911,7 +967,8 @@ TAG(MultiTexCoordP1uiv)(GLenum target, GLenum type, const GLuint *coords) { GET_CURRENT_CONTEXT(ctx); GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR_UI(1, type, 0, attr, coords[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP1uiv"); + ATTR_UI(ctx, 1, type, 0, attr, coords[0]); } static void GLAPIENTRY @@ -919,7 +976,8 @@ TAG(MultiTexCoordP2ui)(GLenum target, GLenum type, GLuint coords) { GET_CURRENT_CONTEXT(ctx); GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR_UI(2, type, 0, attr, coords); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP2ui"); + ATTR_UI(ctx, 2, type, 0, attr, coords); } static void GLAPIENTRY @@ -927,7 +985,8 @@ TAG(MultiTexCoordP2uiv)(GLenum target, GLenum type, const GLuint *coords) { GET_CURRENT_CONTEXT(ctx); GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR_UI(2, type, 0, attr, coords[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP2uiv"); + ATTR_UI(ctx, 2, type, 0, attr, coords[0]); } static void GLAPIENTRY @@ -935,7 +994,8 @@ TAG(MultiTexCoordP3ui)(GLenum target, GLenum type, GLuint coords) { GET_CURRENT_CONTEXT(ctx); GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR_UI(3, type, 0, attr, coords); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP3ui"); + ATTR_UI(ctx, 3, type, 0, attr, coords); } static void GLAPIENTRY @@ -943,7 +1003,8 @@ TAG(MultiTexCoordP3uiv)(GLenum target, GLenum type, const GLuint *coords) { GET_CURRENT_CONTEXT(ctx); GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR_UI(3, type, 0, attr, coords[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP3uiv"); + ATTR_UI(ctx, 3, type, 0, attr, coords[0]); } static void GLAPIENTRY @@ -951,7 +1012,8 @@ TAG(MultiTexCoordP4ui)(GLenum target, GLenum type, GLuint coords) { GET_CURRENT_CONTEXT(ctx); GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR_UI(4, type, 0, attr, coords); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP4ui"); + ATTR_UI(ctx, 4, type, 0, attr, coords); } static void GLAPIENTRY @@ -959,63 +1021,72 @@ TAG(MultiTexCoordP4uiv)(GLenum target, GLenum type, const GLuint *coords) { GET_CURRENT_CONTEXT(ctx); GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; - ATTR_UI(4, type, 0, attr, coords[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glMultiTexCoordP4uiv"); + ATTR_UI(ctx, 4, type, 0, attr, coords[0]); } static void GLAPIENTRY TAG(NormalP3ui)(GLenum type, GLuint coords) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(3, type, 1, VBO_ATTRIB_NORMAL, coords); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glNormalP3ui"); + ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_NORMAL, coords); } static void GLAPIENTRY TAG(NormalP3uiv)(GLenum type, const GLuint *coords) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(3, type, 1, VBO_ATTRIB_NORMAL, coords[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glNormalP3uiv"); + ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_NORMAL, coords[0]); } static void GLAPIENTRY TAG(ColorP3ui)(GLenum type, GLuint color) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(3, type, 1, VBO_ATTRIB_COLOR0, color); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP3ui"); + ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_COLOR0, color); } static void GLAPIENTRY TAG(ColorP3uiv)(GLenum type, const GLuint *color) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(3, type, 1, VBO_ATTRIB_COLOR0, color[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP3uiv"); + ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_COLOR0, color[0]); } static void GLAPIENTRY TAG(ColorP4ui)(GLenum type, GLuint color) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(4, type, 1, VBO_ATTRIB_COLOR0, color); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP4ui"); + ATTR_UI(ctx, 4, type, 1, VBO_ATTRIB_COLOR0, color); } static void GLAPIENTRY TAG(ColorP4uiv)(GLenum type, const GLuint *color) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(4, type, 1, VBO_ATTRIB_COLOR0, color[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glColorP4uiv"); + ATTR_UI(ctx, 4, type, 1, VBO_ATTRIB_COLOR0, color[0]); } static void GLAPIENTRY TAG(SecondaryColorP3ui)(GLenum type, GLuint color) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(3, type, 1, VBO_ATTRIB_COLOR1, color); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glSecondaryColorP3ui"); + ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_COLOR1, color); } static void GLAPIENTRY TAG(SecondaryColorP3uiv)(GLenum type, const GLuint *color) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI(3, type, 1, VBO_ATTRIB_COLOR1, color[0]); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glSecondaryColorP3uiv"); + ATTR_UI(ctx, 3, type, 1, VBO_ATTRIB_COLOR1, color[0]); } static void GLAPIENTRY @@ -1023,7 +1094,8 @@ TAG(VertexAttribP1ui)(GLuint index, GLenum type, GLboolean normalized, GLuint value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI_INDEX(1, type, normalized, index, value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP1ui"); + ATTR_UI_INDEX(ctx, 1, type, normalized, index, value); } static void GLAPIENTRY @@ -1031,7 +1103,8 @@ TAG(VertexAttribP2ui)(GLuint index, GLenum type, GLboolean normalized, GLuint value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI_INDEX(2, type, normalized, index, value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP2ui"); + ATTR_UI_INDEX(ctx, 2, type, normalized, index, value); } static void GLAPIENTRY @@ -1039,7 +1112,8 @@ TAG(VertexAttribP3ui)(GLuint index, GLenum type, GLboolean normalized, GLuint value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI_INDEX(3, type, normalized, index, value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP3ui"); + ATTR_UI_INDEX(ctx, 3, type, normalized, index, value); } static void GLAPIENTRY @@ -1047,7 +1121,8 @@ TAG(VertexAttribP4ui)(GLuint index, GLenum type, GLboolean normalized, GLuint value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI_INDEX(4, type, normalized, index, value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP4ui"); + ATTR_UI_INDEX(ctx, 4, type, normalized, index, value); } static void GLAPIENTRY @@ -1055,7 +1130,8 @@ TAG(VertexAttribP1uiv)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI_INDEX(1, type, normalized, index, *value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP1uiv"); + ATTR_UI_INDEX(ctx, 1, type, normalized, index, *value); } static void GLAPIENTRY @@ -1063,7 +1139,8 @@ TAG(VertexAttribP2uiv)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI_INDEX(2, type, normalized, index, *value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP2uiv"); + ATTR_UI_INDEX(ctx, 2, type, normalized, index, *value); } static void GLAPIENTRY @@ -1071,7 +1148,8 @@ TAG(VertexAttribP3uiv)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI_INDEX(3, type, normalized, index, *value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP3uiv"); + ATTR_UI_INDEX(ctx, 3, type, normalized, index, *value); } static void GLAPIENTRY @@ -1079,7 +1157,8 @@ TAG(VertexAttribP4uiv)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value) { GET_CURRENT_CONTEXT(ctx); - ATTR_UI_INDEX(4, type, normalized, index, *value); + ERROR_IF_NOT_PACKED_TYPE(ctx, type, "glVertexAttribP4uiv"); + ATTR_UI_INDEX(ctx, 4, type, normalized, index, *value); } diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c index 2df1a6ea5..99ba277fb 100644 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/dix/dispatch.c @@ -223,7 +223,11 @@ UpdateCurrentTimeIf(void) #define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ #define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ +#if defined(WIN32) && !defined(__CYGWIN__) +Bool SmartScheduleDisable = TRUE; +#else Bool SmartScheduleDisable = FALSE; +#endif long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; diff --git a/xorg-server/hw/dmx/dmx.h b/xorg-server/hw/dmx/dmx.h index d7c620467..f0cb04459 100644 --- a/xorg-server/hw/dmx/dmx.h +++ b/xorg-server/hw/dmx/dmx.h @@ -407,4 +407,6 @@ extern DevPrivateKeyRec dmxGlyphSetPrivateKeyRec; #define dmxGlyphSetPrivateKey (&dmxGlyphSetPrivateKeyRec) /**< Private index for GlyphSets */ +void DMXExtensionInit(void); + #endif /* DMX_H */ diff --git a/xorg-server/hw/dmx/dmxinit.c b/xorg-server/hw/dmx/dmxinit.c index 5804353fb..7a50aebc3 100644 --- a/xorg-server/hw/dmx/dmxinit.c +++ b/xorg-server/hw/dmx/dmxinit.c @@ -68,10 +68,13 @@ #include <GL/glx.h> #include <GL/glxint.h> #include "dmx_glxvisuals.h" +#include "glx_extinit.h" #include <X11/extensions/Xext.h> #include <X11/extensions/extutil.h> #endif /* GLXEXT */ +#include <X11/extensions/dmxproto.h> + /* Global variables available to all Xserver/hw/dmx routines. */ int dmxNumScreens; DMXScreenInfo *dmxScreens; @@ -586,6 +589,20 @@ dmxExecHost(void) return buffer; } +static void dmxAddExtensions(Bool glxSupported) +{ + const ExtensionModule dmxExtensions[] = { + { DMXExtensionInit, DMX_EXTENSION_NAME, NULL }, +#ifdef GLXEXT + { GlxExtensionInit, "GLX", &glxSupported }, +#endif + }; + int i; + + for (i = 0; i < ARRAY_SIZE(dmxExtensions); i++) + LoadExtension(&dmxExtensions[i], TRUE); +} + /** This routine is called in Xserver/dix/main.c from \a main(). */ void InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) @@ -594,7 +611,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) static unsigned long dmxGeneration = 0; #ifdef GLXEXT - Bool glxSupported = TRUE; + static Bool glxSupported = TRUE; #endif if (dmxGeneration != serverGeneration) { @@ -725,6 +742,9 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) glxSupported &= (dmxScreens[i].glxMajorOpcode > 0); #endif + if (serverGeneration == 1) + dmxAddExtensions(glxSupported); + /* Tell dix layer about the backend displays */ for (i = 0; i < dmxNumScreens; i++) { diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c index 02729d6f6..157ac36b2 100644 --- a/xorg-server/hw/kdrive/ephyr/hostx.c +++ b/xorg-server/hw/kdrive/ephyr/hostx.c @@ -881,7 +881,9 @@ host_screen_from_window(Window w) struct EphyrHostScreen *result = NULL; for (index = 0; index < HostX.n_screens; index++) { - if (HostX.screens[index].win == w || HostX.screens[index].peer_win == w) { + if (HostX.screens[index].win == w + || HostX.screens[index].peer_win == w + || HostX.screens[index].win_pre_existing == w) { result = &HostX.screens[index]; goto out; } diff --git a/xorg-server/hw/vfb/InitOutput.c b/xorg-server/hw/vfb/InitOutput.c index 07ea8ea93..97eccfd4e 100644 --- a/xorg-server/hw/vfb/InitOutput.c +++ b/xorg-server/hw/vfb/InitOutput.c @@ -65,6 +65,7 @@ from The Open Group. #endif /* HAS_SHM */ #include "dix.h" #include "miline.h" +#include "glx_extinit.h" #define VFB_DEFAULT_WIDTH 1280 #define VFB_DEFAULT_HEIGHT 1024 @@ -884,12 +885,30 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) } /* end vfbScreenInit */ +static const ExtensionModule vfbExtensions[] = { +#ifdef GLXEXT + { GlxExtensionInit, "GLX", &noGlxExtension }, +#endif +}; + +static +void vfbExtensionInit(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vfbExtensions); i++) + LoadExtension(&vfbExtensions[i], TRUE); +} + void InitOutput(ScreenInfo * screenInfo, int argc, char **argv) { int i; int NumFormats = 0; + if (serverGeneration == 1) + vfbExtensionInit(); + /* initialize pixmap formats */ /* must have a pixmap depth to match every screen depth */ diff --git a/xorg-server/hw/xfree86/common/xf86Extensions.c b/xorg-server/hw/xfree86/common/xf86Extensions.c index d5309d558..f9e791607 100644 --- a/xorg-server/hw/xfree86/common/xf86Extensions.c +++ b/xorg-server/hw/xfree86/common/xf86Extensions.c @@ -53,7 +53,7 @@ /* * DDX-specific extensions. */ -static ExtensionModule extensionModules[] = { +static const ExtensionModule extensionModules[] = { #ifdef XF86VIDMODE { XFree86VidModeExtensionInit, diff --git a/xorg-server/hw/xfree86/common/xf86platformBus.c b/xorg-server/hw/xfree86/common/xf86platformBus.c index 0525e39bc..599d84ac2 100644 --- a/xorg-server/hw/xfree86/common/xf86platformBus.c +++ b/xorg-server/hw/xfree86/common/xf86platformBus.c @@ -377,6 +377,14 @@ xf86platformProbeDev(DriverPtr drvp) continue; } + /* + * If all of the above fails, which can happen if X was started without + * configuration or if BusID wasn't set for non-PCI devices, use the first + * device by default. + */ + if (!foundScreen && xf86_num_platform_devices > 0 && numDevs > 0) + foundScreen = probeSingleDevice(&xf86_platform_devices[0], drvp, devList[0], 0); + /* if autoaddgpu devices is enabled then go find a few more and add them as GPU screens */ if (xf86Info.autoAddGPU && numDevs) { for (j = 0; j < xf86_num_platform_devices; j++) { diff --git a/xorg-server/hw/xfree86/dixmods/glxmodule.c b/xorg-server/hw/xfree86/dixmods/glxmodule.c index c0c611401..e6bb73673 100644 --- a/xorg-server/hw/xfree86/dixmods/glxmodule.c +++ b/xorg-server/hw/xfree86/dixmods/glxmodule.c @@ -47,7 +47,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static MODULESETUPPROTO(glxSetup); -static ExtensionModule GLXExt = { +static const ExtensionModule GLXExt = { GlxExtensionInit, "GLX", &noGlxExtension diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c index 177f7ac11..13251cff4 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.c +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c @@ -1847,6 +1847,10 @@ SetCompatOutput(xf86CrtcConfigPtr config) output = config->output[config->compat_output]; } + /* All outputs are disconnected, select one to fake */ + if (!output && config->num_output) + output = config->output[0]; + return output; } diff --git a/xorg-server/hw/xquartz/quartz.c b/xorg-server/hw/xquartz/quartz.c index 31b0e619a..5b977c7f9 100644 --- a/xorg-server/hw/xquartz/quartz.c +++ b/xorg-server/hw/xquartz/quartz.c @@ -145,7 +145,7 @@ QuartzSetupScreen(int index, return TRUE; } -static ExtensionModule quartzExtensions[] = { +static const ExtensionModule quartzExtensions[] = { /* PseudoramiX needs to be done before RandR, so * it is in miinitext.c until it can be reordered. * { PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension }, diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c index 4bcd3a006..78ff74fc5 100644 --- a/xorg-server/hw/xwin/InitOutput.c +++ b/xorg-server/hw/xwin/InitOutput.c @@ -204,6 +204,9 @@ ddxGiveUp(enum ExitCode error) } #ifdef XWIN_MULTIWINDOW + /* Unload libraries for taskbar grouping */ + winPropertyStoreDestroy(); + /* Notify the worker threads we're exiting */ winDeinitMultiWindowWM(); #endif @@ -804,7 +807,7 @@ winUseMsg(void) ErrorF("-resize=none|scrollbars|randr" "\tIn windowed mode, [don't] allow resizing of the window. 'scrollbars'\n" "\tmode gives the window scrollbars as needed, 'randr' mode uses the RANR\n" - "\textension to resize the X screen.\n"); + "\textension to resize the X screen. 'randr' is the default.\n"); ErrorF("-rootless\n" "\tRun the server in rootless mode.\n"); @@ -837,7 +840,7 @@ winUseMsg(void) #ifdef XWIN_GLX_WINDOWS ErrorF("-[no]wgl\n" - "\tEnable the GLX extension to use the native Windows WGL interface for accelerated OpenGL\n"); + "\tEnable the GLX extension to use the native Windows WGL interface for hardware-accelerated OpenGL\n"); #endif ErrorF("-[no]winkill\n" "\tAlt+F4 exits the X Server.\n"); @@ -951,6 +954,10 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) /* Detect supported engines */ winDetectSupportedEngines(); +#ifdef XWIN_MULTIWINDOW + /* Load libraries for taskbar grouping */ + winPropertyStoreInit(); +#endif /* Store the instance handle */ g_hInstance = GetModuleHandle(NULL); diff --git a/xorg-server/hw/xwin/Makefile.am b/xorg-server/hw/xwin/Makefile.am index 3fcaf9d0b..93ce57038 100644 --- a/xorg-server/hw/xwin/Makefile.am +++ b/xorg-server/hw/xwin/Makefile.am @@ -23,8 +23,11 @@ SRCS_MULTIWINDOW = \ winmultiwindowshape.c \ winmultiwindowwindow.c \ winmultiwindowwm.c \ - winmultiwindowwndproc.c + winmultiwindowwndproc.c \ + propertystore.h \ + winSetAppUserModelID.c DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW +MULTIWINDOW_LIBS = -lshlwapi -lole32 endif if XWIN_MULTIWINDOWEXTWM @@ -99,6 +102,7 @@ SRCS = InitInput.c \ winshaddd.c \ winshadddnl.c \ winshadgdi.c \ + wintaskbar.c \ wintrayicon.c \ winvalargs.c \ winwakeup.c \ @@ -150,7 +154,7 @@ INCLUDES = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) -XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) +XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) XWin_LDFLAGS = -mwindows -static .rc.o: diff --git a/xorg-server/hw/xwin/ddraw.h b/xorg-server/hw/xwin/ddraw.h index 9463049c8..1871d9551 100644 --- a/xorg-server/hw/xwin/ddraw.h +++ b/xorg-server/hw/xwin/ddraw.h @@ -1,3 +1,7 @@ +#ifdef __MINGW64_VERSION_MAJOR +#include_next <ddraw.h> +#define __XWIN_DDRAW_H +#endif #ifndef __XWIN_DDRAW_H #define __XWIN_DDRAW_H diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c index c0069a20f..22c5abc14 100644 --- a/xorg-server/hw/xwin/glx/indirect.c +++ b/xorg-server/hw/xwin/glx/indirect.c @@ -86,6 +86,7 @@ #include <winpriv.h> #include <wgl_ext_api.h> +#include <winglobals.h> #define NUM_ELEMENTS(x) (sizeof(x)/ sizeof(x[1])) @@ -341,6 +342,10 @@ swap_method_name(int mthd) static void fbConfigsDump(unsigned int n, __GLXconfig * c) { + LogMessage(X_INFO, "%d fbConfigs\n", n); + + if (g_iLogVerbose < 3) + return; ErrorF("%d fbConfigs\n", n); ErrorF ("pxf vis fb render Ste aux accum MS drawable Group/\n"); @@ -595,11 +600,14 @@ glxWinScreenProbe(ScreenPtr pScreen) gl_renderer = (const char *) glGetStringWrapperNonstatic(GL_RENDERER); ErrorF("GL_RENDERER: %s\n", gl_renderer); gl_extensions = (const char *) glGetStringWrapperNonstatic(GL_EXTENSIONS); - glxLogExtensions("GL_EXTENSIONS: ", gl_extensions); wgl_extensions = wglGetExtensionsStringARBWrapper(hdc); if (!wgl_extensions) wgl_extensions = ""; - glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions); + + if (g_iLogVerbose >= 3) { + glxLogExtensions("GL_EXTENSIONS: ", gl_extensions); + glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions); + } if (strcasecmp(gl_renderer, "GDI Generic") == 0) { free(screen); @@ -1835,8 +1843,8 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen) // get the number of pixelformats numConfigs = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL); - GLWIN_DEBUG_MSG("DescribePixelFormat says %d possible pixel formats", - numConfigs); + LogMessage(X_INFO, "%d pixel formats reported by DescribePixelFormat\n", + numConfigs); /* alloc */ result = malloc(sizeof(GLXWinConfig) * numConfigs); @@ -2083,9 +2091,9 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen) return; } - GLWIN_DEBUG_MSG - ("wglGetPixelFormatAttribivARB says %d possible pixel formats", - numConfigs); + LogMessage(X_INFO, + "%d pixel formats reported by wglGetPixelFormatAttribivARB\n", + numConfigs); /* alloc */ result = malloc(sizeof(GLXWinConfig) * numConfigs); diff --git a/xorg-server/hw/xwin/man/XWin.man b/xorg-server/hw/xwin/man/XWin.man index dbadad6f5..18ee667d4 100644 --- a/xorg-server/hw/xwin/man/XWin.man +++ b/xorg-server/hw/xwin/man/XWin.man @@ -121,14 +121,16 @@ Alternative name for \fB\-resize=scrollbars\fP. .SH OPTIONS CONTROLLING RESIZE BEHAVIOUR .TP 8 .B \-resize[=none|scrollbars|randr] -Select the resize mode of an X screen. +Select the resize mode of an X screen. The default is randr. .RS .IP \fB\-resize=none\fP 8 -(default). The screen is not resizable. +The screen is not resizable. In windowed mode, if the window has decorations, a fixed frame is used. +Alternative name is \fB\-noresize\fP. + .IP \fB\-resize=scrollbars\fP 8 The screen window is resizeable, but the screen is not resizable. @@ -159,8 +161,8 @@ of the X screen using the RANDR extension is not permitted. The maximum dimensions of the screen are the dimensions of the \fIWindows\fP virtual desktop. -.IP \fB\--resize\fP 8 -on its own is equivalent to \fB\--resize=randr\fP +.IP \fB\-resize\fP 8 +on its own is equivalent to \fB\-resize=randr\fP .RE .SH OPTIONS CONTROLLING WINDOWS INTEGRATION @@ -211,7 +213,7 @@ is disabled by default. .TP 8 .B \-[no]wgl Enable [disable] the GLX extension to use the native Windows WGL interface -for hardware accelerated OpenGL (AIGLX). (Experimental) +for hardware accelerated OpenGL (AIGLX). The default is enabled. .TP 8 .B \-[no]winkill Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the diff --git a/xorg-server/hw/xwin/propertystore.h b/xorg-server/hw/xwin/propertystore.h new file mode 100644 index 000000000..6afc6c954 --- /dev/null +++ b/xorg-server/hw/xwin/propertystore.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2011 Tobias Häußler + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef PROPERTYSTORE_H +#define PROPERTYSTORE_H + +#include <windows.h> + +#ifdef __MINGW64_VERSION_MAJOR +/* If we are using headers from mingw-w64 project, it provides the PSDK headers this needs ... */ +#include <propkey.h> +#include <propsys.h> +#else /* !__MINGW64_VERSION_MAJOR */ +/* ... otherwise, we need to define all this stuff ourselves */ + +typedef struct _tagpropertykey { + GUID fmtid; + DWORD pid; +} PROPERTYKEY; + +#define REFPROPERTYKEY const PROPERTYKEY * +#define REFPROPVARIANT const PROPVARIANT * + +WINOLEAPI PropVariantClear(PROPVARIANT *pvar); + +#ifdef INTERFACE +#undef INTERFACE +#endif + +#define INTERFACE IPropertyStore +DECLARE_INTERFACE_(IPropertyStore, IUnknown) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID, PVOID *) PURE; + STDMETHOD_(ULONG, AddRef) (THIS) PURE; + STDMETHOD_(ULONG, Release) (THIS) PURE; + STDMETHOD(GetCount) (THIS_ DWORD) PURE; + STDMETHOD(GetAt) (THIS_ DWORD, PROPERTYKEY) PURE; + STDMETHOD(GetValue) (THIS_ REFPROPERTYKEY, PROPVARIANT) PURE; + STDMETHOD(SetValue) (THIS_ REFPROPERTYKEY, REFPROPVARIANT) PURE; + STDMETHOD(Commit) (THIS) PURE; +}; + +#undef INTERFACE +typedef IPropertyStore *LPPROPERTYSTORE; + +DEFINE_GUID(IID_IPropertyStore, 0x886d8eeb, 0x8cf2, 0x4446, 0x8d, 0x02, 0xcd, + 0xba, 0x1d, 0xbd, 0xcf, 0x99); + +#ifdef INITGUID +#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) GUID_EXT const PROPERTYKEY DECLSPEC_SELECTANY name = { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid } +#else +#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) GUID_EXT const PROPERTYKEY name +#endif + +DEFINE_PROPERTYKEY(PKEY_AppUserModel_ID, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, + 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 5); + +#endif /* !__MINGW64_VERSION_MAJOR */ + +typedef HRESULT(__stdcall * SHGETPROPERTYSTOREFORWINDOWPROC) (HWND, REFIID, + void **); + +#endif diff --git a/xorg-server/hw/xwin/win.h b/xorg-server/hw/xwin/win.h index 7b34e84d9..fa774bc00 100644 --- a/xorg-server/hw/xwin/win.h +++ b/xorg-server/hw/xwin/win.h @@ -133,6 +133,8 @@ #define WIN_MAX_KEYS_PER_KEY 4 +#define NONAMELESSUNION + #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> @@ -248,9 +250,6 @@ if (++PROFPT##point % thresh == 0)\ ErrorF (#point ": PROFILEPOINT hit %u times\n", PROFPT##point);\ } -/* We use xor this macro for detecting toggle key state changes */ -#define WIN_XOR(a,b) ((!(a) && (b)) || ((a) && !(b))) - #define DEFINE_ATOM_HELPER(func,atom_name) \ static Atom func (void) { \ static int generation; \ diff --git a/xorg-server/hw/xwin/winSetAppUserModelID.c b/xorg-server/hw/xwin/winSetAppUserModelID.c new file mode 100644 index 000000000..ce9da5e7d --- /dev/null +++ b/xorg-server/hw/xwin/winSetAppUserModelID.c @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2011 Tobias Häußler + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include <xwin-config.h> +#endif + +#include <X11/Xlib.h> +#include <X11/Xproto.h> +#include <X11/Xwindows.h> +#include "winwindow.h" +#include "os.h" +#include "winmsg.h" + +#include <shlwapi.h> + +#define INITGUID +#include "initguid.h" +#include "propertystore.h" +#undef INITGUID + +static HMODULE g_hmodShell32Dll = NULL; +static SHGETPROPERTYSTOREFORWINDOWPROC g_pSHGetPropertyStoreForWindow = NULL; + +void +winPropertyStoreInit(void) +{ + /* + Load library and get function pointer to SHGetPropertyStoreForWindow() + + SHGetPropertyStoreForWindow is only supported since Windows 7. On previous + versions the pointer will be NULL and taskbar grouping is not supported. + winSetAppUserModelID() will do nothing in this case. + */ + g_hmodShell32Dll = LoadLibrary("shell32.dll"); + if (g_hmodShell32Dll == NULL) { + ErrorF("winPropertyStoreInit - Could not load shell32.dll\n"); + return; + } + + g_pSHGetPropertyStoreForWindow = + (SHGETPROPERTYSTOREFORWINDOWPROC) GetProcAddress(g_hmodShell32Dll, + "SHGetPropertyStoreForWindow"); + if (g_pSHGetPropertyStoreForWindow == NULL) { + ErrorF + ("winPropertyStoreInit - Could not get SHGetPropertyStoreForWindow address\n"); + return; + } +} + +void +winPropertyStoreDestroy(void) +{ + if (g_hmodShell32Dll != NULL) { + FreeLibrary(g_hmodShell32Dll); + g_hmodShell32Dll = NULL; + g_pSHGetPropertyStoreForWindow = NULL; + } +} + +void +winSetAppUserModelID(HWND hWnd, const char *AppID) +{ + PROPVARIANT pv; + IPropertyStore *pps = NULL; + HRESULT hr; + + if (g_pSHGetPropertyStoreForWindow == NULL) { + return; + } + + winDebug("winSetAppUserMOdelID - hwnd 0x%08x appid '%s'\n", hWnd, AppID); + + hr = g_pSHGetPropertyStoreForWindow(hWnd, &IID_IPropertyStore, + (void **) &pps); + if (SUCCEEDED(hr) && pps) { + memset(&pv, 0, sizeof(PROPVARIANT)); + if (AppID) { + pv.vt = VT_LPWSTR; + hr = SHStrDupA(AppID, &pv.pwszVal); + } + + if (SUCCEEDED(hr)) { + pps->lpVtbl->SetValue(pps, &PKEY_AppUserModel_ID, &pv); + PropVariantClear(&pv); + } + pps->lpVtbl->Release(pps); + } +} diff --git a/xorg-server/hw/xwin/winblock.c b/xorg-server/hw/xwin/winblock.c index 480e3bd48..a4ae8669f 100644 --- a/xorg-server/hw/xwin/winblock.c +++ b/xorg-server/hw/xwin/winblock.c @@ -86,4 +86,13 @@ winBlockHandler(ScreenPtr pScreen, DispatchMessage(&msg); } } + + /* + At least one X client has asked to suspend the screensaver, so + reset Windows' display idle timer + */ +#ifdef SCREENSAVER + if (screenSaverSuspended) + SetThreadExecutionState(ES_DISPLAY_REQUIRED); +#endif } diff --git a/xorg-server/hw/xwin/winclipboardthread.c b/xorg-server/hw/xwin/winclipboardthread.c index 891278279..c8508a9b8 100644 --- a/xorg-server/hw/xwin/winclipboardthread.c +++ b/xorg-server/hw/xwin/winclipboardthread.c @@ -36,6 +36,7 @@ #define HAS_WINSOCK 1 #endif #include <sys/types.h> +#include <signal.h> #include "winclipboard.h" #ifdef __CYGWIN__ #include <errno.h> @@ -431,7 +432,7 @@ winClipboardProc(void *pvNotUsed) else { ErrorF("winClipboardProc - Clipboard disabled - Exit from server \n"); /* clipboard thread has exited, stop server as well */ - kill(getpid(), SIGTERM); + raise(SIGTERM); } return NULL; diff --git a/xorg-server/hw/xwin/winclipboardxevents.c b/xorg-server/hw/xwin/winclipboardxevents.c index ce533c59f..5cae98caa 100644 --- a/xorg-server/hw/xwin/winclipboardxevents.c +++ b/xorg-server/hw/xwin/winclipboardxevents.c @@ -165,6 +165,24 @@ winClipboardFlushXEvents(HWND hwnd, break; } + /* Close clipboard if we have it open already */ + if (GetOpenClipboardWindow() == hwnd) { + CloseClipboard(); + } + + /* Access the clipboard */ + if (!OpenClipboard(hwnd)) { + ErrorF("winClipboardFlushXEvents - SelectionRequest - " + "OpenClipboard () failed: %08lx\n", GetLastError()); + + /* Abort */ + fAbort = TRUE; + goto winClipboardFlushXEvents_SelectionRequest_Done; + } + + /* Indicate that clipboard was opened */ + fCloseClipboard = TRUE; + /* Check that clipboard format is available */ if (fUseUnicode && !IsClipboardFormatAvailable(CF_UNICODETEXT)) { static int count; /* Hack to stop acroread spamming the log */ @@ -192,24 +210,6 @@ winClipboardFlushXEvents(HWND hwnd, goto winClipboardFlushXEvents_SelectionRequest_Done; } - /* Close clipboard if we have it open already */ - if (GetOpenClipboardWindow() == hwnd) { - CloseClipboard(); - } - - /* Access the clipboard */ - if (!OpenClipboard(hwnd)) { - ErrorF("winClipboardFlushXEvents - SelectionRequest - " - "OpenClipboard () failed: %08lx\n", GetLastError()); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionRequest_Done; - } - - /* Indicate that clipboard was opened */ - fCloseClipboard = TRUE; - /* Setup the string style */ if (event.xselectionrequest.target == XA_STRING) xiccesStyle = XStringStyle; diff --git a/xorg-server/hw/xwin/winengine.c b/xorg-server/hw/xwin/winengine.c index 67489598b..b2007d751 100644 --- a/xorg-server/hw/xwin/winengine.c +++ b/xorg-server/hw/xwin/winengine.c @@ -92,7 +92,7 @@ winDetectSupportedEngines(void) else { /* We have DirectDraw */ winErrorFVerb(2, - "winDetectSupportedEngines - DirectDraw installed\n"); + "winDetectSupportedEngines - DirectDraw installed, allowing ShadowDD\n"); g_dwEnginesSupported |= WIN_SERVER_SHADOW_DD; #ifdef XWIN_PRIMARYFB @@ -100,7 +100,7 @@ winDetectSupportedEngines(void) if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { g_dwEnginesSupported |= WIN_SERVER_PRIMARY_DD; winErrorFVerb(2, - "winDetectSupportedEngines - Allowing PrimaryDD\n"); + "winDetectSupportedEngines - Windows NT, allowing PrimaryDD\n"); } #endif } @@ -112,7 +112,7 @@ winDetectSupportedEngines(void) if (SUCCEEDED(ddrval)) { /* We have DirectDraw4 */ winErrorFVerb(2, - "winDetectSupportedEngines - DirectDraw4 installed\n"); + "winDetectSupportedEngines - DirectDraw4 installed, allowing ShadowDDNL\n"); g_dwEnginesSupported |= WIN_SERVER_SHADOW_DDNL; } diff --git a/xorg-server/hw/xwin/winerror.c b/xorg-server/hw/xwin/winerror.c index 6645469fc..1318b0f36 100644 --- a/xorg-server/hw/xwin/winerror.c +++ b/xorg-server/hw/xwin/winerror.c @@ -59,15 +59,16 @@ OsVendorVErrorF(const char *pszFormat, va_list va_args) #endif /* - * os/util.c/FatalError () calls our vendor ErrorF, so the message - * from a FatalError will be logged. Thus, the message for the - * fatal error is not passed to this function. + * os/log.c:FatalError () calls our vendor ErrorF, so the message + * from a FatalError will be logged. * * Attempt to do last-ditch, safe, important cleanup here. */ void OsVendorFatalError(const char *f, va_list args) { + char errormsg[1024] = ""; + /* Don't give duplicate warning if UseMsg was called */ if (g_fSilentFatalError) return; @@ -78,9 +79,28 @@ OsVendorFatalError(const char *f, va_list args) } LogClose(EXIT_ERR_ABORT); - winMessageBoxF("A fatal error has occurred and " PROJECT_NAME - " will now exit.\n" "Please open %s for more information.\n", - MB_ICONERROR, (g_pszLogFile ? g_pszLogFile : "the logfile")); + /* Format the error message */ + vsnprintf(errormsg, sizeof(errormsg), f, args); + + /* + Sometimes the error message needs a bit of cosmetic cleaning + up for use in a dialog box... + */ + { + char *s; + + while ((s = strstr(errormsg, "\n\t")) != NULL) { + s[0] = ' '; + s[1] = '\n'; + } + } + + winMessageBoxF("A fatal error has occurred and " PROJECT_NAME " will now exit.\n\n" + "%s\n\n" + "Please open %s for more information.\n", + MB_ICONERROR, + errormsg, + (g_pszLogFile ? g_pszLogFile : "the logfile")); } /* diff --git a/xorg-server/hw/xwin/winglobals.c b/xorg-server/hw/xwin/winglobals.c index 4953bd0cf..b34d1a751 100644 --- a/xorg-server/hw/xwin/winglobals.c +++ b/xorg-server/hw/xwin/winglobals.c @@ -77,7 +77,7 @@ Bool g_fKeyboardHookLL = FALSE; Bool g_fNoHelpMessageBox = FALSE; Bool g_fSoftwareCursor = FALSE; Bool g_fSilentDupError = FALSE; -Bool g_fNativeGl = FALSE; +Bool g_fNativeGl = TRUE; #ifdef XWIN_CLIPBOARD /* diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c index 2ffb9a943..a70cdcd16 100644 --- a/xorg-server/hw/xwin/winkeybd.c +++ b/xorg-server/hw/xwin/winkeybd.c @@ -41,6 +41,9 @@ #include "xkbsrv.h" +/* C does not have a logical XOR operator, so we use a macro instead */ +#define LOGICAL_XOR(a,b) ((!(a) && (b)) || ((a) && !(b))) + static Bool g_winKeyState[NUM_KEYCODES]; /* @@ -259,36 +262,54 @@ winRestoreModeKeyStates(void) XkbStateFieldFromRec(&inputInfo.keyboard->key->xkbInfo->state); winDebug("winRestoreModeKeyStates: state %d\n", internalKeyStates); - /* - * NOTE: The C XOR operator, ^, will not work here because it is - * a bitwise operator, not a logical operator. C does not - * have a logical XOR operator, so we use a macro instead. - */ + /* Check if modifier keys are pressed, and if so, fake a press */ + { + BOOL ctrl = (GetAsyncKeyState(VK_CONTROL) < 0); + BOOL shift = (GetAsyncKeyState(VK_SHIFT) < 0); + BOOL alt = (GetAsyncKeyState(VK_LMENU) < 0); + BOOL altgr = (GetAsyncKeyState(VK_RMENU) < 0); + + if (ctrl && altgr) + ctrl = FALSE; + + if (LOGICAL_XOR(internalKeyStates & ControlMask, ctrl)) + winSendKeyEvent(KEY_LCtrl, ctrl); + + if (LOGICAL_XOR(internalKeyStates & ShiftMask, shift)) + winSendKeyEvent(KEY_ShiftL, shift); - /* Has the key state changed? */ + if (LOGICAL_XOR(internalKeyStates & Mod1Mask, alt)) + winSendKeyEvent(KEY_Alt, alt); + + if (LOGICAL_XOR(internalKeyStates & Mod5Mask, altgr)) + winSendKeyEvent(KEY_AltLang, altgr); + } + + /* + Check if latching modifier key states have changed, and if so, + fake a press and a release to toggle the modifier to the correct + state + */ dwKeyState = GetKeyState(VK_NUMLOCK) & 0x0001; - if (WIN_XOR(internalKeyStates & NumLockMask, dwKeyState)) { + if (LOGICAL_XOR(internalKeyStates & NumLockMask, dwKeyState)) { winSendKeyEvent(KEY_NumLock, TRUE); winSendKeyEvent(KEY_NumLock, FALSE); } - /* Has the key state changed? */ dwKeyState = GetKeyState(VK_CAPITAL) & 0x0001; - if (WIN_XOR(internalKeyStates & LockMask, dwKeyState)) { + if (LOGICAL_XOR(internalKeyStates & LockMask, dwKeyState)) { winSendKeyEvent(KEY_CapsLock, TRUE); winSendKeyEvent(KEY_CapsLock, FALSE); } - /* Has the key state changed? */ dwKeyState = GetKeyState(VK_SCROLL) & 0x0001; - if (WIN_XOR(internalKeyStates & ScrollLockMask, dwKeyState)) { + if (LOGICAL_XOR(internalKeyStates & ScrollLockMask, dwKeyState)) { winSendKeyEvent(KEY_ScrollLock, TRUE); winSendKeyEvent(KEY_ScrollLock, FALSE); } - /* Has the key state changed? */ dwKeyState = GetKeyState(VK_KANA) & 0x0001; - if (WIN_XOR(internalKeyStates & KanaMask, dwKeyState)) { + if (LOGICAL_XOR(internalKeyStates & KanaMask, dwKeyState)) { winSendKeyEvent(KEY_HKTG, TRUE); winSendKeyEvent(KEY_HKTG, FALSE); } diff --git a/xorg-server/hw/xwin/winms.h b/xorg-server/hw/xwin/winms.h index 5282fc982..32923e503 100644 --- a/xorg-server/hw/xwin/winms.h +++ b/xorg-server/hw/xwin/winms.h @@ -30,7 +30,6 @@ * Authors: Harold L Hunt II */ -#define NONAMELESSUNION #define DIRECTDRAW_VERSION 0x0300 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c index 42925e36d..773fc9767 100644 --- a/xorg-server/hw/xwin/winmultiwindowwm.c +++ b/xorg-server/hw/xwin/winmultiwindowwm.c @@ -1503,6 +1503,7 @@ winDeinitMultiWindowWM(void) #define HINT_NOMAXIMIZE (1L<<4) #define HINT_NOMINIMIZE (1L<<5) #define HINT_NOSYSMENU (1L<<6) +#define HINT_SKIPTASKBAR (1L<<7) /* These two are used on their own */ #define HINT_MAX (1L<<0) #define HINT_MIN (1L<<1) @@ -1511,12 +1512,14 @@ static void winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) { static Atom windowState, motif_wm_hints, windowType; - static Atom hiddenState, fullscreenState, belowState, aboveState; + static Atom hiddenState, fullscreenState, belowState, aboveState, + skiptaskbarState; static Atom dockWindow; static int generation; Atom type, *pAtom = NULL; int format; - unsigned long hint = 0, maxmin = 0, style, nitems = 0, left = 0; + unsigned long hint = 0, maxmin = 0, nitems = 0, left = 0; + unsigned long style, exStyle; MwmHints *mwm_hint = NULL; if (!hWnd) @@ -1535,6 +1538,8 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) belowState = XInternAtom(pDisplay, "_NET_WM_STATE_BELOW", False); aboveState = XInternAtom(pDisplay, "_NET_WM_STATE_ABOVE", False); dockWindow = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_DOCK", False); + skiptaskbarState = + XInternAtom(pDisplay, "_NET_WM_STATE_SKIP_TASKBAR", False); } if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L, @@ -1542,6 +1547,8 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) &nitems, &left, (unsigned char **) &pAtom) == Success) { if (pAtom && nitems == 1) { + if (*pAtom == skiptaskbarState) + hint |= HINT_SKIPTASKBAR; if (*pAtom == hiddenState) maxmin |= HINT_MIN; else if (*pAtom == fullscreenState) @@ -1630,10 +1637,14 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) XFree(normal_hint); } - /* Override hint settings from above with settings from config file */ + /* + Override hint settings from above with settings from config file and set + application id for grouping. + */ { XClassHint class_hint = { 0, 0 }; char *window_name = 0; + char *application_id = 0; if (XGetClassHint(pDisplay, iWindow, &class_hint)) { XFetchName(pDisplay, iWindow, &window_name); @@ -1642,10 +1653,24 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) winOverrideStyle(class_hint.res_name, class_hint.res_class, window_name); +#define APPLICATION_ID_FORMAT "%s.xwin.%s" +#define APPLICATION_ID_UNKNOWN "unknown" + if (class_hint.res_class) { + asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, + class_hint.res_class); + } + else { + asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, + APPLICATION_ID_UNKNOWN); + } + winSetAppUserModelID(hWnd, application_id); + if (class_hint.res_name) XFree(class_hint.res_name); if (class_hint.res_class) XFree(class_hint.res_class); + if (application_id) + free(application_id); if (window_name) XFree(window_name); } @@ -1682,13 +1707,15 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) HINT_NOFRAME; /* Now apply styles to window */ - style = GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */ + style = GetWindowLongPtr(hWnd, GWL_STYLE); if (!style) - return; + return; /* GetWindowLongPointer returns 0 on failure, we hope this isn't a valid style */ + + style &= ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */ - if (!hint) /* All on */ + if (!(hint & ~HINT_SKIPTASKBAR)) /* No hints, default */ style = style | WS_CAPTION | WS_SIZEBOX; - else if (hint & HINT_NOFRAME) /* All off */ + else if (hint & HINT_NOFRAME) /* No frame, no decorations */ style = style & ~WS_CAPTION & ~WS_SIZEBOX; else style = style | ((hint & HINT_BORDER) ? WS_BORDER : 0) | @@ -1704,7 +1731,21 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) if (hint & HINT_NOSYSMENU) style = style & ~WS_SYSMENU; + if (hint & HINT_SKIPTASKBAR) + style = style & ~WS_MINIMIZEBOX; /* window will become lost if minimized */ + SetWindowLongPtr(hWnd, GWL_STYLE, style); + + exStyle = GetWindowLongPtr(hWnd, GWL_EXSTYLE); + if (hint & HINT_SKIPTASKBAR) + exStyle = (exStyle & ~WS_EX_APPWINDOW) | WS_EX_TOOLWINDOW; + else + exStyle = (exStyle & ~WS_EX_TOOLWINDOW) | WS_EX_APPWINDOW; + SetWindowLongPtr(hWnd, GWL_EXSTYLE, exStyle); + + winDebug + ("winApplyHints: iWindow 0x%08x hints 0x%08x style 0x%08x exstyle 0x%08x\n", + iWindow, hint, style, exStyle); } void diff --git a/xorg-server/hw/xwin/winmultiwindowwndproc.c b/xorg-server/hw/xwin/winmultiwindowwndproc.c index af917d6fc..4180a3aa3 100644 --- a/xorg-server/hw/xwin/winmultiwindowwndproc.c +++ b/xorg-server/hw/xwin/winmultiwindowwndproc.c @@ -825,6 +825,8 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_CLOSE: + /* Removep AppUserModelID property */ + winSetAppUserModelID(hwnd, NULL); /* Branch on if the window was killed in X already */ if (pWinPriv->fXKilled) { /* Window was killed, go ahead and destroy the window */ diff --git a/xorg-server/hw/xwin/winprocarg.c b/xorg-server/hw/xwin/winprocarg.c index 14056faf0..858be4a56 100644 --- a/xorg-server/hw/xwin/winprocarg.c +++ b/xorg-server/hw/xwin/winprocarg.c @@ -142,7 +142,7 @@ winInitializeScreenDefaults(void) #endif defaultScreenInfo.fMultipleMonitors = FALSE; defaultScreenInfo.fLessPointer = FALSE; - defaultScreenInfo.iResizeMode = notAllowed; + defaultScreenInfo.iResizeMode = resizeWithRandr; defaultScreenInfo.fNoTrayIcon = FALSE; defaultScreenInfo.iE3BTimeout = WIN_E3B_DEFAULT; defaultScreenInfo.fUseWinKillKey = WIN_DEFAULT_WIN_KILL; @@ -1161,6 +1161,8 @@ winLogVersionInfo(void) ErrorF("Vendor: %s\n", XVENDORNAME); ErrorF("Release: %d.%d.%d.%d\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP); - ErrorF("%s\n\n", BUILDERSTRING); + if (strlen(BUILDERSTRING)) + ErrorF("%s\n", BUILDERSTRING); ErrorF("Contact: %s\n", BUILDERADDR); + ErrorF("\n"); } diff --git a/xorg-server/hw/xwin/winshaddd.c b/xorg-server/hw/xwin/winshaddd.c index 3afc57cd0..aad3a02a0 100644 --- a/xorg-server/hw/xwin/winshaddd.c +++ b/xorg-server/hw/xwin/winshaddd.c @@ -489,7 +489,7 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf) POINT ptOrigin; DWORD dwBox = RegionNumRects(damage); BoxPtr pBox = RegionRects(damage); - HRGN hrgnTemp = NULL, hrgnCombined = NULL; + HRGN hrgnCombined = NULL; /* * Return immediately if the app is not active @@ -551,15 +551,9 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf) BoxPtr pBoxExtents = RegionExtents(damage); /* Compute a GDI region from the damaged region */ - hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - dwBox--; - pBox++; - while (dwBox--) { - hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR); - DeleteObject(hrgnTemp); - pBox++; - } + hrgnCombined = + CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2, + pBoxExtents->y2); /* Install the GDI region as a clipping region */ SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined); diff --git a/xorg-server/hw/xwin/winshadddnl.c b/xorg-server/hw/xwin/winshadddnl.c index e7306151e..7668bd1c0 100644 --- a/xorg-server/hw/xwin/winshadddnl.c +++ b/xorg-server/hw/xwin/winshadddnl.c @@ -523,7 +523,7 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf) POINT ptOrigin; DWORD dwBox = RegionNumRects(damage); BoxPtr pBox = RegionRects(damage); - HRGN hrgnTemp = NULL, hrgnCombined = NULL; + HRGN hrgnCombined = NULL; /* * Return immediately if the app is not active @@ -595,15 +595,9 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf) BoxPtr pBoxExtents = RegionExtents(damage); /* Compute a GDI region from the damaged region */ - hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - dwBox--; - pBox++; - while (dwBox--) { - hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR); - DeleteObject(hrgnTemp); - pBox++; - } + hrgnCombined = + CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2, + pBoxExtents->y2); /* Install the GDI region as a clipping region */ SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined); diff --git a/xorg-server/hw/xwin/winshadgdi.c b/xorg-server/hw/xwin/winshadgdi.c index cdbb46bf2..912f7e41f 100644 --- a/xorg-server/hw/xwin/winshadgdi.c +++ b/xorg-server/hw/xwin/winshadgdi.c @@ -439,7 +439,7 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf) DWORD dwBox = RegionNumRects(damage); BoxPtr pBox = RegionRects(damage); int x, y, w, h; - HRGN hrgnTemp = NULL, hrgnCombined = NULL; + HRGN hrgnCombined = NULL; #ifdef XWIN_UPDATESTATS static DWORD s_dwNonUnitRegions = 0; @@ -500,16 +500,11 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf) } } else if (!pScreenInfo->fMultiWindow) { + /* Compute a GDI region from the damaged region */ - hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - dwBox--; - pBox++; - while (dwBox--) { - hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR); - DeleteObject(hrgnTemp); - pBox++; - } + hrgnCombined = + CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2, + pBoxExtents->y2); /* Install the GDI region as a clipping region */ SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined); diff --git a/xorg-server/hw/xwin/wintaskbar.c b/xorg-server/hw/xwin/wintaskbar.c new file mode 100644 index 000000000..7dd4ec30b --- /dev/null +++ b/xorg-server/hw/xwin/wintaskbar.c @@ -0,0 +1,92 @@ +/* + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#ifdef HAVE_XWIN_CONFIG_H +#include <xwin-config.h> +#endif + +#include "win.h" +#include "winwindow.h" + +const GUID CLSID_TaskbarList = {0x56fdf344,0xfd6d,0x11d0,{0x95,0x8a,0x0,0x60,0x97,0xc9,0xa0,0x90}}; +const GUID IID_ITaskbarList = {0x56fdf342,0xfd6d,0x11d0,{0x95,0x8a,0x0,0x60,0x97,0xc9,0xa0,0x90}}; + +#ifdef INTERFACE +#undef INTERFACE +#endif + +#define INTERFACE ITaskbarList +DECLARE_INTERFACE_(ITaskbarList, IUnknown) +{ + /* IUnknown methods */ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG, AddRef) (THIS) PURE; + STDMETHOD_(ULONG, Release) (THIS) PURE; + + /* ITaskbarList methods */ + STDMETHOD(HrInit) (THIS) PURE; + STDMETHOD(AddTab) (THIS_ HWND hWnd) PURE; + STDMETHOD(DeleteTab) (THIS_ HWND hWnd) PURE; + STDMETHOD(ActivateTab) (THIS_ HWND hWnd) PURE; + STDMETHOD(SetActiveAlt) (THIS_ HWND hWnd) PURE; +}; +#undef INTERFACE + +/* + The stuff above needs to be in win32api headers, not defined here, + or at least generated from the MIDL :-) +*/ + +/* + This is unnecessarily heavyweight, we could just call CoInitialize() once at + startup and CoUninitialize() once at shutdown +*/ + +/* + The documentation for ITaskbarList::AddTab says that we are responsible for + deleting the tab ourselves when the window is deleted, but that doesn't actually + seem to be the case +*/ + +void winShowWindowOnTaskbar(HWND hWnd, BOOL show) +{ + ITaskbarList* pTaskbarList = NULL; + + if (SUCCEEDED(CoInitialize(NULL))) + { + if (SUCCEEDED(CoCreateInstance((const CLSID *)&CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, (const IID *)&IID_ITaskbarList, (void**)&pTaskbarList))) + { + if (SUCCEEDED(pTaskbarList->lpVtbl->HrInit(pTaskbarList))) + { + if (show) + { + pTaskbarList->lpVtbl->AddTab(pTaskbarList,hWnd); + } + else + { + pTaskbarList->lpVtbl->DeleteTab(pTaskbarList,hWnd); + } + } + pTaskbarList->lpVtbl->Release(pTaskbarList); + } + CoUninitialize(); + } +} diff --git a/xorg-server/hw/xwin/winwin32rootless.c b/xorg-server/hw/xwin/winwin32rootless.c index 5bf710209..974309248 100644 --- a/xorg-server/hw/xwin/winwin32rootless.c +++ b/xorg-server/hw/xwin/winwin32rootless.c @@ -263,7 +263,7 @@ winMWExtWMCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, strcat(pszClass, pszWindowID); #if CYGMULTIWINDOW_DEBUG - winDebug("winCreateWindowsWindow - Creating class: %s\n", pszClass); + winDebug("winMWExtWMCreateFrame - Creating class: %s\n", pszClass); #endif /* Setup our window class */ diff --git a/xorg-server/hw/xwin/winwindow.h b/xorg-server/hw/xwin/winwindow.h index 49a720a67..37b975224 100644 --- a/xorg-server/hw/xwin/winwindow.h +++ b/xorg-server/hw/xwin/winwindow.h @@ -148,5 +148,17 @@ void void winMinimizeWindow(Window id); +void + winPropertyStoreInit(void); + +void + winPropertyStoreDestroy(void); + +void + winSetAppUserModelID(HWND hWnd, const char *AppID); + +void + winShowWindowOnTaskbar(HWND hWnd, BOOL show); + #endif /* XWIN_MULTIWINDOW */ #endif diff --git a/xorg-server/hw/xwin/winwndproc.c b/xorg-server/hw/xwin/winwndproc.c index fe662b9ba..7ba028042 100644 --- a/xorg-server/hw/xwin/winwndproc.c +++ b/xorg-server/hw/xwin/winwndproc.c @@ -930,6 +930,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WIN_POLLING_MOUSE_TIMER_ID: { + static POINT last_point; POINT point; WPARAM wL, wM, wR, wShift, wCtrl; LPARAM lPos; @@ -941,8 +942,12 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) point.x -= GetSystemMetrics(SM_XVIRTUALSCREEN); point.y -= GetSystemMetrics(SM_YVIRTUALSCREEN); - /* Deliver absolute cursor position to X Server */ - winEnqueueMotion(point.x, point.y); + /* If the mouse pointer has moved, deliver absolute cursor position to X Server */ + if (last_point.x != point.x || last_point.y != point.y) { + winEnqueueMotion(point.x, point.y); + last_point.x = point.x; + last_point.y = point.y; + } /* Check if a button was released but we didn't see it */ GetCursorPos(&point); diff --git a/xorg-server/include/extension.h b/xorg-server/include/extension.h index 0f55d9038..acc6addb7 100644 --- a/xorg-server/include/extension.h +++ b/xorg-server/include/extension.h @@ -97,6 +97,6 @@ extern _X_EXPORT void InitExtensions(int argc, char **argv); extern _X_EXPORT void CloseDownExtensions(void); -extern _X_EXPORT void LoadExtension(ExtensionModule *ext, Bool external); +extern _X_EXPORT void LoadExtension(const ExtensionModule *ext, Bool external); #endif /* EXTENSION_H */ diff --git a/xorg-server/include/extinit.h b/xorg-server/include/extinit.h index 7f4718f2f..5690d7b01 100644 --- a/xorg-server/include/extinit.h +++ b/xorg-server/include/extinit.h @@ -68,10 +68,6 @@ extern _X_EXPORT Bool noDbeExtension; extern void DbeExtensionInit(void); #endif -#ifdef DMXEXT -extern void DMXExtensionInit(void); -#endif - #if defined(DPMSExtension) #include <X11/extensions/dpmsconst.h> extern _X_EXPORT Bool noDPMSExtension; diff --git a/xorg-server/mi/miinitext.c b/xorg-server/mi/miinitext.c index d17544097..369da5ede 100644 --- a/xorg-server/mi/miinitext.c +++ b/xorg-server/mi/miinitext.c @@ -365,7 +365,7 @@ NewExtensionModule(void) } void -LoadExtension(ExtensionModule * e, Bool builtin) +LoadExtension(const ExtensionModule * e, Bool builtin) { ExtensionModule *newext; diff --git a/xorg-server/os/osinit.c b/xorg-server/os/osinit.c index 45ab5271b..6c66f9c12 100644 --- a/xorg-server/os/osinit.c +++ b/xorg-server/os/osinit.c @@ -102,6 +102,7 @@ OsRegisterSigWrapper(OsSigWrapperPtr newSigWrapper) * OsSigHandler -- * Catch unexpected signals and exit or continue cleanly. */ +#if !defined(WIN32) || defined(__CYGWIN__) static void #ifdef SA_SIGINFO OsSigHandler(int signo, siginfo_t * sip, void *unused) @@ -146,6 +147,7 @@ OsSigHandler(int signo) FatalError("Caught signal %d (%s). Server aborting\n", signo, strsignal(signo)); } +#endif /* !WIN32 || __CYGWIN__ */ void OsInit(void) @@ -155,6 +157,7 @@ OsInit(void) char fname[PATH_MAX]; if (!been_here) { +#if !defined(WIN32) || defined(__CYGWIN__) struct sigaction act, oact; int i; @@ -181,6 +184,8 @@ OsInit(void) siglist[i], strerror(errno)); } } +#endif /* !WIN32 || __CYGWIN__ */ + #ifdef HAVE_BACKTRACE /* * initialize the backtracer, since the ctor calls dlopen(), which @@ -241,8 +246,10 @@ OsInit(void) #endif } +#if !defined(WIN32) || defined(__CYGWIN__) if (getpgrp() == 0) setpgid(0, 0); +#endif #ifdef RLIMIT_DATA if (limitDataSpace >= 0) { diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index 3c520add5..6f75c1704 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -71,6 +71,7 @@ __stdcall unsigned long GetTickCount(void); #if !defined(WIN32) || !defined(__MINGW32__) #include <sys/time.h> #include <sys/resource.h> +# define SMART_SCHEDULE_POSSIBLE #endif #include "misc.h" #include <X11/X.h> @@ -212,6 +213,9 @@ sig_atomic_t inSignalContext = FALSE; OsSigHandlerPtr OsSignal(int sig, OsSigHandlerPtr handler) { +#if defined(WIN32) && !defined(__CYGWIN__) + return signal(sig, handler); +#else struct sigaction act, oact; sigemptyset(&act.sa_mask); @@ -222,6 +226,7 @@ OsSignal(int sig, OsSigHandlerPtr handler) if (sigaction(sig, &act, &oact)) perror("sigaction"); return oact.sa_handler; +#endif } /* @@ -894,6 +899,7 @@ ProcessCommandLine(int argc, char *argv[]) i = skip - 1; } #endif +#ifdef SMART_SCHEDULE_POSSIBLE else if (strcmp(argv[i], "-dumbSched") == 0) { SmartScheduleDisable = TRUE; } @@ -912,6 +918,7 @@ ProcessCommandLine(int argc, char *argv[]) else UseMsg(); } +#endif else if (strcmp(argv[i], "-render") == 0) { if (++i < argc) { int policy = PictureParseCmapPolicy(argv[i]); @@ -1123,6 +1130,7 @@ XNFstrdup(const char *s) void SmartScheduleStopTimer(void) { +#ifdef SMART_SCHEDULE_POSSIBLE struct itimerval timer; if (SmartScheduleDisable) @@ -1132,11 +1140,13 @@ SmartScheduleStopTimer(void) timer.it_value.tv_sec = 0; timer.it_value.tv_usec = 0; (void) setitimer(ITIMER_REAL, &timer, 0); +#endif } void SmartScheduleStartTimer(void) { +#ifdef SMART_SCHEDULE_POSSIBLE struct itimerval timer; if (SmartScheduleDisable) @@ -1146,6 +1156,7 @@ SmartScheduleStartTimer(void) timer.it_value.tv_sec = 0; timer.it_value.tv_usec = SmartScheduleInterval * 1000; setitimer(ITIMER_REAL, &timer, 0); +#endif } static void @@ -1157,6 +1168,7 @@ SmartScheduleTimer(int sig) void SmartScheduleInit(void) { +#ifdef SMART_SCHEDULE_POSSIBLE struct sigaction act; if (SmartScheduleDisable) @@ -1172,6 +1184,7 @@ SmartScheduleInit(void) perror("sigaction for smart scheduler"); SmartScheduleDisable = TRUE; } +#endif } #ifdef SIG_BLOCK @@ -1227,10 +1240,10 @@ OsBlockSIGIO(void) sigprocmask(SIG_BLOCK, &set, &PreviousSigIOMask); ret = sigismember(&PreviousSigIOMask, SIGIO); return ret; - } else - return 1; + } #endif #endif + return 1; } void |