New upstream version 1.0.5
This commit is contained in:
31
packaging/win32/xming/patches/xming-build-cross.patch
Normal file
31
packaging/win32/xming/patches/xming-build-cross.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
diff -urw xc-orig/config/cf/mingw.cf xc/config/cf/mingw.cf
|
||||
--- xc-orig/config/cf/mingw.cf 2009-03-18 18:13:23.000000000 +0100
|
||||
+++ xc/config/cf/mingw.cf 2009-08-10 16:54:59.594459842 +0200
|
||||
@@ -145,7 +145,8 @@
|
||||
#define HasShm NO
|
||||
|
||||
/* snprintf from windows runtime does return -1 if the buffer is to small */
|
||||
-#define HasSnprintf NO
|
||||
+/* FE: However, latest MinGW provides the correct ones ... */
|
||||
+#define HasSnprintf YES
|
||||
|
||||
#define HasFfs NO
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
|
||||
#define HasSockets NO
|
||||
#define GzipFontCompression YES
|
||||
-#define HasZlib NO
|
||||
+#define HasZlib YES
|
||||
#define HasFreetype2 NO
|
||||
|
||||
/* We don't need -lm */
|
||||
@@ -256,7 +256,7 @@
|
||||
#endif
|
||||
#ifndef ExtraIncDir
|
||||
# ifdef CrossCompileDir
|
||||
-# define ExtraIncDir CrossCompileDir/../../include
|
||||
+# define ExtraIncDir CrossCompileDir/../include
|
||||
# else
|
||||
# define ExtraIncDir /usr/include/w32api
|
||||
# endif
|
||||
25
packaging/win32/xming/patches/xming-build-fontutils.patch
Normal file
25
packaging/win32/xming/patches/xming-build-fontutils.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
diff -urw xc-orig/config/cf/mingw.cf xc/config/cf/mingw.cf
|
||||
--- xc-orig/config/cf/mingw.cf 2010-03-01 04:25:56.919914196 +0100
|
||||
+++ xc/config/cf/mingw.cf 2010-03-01 04:41:59.976930858 +0100
|
||||
@@ -329,6 +329,9 @@
|
||||
#ifndef BuildXkbcomp
|
||||
# define BuildXkbcomp YES
|
||||
#endif
|
||||
+#ifndef BuildFontEncLib
|
||||
+# define BuildFontEncLib YES
|
||||
+#endif
|
||||
|
||||
/* XWin Server specific build flags */
|
||||
#ifndef GlxUseWindows
|
||||
diff -urw xc-orig/programs/Imakefile xc/programs/Imakefile
|
||||
--- xc-orig/programs/Imakefile 2010-03-01 04:25:56.882162887 +0100
|
||||
+++ xc/programs/Imakefile 2010-03-01 04:38:13.110914496 +0100
|
||||
@@ -129,7 +129,7 @@
|
||||
#endif
|
||||
|
||||
#if BuildServersOnly || !BuildClients
|
||||
-SUBDIRS = $(XSSRCDIR) $(XKBCOMPDIR) xauth xset
|
||||
+SUBDIRS = $(XSSRCDIR) $(XKBCOMPDIR) $(MKFONTSCALEDIR) xauth xset
|
||||
#else
|
||||
SUBDIRS = \
|
||||
appres bdftopcf bitmap \
|
||||
155
packaging/win32/xming/patches/xming-build-native.patch
Normal file
155
packaging/win32/xming/patches/xming-build-native.patch
Normal file
@@ -0,0 +1,155 @@
|
||||
diff -urw xc-orig/config/imake/imake.c xc/config/imake/imake.c
|
||||
--- xc-orig/config/imake/imake.c 2009-03-18 18:13:23 +0100
|
||||
+++ xc/config/imake/imake.c 2009-08-03 23:03:20 +0200
|
||||
@@ -280,7 +280,7 @@
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
|
||||
-#if !(defined(Lynx) || defined(__Lynx__) || (defined(SVR4) && !defined(sun))) && !defined (__CYGWIN__)
|
||||
+#if !(defined(Lynx) || defined(__Lynx__) || (defined(SVR4) && !defined(sun))) && !(defined (__CYGWIN__) || defined(__MINGW32__))
|
||||
#define HAS_MKSTEMP
|
||||
#endif
|
||||
|
||||
diff -urw xc-orig/config/util/lndir.c xc/config/util/lndir.c
|
||||
--- xc-orig/config/util/lndir.c 2009-03-18 18:13:23 +0100
|
||||
+++ xc/config/util/lndir.c 2009-08-04 00:18:18 +0200
|
||||
@@ -62,6 +62,9 @@
|
||||
#ifdef USG
|
||||
#include <dirent.h>
|
||||
#else
|
||||
+# ifdef __MINGW32__
|
||||
+# include <dirent.h>
|
||||
+# else
|
||||
#include <sys/dir.h>
|
||||
#ifndef dirent
|
||||
#define dirent direct
|
||||
@@ -69,6 +72,7 @@
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
+#endif
|
||||
#ifndef MAXPATHLEN
|
||||
#define MAXPATHLEN 2048
|
||||
#endif
|
||||
@@ -141,6 +145,9 @@
|
||||
return !strcmp(lname, rname);
|
||||
}
|
||||
|
||||
+#ifdef __MINGW32__
|
||||
+extern __declspec(dllimport) int __stdcall CopyFileA(const char *, const char *, int);
|
||||
+#endif
|
||||
|
||||
/* Recursively create symbolic links from the current directory to the "from"
|
||||
directory. Assumes that files described by fs and ts are directories. */
|
||||
@@ -231,18 +238,25 @@
|
||||
if (!silent)
|
||||
printf ("%s:\n", buf);
|
||||
if ((stat (dp->d_name, &sc) < 0) && (errno == ENOENT)) {
|
||||
+#ifdef __MINGW32__
|
||||
+ if (mkdir (dp->d_name) < 0 ||
|
||||
+ stat (dp->d_name, &sc) < 0) {
|
||||
+#else
|
||||
if (mkdir (dp->d_name, 0777) < 0 ||
|
||||
stat (dp->d_name, &sc) < 0) {
|
||||
+#endif
|
||||
mperror (dp->d_name);
|
||||
curdir = rcurdir = ocurdir;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
+#ifndef __MINGW32__
|
||||
if (readlink (dp->d_name, symbuf, sizeof(symbuf) - 1) >= 0) {
|
||||
msg ("%s: is a link instead of a directory", dp->d_name);
|
||||
curdir = rcurdir = ocurdir;
|
||||
continue;
|
||||
}
|
||||
+#endif
|
||||
if (chdir (dp->d_name) < 0) {
|
||||
mperror (dp->d_name);
|
||||
curdir = rcurdir = ocurdir;
|
||||
@@ -256,6 +270,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef __MINGW32__
|
||||
+ symlen = -1;
|
||||
+#else
|
||||
/* non-directory */
|
||||
symlen = readlink (dp->d_name, symbuf, sizeof(symbuf) - 1);
|
||||
if (symlen >= 0)
|
||||
@@ -270,6 +287,7 @@
|
||||
if (basesymlen >= 0)
|
||||
basesym[basesymlen] = '\0';
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (symlen >= 0) {
|
||||
/* Link exists in new tree. Print message if it doesn't match. */
|
||||
@@ -324,7 +342,11 @@
|
||||
}
|
||||
else
|
||||
sympath = buf;
|
||||
+#ifdef __MINGW32__
|
||||
+ if (CopyFileA(sympath, dp->d_name, 1) != 0)
|
||||
+#else
|
||||
if (symlink (sympath, dp->d_name) < 0)
|
||||
+#endif
|
||||
mperror (dp->d_name);
|
||||
}
|
||||
}
|
||||
diff -urw xcorig/config/cf/mingw.cf xc/config/cf/mingw.cf
|
||||
--- xcorig/config/cf/mingw.cf 2009-03-18 18:13:23 +0100
|
||||
+++ xc/config/cf/mingw.cf 2009-08-09 13:26:26 +0200
|
||||
@@ -145,7 +145,8 @@
|
||||
#define HasShm NO
|
||||
|
||||
/* snprintf from windows runtime does return -1 if the buffer is to small */
|
||||
-#define HasSnprintf NO
|
||||
+/* FE: However, latest MinGW provides the correct ones ... */
|
||||
+#define HasSnprintf YES
|
||||
|
||||
#define HasFfs NO
|
||||
|
||||
@@ -158,7 +159,7 @@
|
||||
|
||||
#define HasSockets NO
|
||||
#define GzipFontCompression YES
|
||||
-#define HasZlib NO
|
||||
+#define HasZlib YES
|
||||
#define HasFreetype2 NO
|
||||
|
||||
/* We don't need -lm */
|
||||
@@ -258,7 +259,7 @@
|
||||
# ifdef CrossCompileDir
|
||||
# define ExtraIncDir CrossCompileDir/../../include
|
||||
# else
|
||||
-# define ExtraIncDir /usr/include/w32api
|
||||
+# define ExtraIncDir /mingw/include
|
||||
# endif
|
||||
#endif
|
||||
|
||||
diff -urw xc-orig/extras/rman/rman.c xc/extras/rman/rman.c
|
||||
--- xc-orig/extras/rman/rman.c 2009-03-18 18:13:28 +0100
|
||||
+++ xc/extras/rman/rman.c 2009-08-07 04:21:06 +0200
|
||||
@@ -268,21 +268,6 @@
|
||||
/* case insensitive versions of strcmp and strncmp */
|
||||
|
||||
static int
|
||||
-stricmp(const char *s1, const char *s2)
|
||||
-{
|
||||
- assert(s1!=NULL && s2!=NULL);
|
||||
- /*strincmp(s1, s2, strlen(s1)+1);*/
|
||||
-
|
||||
- while (tolower(*s1)==tolower(*s2)) {
|
||||
- if (*s1=='\0' /*&& *s2=='\0'*/) return 0;
|
||||
- s1++; s2++;
|
||||
- }
|
||||
-
|
||||
- if (tolower(*s1)<tolower(*s2)) return -1;
|
||||
- else return 1;
|
||||
-}
|
||||
-
|
||||
-static int
|
||||
lcexceptionscmp(const void *a, const void *b)
|
||||
{
|
||||
return stricmp(*(char **)a, *(char **)b);
|
||||
69
packaging/win32/xming/patches/xming-build-nls.patch
Normal file
69
packaging/win32/xming/patches/xming-build-nls.patch
Normal file
@@ -0,0 +1,69 @@
|
||||
diff -urw xc-orig/Imakefile xc/Imakefile
|
||||
--- xc-orig/Imakefile 2009-03-18 18:13:23.000000000 +0100
|
||||
+++ xc/Imakefile 2010-02-20 16:30:25.965264944 +0100
|
||||
@@ -18,12 +18,16 @@
|
||||
#if BuildFonts
|
||||
FONTSDIR = fonts
|
||||
#endif
|
||||
-#ifndef Win32Architecture
|
||||
+#if defined(mingwArchitecture) || !defined(Win32Architecture)
|
||||
#if BuildDocs
|
||||
DOCSDIR = doc
|
||||
#endif
|
||||
NLSSUBDIR = nls
|
||||
#endif
|
||||
+#else
|
||||
+#ifdef mingwArchitecture
|
||||
+ NLSSUBDIR = nls
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
SUBDIRS = include config lib $(NLSSUBDIR) \
|
||||
diff -urw xc-orig/nls/Compose/Imakefile xc/nls/Compose/Imakefile
|
||||
--- xc-orig/nls/Compose/Imakefile 2009-03-18 18:13:20.000000000 +0100
|
||||
+++ xc/nls/Compose/Imakefile 2010-02-20 16:24:42.442511645 +0100
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
XCOMM $XFree86: xc/nls/Compose/Imakefile,v 1.20 2002/05/31 18:45:52 dawes Exp $
|
||||
|
||||
-#ifndef Win32Architecture
|
||||
+#if defined(mingwArchitecture) || !defined(Win32Architecture)
|
||||
# define ComposeTarget(name) @@\
|
||||
all:: name.ct @@\
|
||||
MakeDir($(BUILDI18NDIR)/name) @@\
|
||||
diff -urw xc-orig/nls/Imakefile xc/nls/Imakefile
|
||||
--- xc-orig/nls/Imakefile 2009-03-18 18:13:20.000000000 +0100
|
||||
+++ xc/nls/Imakefile 2010-02-20 16:24:42.443510864 +0100
|
||||
@@ -28,7 +28,7 @@
|
||||
#define R63Compat YES
|
||||
#endif
|
||||
|
||||
-#ifndef Win32Architecture
|
||||
+#if defined(mingwArchitecture) || !defined(Win32Architecture)
|
||||
#if R63Compat
|
||||
# define LTarget(name) @@\
|
||||
CppFileTarget(name.l1,name,$(DEFINES),NullParameter) @@\
|
||||
diff -urw xc-orig/nls/XI18N_OBJS/Imakefile xc/nls/XI18N_OBJS/Imakefile
|
||||
--- xc-orig/nls/XI18N_OBJS/Imakefile 2009-03-18 18:13:20.000000000 +0100
|
||||
+++ xc/nls/XI18N_OBJS/Imakefile 2010-02-20 16:24:42.443510864 +0100
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
XCOMM $XFree86: xc/nls/XI18N_OBJS/Imakefile,v 1.6 2002/12/17 03:41:53 dawes Exp $
|
||||
|
||||
-#ifndef Win32Architecture
|
||||
+#if defined(mingwArchitecture) || !defined(Win32Architecture)
|
||||
# define XI18NTarget(name) @@\
|
||||
all:: name @@\
|
||||
MakeDir($(BUILDI18NDIR)/name) @@\
|
||||
diff -urw xc-orig/nls/XLC_LOCALE/Imakefile xc/nls/XLC_LOCALE/Imakefile
|
||||
--- xc-orig/nls/XLC_LOCALE/Imakefile 2009-03-18 18:13:20.000000000 +0100
|
||||
+++ xc/nls/XLC_LOCALE/Imakefile 2010-02-20 16:24:42.443510864 +0100
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
WCHAR32 = HasWChar32
|
||||
|
||||
-#ifndef Win32Architecture
|
||||
+#if defined(mingwArchitecture) || !defined(Win32Architecture)
|
||||
# define LTarget(name) @@\
|
||||
all:: name.lt @@\
|
||||
@@\
|
||||
12
packaging/win32/xming/patches/xming-build-subsys.patch
Normal file
12
packaging/win32/xming/patches/xming-build-subsys.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -urwN xc-orig/programs/Xserver/Imakefile xc/programs/Xserver/Imakefile
|
||||
--- xc-orig/programs/Xserver/Imakefile 2009-03-18 18:13:47.000000000 +0100
|
||||
+++ xc/programs/Xserver/Imakefile 2009-07-28 02:47:19.754745601 +0200
|
||||
@@ -1052,7 +1052,7 @@
|
||||
#endif
|
||||
XWINSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XWINX11) $(SYSLIBS) $(XWINW32)
|
||||
|
||||
-EXTRA_LDOPTIONS = -e _mainCRTStartup
|
||||
+EXTRA_LDOPTIONS = -Wl,--subsystem,windows -mwindows
|
||||
|
||||
#if HasParallelMake
|
||||
MakeMutex($(XWINDIRS) $(XWINOBJS) $(XWINLIB) $(XWINLIBS) $(XWINSYSLIBS))
|
||||
93
packaging/win32/xming/patches/xming-build-xauth.patch
Normal file
93
packaging/win32/xming/patches/xming-build-xauth.patch
Normal file
@@ -0,0 +1,93 @@
|
||||
diff -urw xc-noauth/programs/Imakefile xc/programs/Imakefile
|
||||
--- xc-noauth/programs/Imakefile 2009-03-18 18:13:38.000000000 +0100
|
||||
+++ xc/programs/Imakefile 2009-08-02 16:40:15.951112896 +0200
|
||||
@@ -129,7 +129,7 @@
|
||||
#endif
|
||||
|
||||
#if BuildServersOnly || !BuildClients
|
||||
-SUBDIRS = $(XSSRCDIR) $(XKBCOMPDIR)
|
||||
+SUBDIRS = $(XSSRCDIR) $(XKBCOMPDIR) xauth
|
||||
#else
|
||||
SUBDIRS = \
|
||||
appres bdftopcf bitmap \
|
||||
diff -urw xc-noauth/programs/xauth/Imakefile xc/programs/xauth/Imakefile
|
||||
--- xc-noauth/programs/xauth/Imakefile 2009-03-18 18:13:37.000000000 +0100
|
||||
+++ xc/programs/xauth/Imakefile 2009-08-02 16:57:42.506366577 +0200
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
XCOMM $XFree86: xc/programs/xauth/Imakefile,v 3.5tsi Exp $
|
||||
|
||||
- DEPLIBS = $(DEPXAUTHLIB) $(DEPXMUULIB) $(DEPXLIB)
|
||||
-LOCAL_LIBRARIES = $(XAUTHLIB) $(XMUULIB) $(XLIB)
|
||||
+ DEPLIBS = $(DEPXAUTHLIB) $(DEPXLIB)
|
||||
+LOCAL_LIBRARIES = $(XAUTHLIB) $(XLIB)
|
||||
SRCS = xauth.c gethost.c process.c parsedpy.c
|
||||
OBJS = xauth.o gethost.o process.o parsedpy.o
|
||||
CONN_DEFINES = $(CONNECTION_FLAGS)
|
||||
diff -urw xc-noauth/programs/xauth/parsedpy.c xc/programs/xauth/parsedpy.c
|
||||
--- xc-noauth/programs/xauth/parsedpy.c 2009-03-18 18:13:37.000000000 +0100
|
||||
+++ xc/programs/xauth/parsedpy.c 2009-08-02 16:56:03.724365404 +0200
|
||||
@@ -44,7 +44,48 @@
|
||||
#include <sys/utsname.h> /* for struct utsname */
|
||||
#endif
|
||||
#include <X11/Xauth.h> /* for FamilyLocal */
|
||||
+#ifdef __MINGW32__
|
||||
+# include <X11/Xosdefs.h>
|
||||
+# include <X11/Xmd.h>
|
||||
+# include <string.h>
|
||||
+# include <unistd.h>
|
||||
+
|
||||
+# ifdef WIN32
|
||||
+# include <X11/Xwinsock.h>
|
||||
+# endif
|
||||
+int
|
||||
+XmuGetHostname(char *buf, int maxlen)
|
||||
+{
|
||||
+ int len;
|
||||
+# ifdef WIN32
|
||||
+ static WSADATA wsadata;
|
||||
+
|
||||
+ if (!wsadata.wVersion && WSAStartup(MAKEWORD(1,1), &wsadata))
|
||||
+ return -1;
|
||||
+# endif
|
||||
+
|
||||
+# ifdef NEED_UTSNAME
|
||||
+ /*
|
||||
+ * same host name crock as in server and xinit.
|
||||
+ */
|
||||
+ struct utsname name;
|
||||
+
|
||||
+ uname (&name);
|
||||
+ len = strlen (name.nodename);
|
||||
+ if (len >= maxlen) len = maxlen - 1;
|
||||
+ strncpy (buf, name.nodename, len);
|
||||
+ buf[len] = '\0';
|
||||
+# else
|
||||
+ buf[0] = '\0';
|
||||
+ (void) gethostname (buf, maxlen);
|
||||
+ buf [maxlen - 1] = '\0';
|
||||
+ len = strlen(buf);
|
||||
+# endif /* hpux */
|
||||
+ return len;
|
||||
+}
|
||||
+#else
|
||||
#include <X11/Xmu/SysUtil.h>
|
||||
+#endif
|
||||
|
||||
#if defined(UNIXCONN) || defined(LOCALCONN)
|
||||
#define UNIX_CONNECTION "unix"
|
||||
diff -urw xc-noauth/programs/xauth/process.c xc/programs/xauth/process.c
|
||||
--- xc-noauth/programs/xauth/process.c 2009-03-18 18:13:37.000000000 +0100
|
||||
+++ xc/programs/xauth/process.c 2009-08-02 16:40:15.952112883 +0200
|
||||
@@ -41,7 +41,11 @@
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
+#ifdef __MINGW32__
|
||||
+# define RETSIGTYPE void
|
||||
+#else
|
||||
#include <sys/socket.h>
|
||||
+#endif
|
||||
|
||||
#include <signal.h>
|
||||
#include <X11/X.h> /* for Family constants */
|
||||
629
packaging/win32/xming/patches/xming-build-xset.patch
Normal file
629
packaging/win32/xming/patches/xming-build-xset.patch
Normal file
@@ -0,0 +1,629 @@
|
||||
diff -urwN xc-orig/config/cf/host.def xc/config/cf/host.def
|
||||
--- xc-orig/config/cf/host.def 1970-01-01 01:00:00 +0100
|
||||
+++ xc/config/cf/host.def 2009-08-05 13:36:23 +0200
|
||||
@@ -0,0 +1 @@
|
||||
+
|
||||
diff -urwN xc-orig/lib/X11/XlibConf.h xc/lib/X11/XlibConf.h
|
||||
--- xc-orig/lib/X11/XlibConf.h 1970-01-01 01:00:00 +0100
|
||||
+++ xc/lib/X11/XlibConf.h 2009-08-05 13:37:03 +0200
|
||||
@@ -0,0 +1,7 @@
|
||||
+/* Defines needed to use Xlib from non-imake projects */
|
||||
+#ifndef XTHREADS
|
||||
+#define XTHREADS
|
||||
+#endif
|
||||
+#ifndef XUSE_MTSAFE_API
|
||||
+#define XUSE_MTSAFE_API
|
||||
+#endif
|
||||
diff -urwN xc-orig/programs/Imakefile xc/programs/Imakefile
|
||||
--- xc-orig/programs/Imakefile 2009-08-05 13:01:30 +0200
|
||||
+++ xc/programs/Imakefile 2009-08-05 13:36:22 +0200
|
||||
@@ -129,7 +129,7 @@
|
||||
#endif
|
||||
|
||||
#if BuildServersOnly || !BuildClients
|
||||
-SUBDIRS = $(XSSRCDIR) $(XKBCOMPDIR) xauth
|
||||
+SUBDIRS = $(XSSRCDIR) $(XKBCOMPDIR) xauth xset
|
||||
#else
|
||||
SUBDIRS = \
|
||||
appres bdftopcf bitmap \
|
||||
diff -urwN xc-orig/programs/xset/CharSet.h xc/programs/xset/CharSet.h
|
||||
--- xc-orig/programs/xset/CharSet.h 1970-01-01 01:00:00 +0100
|
||||
+++ xc/programs/xset/CharSet.h 2009-08-05 13:36:22 +0200
|
||||
@@ -0,0 +1,77 @@
|
||||
+/* $Xorg: CharSet.h,v 1.4 2001/02/09 02:03:51 xorgcvs Exp $ */
|
||||
+
|
||||
+/*
|
||||
+
|
||||
+Copyright 1988, 1998 The Open Group
|
||||
+
|
||||
+Permission to use, copy, modify, distribute, and sell this software and its
|
||||
+documentation for any purpose is hereby granted without fee, provided that
|
||||
+the above copyright notice appear in all copies and that both that
|
||||
+copyright notice and this permission notice appear in supporting
|
||||
+documentation.
|
||||
+
|
||||
+The above copyright notice and this permission notice 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
|
||||
+OPEN GROUP 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.
|
||||
+
|
||||
+Except as contained in this notice, the name of The Open Group shall not be
|
||||
+used in advertising or otherwise to promote the sale, use or other dealings
|
||||
+in this Software without prior written authorization from The Open Group.
|
||||
+
|
||||
+*/
|
||||
+
|
||||
+/* $XFree86: xc/lib/Xmu/CharSet.h,v 1.7 2001/01/17 19:42:53 dawes Exp $ */
|
||||
+
|
||||
+/*
|
||||
+ * The interfaces described by this header file are for miscellaneous utilities
|
||||
+ * and are not part of the Xlib standard.
|
||||
+ */
|
||||
+
|
||||
+#ifndef _XMU_CHARSET_H_
|
||||
+#define _XMU_CHARSET_H_
|
||||
+
|
||||
+#include <X11/Xfuncproto.h>
|
||||
+
|
||||
+_XFUNCPROTOBEGIN
|
||||
+
|
||||
+void XmuCopyISOLatin1Lowered
|
||||
+(
|
||||
+ char *dst_return,
|
||||
+ _Xconst char *src
|
||||
+ );
|
||||
+
|
||||
+void XmuCopyISOLatin1Uppered
|
||||
+(
|
||||
+ char *dst_return,
|
||||
+ _Xconst char *src
|
||||
+ );
|
||||
+
|
||||
+int XmuCompareISOLatin1
|
||||
+(
|
||||
+ _Xconst char *first,
|
||||
+ _Xconst char *second
|
||||
+ );
|
||||
+
|
||||
+void XmuNCopyISOLatin1Lowered
|
||||
+(
|
||||
+ char *dst_return,
|
||||
+ _Xconst char *src,
|
||||
+ int size
|
||||
+ );
|
||||
+
|
||||
+void XmuNCopyISOLatin1Uppered
|
||||
+(
|
||||
+ char *dst_return,
|
||||
+ _Xconst char *src,
|
||||
+ int size
|
||||
+ );
|
||||
+
|
||||
+_XFUNCPROTOEND
|
||||
+
|
||||
+#endif /* _XMU_CHARSET_H_ */
|
||||
diff -urwN xc-orig/programs/xset/DefErrMsg.c xc/programs/xset/DefErrMsg.c
|
||||
--- xc-orig/programs/xset/DefErrMsg.c 1970-01-01 01:00:00 +0100
|
||||
+++ xc/programs/xset/DefErrMsg.c 2009-08-05 13:36:22 +0200
|
||||
@@ -0,0 +1,173 @@
|
||||
+/* $Xorg: DefErrMsg.c,v 1.4 2001/02/09 02:03:52 xorgcvs Exp $ */
|
||||
+
|
||||
+/*
|
||||
+
|
||||
+Copyright 1988, 1998 The Open Group
|
||||
+
|
||||
+Permission to use, copy, modify, distribute, and sell this software and its
|
||||
+documentation for any purpose is hereby granted without fee, provided that
|
||||
+the above copyright notice appear in all copies and that both that
|
||||
+copyright notice and this permission notice appear in supporting
|
||||
+documentation.
|
||||
+
|
||||
+The above copyright notice and this permission notice 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
|
||||
+OPEN GROUP 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.
|
||||
+
|
||||
+Except as contained in this notice, the name of The Open Group shall not be
|
||||
+used in advertising or otherwise to promote the sale, use or other dealings
|
||||
+in this Software without prior written authorization from The Open Group.
|
||||
+
|
||||
+*/
|
||||
+/* $XFree86: xc/lib/Xmu/DefErrMsg.c,v 1.7 2001/01/17 19:42:54 dawes Exp $ */
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+#include <config.h>
|
||||
+#endif
|
||||
+#include <stdio.h>
|
||||
+#define NEED_EVENTS
|
||||
+#include <X11/Xlibint.h>
|
||||
+#include <X11/Xproto.h>
|
||||
+#include "Error.h"
|
||||
+#include "SysUtil.h"
|
||||
+
|
||||
+/*
|
||||
+ * XmuPrintDefaultErrorMessage - print a nice error that looks like the usual
|
||||
+ * message. Returns 1 if the caller should consider exitting else 0.
|
||||
+ */
|
||||
+int
|
||||
+XmuPrintDefaultErrorMessage(Display *dpy, XErrorEvent *event, FILE *fp)
|
||||
+{
|
||||
+ char buffer[BUFSIZ];
|
||||
+ char mesg[BUFSIZ];
|
||||
+ char number[32];
|
||||
+ char *mtype = "XlibMessage";
|
||||
+ register _XExtension *ext = (_XExtension *)NULL;
|
||||
+ _XExtension *bext = (_XExtension *)NULL;
|
||||
+ XGetErrorText(dpy, event->error_code, buffer, BUFSIZ);
|
||||
+ XGetErrorDatabaseText(dpy, mtype, "XError", "X Error", mesg, BUFSIZ);
|
||||
+ (void) fprintf(fp, "%s: %s\n ", mesg, buffer);
|
||||
+ XGetErrorDatabaseText(dpy, mtype, "MajorCode", "Request Major code %d",
|
||||
+ mesg, BUFSIZ);
|
||||
+ (void) fprintf(fp, mesg, event->request_code);
|
||||
+ if (event->request_code < 128) {
|
||||
+ XmuSnprintf(number, sizeof(number), "%d", event->request_code);
|
||||
+ XGetErrorDatabaseText(dpy, "XRequest", number, "", buffer, BUFSIZ);
|
||||
+ } else {
|
||||
+ /* XXX this is non-portable */
|
||||
+ for (ext = dpy->ext_procs;
|
||||
+ ext && (ext->codes.major_opcode != event->request_code);
|
||||
+ ext = ext->next)
|
||||
+ ;
|
||||
+ if (ext)
|
||||
+ XmuSnprintf(buffer, sizeof(buffer), "%s", ext->name);
|
||||
+ else
|
||||
+ buffer[0] = '\0';
|
||||
+ }
|
||||
+ (void) fprintf(fp, " (%s)", buffer);
|
||||
+ fputs("\n ", fp);
|
||||
+ if (event->request_code >= 128) {
|
||||
+ XGetErrorDatabaseText(dpy, mtype, "MinorCode", "Request Minor code %d",
|
||||
+ mesg, BUFSIZ);
|
||||
+ (void) fprintf(fp, mesg, event->minor_code);
|
||||
+ if (ext) {
|
||||
+ XmuSnprintf(mesg, sizeof(mesg),
|
||||
+ "%s.%d", ext->name, event->minor_code);
|
||||
+ XGetErrorDatabaseText(dpy, "XRequest", mesg, "", buffer, BUFSIZ);
|
||||
+ (void) fprintf(fp, " (%s)", buffer);
|
||||
+ }
|
||||
+ fputs("\n ", fp);
|
||||
+ }
|
||||
+ if (event->error_code >= 128) {
|
||||
+ /* kludge, try to find the extension that caused it */
|
||||
+ buffer[0] = '\0';
|
||||
+ for (ext = dpy->ext_procs; ext; ext = ext->next) {
|
||||
+ if (ext->error_string)
|
||||
+ (*ext->error_string)(dpy, event->error_code, &ext->codes,
|
||||
+ buffer, BUFSIZ);
|
||||
+ if (buffer[0]) {
|
||||
+ bext = ext;
|
||||
+ break;
|
||||
+ }
|
||||
+ if (ext->codes.first_error &&
|
||||
+ ext->codes.first_error < event->error_code &&
|
||||
+ (!bext || ext->codes.first_error > bext->codes.first_error))
|
||||
+ bext = ext;
|
||||
+ }
|
||||
+ if (bext)
|
||||
+ XmuSnprintf(buffer, sizeof(buffer), "%s.%d", bext->name,
|
||||
+ event->error_code - bext->codes.first_error);
|
||||
+ else
|
||||
+ strcpy(buffer, "Value");
|
||||
+ XGetErrorDatabaseText(dpy, mtype, buffer, "", mesg, BUFSIZ);
|
||||
+ if (mesg[0]) {
|
||||
+ fputs(" ", fp);
|
||||
+ (void) fprintf(fp, mesg, event->resourceid);
|
||||
+ fputs("\n", fp);
|
||||
+ }
|
||||
+ /* let extensions try to print the values */
|
||||
+ for (ext = dpy->ext_procs; ext; ext = ext->next) {
|
||||
+ if (ext->error_values)
|
||||
+ (*ext->error_values)(dpy, event, fp);
|
||||
+ }
|
||||
+ } else if ((event->error_code == BadWindow) ||
|
||||
+ (event->error_code == BadPixmap) ||
|
||||
+ (event->error_code == BadCursor) ||
|
||||
+ (event->error_code == BadFont) ||
|
||||
+ (event->error_code == BadDrawable) ||
|
||||
+ (event->error_code == BadColor) ||
|
||||
+ (event->error_code == BadGC) ||
|
||||
+ (event->error_code == BadIDChoice) ||
|
||||
+ (event->error_code == BadValue) ||
|
||||
+ (event->error_code == BadAtom)) {
|
||||
+ if (event->error_code == BadValue)
|
||||
+ XGetErrorDatabaseText(dpy, mtype, "Value", "Value 0x%x",
|
||||
+ mesg, BUFSIZ);
|
||||
+ else if (event->error_code == BadAtom)
|
||||
+ XGetErrorDatabaseText(dpy, mtype, "AtomID", "AtomID 0x%x",
|
||||
+ mesg, BUFSIZ);
|
||||
+ else
|
||||
+ XGetErrorDatabaseText(dpy, mtype, "ResourceID", "ResourceID 0x%x",
|
||||
+ mesg, BUFSIZ);
|
||||
+ (void) fprintf(fp, mesg, event->resourceid);
|
||||
+ fputs("\n ", fp);
|
||||
+ }
|
||||
+ XGetErrorDatabaseText(dpy, mtype, "ErrorSerial", "Error Serial #%d",
|
||||
+ mesg, BUFSIZ);
|
||||
+ (void) fprintf(fp, mesg, event->serial);
|
||||
+ fputs("\n ", fp);
|
||||
+ XGetErrorDatabaseText(dpy, mtype, "CurrentSerial", "Current Serial #%d",
|
||||
+ mesg, BUFSIZ);
|
||||
+ (void) fprintf(fp, mesg, NextRequest(dpy)-1);
|
||||
+ fputs("\n", fp);
|
||||
+ if (event->error_code == BadImplementation) return 0;
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * XmuSimpleErrorHandler - ignore errors for XQueryTree, XGetWindowAttributes,
|
||||
+ * and XGetGeometry; print a message for everything else. In all case, do
|
||||
+ * not exit.
|
||||
+ */
|
||||
+int
|
||||
+XmuSimpleErrorHandler(Display *dpy, XErrorEvent *errorp)
|
||||
+{
|
||||
+ switch (errorp->request_code) {
|
||||
+ case X_QueryTree:
|
||||
+ case X_GetWindowAttributes:
|
||||
+ if (errorp->error_code == BadWindow) return 0;
|
||||
+ break;
|
||||
+ case X_GetGeometry:
|
||||
+ if (errorp->error_code == BadDrawable) return 0;
|
||||
+ break;
|
||||
+ }
|
||||
+ /* got a "real" X error */
|
||||
+ return XmuPrintDefaultErrorMessage (dpy, errorp, stderr);
|
||||
+}
|
||||
diff -urwN xc-orig/programs/xset/Error.h xc/programs/xset/Error.h
|
||||
--- xc-orig/programs/xset/Error.h 1970-01-01 01:00:00 +0100
|
||||
+++ xc/programs/xset/Error.h 2009-08-05 13:36:22 +0200
|
||||
@@ -0,0 +1,59 @@
|
||||
+/* $Xorg: Error.h,v 1.5 2001/02/09 02:03:52 xorgcvs Exp $ */
|
||||
+
|
||||
+/*
|
||||
+
|
||||
+Copyright 1988, 1998 The Open Group
|
||||
+
|
||||
+Permission to use, copy, modify, distribute, and sell this software and its
|
||||
+documentation for any purpose is hereby granted without fee, provided that
|
||||
+the above copyright notice appear in all copies and that both that
|
||||
+copyright notice and this permission notice appear in supporting
|
||||
+documentation.
|
||||
+
|
||||
+The above copyright notice and this permission notice 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
|
||||
+OPEN GROUP 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.
|
||||
+
|
||||
+Except as contained in this notice, the name of The Open Group shall not be
|
||||
+used in advertising or otherwise to promote the sale, use or other dealings
|
||||
+in this Software without prior written authorization from The Open Group.
|
||||
+
|
||||
+*/
|
||||
+/* $XFree86: xc/lib/Xmu/Error.h,v 1.5 2001/01/17 19:42:55 dawes Exp $ */
|
||||
+
|
||||
+/*
|
||||
+ * The interfaces described by this header file are for miscellaneous utilities
|
||||
+ * and are not part of the Xlib standard.
|
||||
+ */
|
||||
+
|
||||
+#ifndef _XMU_ERROR_H_
|
||||
+#define _XMU_ERROR_H_
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <X11/Xlib.h>
|
||||
+#include <X11/Xfuncproto.h>
|
||||
+
|
||||
+_XFUNCPROTOBEGIN
|
||||
+
|
||||
+int XmuPrintDefaultErrorMessage
|
||||
+(
|
||||
+ Display *dpy,
|
||||
+ XErrorEvent *event,
|
||||
+ FILE *fp
|
||||
+ );
|
||||
+
|
||||
+int XmuSimpleErrorHandler
|
||||
+(
|
||||
+ Display *dpy,
|
||||
+ XErrorEvent *errorp
|
||||
+ );
|
||||
+
|
||||
+_XFUNCPROTOEND
|
||||
+
|
||||
+#endif /* _XMU_ERROR_H_ */
|
||||
diff -urwN xc-orig/programs/xset/Imakefile xc/programs/xset/Imakefile
|
||||
--- xc-orig/programs/xset/Imakefile 2009-03-18 18:13:34 +0100
|
||||
+++ xc/programs/xset/Imakefile 2009-08-05 21:18:27 +0200
|
||||
@@ -19,10 +19,19 @@
|
||||
XPRINTDEFINES = -DBUILD_PRINTSUPPORT
|
||||
#endif
|
||||
|
||||
+#if HasSnprintf
|
||||
+ MISC_DEFINES = -DHAS_SNPRINTF
|
||||
+#else
|
||||
+ MISC_INCLUDES = -I$(LIBSRC)/misc
|
||||
+#endif
|
||||
+
|
||||
+ SRCS = xset.c DefErrMsg.c Lower.c
|
||||
+ OBJS = xset.o DefErrMsg.o Lower.o
|
||||
+ INCLUDES = $(MISC_INCLUDES)
|
||||
DEFINES = ExtensionDefines DPMSDefines \
|
||||
FontCacheExtensionDefines \
|
||||
- XkbDefines $(XPRINTDEFINES)
|
||||
- DEPLIBS = $(DEPXMUULIB) $(DEPXLIB) $(DEPXF86LIBS) $(DEPFONTLIBS)
|
||||
-LOCAL_LIBRARIES = $(XMUULIB) $(XF86LIBS) $(FONTLIBS) $(XPRINTLIBS) $(XLIB)
|
||||
+ XkbDefines $(XPRINTDEFINES) $(MISC_DEFINES)
|
||||
+ DEPLIBS = $(DEPXLIB) $(DEPXF86LIBS) $(DEPFONTLIBS)
|
||||
+LOCAL_LIBRARIES = $(XF86LIBS) $(FONTLIBS) $(XPRINTLIBS) $(XLIB)
|
||||
|
||||
-SimpleProgramTarget(xset)
|
||||
+ComplexProgramTarget(xset)
|
||||
diff -urwN xc-orig/programs/xset/Lower.c xc/programs/xset/Lower.c
|
||||
--- xc-orig/programs/xset/Lower.c 1970-01-01 01:00:00 +0100
|
||||
+++ xc/programs/xset/Lower.c 2009-08-05 13:36:22 +0200
|
||||
@@ -0,0 +1,164 @@
|
||||
+/* $Xorg: Lower.c,v 1.4 2001/02/09 02:03:53 xorgcvs Exp $ */
|
||||
+
|
||||
+/*
|
||||
+
|
||||
+Copyright 1988, 1998 The Open Group
|
||||
+
|
||||
+Permission to use, copy, modify, distribute, and sell this software and its
|
||||
+documentation for any purpose is hereby granted without fee, provided that
|
||||
+the above copyright notice appear in all copies and that both that
|
||||
+copyright notice and this permission notice appear in supporting
|
||||
+documentation.
|
||||
+
|
||||
+The above copyright notice and this permission notice 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
|
||||
+OPEN GROUP 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.
|
||||
+
|
||||
+Except as contained in this notice, the name of The Open Group shall not be
|
||||
+used in advertising or otherwise to promote the sale, use or other dealings
|
||||
+in this Software without prior written authorization from The Open Group.
|
||||
+
|
||||
+*/
|
||||
+
|
||||
+/* $XFree86: xc/lib/Xmu/Lower.c,v 1.11 2001/07/25 15:04:50 dawes Exp $ */
|
||||
+
|
||||
+#define XK_LATIN1
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+#include <config.h>
|
||||
+#endif
|
||||
+#include <X11/keysymdef.h>
|
||||
+#include "CharSet.h"
|
||||
+#include "SysUtil.h"
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+#ifndef HAS_SNPRINTF
|
||||
+#undef SCOPE
|
||||
+#define SCOPE static
|
||||
+#include "snprintf.c"
|
||||
+#endif
|
||||
+
|
||||
+#include <stdarg.h>
|
||||
+
|
||||
+/*
|
||||
+ * ISO Latin-1 case conversion routine
|
||||
+ */
|
||||
+#define XmuTolower(c) \
|
||||
+((c) >= XK_a && (c) <= XK_z ? \
|
||||
+ (c) : (c) >= XK_A && (c) <= XK_Z ? \
|
||||
+ (c) + (XK_a - XK_A) : (c) >= XK_Agrave && (c) <= XK_Odiaeresis ? \
|
||||
+ (c) + (XK_agrave - XK_Agrave) : (c) >= XK_Ooblique && (c) <= XK_Thorn ? \
|
||||
+ (c) + (XK_oslash - XK_Ooblique) : \
|
||||
+ (c))
|
||||
+
|
||||
+#define XmuToupper(c) \
|
||||
+((c) >= XK_A && (c) <= XK_Z ? \
|
||||
+ (c) : (c) >= XK_a && (c) <= XK_z ? \
|
||||
+ (c) - (XK_a - XK_A) : (c) >= XK_agrave && (c) <= XK_odiaeresis ? \
|
||||
+ (c) - (XK_agrave - XK_Agrave) : (c) >= XK_oslash && (c) <= XK_thorn ? \
|
||||
+ (c) - (XK_oslash - XK_Ooblique) : \
|
||||
+ (c))
|
||||
+
|
||||
+/*
|
||||
+ * Implementation
|
||||
+ */
|
||||
+void
|
||||
+XmuCopyISOLatin1Lowered(char *dst, _Xconst char *src)
|
||||
+{
|
||||
+ register unsigned char *dest, *source;
|
||||
+
|
||||
+ for (dest = (unsigned char *)dst, source = (unsigned char *)src;
|
||||
+ *source;
|
||||
+ source++, dest++)
|
||||
+ *dest = XmuTolower(*source);
|
||||
+ *dest = '\0';
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+XmuCopyISOLatin1Uppered(char *dst, _Xconst char *src)
|
||||
+{
|
||||
+ register unsigned char *dest, *source;
|
||||
+
|
||||
+ for (dest = (unsigned char *)dst, source = (unsigned char *)src;
|
||||
+ *source;
|
||||
+ source++, dest++)
|
||||
+ *dest = XmuToupper(*source);
|
||||
+ *dest = '\0';
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+XmuCompareISOLatin1(_Xconst char *first, _Xconst char *second)
|
||||
+{
|
||||
+ register unsigned char *ap, *bp;
|
||||
+
|
||||
+ for (ap = (unsigned char *)first, bp = (unsigned char *)second;
|
||||
+ *ap && *bp && XmuTolower(*ap) == XmuTolower(*bp);
|
||||
+ ap++, bp++)
|
||||
+ ;
|
||||
+
|
||||
+ return ((int)XmuTolower(*ap) - (int)XmuTolower(*bp));
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+XmuNCopyISOLatin1Lowered(char *dst, _Xconst char *src, register int size)
|
||||
+{
|
||||
+ register unsigned char *dest, *source;
|
||||
+
|
||||
+ if (size > 0)
|
||||
+ {
|
||||
+ for (dest = (unsigned char *)dst, source = (unsigned char *)src;
|
||||
+ *source && size > 1;
|
||||
+ source++, dest++, size--)
|
||||
+ *dest = XmuTolower(*source);
|
||||
+ *dest = '\0';
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+XmuNCopyISOLatin1Uppered(char *dst, _Xconst char *src, register int size)
|
||||
+{
|
||||
+ register unsigned char *dest, *source;
|
||||
+
|
||||
+ if (size > 0)
|
||||
+ {
|
||||
+ for (dest = (unsigned char *)dst, source = (unsigned char *)src;
|
||||
+ *source && size > 1;
|
||||
+ source++, dest++, size--)
|
||||
+ *dest = XmuToupper(*source);
|
||||
+ *dest = '\0';
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+XmuSnprintf(char *str, int size, _Xconst char *fmt, ...)
|
||||
+{
|
||||
+ va_list ap;
|
||||
+ int retval;
|
||||
+
|
||||
+ if (size <= 0)
|
||||
+ return (size);
|
||||
+
|
||||
+ va_start(ap, fmt);
|
||||
+
|
||||
+#if 0
|
||||
+ retval = vsprintf(str, fmt, ap);
|
||||
+ if (retval >= size)
|
||||
+ {
|
||||
+ fprintf(stderr, "WARNING: buffer overflow detected!\n");
|
||||
+ fflush(stderr);
|
||||
+ abort();
|
||||
+ }
|
||||
+#else
|
||||
+ retval = vsnprintf(str, size, fmt, ap);
|
||||
+#endif
|
||||
+
|
||||
+ va_end(ap);
|
||||
+
|
||||
+ return (retval);
|
||||
+}
|
||||
diff -urwN xc-orig/programs/xset/SysUtil.h xc/programs/xset/SysUtil.h
|
||||
--- xc-orig/programs/xset/SysUtil.h 1970-01-01 01:00:00 +0100
|
||||
+++ xc/programs/xset/SysUtil.h 2009-08-05 13:50:56 +0200
|
||||
@@ -0,0 +1,60 @@
|
||||
+/* $Xorg: SysUtil.h,v 1.4 2001/02/09 02:03:53 xorgcvs Exp $ */
|
||||
+
|
||||
+/*
|
||||
+
|
||||
+Copyright 1989, 1998 The Open Group
|
||||
+
|
||||
+Permission to use, copy, modify, distribute, and sell this software and its
|
||||
+documentation for any purpose is hereby granted without fee, provided that
|
||||
+the above copyright notice appear in all copies and that both that
|
||||
+copyright notice and this permission notice appear in supporting
|
||||
+documentation.
|
||||
+
|
||||
+The above copyright notice and this permission notice 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
|
||||
+OPEN GROUP 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.
|
||||
+
|
||||
+Except as contained in this notice, the name of The Open Group shall not be
|
||||
+used in advertising or otherwise to promote the sale, use or other dealings
|
||||
+in this Software without prior written authorization from The Open Group.
|
||||
+
|
||||
+*/
|
||||
+/* $XFree86: xc/lib/Xmu/SysUtil.h,v 1.9 2001/12/14 19:55:55 dawes Exp $ */
|
||||
+
|
||||
+#ifndef _SYSUTIL_H_
|
||||
+#define _SYSUTIL_H_
|
||||
+
|
||||
+#include <X11/Xfuncproto.h>
|
||||
+
|
||||
+_XFUNCPROTOBEGIN
|
||||
+
|
||||
+int XmuGetHostname
|
||||
+(
|
||||
+ char *buf_return,
|
||||
+ int maxlen
|
||||
+);
|
||||
+
|
||||
+#ifndef _XMU_H_
|
||||
+int XmuSnprintf
|
||||
+(
|
||||
+ char *str,
|
||||
+ int size,
|
||||
+ _Xconst char *fmt,
|
||||
+ ...
|
||||
+ )
|
||||
+#if defined(__GNUC__) && \
|
||||
+ ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4)))
|
||||
+__attribute((format(printf,3,4)))
|
||||
+#endif
|
||||
+;
|
||||
+#endif
|
||||
+
|
||||
+_XFUNCPROTOEND
|
||||
+
|
||||
+#endif /* _SYSUTIL_H_ */
|
||||
diff -urwN xc-orig/programs/xset/xset.c xc/programs/xset/xset.c
|
||||
--- xc-orig/programs/xset/xset.c 2009-03-18 18:13:34 +0100
|
||||
+++ xc/programs/xset/xset.c 2009-08-05 13:36:22 +0200
|
||||
@@ -68,7 +68,7 @@
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xutil.h>
|
||||
-#include <X11/Xmu/Error.h>
|
||||
+#include "Error.h"
|
||||
#ifdef MITMISC
|
||||
#include <X11/extensions/MITMisc.h>
|
||||
#endif
|
||||
@@ -98,7 +98,7 @@
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xutil.h>
|
||||
-#include <X11/Xmu/Error.h>
|
||||
+#include "Error.h"
|
||||
#ifdef MITMISC
|
||||
#include <X11/extensions/MITMisc.h>
|
||||
#endif
|
||||
220
packaging/win32/xming/patches/xming-build.patch
Normal file
220
packaging/win32/xming/patches/xming-build.patch
Normal file
@@ -0,0 +1,220 @@
|
||||
diff -urwN xc-orig/config/cf/mingw.cf xc/config/cf/mingw.cf
|
||||
--- xc-orig/config/cf/mingw.cf 2009-03-18 18:13:23.000000000 +0100
|
||||
+++ xc/config/cf/mingw.cf 2010-03-14 16:43:58.971671393 +0100
|
||||
@@ -30,7 +30,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef XVendorString
|
||||
-# define XVendorString "Colin Harrison"
|
||||
+# define XVendorString "The OpenNX Project"
|
||||
#endif
|
||||
#ifndef XVendorRelease
|
||||
# define XVendorRelease CygxVersion
|
||||
@@ -39,10 +39,10 @@
|
||||
# define XVendorManVersionString CygxManVersionString
|
||||
#endif
|
||||
#ifndef XVendorManNameString
|
||||
-# define XVendorManNameString "Xming"
|
||||
+# define XVendorManNameString "OpenNX Xming"
|
||||
#endif
|
||||
#ifndef XVendorContact
|
||||
-# define XVendorContact "http://sourceforge.net/forum/?group_id=156984"
|
||||
+# define XVendorContact "http://sourceforge.net/projects/opennx/"
|
||||
#endif
|
||||
|
||||
/* Operating system strings and version */
|
||||
@@ -118,9 +118,9 @@
|
||||
# endif
|
||||
# ifndef DefaultCCOptions
|
||||
# if defined(UseInstalled)
|
||||
-# define DefaultCCOptions
|
||||
+# define DefaultCCOptions -fno-strict-aliasing
|
||||
# else
|
||||
-# define DefaultCCOptions GccWarningOptions
|
||||
+# define DefaultCCOptions GccWarningOptions -fno-strict-aliasing
|
||||
# endif
|
||||
# endif
|
||||
# if defined(UseInstalled)
|
||||
diff -urwN xc-orig/lib/font/fc/fsconvert.c xc/lib/font/fc/fsconvert.c
|
||||
--- xc-orig/lib/font/fc/fsconvert.c 2009-03-18 18:13:18.000000000 +0100
|
||||
+++ xc/lib/font/fc/fsconvert.c 2010-03-14 16:43:58.972672079 +0100
|
||||
@@ -30,6 +30,7 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
+#include <stdint.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xtrans/Xtrans.h>
|
||||
#include <X11/Xpoll.h>
|
||||
diff -urwN xc-orig/programs/Xserver/fb/fbcompose.c xc/programs/Xserver/fb/fbcompose.c
|
||||
--- xc-orig/programs/Xserver/fb/fbcompose.c 2009-03-18 18:13:39.000000000 +0100
|
||||
+++ xc/programs/Xserver/fb/fbcompose.c 2010-03-14 16:43:58.975671483 +0100
|
||||
@@ -26,6 +26,7 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
+#include <stdint.h>
|
||||
|
||||
#include "fb.h"
|
||||
|
||||
diff -urwN xc-orig/programs/Xserver/hw/xwin/Imakefile xc/programs/Xserver/hw/xwin/Imakefile
|
||||
--- xc-orig/programs/Xserver/hw/xwin/Imakefile 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/Imakefile 2010-03-14 16:45:44.949905456 +0100
|
||||
@@ -23,7 +23,7 @@
|
||||
EXTRADEFINES += -DREAD_FONTDIRS
|
||||
|
||||
#if defined(mingwArchitecture)
|
||||
-PROJECT_NAME = Xming
|
||||
+PROJECT_NAME = OpenNX
|
||||
#elif defined(cygwinArchitecture)
|
||||
PROJECT_NAME = Cygwin/X
|
||||
#else
|
||||
diff -urwN xc-orig/programs/Xserver/hw/xwin/winmultiwindowicons.c xc/programs/Xserver/hw/xwin/winmultiwindowicons.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winmultiwindowicons.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winmultiwindowicons.c 2010-03-14 16:43:58.977654347 +0100
|
||||
@@ -31,6 +31,7 @@
|
||||
#ifdef HAVE_XWIN_CONFIG_H
|
||||
#include <xwin-config.h>
|
||||
#endif
|
||||
+#include <stdint.h>
|
||||
#include "win.h"
|
||||
#include "dixevents.h"
|
||||
#include "winmultiwindowclass.h"
|
||||
diff -urwN xc-orig/programs/Xserver/hw/xwin/winprocarg.c xc/programs/Xserver/hw/xwin/winprocarg.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winprocarg.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winprocarg.c 2010-03-14 16:56:55.234654504 +0100
|
||||
@@ -1483,7 +1483,7 @@
|
||||
|| strlen (argv[i]) > CHARS_PER_LINE)
|
||||
{
|
||||
iCurrLen = 0;
|
||||
- ++iSize;
|
||||
+ iSize += 2;
|
||||
}
|
||||
|
||||
/* Add space for item and trailing space */
|
||||
@@ -1494,7 +1494,7 @@
|
||||
}
|
||||
|
||||
/* Allocate memory for concatenated command line */
|
||||
- g_pszCommandLine = malloc (iSize + 1);
|
||||
+ g_pszCommandLine = malloc (iSize + 2);
|
||||
if (!g_pszCommandLine)
|
||||
FatalError ("winLogCommandLine - Could not allocate memory for "
|
||||
"command line string. Exiting.\n");
|
||||
@@ -1547,7 +1547,9 @@
|
||||
ErrorF ("FreeType2: %d.%d.%d\n", amajor, aminor, apatch);
|
||||
FT_Done_FreeType(library);
|
||||
ErrorF ("Contact: %s\n\n", VENDOR_CONTACT);
|
||||
- if (g_pszCommandLine) ErrorF ("%s\n\n", g_pszCommandLine);
|
||||
+ if (g_pszCommandLine)
|
||||
+ ErrorF ("%s was started with the following command line...\n"
|
||||
+ "%s\n\n", PROJECT_NAME, g_pszCommandLine);
|
||||
}
|
||||
|
||||
/*
|
||||
diff -urwN xc-orig/programs/Xserver/hw/xwin/XWin.rc xc/programs/Xserver/hw/xwin/XWin.rc
|
||||
--- xc-orig/programs/Xserver/hw/xwin/XWin.rc 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/XWin.rc 2010-03-14 16:43:58.978653706 +0100
|
||||
@@ -39,8 +39,8 @@
|
||||
#include <winver.h>
|
||||
|
||||
#include "../../../../../version.def"
|
||||
-#define XW32_VERSIONINFO_NAME "Xming\0"
|
||||
-#define XW32_VERSIONINFO_COMMENT "Xming X Server\0"
|
||||
+#define XW32_VERSIONINFO_NAME "OpenNX Xming\0"
|
||||
+#define XW32_VERSIONINFO_COMMENT "OpenNX X Server\0"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION XW32_VERSION
|
||||
@@ -59,9 +59,9 @@
|
||||
VALUE "FileVersion", XW32_VERSION_STRING
|
||||
VALUE "InternalName", XW32_VERSIONINFO_NAME
|
||||
VALUE "OriginalFilename", "Xming.exe\0"
|
||||
- VALUE "CompanyName", "Colin Harrison\0"
|
||||
+ VALUE "CompanyName", "The OpenNX Project\0"
|
||||
VALUE "LegalCopyright", "Copyright \251 2005-2007 Colin Harrison\0"
|
||||
- VALUE "Info", "http://www.StraightRunning.com/XmingNotes/\0"
|
||||
+ VALUE "Info", "http://sourceforge.net/projects/opennx/\0"
|
||||
VALUE "Comment", XW32_VERSIONINFO_COMMENT
|
||||
END
|
||||
END
|
||||
@@ -154,5 +154,4 @@
|
||||
*/
|
||||
|
||||
IDI_XWIN ICON DISCARDABLE "X.ico"
|
||||
-IDB_XWIN BITMAP "X.bmp"
|
||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "Xming.exe.manifest"
|
||||
diff -urwN xc-orig/programs/Xserver/miext/rootless/accel/rlAccel.c xc/programs/Xserver/miext/rootless/accel/rlAccel.c
|
||||
--- xc-orig/programs/Xserver/miext/rootless/accel/rlAccel.c 2009-03-18 18:13:47.000000000 +0100
|
||||
+++ xc/programs/Xserver/miext/rootless/accel/rlAccel.c 2010-03-14 16:43:58.979653414 +0100
|
||||
@@ -139,7 +139,7 @@
|
||||
|
||||
s = xalloc(sizeof(rlAccelScreenRec));
|
||||
if (!s) return FALSE;
|
||||
- RLACCELREC(pScreen) = s;
|
||||
+ memcpy(RLACCELREC(pScreen), s, sizeof(rlAccelScreenRec));
|
||||
|
||||
// Wrap the screen functions we need
|
||||
s->CreateGC = pScreen->CreateGC;
|
||||
diff -urwN xc-orig/programs/Xserver/miext/rootless/rootlessScreen.c xc/programs/Xserver/miext/rootless/rootlessScreen.c
|
||||
--- xc-orig/programs/Xserver/miext/rootless/rootlessScreen.c 2009-03-18 18:13:47.000000000 +0100
|
||||
+++ xc/programs/Xserver/miext/rootless/rootlessScreen.c 2010-03-14 16:43:58.980653890 +0100
|
||||
@@ -568,7 +568,7 @@
|
||||
|
||||
s = xalloc(sizeof(RootlessScreenRec));
|
||||
if (! s) return FALSE;
|
||||
- SCREENREC(pScreen) = s;
|
||||
+ memcpy(SCREENREC(pScreen), s, sizeof(RootlessScreenRec));
|
||||
|
||||
s->pixmap_data = NULL;
|
||||
s->pixmap_data_size = 0;
|
||||
diff -urwN xc-orig/programs/Xserver/miext/rootless/rootlessWindow.c xc/programs/Xserver/miext/rootless/rootlessWindow.c
|
||||
--- xc-orig/programs/Xserver/miext/rootless/rootlessWindow.c 2009-03-18 18:13:47.000000000 +0100
|
||||
+++ xc/programs/Xserver/miext/rootless/rootlessWindow.c 2010-03-14 16:43:58.981653529 +0100
|
||||
@@ -66,7 +66,7 @@
|
||||
Bool result;
|
||||
RegionRec saveRoot;
|
||||
|
||||
- WINREC(pWin) = NULL;
|
||||
+ memset(WINREC(pWin), 0, sizeof(WindowRec));
|
||||
|
||||
SCREEN_UNWRAP(pWin->drawable.pScreen, CreateWindow);
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
#endif
|
||||
|
||||
xfree(winRec);
|
||||
- WINREC(pWin) = NULL;
|
||||
+ memset(WINREC(pWin), 0, sizeof(WindowRec));
|
||||
}
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@
|
||||
winRec->pixmap = NULL;
|
||||
winRec->wid = NULL;
|
||||
|
||||
- WINREC(pWin) = winRec;
|
||||
+ memcpy(WINREC(pWin), winRec, sizeof(RootlessWindowRec));
|
||||
|
||||
#ifdef SHAPE
|
||||
// Set the frame's shape if the window is shaped
|
||||
@@ -370,7 +370,7 @@
|
||||
{
|
||||
RL_DEBUG_MSG("implementation failed to create frame!\n");
|
||||
xfree(winRec);
|
||||
- WINREC(pWin) = NULL;
|
||||
+ memset(WINREC(pWin), 0, sizeof(WindowRec));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1298,8 +1298,8 @@
|
||||
|
||||
/* Switch the frame record from one to the other. */
|
||||
|
||||
- WINREC(pWin) = NULL;
|
||||
- WINREC(pTopWin) = winRec;
|
||||
+ memset(WINREC(pWin), 0, sizeof(WindowRec));
|
||||
+ memcpy(WINREC(pTopWin), winRec, sizeof(WindowRec));
|
||||
|
||||
RootlessInitializeFrame(pTopWin, winRec);
|
||||
RootlessReshapeFrame(pTopWin);
|
||||
220
packaging/win32/xming/patches/xming-clipfilter.patch
Normal file
220
packaging/win32/xming/patches/xming-clipfilter.patch
Normal file
@@ -0,0 +1,220 @@
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winclipboard.h xc/programs/Xserver/hw/xwin/winclipboard.h
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winclipboard.h 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winclipboard.h 2011-12-11 22:25:09.726239465 +0100
|
||||
@@ -72,8 +72,8 @@
|
||||
|
||||
|
||||
/* Clipboard module constants */
|
||||
-#define WIN_CLIPBOARD_WINDOW_CLASS "xwinclip"
|
||||
-#define WIN_CLIPBOARD_WINDOW_TITLE "xwinclip"
|
||||
+#define WIN_CLIPBOARD_WINDOW_CLASS "OpenNXWinClip"
|
||||
+#define WIN_CLIPBOARD_WINDOW_TITLE "OpenNXWinClip"
|
||||
#ifdef HAS_DEVWINDOWS
|
||||
# define WIN_MSG_QUEUE_FNAME "/dev/windows"
|
||||
#endif
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winclipboardwndproc.c xc/programs/Xserver/hw/xwin/winclipboardwndproc.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winclipboardwndproc.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winclipboardwndproc.c 2011-12-11 22:25:09.727239465 +0100
|
||||
@@ -60,6 +60,8 @@
|
||||
/* BPS - g_hwndClipboard needed for X app->Windows paste fix */
|
||||
extern HWND g_hwndClipboard;
|
||||
|
||||
+extern int g_iClipFilter;
|
||||
+
|
||||
/*
|
||||
* Local function prototypes
|
||||
*/
|
||||
@@ -155,6 +157,7 @@
|
||||
* Windows app. TODO - Perhaps move to win.h with the other WM_USER messages.
|
||||
*/
|
||||
#define WM_USER_PASTE_COMPLETE (WM_USER + 1003)
|
||||
+#define WM_USER_SET_FILTER (WM_USER + 1004)
|
||||
|
||||
LRESULT CALLBACK
|
||||
winClipboardWindowProc (HWND hwnd, UINT message,
|
||||
@@ -166,6 +169,12 @@
|
||||
/* Branch on message type */
|
||||
switch (message)
|
||||
{
|
||||
+ case WM_USER_SET_FILTER:
|
||||
+ if ((0 < wParam) && (4 > wParam)) {
|
||||
+ g_iClipFilter = (int)wParam;
|
||||
+ ErrorF ("Setting ClipFilter to %d\n", g_iClipFilter);
|
||||
+ }
|
||||
+ return 0;
|
||||
case WM_DESTROY:
|
||||
{
|
||||
winDebug ("winClipboardWindowProc - WM_DESTROY\n");
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winclipboardwrappers.c xc/programs/Xserver/hw/xwin/winclipboardwrappers.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winclipboardwrappers.c 2011-12-11 02:06:30.189499447 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winclipboardwrappers.c 2011-12-11 22:25:09.728239464 +0100
|
||||
@@ -74,6 +74,7 @@
|
||||
extern winDispatchProcPtr winProcQueryTreeOrig;
|
||||
extern winDispatchProcPtr winProcSetSelectionOwnerOrig;
|
||||
|
||||
+extern int g_iClipFilter;
|
||||
|
||||
/*
|
||||
* Wrapper for internal QueryTree function.
|
||||
@@ -530,7 +531,21 @@
|
||||
SetClipboardData (CF_TEXT, NULL);
|
||||
|
||||
/* Save handle to last owned selection */
|
||||
+ switch (g_iClipFilter) {
|
||||
+ case CLIPFILTER_PRIMARY:
|
||||
+ if (XA_PRIMARY == stuff->selection) {
|
||||
g_atomLastOwnedSelection = stuff->selection;
|
||||
+ }
|
||||
+ break;
|
||||
+ case CLIPFILTER_CLIPBOARD:
|
||||
+ if (MakeAtom ("CLIPBOARD", 9, TRUE) == stuff->selection) {
|
||||
+ g_atomLastOwnedSelection = stuff->selection;
|
||||
+ }
|
||||
+ break;
|
||||
+ case CLIPFILTER_BOTH:
|
||||
+ g_atomLastOwnedSelection = stuff->selection;
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
/* Release the clipboard */
|
||||
if (!CloseClipboard ())
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winclipboardxevents.c xc/programs/Xserver/hw/xwin/winclipboardxevents.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winclipboardxevents.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winclipboardxevents.c 2011-12-11 22:25:09.730239464 +0100
|
||||
@@ -33,6 +33,8 @@
|
||||
#endif
|
||||
#include "winclipboard.h"
|
||||
|
||||
+#define CLPDEBUG 0
|
||||
+
|
||||
|
||||
/*
|
||||
* References to external symbols
|
||||
@@ -100,7 +102,7 @@
|
||||
*/
|
||||
|
||||
case SelectionRequest:
|
||||
-#if 0
|
||||
+#if CLPDEBUG
|
||||
{
|
||||
char *pszAtomName = NULL;
|
||||
|
||||
@@ -445,7 +447,7 @@
|
||||
*/
|
||||
|
||||
case SelectionNotify:
|
||||
-#if 0
|
||||
+#if 1
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionNotify\n");
|
||||
{
|
||||
char *pszAtomName;
|
||||
@@ -468,7 +470,7 @@
|
||||
{
|
||||
if (event.xselection.target == XA_STRING)
|
||||
{
|
||||
-#if 0
|
||||
+#if CLPDEBUG
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
|
||||
"XA_STRING\n");
|
||||
#endif
|
||||
@@ -476,7 +478,7 @@
|
||||
}
|
||||
else if (event.xselection.target == atomUTF8String)
|
||||
{
|
||||
-#if 0
|
||||
+#if CLPDEBUG
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
|
||||
"Requesting conversion of UTF8 target.\n");
|
||||
#endif
|
||||
@@ -502,7 +504,7 @@
|
||||
#ifdef X_HAVE_UTF8_STRING
|
||||
else if (event.xselection.target == atomCompoundText)
|
||||
{
|
||||
-#if 0
|
||||
+#if CLPDEBUG
|
||||
ErrorF ("winClipboardFlushXEvents - SelectionNotify - "
|
||||
"Requesting conversion of CompoundText target.\n");
|
||||
#endif
|
||||
@@ -556,7 +558,7 @@
|
||||
break;
|
||||
}
|
||||
|
||||
-#if 0
|
||||
+#if CLPDEBUG
|
||||
ErrorF ("SelectionNotify - returned data %d left %d\n",
|
||||
xtpText.nitems, ulReturnBytesLeft);
|
||||
#endif
|
||||
@@ -582,7 +584,7 @@
|
||||
break;
|
||||
}
|
||||
|
||||
-#if 0
|
||||
+#if CLPDEBUG
|
||||
{
|
||||
char *pszAtomName = NULL;
|
||||
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winglobals.c xc/programs/Xserver/hw/xwin/winglobals.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winglobals.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winglobals.c 2011-12-11 22:25:09.731239464 +0100
|
||||
@@ -115,6 +115,7 @@
|
||||
void *g_pClipboardDisplay = NULL;
|
||||
Window g_iClipboardWindow = None;
|
||||
Atom g_atomLastOwnedSelection = None;
|
||||
+int g_iClipFilter = CLIPFILTER_BOTH;
|
||||
#endif
|
||||
|
||||
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/win.h xc/programs/Xserver/hw/xwin/win.h
|
||||
--- xc-orig/programs/Xserver/hw/xwin/win.h 2011-12-11 02:06:30.192499447 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/win.h 2011-12-11 22:25:09.733239464 +0100
|
||||
@@ -808,6 +808,10 @@
|
||||
|
||||
void
|
||||
winFixClipboardChain (void);
|
||||
+
|
||||
+# define CLIPFILTER_PRIMARY 1
|
||||
+# define CLIPFILTER_CLIPBOARD 2
|
||||
+# define CLIPFILTER_BOTH 3
|
||||
#endif
|
||||
|
||||
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winprocarg.c xc/programs/Xserver/hw/xwin/winprocarg.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winprocarg.c 2011-12-11 02:06:30.194499447 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winprocarg.c 2011-12-12 12:29:43.119998361 +0100
|
||||
@@ -50,6 +50,7 @@
|
||||
#ifdef XWIN_CLIPBOARD
|
||||
extern Bool g_fUnicodeClipboard;
|
||||
extern Bool g_fClipboard;
|
||||
+extern int g_iClipFilter;
|
||||
#endif
|
||||
extern int g_iLogVerbose;
|
||||
extern char * g_pszLogFile;
|
||||
@@ -917,9 +918,27 @@
|
||||
if (IS_OPTION ("-clipboard"))
|
||||
{
|
||||
g_fClipboard = TRUE;
|
||||
+ int iArgsProcessed = 1;
|
||||
|
||||
+ /* Grab the optional filter value */
|
||||
+ if (i + 1 < argc) {
|
||||
+ iArgsProcessed++;
|
||||
+ sscanf (argv[i + 1], "%d", &g_iClipFilter);
|
||||
+ if ((CLIPFILTER_PRIMARY > g_iClipFilter) || (CLIPFILTER_BOTH < g_iClipFilter)) {
|
||||
+ g_iClipFilter = CLIPFILTER_BOTH;
|
||||
+ }
|
||||
+ if (0 == strcmp(argv[i + 1], "primary")) {
|
||||
+ g_iClipFilter = CLIPFILTER_PRIMARY;
|
||||
+ }
|
||||
+ if (0 == strcmp(argv[i + 1], "clipboard")) {
|
||||
+ g_iClipFilter = CLIPFILTER_CLIPBOARD;
|
||||
+ }
|
||||
+ if (0 == strcmp(argv[i + 1], "both")) {
|
||||
+ g_iClipFilter = CLIPFILTER_BOTH;
|
||||
+ }
|
||||
+ }
|
||||
/* Indicate that we have processed this argument */
|
||||
- return 1;
|
||||
+ return iArgsProcessed;
|
||||
}
|
||||
#endif
|
||||
|
||||
70
packaging/win32/xming/patches/xming-envbasedir.patch
Normal file
70
packaging/win32/xming/patches/xming-envbasedir.patch
Normal file
@@ -0,0 +1,70 @@
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/InitOutput.c xc/programs/Xserver/hw/xwin/InitOutput.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/InitOutput.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/InitOutput.c 2010-02-23 01:08:11.897702327 +0100
|
||||
@@ -130,7 +130,7 @@
|
||||
|
||||
#ifdef RELOCATE_PROJECTROOT
|
||||
const char *
|
||||
-winGetBaseDir(void);
|
||||
+winGetBaseDir(int getreal);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -384,17 +384,26 @@
|
||||
|
||||
#ifdef RELOCATE_PROJECTROOT
|
||||
const char *
|
||||
-winGetBaseDir(void)
|
||||
+winGetBaseDir(int getreal)
|
||||
{
|
||||
static BOOL inited = FALSE;
|
||||
static char buffer[MAX_PATH];
|
||||
+ static char buffer2[MAX_PATH];
|
||||
if (!inited)
|
||||
{
|
||||
char *fendptr;
|
||||
+ DWORD size = 0;
|
||||
+ buffer[0] = '\0';
|
||||
+ if (NULL != getenv("XMING_BASEDIR"))
|
||||
+ strncpy(buffer2, getenv("XMING_BASEDIR"), sizeof(buffer2));
|
||||
+ if ('\0' == buffer[0]) {
|
||||
HMODULE module = GetModuleHandle(NULL);
|
||||
- DWORD size = GetModuleFileName(module, buffer, sizeof(buffer));
|
||||
- if (sizeof(buffer) > 0)
|
||||
- buffer[sizeof(buffer)-1] = 0;
|
||||
+ size = GetModuleFileName(module, buffer, sizeof(buffer));
|
||||
+ }
|
||||
+ if (0 < sizeof(buffer))
|
||||
+ buffer[sizeof(buffer)-1] = '\0';
|
||||
+ if (0 < sizeof(buffer2))
|
||||
+ buffer2[sizeof(buffer2)-1] = '\0';
|
||||
|
||||
fendptr = buffer + size;
|
||||
while (fendptr > buffer)
|
||||
@@ -408,7 +417,7 @@
|
||||
}
|
||||
inited = TRUE;
|
||||
}
|
||||
- return buffer;
|
||||
+ return getreal ? buffer : buffer2;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -418,7 +427,7 @@
|
||||
BOOL changed_fontpath = FALSE;
|
||||
MessageType font_from = X_DEFAULT;
|
||||
#ifdef RELOCATE_PROJECTROOT
|
||||
- const char *basedir = winGetBaseDir();
|
||||
+ const char *basedir = winGetBaseDir(0);
|
||||
size_t basedirlen = strlen(basedir);
|
||||
#endif
|
||||
|
||||
@@ -724,7 +733,7 @@
|
||||
if (sizeof(xkbbasedir) > 0)
|
||||
xkbbasedir[sizeof(xkbbasedir)-1] = 0;
|
||||
XkbBaseDirectory = xkbbasedir;
|
||||
- XkbBinDirectory = basedir;
|
||||
+ XkbBinDirectory = winGetBaseDir(1);
|
||||
}
|
||||
#endif /* XKB */
|
||||
#endif /* RELOCATE_PROJECTROOT */
|
||||
185
packaging/win32/xming/patches/xming-kbhook.patch
Normal file
185
packaging/win32/xming/patches/xming-kbhook.patch
Normal file
@@ -0,0 +1,185 @@
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/win.h xc/programs/Xserver/hw/xwin/win.h
|
||||
--- xc-orig/programs/Xserver/hw/xwin/win.h 2012-02-22 02:29:25.022775626 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/win.h 2012-02-22 04:33:57.949268146 +0100
|
||||
@@ -448,6 +448,7 @@
|
||||
/* Did the user requested to nitially hide our window? */
|
||||
Bool fHideInitial;
|
||||
DWORD origShowWindowMode;
|
||||
+ Bool fGrabKeyboard;
|
||||
} winScreenInfo, *winScreenInfoPtr;
|
||||
|
||||
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winkeyhook.c xc/programs/Xserver/hw/xwin/winkeyhook.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winkeyhook.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winkeyhook.c 2012-02-22 04:35:47.073275339 +0100
|
||||
@@ -85,8 +85,7 @@
|
||||
/* Get pointers to our screen privates and screen info */
|
||||
pScreenPriv = pWinPriv->pScreenPriv;
|
||||
pScreenInfo = pScreenPriv->pScreenInfo;
|
||||
-
|
||||
- if (pScreenInfo->fMultiWindow)
|
||||
+ if (!pScreenInfo->fGrabKeyboard)
|
||||
fPassAltTab = FALSE;
|
||||
}
|
||||
#endif
|
||||
@@ -171,11 +170,13 @@
|
||||
}
|
||||
|
||||
/* Install the hook only once */
|
||||
- if (!g_hhookKeyboardLL)
|
||||
+ if (!g_hhookKeyboardLL) {
|
||||
g_hhookKeyboardLL = SetWindowsHookEx (WH_KEYBOARD_LL,
|
||||
winKeyboardMessageHookLL,
|
||||
g_hInstance,
|
||||
0);
|
||||
+ ErrorF ("Installing keyboard hook %s\n", ((g_hhookKeyboardLL) ? "ok" : "failed"));;
|
||||
+ }
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -188,7 +189,9 @@
|
||||
void
|
||||
winRemoveKeyboardHookLL ()
|
||||
{
|
||||
- if (g_hhookKeyboardLL)
|
||||
+ if (g_hhookKeyboardLL) {
|
||||
UnhookWindowsHookEx (g_hhookKeyboardLL);
|
||||
+ ErrorF ("Uninstalled keyboard hook\n");
|
||||
+ }
|
||||
g_hhookKeyboardLL = NULL;
|
||||
}
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winprefs.c xc/programs/Xserver/hw/xwin/winprefs.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winprefs.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winprefs.c 2012-02-22 04:33:58.316268169 +0100
|
||||
@@ -48,6 +48,8 @@
|
||||
/* Where will the custom menu commands start counting from? */
|
||||
#define STARTMENUID WM_USER
|
||||
|
||||
+#define ID_TOGGLE_KBGRAB STARTMENUID
|
||||
+
|
||||
/* External global variables */
|
||||
#ifdef XWIN_MULTIWINDOW
|
||||
extern DWORD g_dwCurrentThreadID;
|
||||
@@ -66,12 +68,14 @@
|
||||
extern HICON g_hSmallIconX;
|
||||
|
||||
/* Currently in use command ID, incremented each new menu item created */
|
||||
-static int g_cmdid = STARTMENUID;
|
||||
+static int g_cmdid = STARTMENUID + 10;
|
||||
|
||||
|
||||
/* Defined in DIX */
|
||||
extern char *display;
|
||||
|
||||
+extern Bool g_fKeyboardHookLL;
|
||||
+
|
||||
/* Local function to handle comma-ified icon names */
|
||||
static HICON
|
||||
LoadImageComma (char *fname, int sx, int sy, int flags);
|
||||
@@ -276,7 +280,7 @@
|
||||
DestroyIcon (g_hSmallIconX);
|
||||
|
||||
/* Reset the custom command IDs */
|
||||
- g_cmdid = STARTMENUID;
|
||||
+ g_cmdid = STARTMENUID + 10;
|
||||
|
||||
/* Load the updated resource file */
|
||||
LoadPreferences();
|
||||
@@ -323,6 +327,18 @@
|
||||
if (pref.menu[i].menuItem[j].cmd==CMD_ALWAYSONTOP)
|
||||
CheckMenuItem (hmenu, pref.menu[i].menuItem[j].commandID, dwExStyle );
|
||||
|
||||
+ if (hwnd && g_fKeyboardHookLL) {
|
||||
+ WindowPtr pWin = GetProp (hwnd, WIN_WINDOW_PROP);
|
||||
+ winPrivWinPtr pWinPriv = winGetWindowPriv(pWin);
|
||||
+ /* Get pointers to our screen privates and screen info */
|
||||
+ winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
|
||||
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
|
||||
+ if (pScreenInfo->fGrabKeyboard)
|
||||
+ dwExStyle = MF_BYCOMMAND | MF_CHECKED;
|
||||
+ else
|
||||
+ dwExStyle = MF_BYCOMMAND | MF_UNCHECKED;
|
||||
+ CheckMenuItem (hmenu, ID_TOGGLE_KBGRAB, dwExStyle );
|
||||
+ }
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -343,6 +359,18 @@
|
||||
if (!command)
|
||||
return FALSE;
|
||||
|
||||
+ if (command == ID_TOGGLE_KBGRAB) {
|
||||
+ if (hwnd) {
|
||||
+ WindowPtr pWin = GetProp (hwnd, WIN_WINDOW_PROP);
|
||||
+ winPrivWinPtr pWinPriv = winGetWindowPriv(pWin);
|
||||
+ /* Get pointers to our screen privates and screen info */
|
||||
+ winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
|
||||
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
|
||||
+ pScreenInfo->fGrabKeyboard = !pScreenInfo->fGrabKeyboard;
|
||||
+ }
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
for (i=0; i<pref.menuItems; i++)
|
||||
{
|
||||
m = &(pref.menu[i]);
|
||||
@@ -447,6 +475,7 @@
|
||||
|
||||
|
||||
#ifdef XWIN_MULTIWINDOW
|
||||
+
|
||||
/*
|
||||
* Add the default or a custom menu depending on the class match
|
||||
*/
|
||||
@@ -492,6 +521,12 @@
|
||||
free(res_name);
|
||||
free(res_class);
|
||||
} /* Found wm_class */
|
||||
+
|
||||
+ /* Our internal hardcoded stuff .. */
|
||||
+ if (g_fKeyboardHookLL) {
|
||||
+ InsertMenu (sys, 0, MF_BYPOSITION|MF_ENABLED|MF_STRING,
|
||||
+ ID_TOGGLE_KBGRAB, "Grab Alt-TAB");
|
||||
+ }
|
||||
} /* if pwin */
|
||||
|
||||
/* Fallback to system default */
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winscrinit.c xc/programs/Xserver/hw/xwin/winscrinit.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winscrinit.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winscrinit.c 2012-02-22 04:33:58.316268169 +0100
|
||||
@@ -77,6 +77,7 @@
|
||||
extern miPointerScreenFuncRec g_winPointerCursorFuncs;
|
||||
extern int g_iScreenPrivateIndex;
|
||||
extern Bool g_fSoftwareCursor;
|
||||
+extern Bool g_fKeyboardHookLL;
|
||||
|
||||
|
||||
/*
|
||||
@@ -229,6 +230,7 @@
|
||||
pScreenInfo->dwPaddedWidth = PixmapBytePad (pScreenInfo->dwWidth,
|
||||
pScreenInfo->dwBPP);
|
||||
|
||||
+ pScreenInfo->fGrabKeyboard = g_fKeyboardHookLL;
|
||||
/* Call the engine dependent screen initialization procedure */
|
||||
if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv)))
|
||||
{
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/InitInput.c xc/programs/Xserver/hw/xwin/InitInput.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/InitInput.c 2012-03-19 16:31:21.080040361 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/InitInput.c 2012-03-19 16:33:36.773034311 +0100
|
||||
@@ -72,6 +72,7 @@
|
||||
#ifdef XKB
|
||||
void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc);
|
||||
#endif
|
||||
+extern Bool g_fKeyboardHookLL;
|
||||
|
||||
static void
|
||||
winRegisterPointerDevice(DeviceIntPtr device)
|
||||
@@ -190,6 +191,8 @@
|
||||
SetForegroundWindow(hwnd);
|
||||
LockSetForegroundWindow(LSFW_LOCK);
|
||||
SetFocus(hwnd);
|
||||
+ if (g_fKeyboardHookLL)
|
||||
+ g_fKeyboardHookLL = winInstallKeyboardHookLL ();
|
||||
}
|
||||
}
|
||||
}
|
||||
99
packaging/win32/xming/patches/xming-kioskhack.patch
Normal file
99
packaging/win32/xming/patches/xming-kioskhack.patch
Normal file
@@ -0,0 +1,99 @@
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/InitOutput.c xc/programs/Xserver/hw/xwin/InitOutput.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/InitOutput.c 2012-03-16 14:45:50.640342810 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/InitOutput.c 2012-03-16 16:11:04.331114818 +0100
|
||||
@@ -97,6 +97,7 @@
|
||||
extern FARPROC g_fpTrackMouseEvent;
|
||||
extern Bool g_fNoHelpMessageBox;
|
||||
extern Bool g_fSilentDupError;
|
||||
+extern int g_iKioskX;
|
||||
|
||||
|
||||
/*
|
||||
@@ -797,6 +798,10 @@
|
||||
/* We have to flag this as an explicit screen, even though it isn't */
|
||||
g_ScreenInfo[0].fExplicitScreen = TRUE;
|
||||
}
|
||||
+ if (getenv("NX_KIOSK_X") != NULL)
|
||||
+ {
|
||||
+ g_iKioskX = atoi(getenv("NX_KIOSK_X"));
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winglobals.c xc/programs/Xserver/hw/xwin/winglobals.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winglobals.c 2012-03-16 14:45:50.650342808 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winglobals.c 2012-03-16 16:11:04.332114818 +0100
|
||||
@@ -79,6 +79,7 @@
|
||||
Bool g_fSilentDupError = FALSE;
|
||||
Bool g_fNoIcons = FALSE;
|
||||
|
||||
+int g_iKioskX = 0;
|
||||
|
||||
/*
|
||||
* Global variables for dynamically loaded libraries and
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/win.h xc/programs/Xserver/hw/xwin/win.h
|
||||
--- xc-orig/programs/Xserver/hw/xwin/win.h 2012-03-16 14:45:50.653342808 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/win.h 2012-03-16 16:11:04.334114818 +0100
|
||||
@@ -206,6 +206,9 @@
|
||||
#define WM_TRAYICON (WM_USER + 1000)
|
||||
#define WM_INIT_SYS_MENU (WM_USER + 1001)
|
||||
#define WM_GIVEUP (WM_USER + 1002)
|
||||
+/* defined in winclipboardwndproc.c #define WM_USER_PASTE_COMPLETE (WM_USER + 1003) */
|
||||
+/* defined in winclipboardwndproc.c #define WM_USER_SET_FILTER (WM_USER + 1004) */
|
||||
+#define WM_USER_SET_KIOSK (WM_USER + 1005)
|
||||
|
||||
|
||||
/* Local includes */
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winmouse.c xc/programs/Xserver/hw/xwin/winmouse.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winmouse.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winmouse.c 2012-03-16 16:11:04.335114818 +0100
|
||||
@@ -218,11 +218,26 @@
|
||||
* Enqueue a mouse button event
|
||||
*/
|
||||
|
||||
+extern winScreenInfo g_ScreenInfo[];
|
||||
+extern int g_iLastScreen;
|
||||
+extern int g_iKioskX;
|
||||
+
|
||||
void
|
||||
winMouseButtonsSendEvent (int iEventType, int iButton)
|
||||
{
|
||||
xEvent xCurrentEvent;
|
||||
|
||||
+ if (g_iKioskX) {
|
||||
+ int FS = (-1 == g_iLastScreen) ? g_ScreenInfo[0].fFullScreen : g_ScreenInfo[g_iLastScreen].fFullScreen;
|
||||
+ if (FS) {
|
||||
+ int x = -1;
|
||||
+ int y = -1;
|
||||
+ miPointerPosition(&x, &y);
|
||||
+ if ((0 == y) && ((g_iKioskX - 1) == x))
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* Load an xEvent and enqueue the event */
|
||||
xCurrentEvent.u.u.type = iEventType;
|
||||
#if defined(XFree86Server) && defined(XINPUT)
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winwndproc.c xc/programs/Xserver/hw/xwin/winwndproc.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winwndproc.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winwndproc.c 2012-03-16 16:12:07.167112017 +0100
|
||||
@@ -66,6 +66,7 @@
|
||||
extern HWND g_hwndKeyboardFocus;
|
||||
extern Bool g_fSoftwareCursor;
|
||||
extern DWORD g_dwCurrentThreadID;
|
||||
+extern int g_iKioskX;
|
||||
|
||||
|
||||
/*
|
||||
@@ -1234,6 +1235,11 @@
|
||||
}
|
||||
break;
|
||||
|
||||
+ case WM_USER_SET_KIOSK:
|
||||
+ g_iKioskX = (int)wParam;
|
||||
+ ErrorF ("Setting Kiosk X to %d\n", g_iKioskX);
|
||||
+ return 0;
|
||||
+
|
||||
case WM_ENDSESSION:
|
||||
case WM_GIVEUP:
|
||||
/* Delete the tray Icon */
|
||||
34
packaging/win32/xming/patches/xming-logdebug.patch
Normal file
34
packaging/win32/xming/patches/xming-logdebug.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
diff -urw xc-orig/programs/Xserver/Imakefile xc/programs/Xserver/Imakefile
|
||||
--- xc-orig/programs/Xserver/Imakefile 2011-12-11 01:39:54.142570606 +0100
|
||||
+++ xc/programs/Xserver/Imakefile 2011-12-11 01:50:12.251543048 +0100
|
||||
@@ -1046,7 +1046,7 @@
|
||||
# if defined(GlxUseWindows) && GlxUseWindows
|
||||
XWINGL32 = -lopengl32
|
||||
# endif
|
||||
-XWINW32 = -luser32 -lgdi32 -lws2_32 $(XWINGL32) $(PTHREADLIB)
|
||||
+XWINW32 = -lkernel32 -luser32 -lgdi32 -lws2_32 $(XWINGL32) $(PTHREADLIB)
|
||||
#else
|
||||
XWINW32 = -luser32 -lgdi32
|
||||
#endif
|
||||
diff -urw xc-orig/programs/Xserver/os/log.c xc/programs/Xserver/os/log.c
|
||||
--- xc-orig/programs/Xserver/os/log.c 2009-03-18 18:13:46.000000000 +0100
|
||||
+++ xc/programs/Xserver/os/log.c 2011-12-11 01:56:18.599526714 +0100
|
||||
@@ -95,6 +95,7 @@
|
||||
|
||||
#ifdef WIN32
|
||||
#include <process.h>
|
||||
+#include <windows.h>
|
||||
#define getpid(x) _getpid(x)
|
||||
#endif
|
||||
|
||||
@@ -270,6 +271,10 @@
|
||||
if ((verb < 0 || logVerbosity >= verb) && len > 0)
|
||||
fwrite(tmpBuffer, len, 1, stderr);
|
||||
if ((verb < 0 || logFileVerbosity >= verb) && len > 0) {
|
||||
+#ifdef WIN32
|
||||
+ // Copy everything to windows debug buffer
|
||||
+ OutputDebugStringA(tmpBuffer);
|
||||
+#endif
|
||||
if (logFile) {
|
||||
fwrite(tmpBuffer, len, 1, logFile);
|
||||
if (logFlush) {
|
||||
29
packaging/win32/xming/patches/xming-mutex.patch
Normal file
29
packaging/win32/xming/patches/xming-mutex.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/InitOutput.c xc/programs/Xserver/hw/xwin/InitOutput.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/InitOutput.c 2010-02-26 01:08:16.471542311 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/InitOutput.c 2010-02-26 01:25:24.370543791 +0100
|
||||
@@ -1180,8 +1180,10 @@
|
||||
winCheckDisplayNumber ()
|
||||
{
|
||||
int nDisp;
|
||||
+ int i;
|
||||
HANDLE mutex;
|
||||
char name[MAX_PATH];
|
||||
+ char * fs = "";
|
||||
char * pszPrefix = '\0';
|
||||
OSVERSIONINFO osvi = {0};
|
||||
|
||||
@@ -1207,8 +1209,13 @@
|
||||
pszPrefix = "Global\\";
|
||||
}
|
||||
|
||||
+ for (i = 0; i < g_iNumScreens; ++i)
|
||||
+ if (g_ScreenInfo[i].fFullScreen) {
|
||||
+ fs = "FS";
|
||||
+ break;
|
||||
+ }
|
||||
/* Setup Cygwin/X specific part of name */
|
||||
- snprintf (name, sizeof(name), "%sCYGWINX_DISPLAY:%d", pszPrefix, nDisp);
|
||||
+ snprintf (name, sizeof(name), "%sXMING_DISPLAY%s:%d", pszPrefix, fs, nDisp);
|
||||
|
||||
/* Windows automatically releases the mutex when this process exits */
|
||||
mutex = CreateMutex (NULL, FALSE, name);
|
||||
254
packaging/win32/xming/patches/xming-optionhide.patch
Normal file
254
packaging/win32/xming/patches/xming-optionhide.patch
Normal file
@@ -0,0 +1,254 @@
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/InitInput.c xc/programs/Xserver/hw/xwin/InitInput.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/InitInput.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/InitInput.c 2010-02-23 03:52:52.416690572 +0100
|
||||
@@ -42,8 +42,8 @@
|
||||
* Local function prototypes
|
||||
*/
|
||||
|
||||
-#ifdef XWIN_CLIPBOARD
|
||||
DISPATCH_PROC(winProcEstablishConnection);
|
||||
+#ifdef XWIN_CLIPBOARD
|
||||
DISPATCH_PROC(winProcQueryTree);
|
||||
DISPATCH_PROC(winProcSetSelectionOwner);
|
||||
#endif
|
||||
@@ -60,12 +60,13 @@
|
||||
* References to external symbols
|
||||
*/
|
||||
|
||||
+extern int g_iNumScreens;
|
||||
#ifdef HAS_DEVWINDOWS
|
||||
extern int g_fdMessageQueue;
|
||||
#endif
|
||||
extern Bool g_fXdmcpEnabled;
|
||||
-#ifdef XWIN_CLIPBOARD
|
||||
extern winDispatchProcPtr winProcEstablishConnectionOrig;
|
||||
+#ifdef XWIN_CLIPBOARD
|
||||
extern winDispatchProcPtr winProcQueryTreeOrig;
|
||||
#endif
|
||||
#ifdef XKB
|
||||
@@ -176,6 +177,41 @@
|
||||
}
|
||||
|
||||
|
||||
+void
|
||||
+winDelayedShowWindow()
|
||||
+{
|
||||
+ int i;
|
||||
+ ErrorF ("winDelayedShowWindow\n");
|
||||
+ for (i = 0; i < g_iNumScreens; ++i) {
|
||||
+ if ((g_ScreenInfo[i].pScreen) && g_ScreenInfo[i].fHideInitial) {
|
||||
+ HWND hwnd = (winGetScreenPriv(g_ScreenInfo[i].pScreen))->hwndScreen;
|
||||
+ ErrorF ("winDelayedShowWindow FG %d\n", i);
|
||||
+ ShowWindow(hwnd, g_ScreenInfo[i].origShowWindowMode);
|
||||
+ SetForegroundWindow(hwnd);
|
||||
+ LockSetForegroundWindow(LSFW_LOCK);
|
||||
+ SetFocus(hwnd);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#ifndef XWIN_CLIPBOARD
|
||||
+int
|
||||
+winProcEstablishConnection (ClientPtr client)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ErrorF ("winProcEstablishConnection - Hello\n");
|
||||
+
|
||||
+ winDelayedShowWindow();
|
||||
+
|
||||
+ /* Unwrap the original function, call it, and return */
|
||||
+ InitialVector[2] = winProcEstablishConnectionOrig;
|
||||
+ ret = (*winProcEstablishConnectionOrig) (client);
|
||||
+ winProcEstablishConnectionOrig = NULL;
|
||||
+ return ret;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/* See Porting Layer Definition - p. 17 */
|
||||
void
|
||||
InitInput (int argc, char *argv[])
|
||||
@@ -186,7 +222,6 @@
|
||||
winDebug ("InitInput\n");
|
||||
#endif
|
||||
|
||||
-#ifdef XWIN_CLIPBOARD
|
||||
/*
|
||||
* Wrap some functions at every generation of the server.
|
||||
*/
|
||||
@@ -195,6 +230,7 @@
|
||||
winProcEstablishConnectionOrig = InitialVector[2];
|
||||
InitialVector[2] = winProcEstablishConnection;
|
||||
}
|
||||
+#ifdef XWIN_CLIPBOARD
|
||||
if (g_fXdmcpEnabled
|
||||
&& ProcVector[X_QueryTree] != winProcQueryTree)
|
||||
{
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/InitOutput.c xc/programs/Xserver/hw/xwin/InitOutput.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/InitOutput.c 2010-02-23 03:37:20.167701044 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/InitOutput.c 2010-02-23 03:51:21.386686516 +0100
|
||||
@@ -856,6 +856,10 @@
|
||||
"\tEXPERIMENTAL: Run the internal window manager.\n");
|
||||
#endif
|
||||
|
||||
+ ErrorF ("-hide\n"
|
||||
+ "\tInitially hide root window, then show it on first X11 client connect.\n"
|
||||
+ "\tUsed only in fullscreen and windowed mode.\n");
|
||||
+
|
||||
ErrorF ("-[no]keyhook\n"
|
||||
"\tGrab special windows key combinations like Alt-Tab or the Menu\n"
|
||||
"\tkey. These keys are discarded by default.\n");
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winclipboardwrappers.c xc/programs/Xserver/hw/xwin/winclipboardwrappers.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winclipboardwrappers.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winclipboardwrappers.c 2010-02-23 03:51:21.387687551 +0100
|
||||
@@ -177,6 +177,8 @@
|
||||
* an external client has connected.
|
||||
*/
|
||||
|
||||
+extern void winDelayedShowWindow();
|
||||
+
|
||||
int
|
||||
winProcEstablishConnection (ClientPtr client)
|
||||
{
|
||||
@@ -186,6 +188,8 @@
|
||||
|
||||
ErrorF ("winProcEstablishConnection - Hello\n");
|
||||
|
||||
+ winDelayedShowWindow();
|
||||
+
|
||||
/* Do nothing if clipboard is not enabled */
|
||||
if (!g_fClipboard)
|
||||
{
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/wincreatewnd.c xc/programs/Xserver/hw/xwin/wincreatewnd.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/wincreatewnd.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/wincreatewnd.c 2010-02-23 03:51:21.388687818 +0100
|
||||
@@ -120,13 +120,15 @@
|
||||
#ifdef XWIN_NATIVEGDI
|
||||
case WIN_SERVER_SHADOW_GDI:
|
||||
/* Show the window */
|
||||
- ShowWindow (*phwnd, SW_SHOWMAXIMIZED);
|
||||
+ ShowWindow (*phwnd, pScreenInfo->fHideInitial ? SW_HIDE : SW_SHOWMAXIMIZED);
|
||||
+ pScreenInfo->origShowWindowMode = SW_SHOWMAXIMIZED;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
/* Hide the window */
|
||||
- ShowWindow (*phwnd, SW_SHOWNORMAL);
|
||||
+ ShowWindow (*phwnd, pScreenInfo->fHideInitial ? SW_HIDE : SW_SHOWNORMAL);
|
||||
+ pScreenInfo->origShowWindowMode = SW_SHOWNORMAL;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -134,6 +136,7 @@
|
||||
UpdateWindow (*phwnd);
|
||||
|
||||
/* Attempt to bring our window to the top of the display */
|
||||
+ if (!pScreenInfo->fHideInitial)
|
||||
BringWindowToTop (*phwnd);
|
||||
|
||||
return TRUE;
|
||||
@@ -373,7 +376,8 @@
|
||||
if (fForceShowWindow)
|
||||
{
|
||||
ErrorF("winCreateBoundingWindowWindowed - Setting normal windowstyle\n");
|
||||
- ShowWindow(*phwnd, SW_SHOW);
|
||||
+ ShowWindow(*phwnd, pScreenInfo->fHideInitial ? SW_HIDE : SW_SHOW);
|
||||
+ pScreenInfo->origShowWindowMode = SW_SHOW;
|
||||
}
|
||||
|
||||
/* Get the client area coordinates */
|
||||
@@ -468,8 +472,10 @@
|
||||
#endif
|
||||
ShowWindow (*phwnd, SW_HIDE);
|
||||
}
|
||||
- else
|
||||
- ShowWindow (*phwnd, SW_SHOWNORMAL);
|
||||
+ else {
|
||||
+ ShowWindow(*phwnd, pScreenInfo->fHideInitial ? SW_HIDE : SW_SHOWNORMAL);
|
||||
+ pScreenInfo->origShowWindowMode = SW_SHOWNORMAL;
|
||||
+ }
|
||||
if (!UpdateWindow (*phwnd))
|
||||
{
|
||||
ErrorF ("winCreateBoundingWindowWindowed - UpdateWindow () failed\n");
|
||||
@@ -485,6 +491,7 @@
|
||||
#ifdef XWIN_MULTIWINDOW
|
||||
&& !pScreenInfo->fMultiWindow
|
||||
#endif
|
||||
+ && !pScreenInfo->fHideInitial
|
||||
)
|
||||
{
|
||||
if (!BringWindowToTop (*phwnd))
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/win.h xc/programs/Xserver/hw/xwin/win.h
|
||||
--- xc-orig/programs/Xserver/hw/xwin/win.h 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/win.h 2010-02-23 03:51:21.388687818 +0100
|
||||
@@ -444,6 +444,10 @@
|
||||
|
||||
/* Did the user explicitly set this screen? */
|
||||
Bool fExplicitScreen;
|
||||
+
|
||||
+ /* Did the user requested to nitially hide our window? */
|
||||
+ Bool fHideInitial;
|
||||
+ DWORD origShowWindowMode;
|
||||
} winScreenInfo, *winScreenInfoPtr;
|
||||
|
||||
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winprocarg.c xc/programs/Xserver/hw/xwin/winprocarg.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winprocarg.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winprocarg.c 2010-02-23 03:51:21.389687596 +0100
|
||||
@@ -209,6 +209,7 @@
|
||||
g_ScreenInfo[i].fUseUnixKillKey = WIN_DEFAULT_UNIX_KILL;
|
||||
g_ScreenInfo[i].fIgnoreInput = FALSE;
|
||||
g_ScreenInfo[i].fExplicitScreen = FALSE;
|
||||
+ g_ScreenInfo[i].fHideInitial = FALSE;
|
||||
}
|
||||
|
||||
/* Signal that the default screens have been initialized */
|
||||
@@ -597,6 +598,32 @@
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Look for the '-hide' argument
|
||||
+ */
|
||||
+ if (IS_OPTION ("-hide"))
|
||||
+ {
|
||||
+ /* Is this parameter attached to a screen or is it global? */
|
||||
+ if (-1 == g_iLastScreen)
|
||||
+ {
|
||||
+ int j;
|
||||
+
|
||||
+ /* Parameter is for all screens */
|
||||
+ for (j = 0; j < MAXSCREENS; j++)
|
||||
+ {
|
||||
+ g_ScreenInfo[j].fHideInitial = TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* Parameter is for a single screen */
|
||||
+ g_ScreenInfo[g_iLastScreen].fHideInitial = TRUE;
|
||||
+ }
|
||||
+
|
||||
+ /* Indicate that we have processed this argument */
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
* Look for the '-lesspointer' argument
|
||||
*/
|
||||
if (IS_OPTION ("-lesspointer"))
|
||||
diff -urw xc-orig/programs/Xserver/Imakefile xc/programs/Xserver/Imakefile
|
||||
--- xc-orig/programs/Xserver/Imakefile 2010-02-23 03:37:20.151687345 +0100
|
||||
+++ xc/programs/Xserver/Imakefile 2010-02-23 03:51:21.389687596 +0100
|
||||
@@ -1046,9 +1046,9 @@
|
||||
# if defined(GlxUseWindows) && GlxUseWindows
|
||||
XWINGL32 = -lopengl32
|
||||
# endif
|
||||
-XWINW32 = -lgdi32 -lws2_32 $(XWINGL32) $(PTHREADLIB)
|
||||
+XWINW32 = -luser32 -lgdi32 -lws2_32 $(XWINGL32) $(PTHREADLIB)
|
||||
#else
|
||||
-XWINW32 = -lgdi32
|
||||
+XWINW32 = -luser32 -lgdi32
|
||||
#endif
|
||||
XWINSYSLIBS = $(FONTLIBS) $(LDPRELIBS) $(XWINX11) $(SYSLIBS) $(XWINW32)
|
||||
|
||||
41
packaging/win32/xming/patches/xming-terminate.patch
Normal file
41
packaging/win32/xming/patches/xming-terminate.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
diff -urw xc-orig/programs/Xserver/dix/dispatch.c xc/programs/Xserver/dix/dispatch.c
|
||||
--- xc-orig/programs/Xserver/dix/dispatch.c 2009-03-18 18:13:47.000000000 +0100
|
||||
+++ xc/programs/Xserver/dix/dispatch.c 2010-03-01 02:03:20.986914924 +0100
|
||||
@@ -188,7 +188,7 @@
|
||||
|
||||
static int nextFreeClientID; /* always MIN free client ID */
|
||||
|
||||
-static int nClients; /* number of authorized clients */
|
||||
+volatile int nClients; /* number of authorized clients */
|
||||
|
||||
_X_EXPORT CallbackListPtr ClientStateCallback;
|
||||
|
||||
@@ -3617,6 +3617,7 @@
|
||||
if (client->clientState != ClientStateInitial &&
|
||||
client->clientState != ClientStateAuthenticating )
|
||||
{
|
||||
+ if (nClients > 0)
|
||||
--nClients;
|
||||
}
|
||||
}
|
||||
diff -urw xc-orig/programs/Xserver/hw/xwin/winclipboardthread.c xc/programs/Xserver/hw/xwin/winclipboardthread.c
|
||||
--- xc-orig/programs/Xserver/hw/xwin/winclipboardthread.c 2009-03-18 18:13:40.000000000 +0100
|
||||
+++ xc/programs/Xserver/hw/xwin/winclipboardthread.c 2010-03-01 02:03:47.160183052 +0100
|
||||
@@ -307,6 +307,17 @@
|
||||
/* Signal that the clipboard client has started */
|
||||
g_fClipboardStarted = TRUE;
|
||||
|
||||
+ /* Hack:
|
||||
+ * If -reset or -terminate has been specified on the cmdline,
|
||||
+ * tweak nClients in dix/dispatch.c in order to terminate the
|
||||
+ * server correctly (we are actually NOT a real client).
|
||||
+ */
|
||||
+ extern volatile char dispatchExceptionAtReset;
|
||||
+ if (dispatchExceptionAtReset) {
|
||||
+ extern volatile int nClients;
|
||||
+ nClients--;
|
||||
+ }
|
||||
+
|
||||
/* Loop for X events */
|
||||
while (1)
|
||||
{
|
||||
Reference in New Issue
Block a user