Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
22b6ac72
Unverified
Commit
22b6ac72
authored
Apr 21, 2017
by
Mihai Moldovan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sunweaver-pr/nxagent-dialog-fixes' into 3.6.x
Attributes GH PR #436:
https://github.com/ArcticaProject/nx-libs/pull/436
parents
61d5cd0b
0f67af9d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
102 deletions
+71
-102
Dialog.c
nx-X11/programs/Xserver/hw/nxagent/Dialog.c
+0
-25
Dialog.h
nx-X11/programs/Xserver/hw/nxagent/Dialog.h
+1
-16
Children.cpp
nxcomp/Children.cpp
+70
-61
No files found.
nx-X11/programs/Xserver/hw/nxagent/Dialog.c
View file @
22b6ac72
...
...
@@ -63,7 +63,6 @@ int nxagentEnableRandRModeDialogPid = 0;
int
nxagentDisableRandRModeDialogPid
=
0
;
int
nxagentEnableDeferModePid
=
0
;
int
nxagentDisableDeferModePid
=
0
;
int
nxagentDisableXkbPid
=
0
;
static
int
nxagentFailedReconnectionDialogPid
=
0
;
...
...
@@ -159,15 +158,6 @@ void nxagentResetDialog(int pid)
nxagentDisableDeferModePid
=
0
;
}
else
if
(
pid
==
nxagentDisableXkbPid
)
{
#ifdef TEST
fprintf
(
stderr
,
"nxagentResetDialog: Resetting disable XKB dialog pid [%d].
\n
"
,
nxagentDisableXkbPid
);
#endif
nxagentDisableXkbPid
=
0
;
}
}
void
nxagentLaunchDialog
(
DialogType
dialogType
)
...
...
@@ -273,15 +263,6 @@ void nxagentLaunchDialog(DialogType dialogType)
break
;
}
case
DIALOG_DISABLE_XKB
:
{
message
=
DIALOG_DISABLE_XKB_MESSAGE
;
type
=
DIALOG_DISABLE_XKB_TYPE
;
local
=
DIALOG_DISABLE_XKB_LOCAL
;
pid
=
&
nxagentDisableXkbPid
;
break
;
}
default:
{
#ifdef WARNING
...
...
@@ -521,12 +502,6 @@ void nxagentTerminateDialog(DialogType type)
break
;
}
case
DIALOG_DISABLE_XKB
:
{
pid
=
nxagentDisableXkbPid
;
break
;
}
default:
{
#ifdef WARNING
...
...
nx-X11/programs/Xserver/hw/nxagent/Dialog.h
View file @
22b6ac72
...
...
@@ -41,7 +41,6 @@ typedef enum
DIALOG_FAILED_RECONNECTION
,
DIALOG_ENABLE_DEFER_MODE
,
DIALOG_DISABLE_DEFER_MODE
,
DIALOG_DISABLE_XKB
,
DIALOG_LAST_TAG
}
DialogType
;
...
...
@@ -55,7 +54,6 @@ extern int nxagentEnableRandRModeDialogPid;
extern
int
nxagentDisableRandRModeDialogPid
;
extern
int
nxagentEnableDeferModePid
;
extern
int
nxagentDisableDeferModePid
;
extern
int
nxagentDisableXkbPid
;
extern
char
nxagentFailedReconnectionMessage
[];
...
...
@@ -74,8 +72,7 @@ extern void nxagentTerminateDialogs(void);
nxagentEnableRandRModeDialogPid == 0 && \
nxagentDisableRandRModeDialogPid == 0 && \
nxagentEnableDeferModePid == 0 && \
nxagentDisableDeferModePid == 0 && \
nxagentDisableXkbPid == 0)
nxagentDisableDeferModePid == 0)
#define DECODE_DIALOG_TYPE(type) \
((type) == DIALOG_KILL_SESSION ? "DIALOG_KILL_SESSION" : \
...
...
@@ -88,7 +85,6 @@ extern void nxagentTerminateDialogs(void);
(type) == DIALOG_FAILED_RECONNECTION ? "DIALOG_FAILED_RECONNECTION" : \
(type) == DIALOG_ENABLE_DEFER_MODE ? "DIALOG_ENABLE_DEFER_MODE" : \
(type) == DIALOG_DISABLE_DEFER_MODE ? "DIALOG_DISABLE_DEFER_MODE" : \
(type) == DIALOG_DISABLE_XKB ? "DIALOG_DISABLE_XKB" : \
"UNKNOWN_DIALOG")
/*
...
...
@@ -216,16 +212,5 @@ Ctrl+Alt+E to enable it again.\
#define DIALOG_DISABLE_DEFER_MODE_LOCAL 0
#define DIALOG_DISABLE_XKB_MESSAGE \
\
"\
Changing layout is not allowed with your current display.\
"
#define DIALOG_DISABLE_XKB_TYPE "ok"
#define DIALOG_DISABLE_XKB_LOCAL 0
#endif
/* __Dialog_H__ */
nxcomp/Children.cpp
View file @
22b6ac72
...
...
@@ -260,58 +260,63 @@ int NXTransDialog(const char *caption, const char *message,
// in the default NX path.
//
strcpy
(
command
,
"nxclient"
);
if
(
i
==
0
)
{
char
newPath
[
DEFAULT_STRING_LIMIT
]
;
strcpy
(
command
,
"nxclient"
)
;
strcpy
(
newPath
,
"/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:"
)
;
char
newPath
[
DEFAULT_STRING_LIMIT
]
;
#ifdef __APPLE__
strcpy
(
newPath
,
"/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:"
);
strcat
(
newPath
,
"/Applications/NX Client for OSX.app/Contents/MacOS:"
);
#ifdef __APPLE__
#endif
strcat
(
newPath
,
"/Applications/NX Client for OSX.app/Contents/MacOS:"
);
#ifdef __CYGWIN32__
#endif
strcat
(
newPath
,
".:"
);
#ifdef __CYGWIN32__
#endif
strcat
(
newPath
,
".:"
);
int
newLength
=
strlen
(
newPath
);
#endif
char
*
oldPath
=
getenv
(
"PATH"
);
int
newLength
=
strlen
(
newPath
);
strncpy
(
newPath
+
newLength
,
oldPath
,
DEFAULT_STRING_LIMIT
-
newLength
-
1
);
char
*
oldPath
=
getenv
(
"PATH"
);
newPath
[
DEFAULT_STRING_LIMIT
-
1
]
=
'\0'
;
strncpy
(
newPath
+
newLength
,
oldPath
,
DEFAULT_STRING_LIMIT
-
newLength
-
1
)
;
#ifdef WARNING
*
logofs
<<
"NXTransDialog: WARNING! Trying with path '"
<<
newPath
<<
"'.
\n
"
<<
logofs_flush
;
#endif
newPath
[
DEFAULT_STRING_LIMIT
-
1
]
=
'\0'
;
cerr
<<
"Warning"
<<
": Trying with path '"
<<
newPath
<<
"'.
\n
"
;
#ifdef WARNING
*
logofs
<<
"NXTransDialog: WARNING! Trying with path '"
<<
newPath
<<
"'.
\n
"
<<
logofs_flush
;
#endif
//
// Solaris doesn't seem to have
// function setenv().
//
cerr
<<
"Warning"
<<
": Trying with path '"
<<
newPath
<<
"'.
\n
"
;
#ifdef __sun
//
// Solaris doesn't seem to have
// function setenv().
//
char
newEnv
[
DEFAULT_STRING_LIMIT
+
5
];
#ifdef __sun
sprintf
(
newEnv
,
"PATH=%s"
,
newPath
)
;
char
newEnv
[
DEFAULT_STRING_LIMIT
+
5
]
;
putenv
(
newEnv
);
sprintf
(
newEnv
,
"PATH=%s"
,
newPath
);
#else
putenv
(
newEnv
);
setenv
(
"PATH"
,
newPath
,
1
);
#else
#endif
setenv
(
"PATH"
,
newPath
,
1
);
#endif
}
}
//
...
...
@@ -455,60 +460,64 @@ int NXTransClient(const char* display)
// in the default NX path.
//
strcpy
(
command
,
"nxclient"
);
if
(
i
==
0
)
{
char
newPath
[
DEFAULT_STRING_LIMIT
]
;
strcpy
(
command
,
"nxclient"
)
;
strcpy
(
newPath
,
"/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:"
)
;
char
newPath
[
DEFAULT_STRING_LIMIT
]
;
#ifdef __APPLE__
strcpy
(
newPath
,
"/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:"
);
strcat
(
newPath
,
"/Applications/NX Client for OSX.app/Contents/MacOS:"
);
#ifdef __APPLE__
#endif
strcat
(
newPath
,
"/Applications/NX Client for OSX.app/Contents/MacOS:"
);
#ifdef __CYGWIN32__
#endif
strcat
(
newPath
,
".:"
);
#ifdef __CYGWIN32__
#endif
strcat
(
newPath
,
".:"
);
int
newLength
=
strlen
(
newPath
);
#endif
char
*
oldPath
=
getenv
(
"PATH"
);
int
newLength
=
strlen
(
newPath
);
strncpy
(
newPath
+
newLength
,
oldPath
,
DEFAULT_STRING_LIMIT
-
newLength
-
1
);
char
*
oldPath
=
getenv
(
"PATH"
);
newPath
[
DEFAULT_STRING_LIMIT
-
1
]
=
'\0'
;
strncpy
(
newPath
+
newLength
,
oldPath
,
DEFAULT_STRING_LIMIT
-
newLength
-
1
)
;
#ifdef WARNING
*
logofs
<<
"NXTransClient: WARNING! Trying with path '"
<<
newPath
<<
"'.
\n
"
<<
logofs_flush
;
#endif
newPath
[
DEFAULT_STRING_LIMIT
-
1
]
=
'\0'
;
cerr
<<
"Warning"
<<
": Trying with path '"
<<
newPath
<<
"'.
\n
"
;
#ifdef WARNING
*
logofs
<<
"NXTransClient: WARNING! Trying with path '"
<<
newPath
<<
"'.
\n
"
<<
logofs_flush
;
#endif
//
// Solaris doesn't seem to have
// function setenv().
//
cerr
<<
"Warning"
<<
": Trying with path '"
<<
newPath
<<
"'.
\n
"
;
#ifdef __sun
//
// Solaris doesn't seem to have
// function setenv().
//
char
newEnv
[
DEFAULT_STRING_LIMIT
+
5
];
#ifdef __sun
sprintf
(
newEnv
,
"PATH=%s"
,
newPath
)
;
char
newEnv
[
DEFAULT_STRING_LIMIT
+
5
]
;
putenv
(
newEnv
);
sprintf
(
newEnv
,
"PATH=%s"
,
newPath
);
#else
putenv
(
newEnv
);
setenv
(
"PATH"
,
newPath
,
1
);
#else
#endif
}
setenv
(
"PATH"
,
newPath
,
1
);
#endif
}
}
//
// Hopefully useless.
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment