aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/105_nxagent_export-remote-keyboard-config.patch
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2011-12-29 09:57:30 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2011-12-29 09:57:30 +0100
commit89fea92798d1823bea3991889be4c938043a72ef (patch)
tree201d0b7a5eb63555657914437219d68c356d62c6 /debian/patches/105_nxagent_export-remote-keyboard-config.patch
parentdd287a5c8e01cbdab17c94016cf74f9c92205e13 (diff)
downloadnx-libs-89fea92798d1823bea3991889be4c938043a72ef.tar.gz
nx-libs-89fea92798d1823bea3991889be4c938043a72ef.tar.bz2
nx-libs-89fea92798d1823bea3991889be4c938043a72ef.zip
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
Diffstat (limited to 'debian/patches/105_nxagent_export-remote-keyboard-config.patch')
-rw-r--r--debian/patches/105_nxagent_export-remote-keyboard-config.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/debian/patches/105_nxagent_export-remote-keyboard-config.patch b/debian/patches/105_nxagent_export-remote-keyboard-config.patch
new file mode 100644
index 000000000..efd6e5353
--- /dev/null
+++ b/debian/patches/105_nxagent_export-remote-keyboard-config.patch
@@ -0,0 +1,79 @@
+#! /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 ||