Commit 89fea927 authored by Mike Gabriel's avatar Mike Gabriel

Add FreeNX patches for nxagent (some with other names compared to FreeNX):

- 101_nxagent_set-rgb-path.patch - 102_xserver-xext_set-securitypolicy-path.patch - 103_nxagent_set-X0-config-path.patch - 104_nxagent_enable_debug.patch - 105_nxagent_export-remote-keyboard-config.patch - 106_nxagent_utf8-copy-clipboard.patch - 107_nxagent_clipboard-compound-text+small-bed-sheets.patch - 108_nxagent_wine-close-delay.patch - 109_nxagent_locale-utf8-compound-text.patch - 200_nxagent_unbrand-agent.patch
parent dd287a5c
......@@ -8,6 +8,17 @@ nx-libs (2:3.5.0-0~x2go2) UNRELEASED; urgency=low
* Add individual watch files for NX components in this source package.
* Change naming scheme of patch files.
* Add man page for nxagent. Fix lintian warning: binary-without-manpage.
* Add FreeNX patches for nxagent (some with other names compared to FreeNX):
- 101_nxagent_set-rgb-path.patch
- 102_xserver-xext_set-securitypolicy-path.patch
- 103_nxagent_set-X0-config-path.patch
- 104_nxagent_enable_debug.patch
- 105_nxagent_export-remote-keyboard-config.patch
- 106_nxagent_utf8-copy-clipboard.patch
- 107_nxagent_clipboard-compound-text+small-bed-sheets.patch
- 108_nxagent_wine-close-delay.patch
- 109_nxagent_locale-utf8-compound-text.patch
- 200_nxagent_unbrand-agent.patch
-- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Wed, 28 Dec 2011 19:06:26 +0100
......
nx-X11/.build-exports/lib/* usr/lib/nx/X11
nx-X11/programs/Xserver/Xext/SecurityPolicy usr/share/nx
usr/bin
usr/lib/nx
usr/share/nx
\ No newline at end of file
nx-X11/programs/Xserver/nxagent usr/lib/nx
bin/nxagent usr/bin
debian/rgb usr/share/nx
debian/nxagent.keyboard etc/nxagent
## dpatch by <marceloshima@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Change the path to the keyboard configuration file
--- a/programs/Xserver/os/oscolor.c
+++ b/programs/Xserver/os/oscolor.c
@@ -53,7 +53,7 @@
#include <sys/stat.h>
#include <unistd.h>
-static char* nxAltRgbPaths[] = {"/usr/NX/share/rgb", "/usr/share/X11/rgb", "/etc/X11/rgb"};
+static char* nxAltRgbPaths[] = {"/usr/share/nx/rgb", "/usr/NX/share/rgb", "/usr/share/X11/rgb", "/etc/X11/rgb"};
static char _NXRgbPath[1024];
#endif
## dpatch by <marceloshima@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Change the path to the keyboard configuration file
--- a/programs/Xserver/Xext/security.c
+++ b/programs/Xserver/Xext/security.c
@@ -86,7 +86,7 @@
#ifdef NXAGENT_SERVER
-#define NX_ALTERNATIVEPOLICYFILE "/usr/lib/xserver/SecurityPolicy"
+#define NX_ALTERNATIVEPOLICYFILE "/usr/share/nx/SecurityPolicy"
#endif
--- a/nxagent/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Keyboard.c
@@ -136,7 +136,7 @@
#define XKB_ALTERNATE_BASE_DIRECTORY "/usr/X11R6/lib/X11/xkb"
#endif
#ifndef XKB_CONFIG_FILE
-#define XKB_CONFIG_FILE "X0-config.keyboard"
+#define XKB_CONFIG_FILE "/etc/nxagent/nxagent.keyboard"
#endif
#ifndef XKB_DFLT_RULES_FILE
#define XKB_DFLT_RULES_FILE "xfree86"
@@ -978,8 +978,7 @@
XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb);
- nxagentXkbConfigFilePathSize = strlen(XkbBaseDirectory) +
- strlen(XKB_CONFIG_FILE) + 1;
+ nxagentXkbConfigFilePathSize = strlen(XKB_CONFIG_FILE);
nxagentXkbConfigFilePath = malloc((nxagentXkbConfigFilePathSize + 1) * sizeof(char));
@@ -988,9 +987,7 @@
FatalError("nxagentKeyboardProc: malloc failed.");
}
- strcpy(nxagentXkbConfigFilePath, XkbBaseDirectory);
- strcat(nxagentXkbConfigFilePath, "/");
- strcat(nxagentXkbConfigFilePath, XKB_CONFIG_FILE);
+ strcpy(nxagentXkbConfigFilePath, XKB_CONFIG_FILE);
#ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: nxagentXkbConfigFilePath [%s].\n",
## 90_enable_debug.dpatch by <marceloshima@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
--- a/nxagent/programs/Xserver/hw/nxagent/Imakefile 2010-09-17 14:49:52.000000000 +0200
+++ b/nxagent/programs/Xserver/hw/nxagent/Imakefile 2010-09-17 15:02:43.113911514 +0200
@@ -205,7 +205,8 @@
-DNXAGENT_ONSTART \
-DNXAGENT_SPLASH \
-DNXAGENT_ARTSD \
- -UNX_DEBUG_INPUT \
+ -DNX_DEBUG_INPUT \
+ -DDEBUG \
-UPANORAMIX \
-UDEBUG_TREE
#! /bin/sh /usr/share/dpatch/dpatch-run
## 93_export_remote_keyboar_config.dpatch by <marceloshima@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Export the client keyboard configurations to a file
--- a/nxagent/programs/Xserver/hw/nxagent/Error.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Error.c
@@ -497,7 +497,7 @@
return rootPath;
}
-char *nxagentGetSessionPath()
+char *nxagentGetSessionPath(void)
{
char *rootPath;
--- a/nxagent/programs/Xserver/hw/nxagent/Error.h
+++ b/nxagent/programs/Xserver/hw/nxagent/Error.h
@@ -34,4 +34,6 @@
void nxagentEndRedirectToClientsLog(void);
+char *nxagentGetSessionPath(void);
+
#endif /* __Error_H__ */
--- a/nxagent/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Keyboard.c
@@ -52,6 +52,7 @@
#include "Keyboard.h"
#include "Events.h"
#include "Options.h"
+#include "Error.h"
#include "NXlib.h"
@@ -1770,6 +1771,42 @@
}
#endif
+ if (drulesLen != 0)
+ {
+ char *sessionpath = nxagentGetSessionPath();
+ if (sessionpath != NULL){
+ int keyboard_file_path_size = strlen(sessionpath) + strlen("/keyboard");
+ char *keyboard_file_path = malloc((keyboard_file_path_size + 1) * sizeof(char));
+ FILE *keyboard_file;
+ if ( keyboard_file_path == NULL)
+ {
+ FatalError("nxagentKeyboardProc: malloc failed.");
+ }
+ strcpy(keyboard_file_path, sessionpath);
+ strcat(keyboard_file_path, "/keyboard");
+ if ((keyboard_file = fopen(keyboard_file_path, "w")) != NULL) {
+ if ( drules != NULL )
+ fprintf(keyboard_file, "rules=%s\n", drules);
+ if ( dmodel != NULL )
+ fprintf(keyboard_file, "model=%s\n", dmodel);
+ if ( dlayout != NULL )
+ fprintf(keyboard_file, "layout=%s\n", dlayout);
+ if ( dvariant != NULL )
+ fprintf(keyboard_file, "variant=%s\n", dvariant);
+ if ( doptions != NULL )
+ fprintf(keyboard_file, "options=%s\n", doptions);
+ fclose(keyboard_file);
+ }
+ free(keyboard_file_path);
+ fprintf(stderr, "keyboard file created\n");
+ }
+ fprintf(stderr, "SessionPath not defined\n");
+ }
+ else
+ {
+ fprintf(stderr, "Failed to create the keyboard file\n");
+ }
+
if (nxagentOption(ClientOs) == ClientOsLinux &&
drules != NULL && dmodel != NULL &&
(strcmp(drules, "evdev") == 0 ||
--- a/nxagent/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Clipboard.c
@@ -166,7 +166,9 @@
if (target == XA_STRING) return True;
if (target == serverTEXT) return True;
-
+ /* by dimbor */
+ if (target == serverUTF8_STRING) return True;
+
return False;
}
@@ -402,7 +404,12 @@
lastServerProperty = X->xselectionrequest.property;
lastServerRequestor = X->xselectionrequest.requestor;
lastServerTarget = X->xselectionrequest.target;
- lastServerTime = X->xselectionrequest.time;
+
+ /* by dimbor */
+ if (lastServerTarget != XA_STRING)
+ lastServerTarget = serverUTF8_STRING;
+
+ lastServerTime = X->xselectionrequest.time;
x.u.u.type = SelectionRequest;
x.u.selectionRequest.time = GetTimeInMillis();
@@ -424,11 +431,12 @@
x.u.selectionRequest.selection = CurrentSelections[i].selection;
- /*
- * x.u.selectionRequest.target = X->xselectionrequest.target;
- */
-
- x.u.selectionRequest.target = XA_STRING;
+ /* by dimbor (idea from zahvatov) */
+ if (X->xselectionrequest.target != XA_STRING)
+ x.u.selectionRequest.target = clientUTF8_STRING;
+ else
+ x.u.selectionRequest.target = XA_STRING;
+
x.u.selectionRequest.property = clientCutProperty;
(void) TryClientEvents(lastSelectionOwner[i].client, &x, 1,
--- a/nxagent/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Clipboard.c
@@ -1226,10 +1226,11 @@
Atom xa_STRING[4];
xEvent x;
+ /* --- Order changed by dimbor (prevent sending COMPOUND_TEXT to client --- */
xa_STRING[0] = XA_STRING;
- xa_STRING[1] = clientTEXT;
- xa_STRING[2] = clientCOMPOUND_TEXT;
- xa_STRING[3] = clientUTF8_STRING;
+ xa_STRING[1] = clientUTF8_STRING;
+ xa_STRING[2] = clientTEXT;
+ xa_STRING[3] = clientCOMPOUND_TEXT;
ChangeWindowProperty(pWin,
property,
--- a/nxagent/programs/Xserver/hw/nxagent/Image.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Image.c
@@ -644,6 +644,10 @@
pDrawable -> depth != 1 &&
nxagentOption(DeferLevel) >= 1)
{
+ /* -- changed by dimbor (small "bed-sheets" never need be prevented - always put) --*/
+ if (dstHeight > 16)
+ {
+ /* -------------------------------------------------------------------------------- */
#ifdef TEST
fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on region [%d,%d,%d,%d] "
"for drawable at [%p] with drawable pixmap.\n", pRegion -> extents.x1,
@@ -654,6 +658,9 @@
nxagentMarkCorruptedRegion(pDrawable, pRegion);
goto nxagentPutImageEnd;
+ /* --- changed by dimbor ---*/
+ }
+ /* ------------------------- */
}
if (pDrawable -> type == DRAWABLE_WINDOW &&
--- a/nxagent/programs/Xserver/hw/nxagent/Window.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Window.c
@@ -176,6 +176,14 @@
static int nxagentForceExposure(WindowPtr pWin, pointer ptr);
+/* by dimbor */
+typedef struct
+{
+ CARD32 state;
+ Window icon;
+}
+nxagentWMStateRec;
+
/*
* This is currently unused.
*/
@@ -1640,6 +1648,17 @@
nxagentAddConfiguredWindow(pWin, CWStackingOrder);
nxagentAddConfiguredWindow(pWin, CW_Shape);
+ /* add by dimbor */
+ if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin))
+ {
+ Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True);
+ nxagentWMStateRec wmState;
+ wmState.state = 1; /* NormalState */
+ wmState.icon = None;
+ if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success)
+ fprintf(stderr, "nxagentRealizeWindow: Additing WM_STATE fail.\n");
+ }
+
#ifdef SHAPE
/*
@@ -1686,6 +1705,17 @@
return True;
}
+ /* add by dimbor */
+ if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin))
+ {
+ Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True);
+ nxagentWMStateRec wmState;
+ wmState.state = 3; /* WithdrawnState */
+ wmState.icon = None;
+ if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success)
+ fprintf(stderr, "nxagentUnRealizeWindow: Changing WM_STATE failed.\n");
+ }
+
XUnmapWindow(nxagentDisplay, nxagentWindow(pWin));
return True;
--- a/nxagent/programs/Xserver/hw/nxagent/Init.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Init.c
@@ -64,6 +64,9 @@
#include "NX.h"
#include "NXlib.h"
+/* by dimbor */
+#include <X11/Xlocale.h>
+
/*
* Set here the required log level.
*/
@@ -339,6 +342,20 @@
*/
blackRoot = TRUE;
+
+ /* by dimbor */
+ char *locale = setlocale(LC_ALL, "");
+ if (!locale)
+ fprintf(stderr, "InitOutput: failed to set locale, reverting to \"C\"\n");
+ else
+ {
+ if (!XSupportsLocale())
+ fprintf(stderr, "InitOutput: Locale %s not supported by X\n",locale);
+ else
+ fprintf(stderr, "InitOutput: Set %s locale\n",locale);
+ }
+ if (!XSetLocaleModifiers(""))
+ fprintf(stderr,"InitOutput: cannot set locale modifiers.\n");
}
void InitInput(argc, argv)
--- a/nxagent/programs/Xserver/hw/nxagent/Rootless.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Rootless.c
@@ -32,6 +32,10 @@
#include "NXlib.h"
+/* by dimbor */
+#include "Xatom.h"
+#include <X11/Xlocale.h>
+
/*
* Set here the required log level.
*/
@@ -100,6 +104,10 @@
static void nxagentRemovePropertyFromList(void);
+/* by dimbor */
+static char szAgentUTF8_STRING[] = "UTF8_STRING";
+static Atom agentUTF8_STRING;
+
/*
* This is currently unused.
*/
@@ -419,6 +427,28 @@
}
}
+/* by dimbor */
+char *textToUTF8String(char *text, int nitems)
+{
+ XTextProperty t_prop;
+ char *ret=NULL;
+ t_prop.value=((unsigned char *)text);
+ t_prop.nitems=nitems;
+ if (!t_prop.nitems)
+ return ret;
+ t_prop.format=8;
+ t_prop.encoding=XInternAtom(nxagentDisplay, "COMPOUND_TEXT", 0);
+ char **list;
+ int num;
+ int r = XmbTextPropertyToTextList(nxagentDisplay, &t_prop,&list, &num);
+ if ((r == Success || r > 0) && num > 0 && *list)
+ {
+ ret=(char *)strdup (*list);
+ XFreeStringList(list);
+ }
+ return ret;
+}
+
int nxagentExportAllProperty(pWin)
WindowPtr pWin;
{
@@ -464,6 +494,7 @@
if (strncmp(propertyS, "WM_", 3) != 0 &&
strncmp(propertyS, "_NET_", 5) != 0 &&
+ strncmp(propertyS, "_MOTIF_", 7) != 0 &&
strcmp(propertyS, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR") != 0)
{
#ifdef TEST
@@ -474,6 +505,7 @@
#endif
}
else if (strcmp(typeS, "STRING") == 0 ||
+ strcmp(typeS, "_MOTIF_WM_HINTS") == 0 ||
#ifndef _XSERVER64
strcmp(typeS, "CARDINAL") == 0 ||
strcmp(typeS, "WM_SIZE_HINTS") == 0 ||
@@ -483,6 +515,15 @@
output = value;
export = True;
}
+ /* add by dimbor */
+ else if (strcmp(typeS, "COMPOUND_TEXT") == 0)
+ {
+ output = textToUTF8String(value, nUnits);
+ nUnits = strlen((char *) output);
+ type = MakeAtom(szAgentUTF8_STRING, strlen(szAgentUTF8_STRING), True);
+ freeMem = True;
+ export = True;
+ }
#ifdef _XSERVER64
else if (strcmp(typeS, "CARDINAL") == 0 || strcmp(typeS, "WM_SIZE_HINTS") == 0)
{
--- a/nxagent/programs/Xserver/hw/nxagent/Screen.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Screen.c
@@ -1539,7 +1539,20 @@
#ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Created new default window with id [%ld].\n",
nxagentDefaultWindows[pScreen->myNum]);
+
+ fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window withid [%ld].\n",
+ nxagentDefaultWindows[pScreen->myNum]);
#endif
+
+ XClassHint hint;
+ hint.res_name=malloc(strlen(HINT)+1);
+ hint.res_class=malloc(strlen(HINT)+1);
+ strcpy(hint.res_name,HINT);
+ strcpy(hint.res_class,HINT);
+ XSetClassHint(nxagentDisplay,nxagentDefaultWindows[pScreen->myNum],&hint);
+ free(hint.res_name);
+ free(hint.res_class);
+
if (nxagentOption(Fullscreen))
{
--- a/nxagent/programs/Xserver/hw/nxagent/Screen.h
+++ b/nxagent/programs/Xserver/hw/nxagent/Screen.h
@@ -36,6 +36,8 @@
#define MIN_NXAGENT_HEIGHT 60
#define NXAGENT_FRAME_WIDTH 2000
+#define HINT "NXAgent"
+
#define nxagentSetPrintGeometry(screen) \
nxagentPrintGeometryFlags = (1 << (screen));
--- a/nxagent/programs/Xserver/hw/nxagent/Display.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Display.c
@@ -1861,7 +1861,7 @@
strncpy(default_path, "", 255);
strcat(icon_filename, NXAGENT_ICON_NAME);
- strcat(default_path,"/usr/NX/share/images/");
+ strcat(default_path,"/usr/share/pixmaps/");
strcat(default_path,icon_filename);
if ((icon_fp = fopen(default_path, "r")) == NULL)
--- a/nxagent/programs/Xserver/hw/nxagent/Splash.c
+++ b/nxagent/programs/Xserver/hw/nxagent/Splash.c
@@ -204,6 +204,7 @@
nxagentPixmapLogo = XCreatePixmap(nxagentDisplay, win, width, height, nxagentLogoDepth);
+ return;
if (!nxagentPixmapLogo)
{
return;
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment