diff options
author | Mihai Moldovan <ïonic@ionic.de> | 2016-06-28 23:51:14 +0000 |
---|---|---|
committer | Mihai Moldovan <ïonic@ionic.de> | 2016-07-28 03:26:00 +0000 |
commit | 6effea543d04150ca0d5aa6d4b5edadfd320ea17 (patch) | |
tree | 30d5d39db6820b46d747a6e11bd470f5934296a4 /nx-X11/programs/Xserver/hw/nxagent | |
parent | 29be5cc07bdaa22086da6d0607a1c86b07e95875 (diff) | |
download | nx-libs-6effea543d04150ca0d5aa6d4b5edadfd320ea17.tar.gz nx-libs-6effea543d04150ca0d5aa6d4b5edadfd320ea17.tar.bz2 nx-libs-6effea543d04150ca0d5aa6d4b5edadfd320ea17.zip |
nx-X11/programs/Xserver/hw/nxagent/Display.c: use new ReconnectTolerance nxagentOption in nxagentCheckForDefaultDepthCompatibility() and modify behavior based on this value.
Recognized values:
- Strict means that the old and new default depth values
must match exactly.
- Safe or Risky means that the default depth values
might differ, but the new default depth value must be at
least as high as the former default depth value. This is
recommended, because it allows clients with a
higher default depth value to still connect, but
not lose functionality.
- Bypass or higher means that all of these checks are
essentially deactivated. This is probably a very
bad idea.
Note that the default ReconnectTolerance value is still Strict.
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Display.c | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 5943fbf77..ea58437ea 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -2175,10 +2175,40 @@ void nxagentDisconnectDisplay(void) static int nxagentCheckForDefaultDepthCompatibility() { + /* + * Depending on the (reconnect) tolerance checks value, this + * function checks stricter or looser: + * - Strict means that the old and new default depth values + * must match exactly. + * - Safe or Risky means that the default depth values might differ, + * but the new default depth value must be at least as + * high as the former default depth value. This is + * recommended, because it allows clients with a + * higher default depth value to still connect, but + * not lose functionality. + * - Bypass or higher means that all of these checks are + * essentially deactivated. This is probably a very + * bad idea. + */ + int dDepth; dDepth = DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay)); + const unsigned int tolerance = nxagentOption(ReconnectTolerance); + + if (ToleranceChecksBypass <= tolerance) + { + #ifdef WARNING + fprintf(stderr, "nxagentCheckForDefaultDepthCompatibility: WARNING! Not proceeding with any checks, " + "because tolerance [%u] higher than or equal [%u]. New default depth value " + "is [%d], former default depth value is [%d].\n", tolerance, + ToleranceChecksBypass, dDepth, nxagentDefaultDepthRecBackup); + #endif + + return 1; + } + if (nxagentDefaultDepthRecBackup == dDepth) { #ifdef TEST @@ -2188,11 +2218,22 @@ static int nxagentCheckForDefaultDepthCompatibility() return 1; } + else if ((ToleranceChecksSafe <= tolerance) && (nxagentDefaultDepthRecBackup < dDepth)) + { + #ifdef WARNING + fprintf(stderr, "nxagentCheckForDefaultDepthCompatibility: WARNING! New default depth [%d] " + "higher than the old default depth [%d] at tolerance [%u].\n", dDepth, + nxagentDefaultDepthRecBackup, tolerance); + #endif + + return 1; + } else { #ifdef WARNING fprintf(stderr, "nxagentCheckForDefaultDepthCompatibility: WARNING! New default depth [%d] " - "doesn't match with old default depth [%d].\n", dDepth, nxagentDefaultDepthRecBackup); + "doesn't match with old default depth [%d] at tolerance [%u].\n", dDepth, + nxagentDefaultDepthRecBackup, tolerance); #endif return 0; |