This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository nx-libs. from 427ac34 release 3.5.99.18 new f729ac9 rrdispatch.c: remove obsolete ifdef new 34e4291 Screen.c: simplify and fix handling of rootless mode new 5bbab00 Screen.c: code optimization for rootless mode new 16cd2bb nxagent: rework Bool handling new b61934b Merge branch 'uli42-pr/misc' into 3.6.x new 586742b Revert "nxagent: rework Bool handling" new 24d7d0f Merge branch 'uli42-pr/revert' into 3.6.x new f1b27c4 keystrokes.cfg: Add missing Shift=1 for viewport_move_up/down/right new a3dc87d Merge branch 'uli42-pr/fix_keystrokes' into 3.6.x new bfc05af nxproxy: list known session types in help output new fc29077 Keyboard.c: fix comment. new 66315e4 Merge branch 'uli42-pr/session_types' into 3.6.x new 3572b25 Regression fix for bfc05af7. Properly end lines in help/usage text. new de421e4 Revert "Fix parsing ports set to unix sockets" new 36a7f04 nx-X11/lib/configure.ac: Assure that the USE_DYNAMIC_XCURSOR macro is defined at build-time. new 0eb71d7 Merge branch 'gh-sunweaver/pr/xlib-loadable-modules' into 3.6.x new 71a3b84 nx-X11/lib/configure.ac: fix version number new f2e48fb nx-X11/lib/configure.ac: add forgotten status line new a70e36c ConnDis.c: remove obsolete MNX_TCPCONN new c81a457 Use calloc to zero fill buffers being allocated for replies & events new c6b6a8f Use C99 designated initializers in various extension Replies new e7a5007 xfixes: use calloc for some structs new d156ce5 Merge branch 'uli42-pr/xfixes_memset' into 3.6.x new 4713429 Fix: clang does not know about gnu_printf new 0e481f8 nxcomp: fix unused variable new 0934b1e nxcomp: fix unused variables new e1f2a24 xlib: remove superflous parens new a8ed282 Xlib: remove register keywords new 74fe99d xcompshad: remove unused variables new a53c655 Logger.h: fix missing compiler attribute new 059028c Logger.h: remove pragma, correct attributes new 7c8214f GenericReply.h: remove unused variable new 176f9b4 Merge branch 'uli42-pr/fix_clang_warnings' into 3.6.x new ebd1ea0 .travis.yml: move from Ubuntu Trusty to Xenial. new f2a1e87 .travis.yml: Update clang-6.0 to clang-7 new 440ce3f .travis.yml: add some soft requirements new 4538d21 Merge branch 'mjtrangoni-move-to-xenial' into 3.6.x new 486cc6f add nxdialog for displaying dialogs new 2aa575f nxdialog: pylint improvements new 3a097e6 nxdialog: use gtk3 instead of gtk2 new 57700cd nxdialog: convert from optparse to argparse new acffe15 nxdialog: make code compatible to python2 _and_ python3 new 07052a2 nxdialog: allow to provide --parent 0 for testing new d0e40f8 nxdialog: add example call new df79c3b Merge branch 'uli42-pr/add_nxdialog' into 3.6.x new 57ca69f nxdialog: Turn into autotools project, add man page. new 6812657 Makefile: Integrate new subproject "nxdialog". new ae565e1 Merge branch 'sunweaver-pr/nxdialog-autotools' into 3.6.x new 00f8d49 debian/*: Debianize package inclusion of nxdialog (ships with nxagent bin:pkg for now). new ca8d889 debian/libnx-x11-6.symbols: Update symbols. new ff1b3e9 nxdialog: Allow user to specify hexadecimal X11 window IDs. new 400b627 nx-libs.spec: Dropping nxdialog files from installation for now when building RPMs. Postponing nxdialog integration with RPM packaging for now. new da9a1bc debian/patches: Add 2004_enforce-lpthread.patch. On Debian, enforce -lpthread when building nxcomp. This is a nasty work around for a missing symbols issue that needs to get addressed otherwise in later release. new 59305c8 release 3.5.99.19 The 54 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: .travis.yml | 37 ++- ChangeLog | 228 ++++++++++++- Makefile | 8 + VERSION | 2 +- debian/changelog | 7 + debian/control | 5 +- debian/libnx-x11-6.symbols | 6 +- debian/nxagent.install | 2 + debian/patches/2003_nxdialog-use-python3.patch | 11 + debian/patches/2004_enforce-lpthread.patch | 33 ++ debian/patches/series | 2 + etc/keystrokes.cfg | 12 +- nx-X11/lib/configure.ac | 36 ++- nx-X11/lib/include/X11/Xlibint.h | 18 +- nx-X11/lib/src/ConnDis.c | 2 +- nx-X11/lib/src/xkb/XKBBind.c | 2 +- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 4 +- nx-X11/programs/Xserver/Xext/sync.c | 2 +- nx-X11/programs/Xserver/damageext/damageext.c | 10 +- nx-X11/programs/Xserver/dbe/dbe.c | 34 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 3 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 15 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 50 ++- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 2 +- nx-X11/programs/Xserver/randr/rrdispatch.c | 4 - nx-X11/programs/Xserver/record/record.c | 35 +- nx-X11/programs/Xserver/render/render.c | 18 +- nx-X11/programs/Xserver/xfixes/cursor.c | 24 +- nx-X11/programs/Xserver/xfixes/region.c | 4 +- nx-X11/programs/Xserver/xfixes/xfixes.c | 11 +- nx-libs.spec | 6 +- nxcomp/src/GenericReply.h | 1 - nxcomp/src/Loop.cpp | 6 +- nxcomp/src/Misc.cpp | 7 +- nxcomp/src/Timestamp.cpp | 1 - nxcomp/src/TranslateCoords.h | 8 +- nxcompshad/src/Logger.h | 15 +- nxcompshad/src/X11.h | 4 - {nxproxy => nxdialog}/Makefile.am | 4 +- nxdialog/README.md | 23 ++ {nxproxy => nxdialog}/VERSION | 0 nxdialog/bin/Makefile.am | 3 + nxdialog/bin/nxdialog | 395 +++++++++++++++++++++++ nxdialog/configure.ac | 22 ++ {nxproxy => nxdialog}/man/Makefile.am | 2 +- nxdialog/man/nxdialog.1 | 72 +++++ nxproxy/man/nxproxy.1 | 2 +- 47 files changed, 1027 insertions(+), 171 deletions(-) create mode 100644 debian/patches/2003_nxdialog-use-python3.patch create mode 100644 debian/patches/2004_enforce-lpthread.patch copy {nxproxy => nxdialog}/Makefile.am (94%) create mode 100644 nxdialog/README.md copy {nxproxy => nxdialog}/VERSION (100%) create mode 100644 nxdialog/bin/Makefile.am create mode 100755 nxdialog/bin/nxdialog create mode 100644 nxdialog/configure.ac copy {nxproxy => nxdialog}/man/Makefile.am (66%) create mode 100644 nxdialog/man/nxdialog.1 -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit f729ac996cef9fef7fe963b7b6c9de93fc8eb2cf Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 7 21:40:05 2019 +0100 rrdispatch.c: remove obsolete ifdef --- nx-X11/programs/Xserver/randr/rrdispatch.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c index 68d3b97..0626561 100644 --- a/nx-X11/programs/Xserver/randr/rrdispatch.c +++ b/nx-X11/programs/Xserver/randr/rrdispatch.c @@ -64,11 +64,7 @@ ProcRRQueryVersion(ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } -#ifndef NXAGENT_SERVER - WriteToClient(client, sizeof(xRRQueryVersionReply), &rep); -#else WriteToClient(client, sizeof(xRRQueryVersionReply), &rep); -#endif return Success; } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit b61934be2e9b4a8d3112270b0e691d47f99ba39f Merge: 427ac34 16cd2bb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Feb 13 12:32:06 2019 +0100 Merge branch 'uli42-pr/misc' into 3.6.x Attributes GH PR #766: https://github.com/ArcticaProject/nx-libs/pull/766 nx-X11/programs/Xserver/hw/nxagent/Args.c | 32 ++++---- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 34 ++++---- nx-X11/programs/Xserver/hw/nxagent/Events.c | 98 +++++++++++------------ nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/GC.c | 26 +++--- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 32 ++++---- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 36 ++++----- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXglxext.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 10 +-- nx-X11/programs/Xserver/hw/nxagent/Render.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 100 ++++++++++++------------ nx-X11/programs/Xserver/hw/nxagent/Trap.c | 26 +++--- nx-X11/programs/Xserver/hw/nxagent/Trap.h | 8 ++ nx-X11/programs/Xserver/hw/nxagent/Window.c | 40 +++++----- nx-X11/programs/Xserver/randr/rrdispatch.c | 4 - 31 files changed, 283 insertions(+), 285 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 24d7d0faa4b5c12c691599bf61bae5cfe1ef4120 Merge: b61934b 586742b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Feb 15 11:45:14 2019 +0100 Merge branch 'uli42-pr/revert' into 3.6.x Attributes GH PR #773: https://github.com/ArcticaProject/nx-libs/pull/773 Fixes ArcticaProject/nx-libs#772. nx-X11/programs/Xserver/hw/nxagent/Args.c | 32 ++++---- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 34 ++++----- nx-X11/programs/Xserver/hw/nxagent/Events.c | 98 ++++++++++++------------- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/GC.c | 26 +++---- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 32 ++++---- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 36 ++++----- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXglxext.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 10 +-- nx-X11/programs/Xserver/hw/nxagent/Render.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 52 ++++++------- nx-X11/programs/Xserver/hw/nxagent/Trap.c | 26 +++---- nx-X11/programs/Xserver/hw/nxagent/Trap.h | 8 -- nx-X11/programs/Xserver/hw/nxagent/Window.c | 40 +++++----- 30 files changed, 255 insertions(+), 261 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 5bbab001a7909b665683e577bc47794edfd294d4 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 7 23:06:58 2019 +0100 Screen.c: code optimization for rootless mode In rootless mode skip processing user geometry stuff since the values will we overwritten later anyway. --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 103cd1d..9ba217c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -885,10 +885,10 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, #endif /* - * Forced geometry parameter to user geometry. + * Force geometry parameter to user geometry except if in rootless mode. */ - if (nxagentResizeDesktopAtStartup) + if (nxagentResizeDesktopAtStartup && !nxagentOption(Rootless)) { if (nxagentUserGeometry.flag & XValue) { @@ -922,9 +922,11 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, /* * This is first time the screen is initialized. * Filling the geometry parameter from user geometry. + * we do not need this in rootless mode since we ignore + * user geometry then. */ - if (nxagentReconnectTrap == False) + if (nxagentReconnectTrap == False && !nxagentOption(Rootless)) { if (nxagentUserGeometry.flag & XValue) { @@ -1067,7 +1069,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, else /* window mode */ { /* - * screen is initialized for the first time + * screen is initialized for the first time. */ if (nxagentReconnectTrap == False) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 16cd2bbe1c4425e3fa557f9ca0723aa94a50b071 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Feb 8 00:44:48 2019 +0100 nxagent: rework Bool handling drop "== False", "== 0", "== True" and "== 0" for nxagentOptions and Traps --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 32 ++++---- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 34 ++++----- nx-X11/programs/Xserver/hw/nxagent/Events.c | 98 ++++++++++++------------- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/GC.c | 26 +++---- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 32 ++++---- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 36 +++++---- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXglxext.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 10 +-- nx-X11/programs/Xserver/hw/nxagent/Render.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 52 ++++++------- nx-X11/programs/Xserver/hw/nxagent/Trap.c | 26 +++---- nx-X11/programs/Xserver/hw/nxagent/Trap.h | 8 ++ nx-X11/programs/Xserver/hw/nxagent/Window.c | 40 +++++----- 30 files changed, 261 insertions(+), 255 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 949892f..57bcfa4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -522,7 +522,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) sscanf(argv[i], "%i", &level) == 1 && level >= 0 && level <= 2) { - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentChangeOption(DeferLevel, level); @@ -624,7 +624,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) } } - if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen) == 1)) return 2; + if (nxagentUserGeometry.flag || nxagentOption(Fullscreen)) return 2; } return 0; @@ -1122,7 +1122,7 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "render")) { - if (nxagentReconnectTrap == True) + if (nxagentReconnectTrap) { #ifdef DEBUG fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'render' at reconnection.\n"); @@ -1154,7 +1154,7 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "fullscreen")) { - if (nxagentReconnectTrap == True) + if (nxagentReconnectTrap) { #ifdef DEBUG fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'fullscreen' at reconnection.\n"); @@ -1267,13 +1267,13 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "resize")) { - if (nxagentOption(DesktopResize) == 0 || strcmp(value, "0") == 0) + if (!nxagentOption(DesktopResize) || strcmp(value, "0") == 0) { - nxagentResizeDesktopAtStartup = 0; + nxagentResizeDesktopAtStartup = False; } else if (strcmp(value, "1") == 0) { - nxagentResizeDesktopAtStartup = 1; + nxagentResizeDesktopAtStartup = True; } else { @@ -1324,7 +1324,7 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "autodpi")) { - if (nxagentReconnectTrap == True) + if (nxagentReconnectTrap) { #ifdef DEBUG fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'autodpi' at reconnection.\n"); @@ -1793,7 +1793,7 @@ N/A #endif - if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen) == 1) + if (nxagentOption(Rootless) && nxagentOption(Fullscreen)) { #ifdef TEST fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); @@ -2092,7 +2092,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. nxagentAlphaEnabled = False; } - if ((nxagentOption(Rootless) == 1) && nxagentOption(Xdmcp)) + if (nxagentOption(Rootless) && nxagentOption(Xdmcp)) { FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n"); } @@ -2102,7 +2102,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. * XDMCP sessions. */ - if (nxagentOption(Reset) == True && nxagentMaxAllowedResets == 0) + if (nxagentOption(Reset) && nxagentMaxAllowedResets == 0) { #ifdef WARNING fprintf(stderr, "nxagentPostProcessArgs: Disabling the server reset.\n"); @@ -2119,7 +2119,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. * to a standard XFree86 server. */ - if (nxagentOption(Reset) == False) + if (!nxagentOption(Reset)) { #ifdef TEST fprintf(stderr, "nxagentPostProcessArgs: Disabling dispatch of exception at server reset.\n"); @@ -2399,7 +2399,7 @@ void nxagentSetDeferLevel(void) * of the agent. */ - if (nxagentOption(Streaming) == 1) + if (nxagentOption(Streaming)) { fprintf(stderr, "Warning: Streaming of images not available in this agent.\n"); @@ -2484,7 +2484,7 @@ void nxagentSetDeferLevel(void) * Set the defer timeout. */ - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow)) { #ifdef TEST fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer timeout parameter in shadow mode.\n"); @@ -2499,7 +2499,7 @@ void nxagentSetDeferLevel(void) * Set the defer level. */ - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow) ) { #ifdef TEST fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer parameter in shadow mode.\n"); @@ -2631,7 +2631,7 @@ void nxagentSetScheduler(void) * The smart scheduler is the default. */ - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow)) { #ifdef TEST fprintf(stderr, "nxagentSetScheduler: Using the dumb scheduler in shadow mode.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index e486718..4cdcda9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -59,7 +59,7 @@ void nxagentCompositeExtensionInit(void) nxagentCompositeEnable = 0; - if (nxagentOption(Composite) == 1) + if (nxagentOption(Composite)) { int eventBase, errorBase; @@ -119,7 +119,7 @@ void nxagentRedirectDefaultWindows(void) { int i; - if (nxagentOption(Rootless) == 1 || + if (nxagentOption(Rootless) || nxagentCompositeEnable == 0) { #ifdef TEST @@ -159,7 +159,7 @@ void nxagentRedirectDefaultWindows(void) void nxagentRedirectWindow(WindowPtr pWin) { - if (nxagentOption(Rootless) == 0 || + if (!nxagentOption(Rootless) || nxagentCompositeEnable == 0) { #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c index a67115c..41aa773 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -134,7 +134,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor) cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None; - if (nxagentOption(Rootless) == False) + if (!nxagentOption(Rootless)) { XDefineCursor(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 1278749..89a191d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -313,7 +313,7 @@ static void nxagentSighupHandler(int signal) } else if (nxagentSessionState == SESSION_UP) { - if (nxagentOption(Persistent) == 1) + if (nxagentOption(Persistent)) { #ifdef TEST fprintf(stderr, "nxagentSighupHandler: Handling the signal by disconnecting the agent.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 88f3da3..a1eb08a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -148,7 +148,7 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre pDrawable = nxagentSplitDrawable(pDrawable); - if (nxagentLosslessTrap == 0) + if (!nxagentLosslessTrap) { if (nxagentDrawableStatus(pDrawable) == Synchronized) { @@ -171,15 +171,15 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre * transferred in a single operation. */ - nxagentFBTrap = 1; + nxagentFBTrap = True; - nxagentSplitTrap = 1; + nxagentSplitTrap = True; result = nxagentSynchronizeDrawableData(pDrawable, breakMask, owner); - nxagentSplitTrap = 0; + nxagentSplitTrap = False; - nxagentFBTrap = 0; + nxagentFBTrap = False; if (wait == DO_WAIT && nxagentSplitResource(pDrawable) != NULL) { @@ -253,7 +253,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask * compression turned off. */ - if (nxagentLosslessTrap == 1) + if (nxagentLosslessTrap) { pGC = nxagentGetGraphicContext(pDrawable); @@ -285,7 +285,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask goto nxagentSynchronizeDrawableDataEnd; } - else if (nxagentReconnectTrap == 1) + else if (nxagentReconnectTrap) { /* * The pixmap data is not synchronized unless @@ -298,7 +298,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask { #ifdef TEST - if (nxagentReconnectTrap == 1) + if (nxagentReconnectTrap) { static int totalLength; static int totalReconnectedPixmaps; @@ -586,11 +586,11 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned saveTrap = nxagentGCTrap; - nxagentGCTrap = 0; + nxagentGCTrap = False; - nxagentFBTrap = 1; + nxagentFBTrap = True; - nxagentSplitTrap = 1; + nxagentSplitTrap = True; pGC = nxagentGetGraphicContext(pDrawable); @@ -894,7 +894,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (owner != NULL) { - if (nxagentOption(Shadow) == 1 && + if (nxagentOption(Shadow) && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE)) { @@ -945,15 +945,15 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentSynchronizeRegionStop: - nxagentSplitTrap = 0; + nxagentSplitTrap = False; - nxagentFBTrap = 0; + nxagentFBTrap = False; nxagentGCTrap = saveTrap; success = 1; - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { if (nxagentSynchronization.abort == 1) { @@ -1025,7 +1025,7 @@ nxagentSynchronizeRegionStop: w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1; h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1; - if (nxagentOption(Shadow) == 1 && + if (nxagentOption(Shadow) && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE)) { @@ -2633,7 +2633,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) saveTrap = nxagentGCTrap; - nxagentGCTrap = 1; + nxagentGCTrap = True; if (nxagentDrawableStatus(pDrawable) == Synchronized) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 5281b4b..81d6c98 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -583,13 +583,13 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentChangeOption(DesktopResize, !desktopResize); - if (nxagentOption(DesktopResize) == 0) + if (!nxagentOption(DesktopResize)) { fprintf(stderr,"Info: Disabled desktop resize mode in agent.\n"); nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE); - if (nxagentOption(Fullscreen) == 0) + if (!nxagentOption(Fullscreen)) { nxagentSetWMNormalHintsMaxsize(pScreen, nxagentOption(RootWidth), @@ -621,7 +621,7 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen) nxagentChangeOption(DesktopResize, !desktopResize); - if (nxagentOption(DesktopResize) == 0) + if (!nxagentOption(DesktopResize)) { nxagentShadowSetRatio(1.0, 1.0); @@ -1048,7 +1048,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } case doSwitchResizeMode: { - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { if (nxagentNoDialogIsRunning) { @@ -1096,7 +1096,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentRemoveDuplicatedKeys(&X); } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && result == doNothing) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1147,17 +1147,17 @@ FIXME: Don't enqueue the KeyRelease event if the key was { if (X.xkey.keycode == nxagentCapsLockKeycode) { - nxagentXkbCapsTrap = 1; + nxagentXkbCapsTrap = True; } else if (X.xkey.keycode == nxagentNumLockKeycode) { - nxagentXkbNumTrap = 1; + nxagentXkbNumTrap = True; } nxagentInitXkbKeyboardState(); - nxagentXkbCapsTrap = 0; - nxagentXkbNumTrap = 0; + nxagentXkbCapsTrap = False; + nxagentXkbNumTrap = False; } memset(&x, 0, sizeof(xEvent)); @@ -1181,7 +1181,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was CriticalOutputPending = 1; - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1204,7 +1204,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (nxagentOption(Fullscreen)) { - if ( (nxagentOption(MagicPixel) == 1) && (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y)) ) + if ( nxagentOption(MagicPixel) && (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y)) ) { pScreen = nxagentScreen(X.xbutton.window); @@ -1219,7 +1219,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was closeSession = TRUE; } - if (nxagentOption(DesktopResize) == False && + if (!nxagentOption(DesktopResize) && (X.xbutton.state & (ControlMask | Mod1Mask)) == (ControlMask | Mod1Mask)) { /* @@ -1275,7 +1275,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was CriticalOutputPending = 1; } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xbutton.x -= nxagentOption(RootX); X.xbutton.y -= nxagentOption(RootY); @@ -1349,7 +1349,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was CriticalOutputPending = 1; } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xbutton.x -= nxagentOption(RootX); X.xbutton.y -= nxagentOption(RootY); @@ -1410,7 +1410,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) && X.xmotion.x_root < (nxagentLastEnteredTopLevelWindow -> drawable.x + (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) + 50) && - nxagentOption(Menu) == 1) + nxagentOption(Menu)) { nxagentPulldownDialog(nxagentLastEnteredTopLevelWindow -> drawable.id); } @@ -1464,7 +1464,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was viewportLastY = X.xmotion.y; } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) && !viewportCursor) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && !viewportCursor) { X.xmotion.x -= nxagentOption(RootX); X.xmotion.y -= nxagentOption(RootY); @@ -1482,7 +1482,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was NXShadowEvent(nxagentDisplay, X); } - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentInputEvent = 1; } @@ -1575,7 +1575,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was x.u.u.detail = i * 8 + k; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { xM.type = KeyRelease; xM.xkey.display = nxagentDisplay; @@ -1672,14 +1672,14 @@ FIXME: Don't enqueue the KeyRelease event if the key was mask = CWX | CWY; - nxagentScreenTrap = 1; + nxagentScreenTrap = True; ConfigureWindow(pWin, mask, (XID *) values, pClient); - nxagentScreenTrap = 0; + nxagentScreenTrap = False; } - if (nxagentOption(Fullscreen) == 1 && + if (nxagentOption(Fullscreen) && X.xcrossing.window == nxagentFullscreenWindow && X.xcrossing.detail != NotifyInferior) { @@ -1803,7 +1803,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was { int value = X.xvisibility.state; - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { TraverseTree(pWin, nxagentChangeVisibilityPrivate, &value); } @@ -1970,22 +1970,22 @@ FIXME: Don't enqueue the KeyRelease event if the key was fprintf(stderr, "nxagentDispatchEvents: Going to handle new UnmapNotify event.\n"); #endif - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { if ((pWin = nxagentRootlessTopLevelWindow(X.xunmap.window)) != NULL || ((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL && nxagentWindowTopLevel(pWin) == 1)) { - nxagentScreenTrap = 1; + nxagentScreenTrap = True; UnmapWindow(pWin, False); - nxagentScreenTrap = 0; + nxagentScreenTrap = False; } } - if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && - nxagentOption(Nested) == 0 && + if (nxagentUseNXTrans == 1 && !nxagentOption(Rootless) && + !nxagentOption(Nested) && X.xmap.window != nxagentIconWindow) { nxagentVisibility = VisibilityFullyObscured; @@ -2002,7 +2002,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was fprintf(stderr, "nxagentDispatchEvents: Going to handle new MapNotify event.\n"); #endif - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { Bool value = 1; @@ -2012,11 +2012,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was { pClient = wClient(pWin); - nxagentScreenTrap = 1; + nxagentScreenTrap = True; MapWindow(pWin, pClient); - nxagentScreenTrap = 0; + nxagentScreenTrap = False; } if (pWin != NULL) @@ -2025,7 +2025,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was } } - if (nxagentOption(AllScreens) == 1) + if (nxagentOption(AllScreens)) { if (X.xmap.window == nxagentIconWindow) { @@ -2034,7 +2034,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was } } - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { nxagentVisibility = VisibilityUnobscured; nxagentVisibilityStop = False; @@ -2155,7 +2155,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (switchFullscreen) { - if (nxagentOption(AllScreens) == 1 && nxagentOption(Fullscreen) == 1) + if (nxagentOption(AllScreens) && nxagentOption(Fullscreen)) { nxagentSwitchAllScreens(pScreen, 0); } @@ -2167,7 +2167,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (switchAllScreens) { - if (nxagentOption(AllScreens) == 0 && nxagentOption(Fullscreen) == 1) + if (!nxagentOption(AllScreens) && nxagentOption(Fullscreen)) { nxagentSwitchFullscreen(pScreen, 0); } @@ -2310,17 +2310,17 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) { if (X -> xkey.keycode == nxagentCapsLockKeycode) { - nxagentXkbCapsTrap = 1; + nxagentXkbCapsTrap = True; } else if (X -> xkey.keycode == nxagentNumLockKeycode) { - nxagentXkbNumTrap = 1; + nxagentXkbNumTrap = True; } nxagentInitXkbKeyboardState(); - nxagentXkbCapsTrap = 0; - nxagentXkbNumTrap = 0; + nxagentXkbCapsTrap = False; + nxagentXkbNumTrap = False; } if (nxagentCheckSpecialKeystroke(&X -> xkey, result)) @@ -3208,7 +3208,7 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X) int nxagentHandleConfigureNotify(XEvent* X) { - if (nxagentOption(Rootless) == True) + if (nxagentOption(Rootless)) { ClientPtr pClient; WindowPtr pWinWindow; @@ -3281,11 +3281,11 @@ int nxagentHandleConfigureNotify(XEvent* X) mask |= CWHeight | CWWidth | CWBorderWidth; - nxagentScreenTrap = 1; + nxagentScreenTrap = True; ConfigureWindow(pWinWindow, mask, (XID *) values, pClient); - nxagentScreenTrap = 0; + nxagentScreenTrap = False; nxagentCheckWindowConfiguration((XConfigureEvent*)X); @@ -3358,7 +3358,7 @@ int nxagentHandleConfigureNotify(XEvent* X) if (X -> xconfigure.window == nxagentDefaultWindows[pScreen -> myNum]) { - if (nxagentOption(AllScreens) == 0) + if (!nxagentOption(AllScreens)) { /* * - WITHOUT window manager any position change is relevant @@ -3370,7 +3370,7 @@ int nxagentHandleConfigureNotify(XEvent* X) int newX = X -> xconfigure.x; int newY = X -> xconfigure.y; - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize)) { if (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height || @@ -3434,7 +3434,7 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentChangeOption(Y, newY); } - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 && + if (nxagentOption(Shadow) && nxagentOption(DesktopResize) && (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height)) { @@ -3454,7 +3454,7 @@ int nxagentHandleConfigureNotify(XEvent* X) /* if in shadowing mode or if neither size nor position have changed we do not need to adjust RandR */ /* FIXME: Comment makes no sense */ - if (nxagentOption(Shadow) == 1 || + if (nxagentOption(Shadow) || (nxagentOption(Width) == nxagentOption(RootWidth) && nxagentOption(Height) == nxagentOption(RootHeight) && nxagentOption(X) == nxagentOption(RootX) && @@ -3469,7 +3469,7 @@ int nxagentHandleConfigureNotify(XEvent* X) XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, X -> xconfigure.width, X -> xconfigure.height); - if (nxagentOption(Fullscreen) == 0) + if (!nxagentOption(Fullscreen)) { nxagentMoveViewport(pScreen, 0, 0); } @@ -3639,7 +3639,7 @@ int nxagentHandleReparentNotify(XEvent* X) return 1; } - else if (nxagentWMIsRunning && nxagentOption(Fullscreen) == 0 && + else if (nxagentWMIsRunning && !nxagentOption(Fullscreen) && nxagentOption(WMBorderWidth) == -1) { XlibWindow w; @@ -4415,7 +4415,7 @@ int nxagentUserInput(void *p) * tus. */ - if (nxagentOption(Shadow) == 1 && + if (nxagentOption(Shadow) && nxagentPendingEvents(nxagentDisplay) > 0) { nxagentDispatchEvents(NULL); @@ -4436,7 +4436,7 @@ int nxagentUserInput(void *p) * order to update the screen smoothly. */ - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow)) { return result; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 785724c..1681910 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -396,7 +396,7 @@ void nxagentRandRSetWindowsSize(int width, int height) { if (width == 0) { - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } @@ -408,7 +408,7 @@ void nxagentRandRSetWindowsSize(int width, int height) if (height == 0) { - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } @@ -420,7 +420,7 @@ void nxagentRandRSetWindowsSize(int width, int height) XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height); - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width, height); @@ -434,8 +434,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, UpdateCurrentTime(); - if (nxagentOption(DesktopResize) == 1 && - (nxagentOption(Fullscreen) == 1 || + if (nxagentOption(DesktopResize) && + (nxagentOption(Fullscreen) || width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) || height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)))) { @@ -446,8 +446,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, } } - if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 && - nxagentOption(AllScreens) == 0) + if (nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) && + !nxagentOption(AllScreens)) { nxagentChangeOption(Width, width); nxagentChangeOption(Height, height); @@ -455,8 +455,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight); - if (result == 1 && nxagentOption(DesktopResize) == 1 && - nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0) + if (result == 1 && nxagentOption(DesktopResize) && + !nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) { nxagentRandRSetWindowsSize(width, height); nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 2fac2f1..2facc72 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -385,7 +385,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) else { if (nxagentDrawableStatus((DrawablePtr) pGC -> tile.pixmap) == NotSynchronized && - nxagentGCTrap == 0) + !nxagentGCTrap) { /* * If the tile is corrupted and is not too @@ -437,7 +437,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) if (mask & GCStipple) { if (nxagentDrawableStatus((DrawablePtr) pGC -> stipple) == NotSynchronized && - nxagentGCTrap == 0) + !nxagentGCTrap) { #ifdef TEST fprintf(stderr, "nxagentChangeGC: WARNING! Synchronizing GC at [%p] due the stipple at [%p].\n", @@ -535,7 +535,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) { mask &= ~GCDashList; - if (nxagentGCTrap == 0) + if (!nxagentGCTrap) { XSetDashes(nxagentDisplay, nxagentGC(pGC), pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList); @@ -549,7 +549,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) changeFlag += nxagentTestGC(values.arc_mode, arc_mode); } - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { #ifdef TEST fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n", @@ -668,7 +668,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) { case CT_NONE: { - if (clipsMatch == 0 && nxagentGCTrap == 0) + if (clipsMatch == 0 && !nxagentGCTrap) { XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); } @@ -677,7 +677,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_REGION: { - if (clipsMatch == 0 && nxagentGCTrap == 0) + if (clipsMatch == 0 && !nxagentGCTrap) { nRects = RegionNumRects((RegionPtr)pValue); size = nRects * sizeof(*pRects); @@ -701,7 +701,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_PIXMAP: { - if (nxagentGCTrap == 0) + if (!nxagentGCTrap) { XSetClipMask(nxagentDisplay, nxagentGC(pGC), nxagentPixmap((PixmapPtr)pValue)); @@ -719,7 +719,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_UNSORTED: { - if (clipsMatch == 0 && nxagentGCTrap == 0) + if (clipsMatch == 0 && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -730,7 +730,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YSORTED: { - if (clipsMatch == 0 && nxagentGCTrap == 0) + if (clipsMatch == 0 && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -741,7 +741,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YXSORTED: { - if (clipsMatch == 0 && nxagentGCTrap == 0) + if (clipsMatch == 0 && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -752,7 +752,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YXBANDED: { - if (clipsMatch == 0 && nxagentGCTrap == 0) + if (clipsMatch == 0 && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -809,7 +809,7 @@ void nxagentDestroyClip(GCPtr pGC) nxagentDestroyClipHelper(pGC); - if (nxagentGCTrap == 0) + if (!nxagentGCTrap) { XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); } @@ -1453,7 +1453,7 @@ GCPtr nxagentGetScratchGC(unsigned depth, ScreenPtr pScreen) nxagentSaveGCTrap = nxagentGCTrap; - nxagentGCTrap = 0; + nxagentGCTrap = False; pGC = GetScratchGC(depth, pScreen); diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index beb9ef0..0617e73 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -80,7 +80,7 @@ static int nxagentSaveGCTrap; { \ nxagentSaveGCTrap = nxagentGCTrap;\ \ - nxagentGCTrap = 1; \ + nxagentGCTrap = True; \ } #define RESET_GC_TRAP() \ @@ -696,7 +696,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } - if (nxagentGCTrap == 1 || nxagentShmTrap == 1) + if (nxagentGCTrap || nxagentShmTrap) { if (pSrcDrawable -> type == DRAWABLE_PIXMAP && pDstDrawable -> type == DRAWABLE_PIXMAP) @@ -730,7 +730,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * to the check in Image.c, this is of little use. */ - if (nxagentOption(IgnoreVisibility) == 0 && pDstDrawable -> type == DRAWABLE_WINDOW && + if (!nxagentOption(IgnoreVisibility) && pDstDrawable -> type == DRAWABLE_WINDOW && (nxagentWindowIsVisible((WindowPtr) pDstDrawable) == 0 || (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) { @@ -934,7 +934,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); #endif - if (nxagentGCTrap == 1 || nxagentShmTrap == 1) + if (nxagentGCTrap || nxagentShmTrap) { if (pSrcDrawable -> type == DRAWABLE_PIXMAP && pDstDrawable -> type == DRAWABLE_PIXMAP) @@ -1118,7 +1118,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, (void *) pDrawable, (void *) pGC, nPoints); #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1175,7 +1175,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, void nxagentPolyLines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints, xPoint *pPoints) { - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1248,7 +1248,7 @@ void nxagentPolySegment(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1325,7 +1325,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1390,7 +1390,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, void nxagentPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs) { - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1449,7 +1449,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, { xPoint *newPoints = NULL; - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1571,7 +1571,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1719,7 +1719,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, void nxagentPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs) { - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1798,7 +1798,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, width = XTextWidth(nxagentFontStruct(pGC->font), string, count); - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1871,7 +1871,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, width = XTextWidth16(nxagentFontStruct(pGC->font), (XChar2b *)string, count); - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1930,7 +1930,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *string) { - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1987,7 +1987,7 @@ void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *string) { - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index c9aea9c..af45bce 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -680,7 +680,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) * the session. */ - if (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0) + if (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0) { #ifdef DEBUG fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index a5e1972..c022ebd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -428,7 +428,7 @@ FIXME: Here the split trap is always set and so the caching of resource, nxagentSplitTrap); #endif - if (nxagentSplitTrap == 1 || nxagentUnpackAlpha[resource] == NULL || + if (nxagentSplitTrap || nxagentUnpackAlpha[resource] == NULL || nxagentUnpackAlpha[resource] -> size != size || memcmp(nxagentUnpackAlpha[resource] -> data, data, size) != 0) { @@ -584,8 +584,8 @@ FIXME: Should use these. int framebuffer = 1; int realize = 1; */ - if (nxagentGCTrap == 1 && nxagentReconnectTrap == 0 && - nxagentFBTrap == 0 && nxagentShmTrap == 0) + if (nxagentGCTrap && !nxagentReconnectTrap && + !nxagentFBTrap && !nxagentShmTrap) { if (pDrawable -> type == DRAWABLE_PIXMAP) { @@ -601,11 +601,10 @@ FIXME: Should use these. goto nxagentPutImageEnd; } - if (nxagentReconnectTrap == 0 && - nxagentSplitTrap == 0) + if (!nxagentReconnectTrap && !nxagentSplitTrap) { if (pDrawable -> type == DRAWABLE_PIXMAP && - nxagentFBTrap == 0 && nxagentShmTrap == 0) + !nxagentFBTrap && !nxagentShmTrap) { fbPutImage(nxagentVirtualDrawable(pDrawable), pGC, depth, dstX, dstY, dstWidth, dstHeight, leftPad, format, data); @@ -693,11 +692,11 @@ FIXME: Should use these. /* FIXME: Should we disable the split with link LAN? - split = (nxagentOption(Streaming) == 1 && + split = (nxagentOption(Streaming) && nxagentOption(LinkType) != LINK_TYPE_NONE && nxagentOption(LinkType) != LINK_TYPE_LAN */ - split = (nxagentOption(Streaming) == 1 && + split = (nxagentOption(Streaming) && nxagentOption(LinkType) != LINK_TYPE_NONE /* FIXME: Do we stream the images from GLX or Xv? If we do that, @@ -710,8 +709,8 @@ FIXME: Do we stream the images from GLX or Xv? If we do that, /* FIXME: Temporarily stream the GLX data. - && nxagentGlxTrap == 0 - && nxagentXvTrap == 0 + && !nxagentGlxTrap + && !nxagentXvTrap */ ); @@ -720,12 +719,11 @@ FIXME: Temporarily stream the GLX data. * is less than 15. */ - if (split == 1 && (nxagentSplitTrap == 1 || depth < 15)) + if (split == 1 && (nxagentSplitTrap || depth < 15)) { #ifdef TEST - if (nxagentSplitTrap == 1 || - nxagentReconnectTrap == 1) + if (nxagentSplitTrap || nxagentReconnectTrap) { fprintf(stderr, "nxagentPutImage: Not splitting with reconnection [%d] trap [%d] " "depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth); @@ -767,7 +765,7 @@ FIXME: Temporarily stream the GLX data. */ if (nxagentOption(LinkType) != LINK_TYPE_NONE && - (nxagentGlxTrap == 1 || nxagentXvTrap == 1)) + (nxagentGlxTrap || nxagentXvTrap)) { #ifdef TEST fprintf(stderr, "nxagentPutImage: Disabling the use of the cache with GLX or Xvideo.\n"); @@ -974,7 +972,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, bytesPerLine = nxagentImagePad(w, format, leftPad, depth); - if (nxagentOption(Shadow) == 1 && format == ZPixmap && + if (nxagentOption(Shadow) && format == ZPixmap && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE) && pDrawable == (DrawablePtr) nxagentShadowPixmapPtr) @@ -1197,7 +1195,7 @@ FIXME: Should use an unpack resource here. if (w <= IMAGE_PACK_WIDTH || h <= IMAGE_PACK_HEIGHT || nxagentImageLength(w, h, format, leftPad, depth) <= - IMAGE_PACK_LENGTH || nxagentLosslessTrap == 1) + IMAGE_PACK_LENGTH || nxagentLosslessTrap) { if (nxagentPackLossless == PACK_NONE) { @@ -1273,8 +1271,8 @@ FIXME: Should try to locate the image anyway, if the lossless again using the preferred method. */ if (nxagentNeedCache(plainImage, packMethod) && - nxagentGlxTrap == 0 && nxagentXvTrap == 0 && - nxagentLosslessTrap == 0 && NXImageCacheSize > 0) + !nxagentGlxTrap && !nxagentXvTrap && + !nxagentLosslessTrap && NXImageCacheSize > 0) { /* * Be sure that the padding bits are @@ -1341,7 +1339,7 @@ FIXME: There should be a callback registered by the agent that * compress better. */ - if (lossless == 0 && nxagentOption(Adaptive) == 1) + if (lossless == 0 && nxagentOption(Adaptive)) { int ratio = nxagentUniquePixels(plainImage); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index af27c6e..4f1349c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -753,7 +753,7 @@ XkbError: fprintf(stderr, "nxagentKeyboardProc: nxagentKeyboard is [%s].\n", nxagentKeyboard ? nxagentKeyboard : "NULL"); #endif - if (nxagentX2go == 1 && nxagentKeyboard && (strcmp(nxagentKeyboard, "null/null") == 0)) + if (nxagentX2go && nxagentKeyboard && (strcmp(nxagentKeyboard, "null/null") == 0)) { #ifdef TEST fprintf(stderr, "%s: changing nxagentKeyboard from [null/null] to [clone].\n", __func__); @@ -873,7 +873,7 @@ XkbError: * instead of a file. Which is achieved by passing NULL to * nxagentWriteKeyboardFile. */ - if (nxagentX2go == 1) + if (nxagentX2go) nxagentWriteKeyboardDir(); } else @@ -891,7 +891,7 @@ XkbError: * know about that yet. Once x2go starts using clone * we can drop this here. */ - if (nxagentX2go == 1) + if (nxagentX2go) nxagentWriteKeyboardFile(nxagentRemoteRules, nxagentRemoteModel, nxagentRemoteLayout, nxagentRemoteVariant, nxagentRemoteOptions); } } @@ -935,7 +935,7 @@ XkbError: XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); } - if (nxagentOption(Shadow) == 1 && pDev && pDev->key) + if (nxagentOption(Shadow) && pDev && pDev->key) { NXShadowInitKeymap(&(pDev->key->curKeySyms)); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 22d5f19..279b730 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -326,7 +326,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio clientReady[0] = 0; - if (nxagentSplashWindow != None || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)) + if (nxagentSplashWindow != None || (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0)) { #ifdef TEST fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n", @@ -339,7 +339,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio if (serverGeneration > nxagentMaxAllowedResets && nxagentSessionState == SESSION_STARTING && - (nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1)) + (!nxagentOption(Xdmcp) || nxagentXdmcpUp == 1)) { #ifdef NX_DEBUG_INPUT fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", @@ -568,7 +568,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString()); } - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow)) { NXShadowDestroy(); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index 370fff6..ed2e1d8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -199,7 +199,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, * } */ - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { /* * FIXME: We should use the correct value @@ -245,7 +245,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse) #ifdef NXAGENT_SERVER - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { XUngrabPointer(nxagentDisplay, CurrentTime); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c index 9d0f4f7..3538191 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c @@ -116,7 +116,7 @@ static int __glXDispatch(ClientPtr client) * dispatching a GLX operation. */ - nxagentGlxTrap = 1; + nxagentGlxTrap = True; #ifdef TEST fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n", @@ -125,7 +125,7 @@ static int __glXDispatch(ClientPtr client) retval = (*proc)(cl, (GLbyte *) stuff); - nxagentGlxTrap = 0; + nxagentGlxTrap = False; #ifdef TEST fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 9d8a46c..dd432ff 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -189,7 +189,7 @@ ProcChangeProperty(ClientPtr client) return err; else { - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format, (int) mode, len, (void *) &stuff[1]); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index ce4ea9d..f7bf500 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -1683,11 +1683,11 @@ ProcRenderDispatch (ClientPtr client) * avoid reentrancy in GCOps.c. */ - nxagentGCTrap = 1; + nxagentGCTrap = True; result = (*ProcRenderVector[stuff->data]) (client); - nxagentGCTrap = 0; + nxagentGCTrap = False; return result; } @@ -1720,11 +1720,11 @@ SProcRenderDispatch (ClientPtr client) * avoid reentrancy in GCOps.c. */ - nxagentGCTrap = 1; + nxagentGCTrap = True; result = (*SProcRenderVector[stuff->data]) (client); - nxagentGCTrap = 0; + nxagentGCTrap = False; return result; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index 246d393..6ce2e48 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -96,7 +96,7 @@ ShmExtensionInit(void) #endif #ifdef NXAGENT_SERVER - if (nxagentOption(SharedMemory) == False) + if (!nxagentOption(SharedMemory)) { return; } @@ -207,11 +207,11 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) { /* Careful! This wrapper DEACTIVATES the trap! */ - nxagentShmTrap = 0; + nxagentShmTrap = False; nxagent_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data); - nxagentShmTrap = 1; + nxagentShmTrap = True; return; } @@ -476,11 +476,11 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) { PixmapPtr result; - nxagentShmPixmapTrap = 1; + nxagentShmPixmapTrap = True; result = nxagent_fbShmCreatePixmap(pScreen, width, height, depth, addr); - nxagentShmPixmapTrap = 0; + nxagentShmPixmapTrap = False; return result; } @@ -553,11 +553,11 @@ ProcShmDispatch (register ClientPtr client) { int result; - nxagentShmTrap = 1; + nxagentShmTrap = True; result = nxagent_ProcShmDispatch(client); - nxagentShmTrap = 0; + nxagentShmTrap = False; return result; } @@ -591,13 +591,13 @@ SProcShmDispatch (client) #endif #ifdef NXAGENT_SERVER - nxagentShmTrap = 1; + nxagentShmTrap = True; #endif result = SProcShmPutImage(client); #ifdef NXAGENT_SERVER - nxagentShmTrap = 0; + nxagentShmTrap = False; #endif #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 64bbf67..653bfb3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -561,7 +561,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) && pWin -> overrideRedirect == 0 && - nxagentScreenTrap == 0) + !nxagentScreenTrap) { nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c index 336ec10..db4802c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c @@ -162,11 +162,11 @@ ProcXvDispatch(ClientPtr client) stuff->data, client -> index); #endif - nxagentXvTrap = 1; + nxagentXvTrap = True; result = nxagent_ProcXvDispatch(client); - nxagentXvTrap = 0; + nxagentXvTrap = False; #ifdef TEST fprintf(stderr, "ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n", @@ -239,11 +239,11 @@ SProcXvDispatch(ClientPtr client) stuff->data, client -> index); #endif - nxagentXvTrap = 1; + nxagentXvTrap = True; result = nxagent_SProcXvDispatch(client); - nxagentXvTrap = 0; + nxagentXvTrap = False; #ifdef TEST fprintf(stderr, "SProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 316d147..64a7f86 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -145,7 +145,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE #define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \ - (nxagentSplitTrap == 0 && \ + (!nxagentSplitTrap && \ nxagentOption(DeferLevel) > 0) /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index be154f9..3deedda 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -217,7 +217,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, * id of the drawable in the checksum. */ - if (width != 0 && height != 0 && nxagentGCTrap == 0) + if (width != 0 && height != 0 && !nxagentGCTrap) { pPixmapPriv -> id = XCreatePixmap(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum], @@ -348,7 +348,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, fprintf(stderr, "Warning: Disabling render extension due to missing pixmap format.\n"); #endif - nxagentRenderTrap = 1; + nxagentRenderTrap = True; } nxagentDestroyPixmap(pPixmap); @@ -923,11 +923,11 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2) return; } - nxagentSplitTrap = 1; + nxagentSplitTrap = True; *pBool = nxagentSynchronizeDrawableData((DrawablePtr) pPixmap, NEVER_BREAK, NULL); - nxagentSplitTrap = 0; + nxagentSplitTrap = False; if (!*pBool) { @@ -1256,11 +1256,11 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, saveTrap = nxagentGCTrap; - nxagentGCTrap = 0; + nxagentGCTrap = False; - nxagentSplitTrap = 1; + nxagentSplitTrap = True; - nxagentFBTrap = 1; + nxagentFBTrap = True; if ((data = malloc(length)) != NULL) { @@ -1281,9 +1281,9 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, nxagentGCTrap = saveTrap; - nxagentSplitTrap = 0; + nxagentSplitTrap = False; - nxagentFBTrap = 0; + nxagentFBTrap = False; nxagentFreeScratchGC(pGC); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index c592307..124fddd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -85,7 +85,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) * window. */ - if (nxagentOption(DeviceControl) == True) + if (nxagentOption(DeviceControl)) { #ifdef TEST fprintf(stderr, "nxagentChangePointerControl: WARNING! Propagating changes to pointer settings.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index a921df6..f7e585a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -240,7 +240,7 @@ TODO: This should be reset only when */ nxagentException.ioError = 0; - if (nxagentOption(Persistent) == 1 && nxagentSessionState != SESSION_STARTING) + if (nxagentOption(Persistent) && nxagentSessionState != SESSION_STARTING) { if (nxagentSessionState == SESSION_UP) { @@ -338,7 +338,7 @@ void nxagentInitializeRecLossyLevel(void) void nxagentInitReconnector(void) { - nxagentReconnectTrap = 0; + nxagentReconnectTrap = False; reconnectLossyLevel[DISPLAY_STEP] = malloc(sizeof(int)); reconnectLossyLevel[SCREEN_STEP] = malloc(sizeof(int)); @@ -608,8 +608,8 @@ Bool nxagentReconnectSession(void) nxagentOldKeyboard = NULL; } - if (nxagentOption(ResetKeyboardAtResume) == 1 && - (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || + if (nxagentOption(ResetKeyboardAtResume) && + (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || strcmp(nxagentKeyboard, "query") == 0 || strcmp(nxagentKeyboard, "clone") == 0)) @@ -648,7 +648,7 @@ Bool nxagentReconnectSession(void) nxagentRedirectDefaultWindows(); - if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama) == True) + if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) || nxagentOption(Xinerama)) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentOption(RootHeight)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 9d91b1f..84c81a3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -569,11 +569,11 @@ int nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) nxagentMarkCorruptedRegion(pPicture -> pDrawable, NULL); - nxagentLosslessTrap = 1; + nxagentLosslessTrap = True; nxagentSynchronizeDrawable(pPicture -> pDrawable, DO_WAIT, NEVER_BREAK, NULL); - nxagentLosslessTrap = 0; + nxagentLosslessTrap = False; cid = XRenderCreateCursor(nxagentDisplay, nxagentPicture(pPicture), x, y); @@ -2741,7 +2741,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2) int i; - if (nxagentReconnectTrap == 0) + if (!nxagentReconnectTrap) { #ifdef DEBUG fprintf(stderr, "nxagentReconnectGlyphSet: GlyphSet at [%p].\n", (void *) pGly); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 82ec14f..f28acf9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -373,9 +373,9 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) mask = CWSibling | CWStackMode; values[0] = pWin -> drawable.id; pClient = wClient(toplevel[ntoplevel]); - nxagentScreenTrap = 1; + nxagentScreenTrap = True; ConfigureWindow(toplevel[ntoplevel], mask, (XID *) values, pClient); - nxagentScreenTrap = 0; + nxagentScreenTrap = False; #ifdef TEST fprintf(stderr, "nxagentRootlessRestack: Restacked window [%p].\n", (void*) toplevel[ntoplevel]); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 9ba217c..ac9d6cc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -596,7 +596,7 @@ FIXME: Do we need to check the key grab if the raise(SIGTERM); } - else if (nxagentOption(Persistent) == 0) + else if (!nxagentOption(Persistent)) { fprintf(stderr, "Info: Terminating session with persistence not allowed.\n"); @@ -871,7 +871,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, pScreen->myNum); #endif - if (nxagentRenderEnable && nxagentReconnectTrap == False) + if (nxagentRenderEnable && !nxagentReconnectTrap) { PictureScreenPrivateIndex = -1; } @@ -926,7 +926,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * user geometry then. */ - if (nxagentReconnectTrap == False && !nxagentOption(Rootless)) + if (!nxagentReconnectTrap && !nxagentOption(Rootless)) { if (nxagentUserGeometry.flag & XValue) { @@ -970,7 +970,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * the screen if we are either in rootless or in fullscreen mode. */ - if (nxagentOption(Rootless) == False && !nxagentWMIsRunning) + if (!nxagentOption(Rootless) && !nxagentWMIsRunning) { #ifdef TEST fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n"); @@ -979,7 +979,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, nxagentChangeOption(Fullscreen, True); if (nxagentOption(ClientOs) == ClientOsWinnt && - (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)) + (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup)) { NXSetExposeParameters(nxagentDisplay, 0, 0, 0); } @@ -988,7 +988,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, if (nxagentOption(Fullscreen) && nxagentWMIsRunning && nxagentReconnectTrap && - nxagentResizeDesktopAtStartup == False && + !nxagentResizeDesktopAtStartup && nxagentXServerGeometryChanged()) { #ifdef TEST @@ -1019,7 +1019,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, nxagentChangeOption(Height, h); /* first time screen initialization or resize during reconnect */ - if (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup) + if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup) { if (nxagentOption(RootWidth) >= w) { @@ -1072,7 +1072,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * screen is initialized for the first time. */ - if (nxagentReconnectTrap == False) + if (!nxagentReconnectTrap) { nxagentChangeOption(RootX, 0); nxagentChangeOption(RootY, 0); @@ -1111,7 +1111,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * the root window isn't bigger than the X server root window.. */ - if (nxagentReconnectTrap == False) + if (!nxagentReconnectTrap) { if ((nxagentOption(RootWidth) < w) && !(nxagentUserGeometry.flag & WidthValue)) @@ -1143,7 +1143,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); - if (nxagentReconnectTrap == 0) + if (!nxagentReconnectTrap) { if (nxagentOption(Persistent)) { @@ -1344,11 +1344,11 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, rootDepth, (long unsigned int)defaultVisual); #endif - if ((monitorResolution < 1) && (nxagentAutoDPI == False)) + if ((monitorResolution < 1) && !nxagentAutoDPI) { monitorResolution = NXAGENT_DEFAULT_DPI; } - else if ((monitorResolution < 1) && (nxagentAutoDPI == True)) + else if ((monitorResolution < 1) && nxagentAutoDPI) { monitorResolution = NXAGENT_AUTO_DPI; } @@ -1699,21 +1699,21 @@ N/A #endif if (nxagentDoFullGeneration == 1 || - nxagentReconnectTrap == 1) + nxagentReconnectTrap) { valuemask = CWBackPixel | CWEventMask | CWColormap | - (nxagentOption(AllScreens) == 1 ? CWOverrideRedirect : 0); + (nxagentOption(AllScreens) ? CWOverrideRedirect : 0); attributes.background_pixel = nxagentBlackPixel; attributes.event_mask = nxagentGetDefaultEventMask(); attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)); - if (nxagentOption(AllScreens) == 1) + if (nxagentOption(AllScreens)) { attributes.override_redirect = True; } - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { if (nxagentReconnectTrap) { @@ -1749,7 +1749,7 @@ N/A * handling the splash screen. */ - if (nxagentOption(Rootless) == True) + if (nxagentOption(Rootless)) { nxagentDefaultWindows[pScreen->myNum] = DefaultRootWindow(nxagentDisplay); @@ -1776,7 +1776,7 @@ N/A nxagentDefaultVisual(pScreen), valuemask, &attributes); - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { valuemask = CWEventMask; mask = PointerMotionMask; @@ -1884,7 +1884,7 @@ N/A sizeHints->width = nxagentOption(RootWidth); sizeHints->height = nxagentOption(RootHeight); - if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) + if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen)) { sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -2000,7 +2000,7 @@ N/A /* FIXME: This doing the same thing in both cases. The comments do not seem accurate (anymore?) */ - if (nxagentOption(Rootless) == False) + if (!nxagentOption(Rootless)) { /* * Set the WM_DELETE_WINDOW protocol for the main agent @@ -2049,7 +2049,7 @@ N/A * and pointer settings. */ - if (nxagentOption(DeviceControl) == False) + if (!nxagentOption(DeviceControl)) { fprintf(stderr, "Info: Not using local device configuration changes.\n"); } @@ -2428,13 +2428,13 @@ FIXME: We should try to restore the previously * Change agent window size and size hints. */ - if ((nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)) + if (!nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) { nxagentSetWMNormalHints(pScreen->myNum, width, height); XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height); } @@ -2589,7 +2589,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) NXShadowSetDisplayUid(nxagentShadowUid); } - if (nxagentOption(UseDamage) == 0) + if (!nxagentOption(UseDamage)) { NXShadowDisableDamage(); } @@ -2634,7 +2634,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) #ifndef __CYGWIN32__ - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight); @@ -4571,7 +4571,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height) sizeHints->width = width; sizeHints->height = height; - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize)) { sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.c b/nx-X11/programs/Xserver/hw/nxagent/Trap.c index c582f6a..9453d20 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.c @@ -31,7 +31,7 @@ * reentrancy in GC operations. */ -int nxagentGCTrap = 0; +int nxagentGCTrap = False; /* * Set if we are enqueing an internal @@ -39,14 +39,14 @@ int nxagentGCTrap = 0; * Window. Used to remove any screen operation. */ -int nxagentScreenTrap = 0; +int nxagentScreenTrap = False; /* * Set if we detected that our RENDER * implementation is faulty. */ -int nxagentRenderTrap = 0; +int nxagentRenderTrap = False; /* * Set if we are executing a GC operation @@ -54,55 +54,55 @@ int nxagentRenderTrap = 0; * reentrancy in FB layer. */ -int nxagentFBTrap = 0; +int nxagentFBTrap = False; /* * Set if we are dispatching a shared * memory extension request. */ -int nxagentShmTrap = 0; +int nxagentShmTrap = False; /* * Set if a shared pixmap operation is * requested by the client. */ -int nxagentShmPixmapTrap = 0; +int nxagentShmPixmapTrap = False; /* * Set if we are dispatching a XVideo * extension request. */ -int nxagentXvTrap = 0; +int nxagentXvTrap = False; /* * Set if we are dispatching a GLX * extension request. */ -int nxagentGlxTrap = 0; +int nxagentGlxTrap = False; /* * Set while we are resuming the session. */ -int nxagentReconnectTrap = 0; +int nxagentReconnectTrap = False; /* * Set if we need to realize a drawable * by using a lossless encoding. */ -int nxagentLosslessTrap = 0; +int nxagentLosslessTrap = False; /* * Set to force the synchronization of * a drawable. */ -int nxagentSplitTrap = 0; +int nxagentSplitTrap = False; /* * Set to avoid CapsLock synchronization @@ -110,7 +110,7 @@ int nxagentSplitTrap = 0; * key to be pressed in the session. */ -int nxagentXkbCapsTrap = 0; +int nxagentXkbCapsTrap = False; /* * Set to avoid NumLock synchronization @@ -118,5 +118,5 @@ int nxagentXkbCapsTrap = 0; * key to be pressed in the session. */ -int nxagentXkbNumTrap = 0; +int nxagentXkbNumTrap = False; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.h b/nx-X11/programs/Xserver/hw/nxagent/Trap.h index f0884f6..1abacda 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.h @@ -26,6 +26,14 @@ #ifndef __Traps_H__ #define __Traps_H__ +#ifndef True +# define True 1 +#endif + +#ifndef False +# define False 0 +#endif + /* * Set if we are dispatching a render * extension request. Used to avoid diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index c404d0a..ce0563f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -397,7 +397,7 @@ Bool nxagentCreateWindow(WindowPtr pWin) nxagentWindowPriv(pWin) -> corruptedTimestamp = 0; nxagentWindowPriv(pWin) -> splitResource = NULL; - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { if (pWin != nxagentRootlessWindow) { @@ -557,7 +557,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) { nxagentPrivWindowPtr pWindowPriv; - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return 1; } @@ -685,7 +685,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) { - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return True; } @@ -703,7 +703,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) { - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return; } @@ -713,7 +713,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) { - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { return; } @@ -908,9 +908,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e); nxagentFullscreenWindow = w; - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize)) { - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); @@ -959,12 +959,12 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentIconWindow = nxagentFullscreenWindow = None; - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize)) { nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentOption(RootHeight)); @@ -985,7 +985,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentChangeOption(Width, nxagentOption(SavedWidth)); nxagentChangeOption(Height, nxagentOption(SavedHeight)); - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1) + if (nxagentOption(Shadow) && nxagentOption(DesktopResize)) { nxagentShadowAdaptToRatio(); } @@ -1225,7 +1225,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) int offX = nxagentWindowPriv(pWin)->x - pWin->origin.x; int offY = nxagentWindowPriv(pWin)->y - pWin->origin.y; - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { #ifdef TEST fprintf(stderr, "nxagentConfigureWindow: WARNING: Called with the screen trap set.\n"); @@ -1234,7 +1234,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) return; } - if (nxagentOption(Rootless) == 1 && + if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) == 1) { mask &= ~(CWSibling | CWStackMode); @@ -1836,7 +1836,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired) Bool nxagentRealizeWindow(WindowPtr pWin) { - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return True; } @@ -2427,7 +2427,7 @@ void nxagentRefreshWindows(WindowPtr pWin) void nxagentUnmapWindows(void) { - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { for (int i = 0; i < screenInfo.numScreens; i++) { @@ -2450,7 +2450,7 @@ void nxagentMapDefaultWindows(void) MapWindow(pWin, serverClient); - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { /* * Show the NX splash screen. @@ -2470,7 +2470,7 @@ void nxagentMapDefaultWindows(void) * Windows client. */ - if (nxagentOption(Shadow) == 0 || !nxagentWMIsRunning) + if (!nxagentOption(Shadow) || !nxagentWMIsRunning) { #ifdef TEST fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n", @@ -2479,7 +2479,7 @@ void nxagentMapDefaultWindows(void) XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); - if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning) + if (nxagentOption(Fullscreen) && nxagentWMIsRunning) { nxagentMaximizeToFullScreen(pScreen); } @@ -2497,7 +2497,7 @@ void nxagentMapDefaultWindows(void) * after the Root Window is mapped. */ - if (nxagentReconnectTrap == 0) + if (!nxagentReconnectTrap) { XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]); } @@ -2693,7 +2693,7 @@ Bool nxagentReconnectAllWindows(void *p0) * Windows is raised. */ - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { for (int i = 0; i < screenInfo.numScreens; i++) { @@ -3196,7 +3196,7 @@ XXX: This would break Motif menus. XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum); } } - else if (nxagentOption(Rootless) == 0) + else if (!nxagentOption(Rootless)) { /* * Map the root window. -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 586742b715a3e3451a4587439778c410a1970cdd Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Feb 15 09:37:18 2019 +0100 Revert "nxagent: rework Bool handling" This reverts commit 16cd2bbe1c4425e3fa557f9ca0723aa94a50b071. It turned out that I had missed some of the Booleans being actually tristate variables. I think I can fix this (they do not need to be tristate) but I revert this for now to get back to a working state (there are reports about non-working fullscreen mode and reconnect problems). Refers to ArcticaProject/nx-libs#772 --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 32 ++++---- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 34 ++++----- nx-X11/programs/Xserver/hw/nxagent/Events.c | 98 ++++++++++++------------- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/GC.c | 26 +++---- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 32 ++++---- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 36 ++++----- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXglxext.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 18 ++--- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 10 +-- nx-X11/programs/Xserver/hw/nxagent/Render.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 52 ++++++------- nx-X11/programs/Xserver/hw/nxagent/Trap.c | 26 +++---- nx-X11/programs/Xserver/hw/nxagent/Trap.h | 8 -- nx-X11/programs/Xserver/hw/nxagent/Window.c | 40 +++++----- 30 files changed, 255 insertions(+), 261 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 57bcfa4..949892f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -522,7 +522,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) sscanf(argv[i], "%i", &level) == 1 && level >= 0 && level <= 2) { - if (!nxagentOption(Shadow)) + if (nxagentOption(Shadow) == 0) { nxagentChangeOption(DeferLevel, level); @@ -624,7 +624,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) } } - if (nxagentUserGeometry.flag || nxagentOption(Fullscreen)) return 2; + if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen) == 1)) return 2; } return 0; @@ -1122,7 +1122,7 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "render")) { - if (nxagentReconnectTrap) + if (nxagentReconnectTrap == True) { #ifdef DEBUG fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'render' at reconnection.\n"); @@ -1154,7 +1154,7 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "fullscreen")) { - if (nxagentReconnectTrap) + if (nxagentReconnectTrap == True) { #ifdef DEBUG fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'fullscreen' at reconnection.\n"); @@ -1267,13 +1267,13 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "resize")) { - if (!nxagentOption(DesktopResize) || strcmp(value, "0") == 0) + if (nxagentOption(DesktopResize) == 0 || strcmp(value, "0") == 0) { - nxagentResizeDesktopAtStartup = False; + nxagentResizeDesktopAtStartup = 0; } else if (strcmp(value, "1") == 0) { - nxagentResizeDesktopAtStartup = True; + nxagentResizeDesktopAtStartup = 1; } else { @@ -1324,7 +1324,7 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "autodpi")) { - if (nxagentReconnectTrap) + if (nxagentReconnectTrap == True) { #ifdef DEBUG fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'autodpi' at reconnection.\n"); @@ -1793,7 +1793,7 @@ N/A #endif - if (nxagentOption(Rootless) && nxagentOption(Fullscreen)) + if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen) == 1) { #ifdef TEST fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); @@ -2092,7 +2092,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. nxagentAlphaEnabled = False; } - if (nxagentOption(Rootless) && nxagentOption(Xdmcp)) + if ((nxagentOption(Rootless) == 1) && nxagentOption(Xdmcp)) { FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n"); } @@ -2102,7 +2102,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. * XDMCP sessions. */ - if (nxagentOption(Reset) && nxagentMaxAllowedResets == 0) + if (nxagentOption(Reset) == True && nxagentMaxAllowedResets == 0) { #ifdef WARNING fprintf(stderr, "nxagentPostProcessArgs: Disabling the server reset.\n"); @@ -2119,7 +2119,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. * to a standard XFree86 server. */ - if (!nxagentOption(Reset)) + if (nxagentOption(Reset) == False) { #ifdef TEST fprintf(stderr, "nxagentPostProcessArgs: Disabling dispatch of exception at server reset.\n"); @@ -2399,7 +2399,7 @@ void nxagentSetDeferLevel(void) * of the agent. */ - if (nxagentOption(Streaming)) + if (nxagentOption(Streaming) == 1) { fprintf(stderr, "Warning: Streaming of images not available in this agent.\n"); @@ -2484,7 +2484,7 @@ void nxagentSetDeferLevel(void) * Set the defer timeout. */ - if (nxagentOption(Shadow)) + if (nxagentOption(Shadow) == 1) { #ifdef TEST fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer timeout parameter in shadow mode.\n"); @@ -2499,7 +2499,7 @@ void nxagentSetDeferLevel(void) * Set the defer level. */ - if (nxagentOption(Shadow) ) + if (nxagentOption(Shadow) == 1) { #ifdef TEST fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer parameter in shadow mode.\n"); @@ -2631,7 +2631,7 @@ void nxagentSetScheduler(void) * The smart scheduler is the default. */ - if (nxagentOption(Shadow)) + if (nxagentOption(Shadow) == 1) { #ifdef TEST fprintf(stderr, "nxagentSetScheduler: Using the dumb scheduler in shadow mode.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index 4cdcda9..e486718 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -59,7 +59,7 @@ void nxagentCompositeExtensionInit(void) nxagentCompositeEnable = 0; - if (nxagentOption(Composite)) + if (nxagentOption(Composite) == 1) { int eventBase, errorBase; @@ -119,7 +119,7 @@ void nxagentRedirectDefaultWindows(void) { int i; - if (nxagentOption(Rootless) || + if (nxagentOption(Rootless) == 1 || nxagentCompositeEnable == 0) { #ifdef TEST @@ -159,7 +159,7 @@ void nxagentRedirectDefaultWindows(void) void nxagentRedirectWindow(WindowPtr pWin) { - if (!nxagentOption(Rootless) || + if (nxagentOption(Rootless) == 0 || nxagentCompositeEnable == 0) { #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c index 41aa773..a67115c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -134,7 +134,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor) cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None; - if (!nxagentOption(Rootless)) + if (nxagentOption(Rootless) == False) { XDefineCursor(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 89a191d..1278749 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -313,7 +313,7 @@ static void nxagentSighupHandler(int signal) } else if (nxagentSessionState == SESSION_UP) { - if (nxagentOption(Persistent)) + if (nxagentOption(Persistent) == 1) { #ifdef TEST fprintf(stderr, "nxagentSighupHandler: Handling the signal by disconnecting the agent.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index a1eb08a..88f3da3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -148,7 +148,7 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre pDrawable = nxagentSplitDrawable(pDrawable); - if (!nxagentLosslessTrap) + if (nxagentLosslessTrap == 0) { if (nxagentDrawableStatus(pDrawable) == Synchronized) { @@ -171,15 +171,15 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre * transferred in a single operation. */ - nxagentFBTrap = True; + nxagentFBTrap = 1; - nxagentSplitTrap = True; + nxagentSplitTrap = 1; result = nxagentSynchronizeDrawableData(pDrawable, breakMask, owner); - nxagentSplitTrap = False; + nxagentSplitTrap = 0; - nxagentFBTrap = False; + nxagentFBTrap = 0; if (wait == DO_WAIT && nxagentSplitResource(pDrawable) != NULL) { @@ -253,7 +253,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask * compression turned off. */ - if (nxagentLosslessTrap) + if (nxagentLosslessTrap == 1) { pGC = nxagentGetGraphicContext(pDrawable); @@ -285,7 +285,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask goto nxagentSynchronizeDrawableDataEnd; } - else if (nxagentReconnectTrap) + else if (nxagentReconnectTrap == 1) { /* * The pixmap data is not synchronized unless @@ -298,7 +298,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask { #ifdef TEST - if (nxagentReconnectTrap) + if (nxagentReconnectTrap == 1) { static int totalLength; static int totalReconnectedPixmaps; @@ -586,11 +586,11 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned saveTrap = nxagentGCTrap; - nxagentGCTrap = False; + nxagentGCTrap = 0; - nxagentFBTrap = True; + nxagentFBTrap = 1; - nxagentSplitTrap = True; + nxagentSplitTrap = 1; pGC = nxagentGetGraphicContext(pDrawable); @@ -894,7 +894,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (owner != NULL) { - if (nxagentOption(Shadow) && + if (nxagentOption(Shadow) == 1 && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE)) { @@ -945,15 +945,15 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentSynchronizeRegionStop: - nxagentSplitTrap = False; + nxagentSplitTrap = 0; - nxagentFBTrap = False; + nxagentFBTrap = 0; nxagentGCTrap = saveTrap; success = 1; - if (!nxagentOption(Shadow)) + if (nxagentOption(Shadow) == 0) { if (nxagentSynchronization.abort == 1) { @@ -1025,7 +1025,7 @@ nxagentSynchronizeRegionStop: w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1; h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1; - if (nxagentOption(Shadow) && + if (nxagentOption(Shadow) == 1 && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE)) { @@ -2633,7 +2633,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) saveTrap = nxagentGCTrap; - nxagentGCTrap = True; + nxagentGCTrap = 1; if (nxagentDrawableStatus(pDrawable) == Synchronized) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 81d6c98..5281b4b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -583,13 +583,13 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentChangeOption(DesktopResize, !desktopResize); - if (!nxagentOption(DesktopResize)) + if (nxagentOption(DesktopResize) == 0) { fprintf(stderr,"Info: Disabled desktop resize mode in agent.\n"); nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE); - if (!nxagentOption(Fullscreen)) + if (nxagentOption(Fullscreen) == 0) { nxagentSetWMNormalHintsMaxsize(pScreen, nxagentOption(RootWidth), @@ -621,7 +621,7 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen) nxagentChangeOption(DesktopResize, !desktopResize); - if (!nxagentOption(DesktopResize)) + if (nxagentOption(DesktopResize) == 0) { nxagentShadowSetRatio(1.0, 1.0); @@ -1048,7 +1048,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } case doSwitchResizeMode: { - if (!nxagentOption(Shadow)) + if (nxagentOption(Shadow) == 0) { if (nxagentNoDialogIsRunning) { @@ -1096,7 +1096,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentRemoveDuplicatedKeys(&X); } - if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && result == doNothing) + if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1147,17 +1147,17 @@ FIXME: Don't enqueue the KeyRelease event if the key was { if (X.xkey.keycode == nxagentCapsLockKeycode) { - nxagentXkbCapsTrap = True; + nxagentXkbCapsTrap = 1; } else if (X.xkey.keycode == nxagentNumLockKeycode) { - nxagentXkbNumTrap = True; + nxagentXkbNumTrap = 1; } nxagentInitXkbKeyboardState(); - nxagentXkbCapsTrap = False; - nxagentXkbNumTrap = False; + nxagentXkbCapsTrap = 0; + nxagentXkbNumTrap = 0; } memset(&x, 0, sizeof(xEvent)); @@ -1181,7 +1181,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was CriticalOutputPending = 1; - if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) + if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1204,7 +1204,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (nxagentOption(Fullscreen)) { - if ( nxagentOption(MagicPixel) && (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y)) ) + if ( (nxagentOption(MagicPixel) == 1) && (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y)) ) { pScreen = nxagentScreen(X.xbutton.window); @@ -1219,7 +1219,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was closeSession = TRUE; } - if (!nxagentOption(DesktopResize) && + if (nxagentOption(DesktopResize) == False && (X.xbutton.state & (ControlMask | Mod1Mask)) == (ControlMask | Mod1Mask)) { /* @@ -1275,7 +1275,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was CriticalOutputPending = 1; } - if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) + if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) { X.xbutton.x -= nxagentOption(RootX); X.xbutton.y -= nxagentOption(RootY); @@ -1349,7 +1349,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was CriticalOutputPending = 1; } - if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) + if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) { X.xbutton.x -= nxagentOption(RootX); X.xbutton.y -= nxagentOption(RootY); @@ -1410,7 +1410,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) && X.xmotion.x_root < (nxagentLastEnteredTopLevelWindow -> drawable.x + (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) + 50) && - nxagentOption(Menu)) + nxagentOption(Menu) == 1) { nxagentPulldownDialog(nxagentLastEnteredTopLevelWindow -> drawable.id); } @@ -1464,7 +1464,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was viewportLastY = X.xmotion.y; } - if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && !viewportCursor) + if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) && !viewportCursor) { X.xmotion.x -= nxagentOption(RootX); X.xmotion.y -= nxagentOption(RootY); @@ -1482,7 +1482,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was NXShadowEvent(nxagentDisplay, X); } - if (!nxagentOption(Shadow)) + if (nxagentOption(Shadow) == 0) { nxagentInputEvent = 1; } @@ -1575,7 +1575,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was x.u.u.detail = i * 8 + k; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); - if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) + if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) { xM.type = KeyRelease; xM.xkey.display = nxagentDisplay; @@ -1672,14 +1672,14 @@ FIXME: Don't enqueue the KeyRelease event if the key was mask = CWX | CWY; - nxagentScreenTrap = True; + nxagentScreenTrap = 1; ConfigureWindow(pWin, mask, (XID *) values, pClient); - nxagentScreenTrap = False; + nxagentScreenTrap = 0; } - if (nxagentOption(Fullscreen) && + if (nxagentOption(Fullscreen) == 1 && X.xcrossing.window == nxagentFullscreenWindow && X.xcrossing.detail != NotifyInferior) { @@ -1803,7 +1803,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was { int value = X.xvisibility.state; - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 1) { TraverseTree(pWin, nxagentChangeVisibilityPrivate, &value); } @@ -1970,22 +1970,22 @@ FIXME: Don't enqueue the KeyRelease event if the key was fprintf(stderr, "nxagentDispatchEvents: Going to handle new UnmapNotify event.\n"); #endif - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 1) { if ((pWin = nxagentRootlessTopLevelWindow(X.xunmap.window)) != NULL || ((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL && nxagentWindowTopLevel(pWin) == 1)) { - nxagentScreenTrap = True; + nxagentScreenTrap = 1; UnmapWindow(pWin, False); - nxagentScreenTrap = False; + nxagentScreenTrap = 0; } } - if (nxagentUseNXTrans == 1 && !nxagentOption(Rootless) && - !nxagentOption(Nested) && + if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && + nxagentOption(Nested) == 0 && X.xmap.window != nxagentIconWindow) { nxagentVisibility = VisibilityFullyObscured; @@ -2002,7 +2002,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was fprintf(stderr, "nxagentDispatchEvents: Going to handle new MapNotify event.\n"); #endif - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 1) { Bool value = 1; @@ -2012,11 +2012,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was { pClient = wClient(pWin); - nxagentScreenTrap = True; + nxagentScreenTrap = 1; MapWindow(pWin, pClient); - nxagentScreenTrap = False; + nxagentScreenTrap = 0; } if (pWin != NULL) @@ -2025,7 +2025,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was } } - if (nxagentOption(AllScreens)) + if (nxagentOption(AllScreens) == 1) { if (X.xmap.window == nxagentIconWindow) { @@ -2034,7 +2034,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was } } - if (nxagentOption(Fullscreen)) + if (nxagentOption(Fullscreen) == 1) { nxagentVisibility = VisibilityUnobscured; nxagentVisibilityStop = False; @@ -2155,7 +2155,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (switchFullscreen) { - if (nxagentOption(AllScreens) && nxagentOption(Fullscreen)) + if (nxagentOption(AllScreens) == 1 && nxagentOption(Fullscreen) == 1) { nxagentSwitchAllScreens(pScreen, 0); } @@ -2167,7 +2167,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (switchAllScreens) { - if (!nxagentOption(AllScreens) && nxagentOption(Fullscreen)) + if (nxagentOption(AllScreens) == 0 && nxagentOption(Fullscreen) == 1) { nxagentSwitchFullscreen(pScreen, 0); } @@ -2310,17 +2310,17 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) { if (X -> xkey.keycode == nxagentCapsLockKeycode) { - nxagentXkbCapsTrap = True; + nxagentXkbCapsTrap = 1; } else if (X -> xkey.keycode == nxagentNumLockKeycode) { - nxagentXkbNumTrap = True; + nxagentXkbNumTrap = 1; } nxagentInitXkbKeyboardState(); - nxagentXkbCapsTrap = False; - nxagentXkbNumTrap = False; + nxagentXkbCapsTrap = 0; + nxagentXkbNumTrap = 0; } if (nxagentCheckSpecialKeystroke(&X -> xkey, result)) @@ -3208,7 +3208,7 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X) int nxagentHandleConfigureNotify(XEvent* X) { - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == True) { ClientPtr pClient; WindowPtr pWinWindow; @@ -3281,11 +3281,11 @@ int nxagentHandleConfigureNotify(XEvent* X) mask |= CWHeight | CWWidth | CWBorderWidth; - nxagentScreenTrap = True; + nxagentScreenTrap = 1; ConfigureWindow(pWinWindow, mask, (XID *) values, pClient); - nxagentScreenTrap = False; + nxagentScreenTrap = 0; nxagentCheckWindowConfiguration((XConfigureEvent*)X); @@ -3358,7 +3358,7 @@ int nxagentHandleConfigureNotify(XEvent* X) if (X -> xconfigure.window == nxagentDefaultWindows[pScreen -> myNum]) { - if (!nxagentOption(AllScreens)) + if (nxagentOption(AllScreens) == 0) { /* * - WITHOUT window manager any position change is relevant @@ -3370,7 +3370,7 @@ int nxagentHandleConfigureNotify(XEvent* X) int newX = X -> xconfigure.x; int newY = X -> xconfigure.y; - if (nxagentOption(DesktopResize)) + if (nxagentOption(DesktopResize) == 1) { if (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height || @@ -3434,7 +3434,7 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentChangeOption(Y, newY); } - if (nxagentOption(Shadow) && nxagentOption(DesktopResize) && + if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 && (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height)) { @@ -3454,7 +3454,7 @@ int nxagentHandleConfigureNotify(XEvent* X) /* if in shadowing mode or if neither size nor position have changed we do not need to adjust RandR */ /* FIXME: Comment makes no sense */ - if (nxagentOption(Shadow) || + if (nxagentOption(Shadow) == 1 || (nxagentOption(Width) == nxagentOption(RootWidth) && nxagentOption(Height) == nxagentOption(RootHeight) && nxagentOption(X) == nxagentOption(RootX) && @@ -3469,7 +3469,7 @@ int nxagentHandleConfigureNotify(XEvent* X) XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, X -> xconfigure.width, X -> xconfigure.height); - if (!nxagentOption(Fullscreen)) + if (nxagentOption(Fullscreen) == 0) { nxagentMoveViewport(pScreen, 0, 0); } @@ -3639,7 +3639,7 @@ int nxagentHandleReparentNotify(XEvent* X) return 1; } - else if (nxagentWMIsRunning && !nxagentOption(Fullscreen) && + else if (nxagentWMIsRunning && nxagentOption(Fullscreen) == 0 && nxagentOption(WMBorderWidth) == -1) { XlibWindow w; @@ -4415,7 +4415,7 @@ int nxagentUserInput(void *p) * tus. */ - if (nxagentOption(Shadow) && + if (nxagentOption(Shadow) == 1 && nxagentPendingEvents(nxagentDisplay) > 0) { nxagentDispatchEvents(NULL); @@ -4436,7 +4436,7 @@ int nxagentUserInput(void *p) * order to update the screen smoothly. */ - if (nxagentOption(Shadow)) + if (nxagentOption(Shadow) == 1) { return result; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 1681910..785724c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -396,7 +396,7 @@ void nxagentRandRSetWindowsSize(int width, int height) { if (width == 0) { - if (nxagentOption(Fullscreen)) + if (nxagentOption(Fullscreen) == 1) { width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } @@ -408,7 +408,7 @@ void nxagentRandRSetWindowsSize(int width, int height) if (height == 0) { - if (nxagentOption(Fullscreen)) + if (nxagentOption(Fullscreen) == 1) { height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } @@ -420,7 +420,7 @@ void nxagentRandRSetWindowsSize(int width, int height) XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height); - if (!nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 0) { XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width, height); @@ -434,8 +434,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, UpdateCurrentTime(); - if (nxagentOption(DesktopResize) && - (nxagentOption(Fullscreen) || + if (nxagentOption(DesktopResize) == 1 && + (nxagentOption(Fullscreen) == 1 || width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) || height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)))) { @@ -446,8 +446,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, } } - if (nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) && - !nxagentOption(AllScreens)) + if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 && + nxagentOption(AllScreens) == 0) { nxagentChangeOption(Width, width); nxagentChangeOption(Height, height); @@ -455,8 +455,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight); - if (result == 1 && nxagentOption(DesktopResize) && - !nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) + if (result == 1 && nxagentOption(DesktopResize) == 1 && + nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0) { nxagentRandRSetWindowsSize(width, height); nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 2facc72..2fac2f1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -385,7 +385,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) else { if (nxagentDrawableStatus((DrawablePtr) pGC -> tile.pixmap) == NotSynchronized && - !nxagentGCTrap) + nxagentGCTrap == 0) { /* * If the tile is corrupted and is not too @@ -437,7 +437,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) if (mask & GCStipple) { if (nxagentDrawableStatus((DrawablePtr) pGC -> stipple) == NotSynchronized && - !nxagentGCTrap) + nxagentGCTrap == 0) { #ifdef TEST fprintf(stderr, "nxagentChangeGC: WARNING! Synchronizing GC at [%p] due the stipple at [%p].\n", @@ -535,7 +535,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) { mask &= ~GCDashList; - if (!nxagentGCTrap) + if (nxagentGCTrap == 0) { XSetDashes(nxagentDisplay, nxagentGC(pGC), pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList); @@ -549,7 +549,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) changeFlag += nxagentTestGC(values.arc_mode, arc_mode); } - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { #ifdef TEST fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n", @@ -668,7 +668,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) { case CT_NONE: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (clipsMatch == 0 && nxagentGCTrap == 0) { XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); } @@ -677,7 +677,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_REGION: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (clipsMatch == 0 && nxagentGCTrap == 0) { nRects = RegionNumRects((RegionPtr)pValue); size = nRects * sizeof(*pRects); @@ -701,7 +701,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_PIXMAP: { - if (!nxagentGCTrap) + if (nxagentGCTrap == 0) { XSetClipMask(nxagentDisplay, nxagentGC(pGC), nxagentPixmap((PixmapPtr)pValue)); @@ -719,7 +719,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_UNSORTED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (clipsMatch == 0 && nxagentGCTrap == 0) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -730,7 +730,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YSORTED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (clipsMatch == 0 && nxagentGCTrap == 0) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -741,7 +741,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YXSORTED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (clipsMatch == 0 && nxagentGCTrap == 0) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -752,7 +752,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YXBANDED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (clipsMatch == 0 && nxagentGCTrap == 0) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -809,7 +809,7 @@ void nxagentDestroyClip(GCPtr pGC) nxagentDestroyClipHelper(pGC); - if (!nxagentGCTrap) + if (nxagentGCTrap == 0) { XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); } @@ -1453,7 +1453,7 @@ GCPtr nxagentGetScratchGC(unsigned depth, ScreenPtr pScreen) nxagentSaveGCTrap = nxagentGCTrap; - nxagentGCTrap = False; + nxagentGCTrap = 0; pGC = GetScratchGC(depth, pScreen); diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 0617e73..beb9ef0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -80,7 +80,7 @@ static int nxagentSaveGCTrap; { \ nxagentSaveGCTrap = nxagentGCTrap;\ \ - nxagentGCTrap = True; \ + nxagentGCTrap = 1; \ } #define RESET_GC_TRAP() \ @@ -696,7 +696,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } - if (nxagentGCTrap || nxagentShmTrap) + if (nxagentGCTrap == 1 || nxagentShmTrap == 1) { if (pSrcDrawable -> type == DRAWABLE_PIXMAP && pDstDrawable -> type == DRAWABLE_PIXMAP) @@ -730,7 +730,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * to the check in Image.c, this is of little use. */ - if (!nxagentOption(IgnoreVisibility) && pDstDrawable -> type == DRAWABLE_WINDOW && + if (nxagentOption(IgnoreVisibility) == 0 && pDstDrawable -> type == DRAWABLE_WINDOW && (nxagentWindowIsVisible((WindowPtr) pDstDrawable) == 0 || (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) { @@ -934,7 +934,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); #endif - if (nxagentGCTrap || nxagentShmTrap) + if (nxagentGCTrap == 1 || nxagentShmTrap == 1) { if (pSrcDrawable -> type == DRAWABLE_PIXMAP && pDstDrawable -> type == DRAWABLE_PIXMAP) @@ -1118,7 +1118,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, (void *) pDrawable, (void *) pGC, nPoints); #endif - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1175,7 +1175,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, void nxagentPolyLines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints, xPoint *pPoints) { - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1248,7 +1248,7 @@ void nxagentPolySegment(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1325,7 +1325,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1390,7 +1390,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, void nxagentPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs) { - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1449,7 +1449,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, { xPoint *newPoints = NULL; - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1571,7 +1571,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1719,7 +1719,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, void nxagentPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs) { - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1798,7 +1798,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, width = XTextWidth(nxagentFontStruct(pGC->font), string, count); - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1871,7 +1871,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, width = XTextWidth16(nxagentFontStruct(pGC->font), (XChar2b *)string, count); - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1930,7 +1930,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *string) { - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1987,7 +1987,7 @@ void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *string) { - if (nxagentGCTrap) + if (nxagentGCTrap == 1) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index af45bce..c9aea9c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -680,7 +680,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) * the session. */ - if (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0) + if (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0) { #ifdef DEBUG fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index c022ebd..a5e1972 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -428,7 +428,7 @@ FIXME: Here the split trap is always set and so the caching of resource, nxagentSplitTrap); #endif - if (nxagentSplitTrap || nxagentUnpackAlpha[resource] == NULL || + if (nxagentSplitTrap == 1 || nxagentUnpackAlpha[resource] == NULL || nxagentUnpackAlpha[resource] -> size != size || memcmp(nxagentUnpackAlpha[resource] -> data, data, size) != 0) { @@ -584,8 +584,8 @@ FIXME: Should use these. int framebuffer = 1; int realize = 1; */ - if (nxagentGCTrap && !nxagentReconnectTrap && - !nxagentFBTrap && !nxagentShmTrap) + if (nxagentGCTrap == 1 && nxagentReconnectTrap == 0 && + nxagentFBTrap == 0 && nxagentShmTrap == 0) { if (pDrawable -> type == DRAWABLE_PIXMAP) { @@ -601,10 +601,11 @@ FIXME: Should use these. goto nxagentPutImageEnd; } - if (!nxagentReconnectTrap && !nxagentSplitTrap) + if (nxagentReconnectTrap == 0 && + nxagentSplitTrap == 0) { if (pDrawable -> type == DRAWABLE_PIXMAP && - !nxagentFBTrap && !nxagentShmTrap) + nxagentFBTrap == 0 && nxagentShmTrap == 0) { fbPutImage(nxagentVirtualDrawable(pDrawable), pGC, depth, dstX, dstY, dstWidth, dstHeight, leftPad, format, data); @@ -692,11 +693,11 @@ FIXME: Should use these. /* FIXME: Should we disable the split with link LAN? - split = (nxagentOption(Streaming) && + split = (nxagentOption(Streaming) == 1 && nxagentOption(LinkType) != LINK_TYPE_NONE && nxagentOption(LinkType) != LINK_TYPE_LAN */ - split = (nxagentOption(Streaming) && + split = (nxagentOption(Streaming) == 1 && nxagentOption(LinkType) != LINK_TYPE_NONE /* FIXME: Do we stream the images from GLX or Xv? If we do that, @@ -709,8 +710,8 @@ FIXME: Do we stream the images from GLX or Xv? If we do that, /* FIXME: Temporarily stream the GLX data. - && !nxagentGlxTrap - && !nxagentXvTrap + && nxagentGlxTrap == 0 + && nxagentXvTrap == 0 */ ); @@ -719,11 +720,12 @@ FIXME: Temporarily stream the GLX data. * is less than 15. */ - if (split == 1 && (nxagentSplitTrap || depth < 15)) + if (split == 1 && (nxagentSplitTrap == 1 || depth < 15)) { #ifdef TEST - if (nxagentSplitTrap || nxagentReconnectTrap) + if (nxagentSplitTrap == 1 || + nxagentReconnectTrap == 1) { fprintf(stderr, "nxagentPutImage: Not splitting with reconnection [%d] trap [%d] " "depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth); @@ -765,7 +767,7 @@ FIXME: Temporarily stream the GLX data. */ if (nxagentOption(LinkType) != LINK_TYPE_NONE && - (nxagentGlxTrap || nxagentXvTrap)) + (nxagentGlxTrap == 1 || nxagentXvTrap == 1)) { #ifdef TEST fprintf(stderr, "nxagentPutImage: Disabling the use of the cache with GLX or Xvideo.\n"); @@ -972,7 +974,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, bytesPerLine = nxagentImagePad(w, format, leftPad, depth); - if (nxagentOption(Shadow) && format == ZPixmap && + if (nxagentOption(Shadow) == 1 && format == ZPixmap && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE) && pDrawable == (DrawablePtr) nxagentShadowPixmapPtr) @@ -1195,7 +1197,7 @@ FIXME: Should use an unpack resource here. if (w <= IMAGE_PACK_WIDTH || h <= IMAGE_PACK_HEIGHT || nxagentImageLength(w, h, format, leftPad, depth) <= - IMAGE_PACK_LENGTH || nxagentLosslessTrap) + IMAGE_PACK_LENGTH || nxagentLosslessTrap == 1) { if (nxagentPackLossless == PACK_NONE) { @@ -1271,8 +1273,8 @@ FIXME: Should try to locate the image anyway, if the lossless again using the preferred method. */ if (nxagentNeedCache(plainImage, packMethod) && - !nxagentGlxTrap && !nxagentXvTrap && - !nxagentLosslessTrap && NXImageCacheSize > 0) + nxagentGlxTrap == 0 && nxagentXvTrap == 0 && + nxagentLosslessTrap == 0 && NXImageCacheSize > 0) { /* * Be sure that the padding bits are @@ -1339,7 +1341,7 @@ FIXME: There should be a callback registered by the agent that * compress better. */ - if (lossless == 0 && nxagentOption(Adaptive)) + if (lossless == 0 && nxagentOption(Adaptive) == 1) { int ratio = nxagentUniquePixels(plainImage); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 4f1349c..af27c6e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -753,7 +753,7 @@ XkbError: fprintf(stderr, "nxagentKeyboardProc: nxagentKeyboard is [%s].\n", nxagentKeyboard ? nxagentKeyboard : "NULL"); #endif - if (nxagentX2go && nxagentKeyboard && (strcmp(nxagentKeyboard, "null/null") == 0)) + if (nxagentX2go == 1 && nxagentKeyboard && (strcmp(nxagentKeyboard, "null/null") == 0)) { #ifdef TEST fprintf(stderr, "%s: changing nxagentKeyboard from [null/null] to [clone].\n", __func__); @@ -873,7 +873,7 @@ XkbError: * instead of a file. Which is achieved by passing NULL to * nxagentWriteKeyboardFile. */ - if (nxagentX2go) + if (nxagentX2go == 1) nxagentWriteKeyboardDir(); } else @@ -891,7 +891,7 @@ XkbError: * know about that yet. Once x2go starts using clone * we can drop this here. */ - if (nxagentX2go) + if (nxagentX2go == 1) nxagentWriteKeyboardFile(nxagentRemoteRules, nxagentRemoteModel, nxagentRemoteLayout, nxagentRemoteVariant, nxagentRemoteOptions); } } @@ -935,7 +935,7 @@ XkbError: XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); } - if (nxagentOption(Shadow) && pDev && pDev->key) + if (nxagentOption(Shadow) == 1 && pDev && pDev->key) { NXShadowInitKeymap(&(pDev->key->curKeySyms)); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 279b730..22d5f19 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -326,7 +326,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio clientReady[0] = 0; - if (nxagentSplashWindow != None || (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0)) + if (nxagentSplashWindow != None || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)) { #ifdef TEST fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n", @@ -339,7 +339,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio if (serverGeneration > nxagentMaxAllowedResets && nxagentSessionState == SESSION_STARTING && - (!nxagentOption(Xdmcp) || nxagentXdmcpUp == 1)) + (nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1)) { #ifdef NX_DEBUG_INPUT fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", @@ -568,7 +568,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString()); } - if (nxagentOption(Shadow)) + if (nxagentOption(Shadow) == 1) { NXShadowDestroy(); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index ed2e1d8..370fff6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -199,7 +199,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, * } */ - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 1) { /* * FIXME: We should use the correct value @@ -245,7 +245,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse) #ifdef NXAGENT_SERVER - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 1) { XUngrabPointer(nxagentDisplay, CurrentTime); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c index 3538191..9d0f4f7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglxext.c @@ -116,7 +116,7 @@ static int __glXDispatch(ClientPtr client) * dispatching a GLX operation. */ - nxagentGlxTrap = True; + nxagentGlxTrap = 1; #ifdef TEST fprintf(stderr, "__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].\n", @@ -125,7 +125,7 @@ static int __glXDispatch(ClientPtr client) retval = (*proc)(cl, (GLbyte *) stuff); - nxagentGlxTrap = False; + nxagentGlxTrap = 0; #ifdef TEST fprintf(stderr, "__glXDispatch: Dispatched GLX operation [%d] for client [%d].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index dd432ff..9d8a46c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -189,7 +189,7 @@ ProcChangeProperty(ClientPtr client) return err; else { - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 1) { nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format, (int) mode, len, (void *) &stuff[1]); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index f7bf500..ce4ea9d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -1683,11 +1683,11 @@ ProcRenderDispatch (ClientPtr client) * avoid reentrancy in GCOps.c. */ - nxagentGCTrap = True; + nxagentGCTrap = 1; result = (*ProcRenderVector[stuff->data]) (client); - nxagentGCTrap = False; + nxagentGCTrap = 0; return result; } @@ -1720,11 +1720,11 @@ SProcRenderDispatch (ClientPtr client) * avoid reentrancy in GCOps.c. */ - nxagentGCTrap = True; + nxagentGCTrap = 1; result = (*SProcRenderVector[stuff->data]) (client); - nxagentGCTrap = False; + nxagentGCTrap = 0; return result; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index 6ce2e48..246d393 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -96,7 +96,7 @@ ShmExtensionInit(void) #endif #ifdef NXAGENT_SERVER - if (!nxagentOption(SharedMemory)) + if (nxagentOption(SharedMemory) == False) { return; } @@ -207,11 +207,11 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) { /* Careful! This wrapper DEACTIVATES the trap! */ - nxagentShmTrap = False; + nxagentShmTrap = 0; nxagent_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data); - nxagentShmTrap = True; + nxagentShmTrap = 1; return; } @@ -476,11 +476,11 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) { PixmapPtr result; - nxagentShmPixmapTrap = True; + nxagentShmPixmapTrap = 1; result = nxagent_fbShmCreatePixmap(pScreen, width, height, depth, addr); - nxagentShmPixmapTrap = False; + nxagentShmPixmapTrap = 0; return result; } @@ -553,11 +553,11 @@ ProcShmDispatch (register ClientPtr client) { int result; - nxagentShmTrap = True; + nxagentShmTrap = 1; result = nxagent_ProcShmDispatch(client); - nxagentShmTrap = False; + nxagentShmTrap = 0; return result; } @@ -591,13 +591,13 @@ SProcShmDispatch (client) #endif #ifdef NXAGENT_SERVER - nxagentShmTrap = True; + nxagentShmTrap = 1; #endif result = SProcShmPutImage(client); #ifdef NXAGENT_SERVER - nxagentShmTrap = False; + nxagentShmTrap = 0; #endif #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 653bfb3..64bbf67 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -561,7 +561,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) && pWin -> overrideRedirect == 0 && - !nxagentScreenTrap) + nxagentScreenTrap == 0) { nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c index db4802c..336ec10 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c @@ -162,11 +162,11 @@ ProcXvDispatch(ClientPtr client) stuff->data, client -> index); #endif - nxagentXvTrap = True; + nxagentXvTrap = 1; result = nxagent_ProcXvDispatch(client); - nxagentXvTrap = False; + nxagentXvTrap = 0; #ifdef TEST fprintf(stderr, "ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n", @@ -239,11 +239,11 @@ SProcXvDispatch(ClientPtr client) stuff->data, client -> index); #endif - nxagentXvTrap = True; + nxagentXvTrap = 1; result = nxagent_SProcXvDispatch(client); - nxagentXvTrap = False; + nxagentXvTrap = 0; #ifdef TEST fprintf(stderr, "SProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 64a7f86..316d147 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -145,7 +145,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE #define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \ - (!nxagentSplitTrap && \ + (nxagentSplitTrap == 0 && \ nxagentOption(DeferLevel) > 0) /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index 3deedda..be154f9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -217,7 +217,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, * id of the drawable in the checksum. */ - if (width != 0 && height != 0 && !nxagentGCTrap) + if (width != 0 && height != 0 && nxagentGCTrap == 0) { pPixmapPriv -> id = XCreatePixmap(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum], @@ -348,7 +348,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, fprintf(stderr, "Warning: Disabling render extension due to missing pixmap format.\n"); #endif - nxagentRenderTrap = True; + nxagentRenderTrap = 1; } nxagentDestroyPixmap(pPixmap); @@ -923,11 +923,11 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2) return; } - nxagentSplitTrap = True; + nxagentSplitTrap = 1; *pBool = nxagentSynchronizeDrawableData((DrawablePtr) pPixmap, NEVER_BREAK, NULL); - nxagentSplitTrap = False; + nxagentSplitTrap = 0; if (!*pBool) { @@ -1256,11 +1256,11 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, saveTrap = nxagentGCTrap; - nxagentGCTrap = False; + nxagentGCTrap = 0; - nxagentSplitTrap = True; + nxagentSplitTrap = 1; - nxagentFBTrap = True; + nxagentFBTrap = 1; if ((data = malloc(length)) != NULL) { @@ -1281,9 +1281,9 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, nxagentGCTrap = saveTrap; - nxagentSplitTrap = False; + nxagentSplitTrap = 0; - nxagentFBTrap = False; + nxagentFBTrap = 0; nxagentFreeScratchGC(pGC); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index 124fddd..c592307 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -85,7 +85,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) * window. */ - if (nxagentOption(DeviceControl)) + if (nxagentOption(DeviceControl) == True) { #ifdef TEST fprintf(stderr, "nxagentChangePointerControl: WARNING! Propagating changes to pointer settings.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index f7e585a..a921df6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -240,7 +240,7 @@ TODO: This should be reset only when */ nxagentException.ioError = 0; - if (nxagentOption(Persistent) && nxagentSessionState != SESSION_STARTING) + if (nxagentOption(Persistent) == 1 && nxagentSessionState != SESSION_STARTING) { if (nxagentSessionState == SESSION_UP) { @@ -338,7 +338,7 @@ void nxagentInitializeRecLossyLevel(void) void nxagentInitReconnector(void) { - nxagentReconnectTrap = False; + nxagentReconnectTrap = 0; reconnectLossyLevel[DISPLAY_STEP] = malloc(sizeof(int)); reconnectLossyLevel[SCREEN_STEP] = malloc(sizeof(int)); @@ -608,8 +608,8 @@ Bool nxagentReconnectSession(void) nxagentOldKeyboard = NULL; } - if (nxagentOption(ResetKeyboardAtResume) && - (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || + if (nxagentOption(ResetKeyboardAtResume) == 1 && + (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || strcmp(nxagentKeyboard, "query") == 0 || strcmp(nxagentKeyboard, "clone") == 0)) @@ -648,7 +648,7 @@ Bool nxagentReconnectSession(void) nxagentRedirectDefaultWindows(); - if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) || nxagentOption(Xinerama)) + if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama) == True) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentOption(RootHeight)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 84c81a3..9d91b1f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -569,11 +569,11 @@ int nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) nxagentMarkCorruptedRegion(pPicture -> pDrawable, NULL); - nxagentLosslessTrap = True; + nxagentLosslessTrap = 1; nxagentSynchronizeDrawable(pPicture -> pDrawable, DO_WAIT, NEVER_BREAK, NULL); - nxagentLosslessTrap = False; + nxagentLosslessTrap = 0; cid = XRenderCreateCursor(nxagentDisplay, nxagentPicture(pPicture), x, y); @@ -2741,7 +2741,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2) int i; - if (!nxagentReconnectTrap) + if (nxagentReconnectTrap == 0) { #ifdef DEBUG fprintf(stderr, "nxagentReconnectGlyphSet: GlyphSet at [%p].\n", (void *) pGly); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index f28acf9..82ec14f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -373,9 +373,9 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) mask = CWSibling | CWStackMode; values[0] = pWin -> drawable.id; pClient = wClient(toplevel[ntoplevel]); - nxagentScreenTrap = True; + nxagentScreenTrap = 1; ConfigureWindow(toplevel[ntoplevel], mask, (XID *) values, pClient); - nxagentScreenTrap = False; + nxagentScreenTrap = 0; #ifdef TEST fprintf(stderr, "nxagentRootlessRestack: Restacked window [%p].\n", (void*) toplevel[ntoplevel]); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index ac9d6cc..9ba217c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -596,7 +596,7 @@ FIXME: Do we need to check the key grab if the raise(SIGTERM); } - else if (!nxagentOption(Persistent)) + else if (nxagentOption(Persistent) == 0) { fprintf(stderr, "Info: Terminating session with persistence not allowed.\n"); @@ -871,7 +871,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, pScreen->myNum); #endif - if (nxagentRenderEnable && !nxagentReconnectTrap) + if (nxagentRenderEnable && nxagentReconnectTrap == False) { PictureScreenPrivateIndex = -1; } @@ -926,7 +926,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * user geometry then. */ - if (!nxagentReconnectTrap && !nxagentOption(Rootless)) + if (nxagentReconnectTrap == False && !nxagentOption(Rootless)) { if (nxagentUserGeometry.flag & XValue) { @@ -970,7 +970,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * the screen if we are either in rootless or in fullscreen mode. */ - if (!nxagentOption(Rootless) && !nxagentWMIsRunning) + if (nxagentOption(Rootless) == False && !nxagentWMIsRunning) { #ifdef TEST fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n"); @@ -979,7 +979,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, nxagentChangeOption(Fullscreen, True); if (nxagentOption(ClientOs) == ClientOsWinnt && - (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup)) + (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)) { NXSetExposeParameters(nxagentDisplay, 0, 0, 0); } @@ -988,7 +988,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, if (nxagentOption(Fullscreen) && nxagentWMIsRunning && nxagentReconnectTrap && - !nxagentResizeDesktopAtStartup && + nxagentResizeDesktopAtStartup == False && nxagentXServerGeometryChanged()) { #ifdef TEST @@ -1019,7 +1019,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, nxagentChangeOption(Height, h); /* first time screen initialization or resize during reconnect */ - if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup) + if (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup) { if (nxagentOption(RootWidth) >= w) { @@ -1072,7 +1072,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * screen is initialized for the first time. */ - if (!nxagentReconnectTrap) + if (nxagentReconnectTrap == False) { nxagentChangeOption(RootX, 0); nxagentChangeOption(RootY, 0); @@ -1111,7 +1111,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * the root window isn't bigger than the X server root window.. */ - if (!nxagentReconnectTrap) + if (nxagentReconnectTrap == False) { if ((nxagentOption(RootWidth) < w) && !(nxagentUserGeometry.flag & WidthValue)) @@ -1143,7 +1143,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); - if (!nxagentReconnectTrap) + if (nxagentReconnectTrap == 0) { if (nxagentOption(Persistent)) { @@ -1344,11 +1344,11 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, rootDepth, (long unsigned int)defaultVisual); #endif - if ((monitorResolution < 1) && !nxagentAutoDPI) + if ((monitorResolution < 1) && (nxagentAutoDPI == False)) { monitorResolution = NXAGENT_DEFAULT_DPI; } - else if ((monitorResolution < 1) && nxagentAutoDPI) + else if ((monitorResolution < 1) && (nxagentAutoDPI == True)) { monitorResolution = NXAGENT_AUTO_DPI; } @@ -1699,21 +1699,21 @@ N/A #endif if (nxagentDoFullGeneration == 1 || - nxagentReconnectTrap) + nxagentReconnectTrap == 1) { valuemask = CWBackPixel | CWEventMask | CWColormap | - (nxagentOption(AllScreens) ? CWOverrideRedirect : 0); + (nxagentOption(AllScreens) == 1 ? CWOverrideRedirect : 0); attributes.background_pixel = nxagentBlackPixel; attributes.event_mask = nxagentGetDefaultEventMask(); attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)); - if (nxagentOption(AllScreens)) + if (nxagentOption(AllScreens) == 1) { attributes.override_redirect = True; } - if (nxagentOption(Fullscreen)) + if (nxagentOption(Fullscreen) == 1) { if (nxagentReconnectTrap) { @@ -1749,7 +1749,7 @@ N/A * handling the splash screen. */ - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == True) { nxagentDefaultWindows[pScreen->myNum] = DefaultRootWindow(nxagentDisplay); @@ -1776,7 +1776,7 @@ N/A nxagentDefaultVisual(pScreen), valuemask, &attributes); - if (!nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 0) { valuemask = CWEventMask; mask = PointerMotionMask; @@ -1884,7 +1884,7 @@ N/A sizeHints->width = nxagentOption(RootWidth); sizeHints->height = nxagentOption(RootHeight); - if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen)) + if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) { sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -2000,7 +2000,7 @@ N/A /* FIXME: This doing the same thing in both cases. The comments do not seem accurate (anymore?) */ - if (!nxagentOption(Rootless)) + if (nxagentOption(Rootless) == False) { /* * Set the WM_DELETE_WINDOW protocol for the main agent @@ -2049,7 +2049,7 @@ N/A * and pointer settings. */ - if (!nxagentOption(DeviceControl)) + if (nxagentOption(DeviceControl) == False) { fprintf(stderr, "Info: Not using local device configuration changes.\n"); } @@ -2428,13 +2428,13 @@ FIXME: We should try to restore the previously * Change agent window size and size hints. */ - if (!nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) + if ((nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)) { nxagentSetWMNormalHints(pScreen->myNum, width, height); XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); - if (!nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 0) { XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height); } @@ -2589,7 +2589,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) NXShadowSetDisplayUid(nxagentShadowUid); } - if (!nxagentOption(UseDamage)) + if (nxagentOption(UseDamage) == 0) { NXShadowDisableDamage(); } @@ -2634,7 +2634,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) #ifndef __CYGWIN32__ - if (nxagentOption(Fullscreen)) + if (nxagentOption(Fullscreen) == 1) { nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight); @@ -4571,7 +4571,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height) sizeHints->width = width; sizeHints->height = height; - if (nxagentOption(DesktopResize)) + if (nxagentOption(DesktopResize) == 1) { sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.c b/nx-X11/programs/Xserver/hw/nxagent/Trap.c index 9453d20..c582f6a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.c @@ -31,7 +31,7 @@ * reentrancy in GC operations. */ -int nxagentGCTrap = False; +int nxagentGCTrap = 0; /* * Set if we are enqueing an internal @@ -39,14 +39,14 @@ int nxagentGCTrap = False; * Window. Used to remove any screen operation. */ -int nxagentScreenTrap = False; +int nxagentScreenTrap = 0; /* * Set if we detected that our RENDER * implementation is faulty. */ -int nxagentRenderTrap = False; +int nxagentRenderTrap = 0; /* * Set if we are executing a GC operation @@ -54,55 +54,55 @@ int nxagentRenderTrap = False; * reentrancy in FB layer. */ -int nxagentFBTrap = False; +int nxagentFBTrap = 0; /* * Set if we are dispatching a shared * memory extension request. */ -int nxagentShmTrap = False; +int nxagentShmTrap = 0; /* * Set if a shared pixmap operation is * requested by the client. */ -int nxagentShmPixmapTrap = False; +int nxagentShmPixmapTrap = 0; /* * Set if we are dispatching a XVideo * extension request. */ -int nxagentXvTrap = False; +int nxagentXvTrap = 0; /* * Set if we are dispatching a GLX * extension request. */ -int nxagentGlxTrap = False; +int nxagentGlxTrap = 0; /* * Set while we are resuming the session. */ -int nxagentReconnectTrap = False; +int nxagentReconnectTrap = 0; /* * Set if we need to realize a drawable * by using a lossless encoding. */ -int nxagentLosslessTrap = False; +int nxagentLosslessTrap = 0; /* * Set to force the synchronization of * a drawable. */ -int nxagentSplitTrap = False; +int nxagentSplitTrap = 0; /* * Set to avoid CapsLock synchronization @@ -110,7 +110,7 @@ int nxagentSplitTrap = False; * key to be pressed in the session. */ -int nxagentXkbCapsTrap = False; +int nxagentXkbCapsTrap = 0; /* * Set to avoid NumLock synchronization @@ -118,5 +118,5 @@ int nxagentXkbCapsTrap = False; * key to be pressed in the session. */ -int nxagentXkbNumTrap = False; +int nxagentXkbNumTrap = 0; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.h b/nx-X11/programs/Xserver/hw/nxagent/Trap.h index 1abacda..f0884f6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.h @@ -26,14 +26,6 @@ #ifndef __Traps_H__ #define __Traps_H__ -#ifndef True -# define True 1 -#endif - -#ifndef False -# define False 0 -#endif - /* * Set if we are dispatching a render * extension request. Used to avoid diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index ce0563f..c404d0a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -397,7 +397,7 @@ Bool nxagentCreateWindow(WindowPtr pWin) nxagentWindowPriv(pWin) -> corruptedTimestamp = 0; nxagentWindowPriv(pWin) -> splitResource = NULL; - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 1) { if (pWin != nxagentRootlessWindow) { @@ -557,7 +557,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) { nxagentPrivWindowPtr pWindowPriv; - if (nxagentScreenTrap) + if (nxagentScreenTrap == 1) { return 1; } @@ -685,7 +685,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) { - if (nxagentScreenTrap) + if (nxagentScreenTrap == 1) { return True; } @@ -703,7 +703,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) { - if (nxagentScreenTrap) + if (nxagentScreenTrap == 1) { return; } @@ -713,7 +713,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) { - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 1) { return; } @@ -908,9 +908,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e); nxagentFullscreenWindow = w; - if (nxagentOption(DesktopResize)) + if (nxagentOption(DesktopResize) == 1) { - if (!nxagentOption(Shadow)) + if (nxagentOption(Shadow) == 0) { nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); @@ -959,12 +959,12 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentIconWindow = nxagentFullscreenWindow = None; - if (nxagentOption(DesktopResize)) + if (nxagentOption(DesktopResize) == 1) { nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); - if (!nxagentOption(Shadow)) + if (nxagentOption(Shadow) == 0) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentOption(RootHeight)); @@ -985,7 +985,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentChangeOption(Width, nxagentOption(SavedWidth)); nxagentChangeOption(Height, nxagentOption(SavedHeight)); - if (nxagentOption(Shadow) && nxagentOption(DesktopResize)) + if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1) { nxagentShadowAdaptToRatio(); } @@ -1225,7 +1225,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) int offX = nxagentWindowPriv(pWin)->x - pWin->origin.x; int offY = nxagentWindowPriv(pWin)->y - pWin->origin.y; - if (nxagentScreenTrap) + if (nxagentScreenTrap == 1) { #ifdef TEST fprintf(stderr, "nxagentConfigureWindow: WARNING: Called with the screen trap set.\n"); @@ -1234,7 +1234,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) return; } - if (nxagentOption(Rootless) && + if (nxagentOption(Rootless) == 1 && nxagentWindowTopLevel(pWin) == 1) { mask &= ~(CWSibling | CWStackMode); @@ -1836,7 +1836,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired) Bool nxagentRealizeWindow(WindowPtr pWin) { - if (nxagentScreenTrap) + if (nxagentScreenTrap == 1) { return True; } @@ -2427,7 +2427,7 @@ void nxagentRefreshWindows(WindowPtr pWin) void nxagentUnmapWindows(void) { - if (nxagentOption(Fullscreen)) + if (nxagentOption(Fullscreen) == 1) { for (int i = 0; i < screenInfo.numScreens; i++) { @@ -2450,7 +2450,7 @@ void nxagentMapDefaultWindows(void) MapWindow(pWin, serverClient); - if (!nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 0) { /* * Show the NX splash screen. @@ -2470,7 +2470,7 @@ void nxagentMapDefaultWindows(void) * Windows client. */ - if (!nxagentOption(Shadow) || !nxagentWMIsRunning) + if (nxagentOption(Shadow) == 0 || !nxagentWMIsRunning) { #ifdef TEST fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n", @@ -2479,7 +2479,7 @@ void nxagentMapDefaultWindows(void) XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); - if (nxagentOption(Fullscreen) && nxagentWMIsRunning) + if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning) { nxagentMaximizeToFullScreen(pScreen); } @@ -2497,7 +2497,7 @@ void nxagentMapDefaultWindows(void) * after the Root Window is mapped. */ - if (!nxagentReconnectTrap) + if (nxagentReconnectTrap == 0) { XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]); } @@ -2693,7 +2693,7 @@ Bool nxagentReconnectAllWindows(void *p0) * Windows is raised. */ - if (!nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 0) { for (int i = 0; i < screenInfo.numScreens; i++) { @@ -3196,7 +3196,7 @@ XXX: This would break Motif menus. XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum); } } - else if (!nxagentOption(Rootless)) + else if (nxagentOption(Rootless) == 0) { /* * Map the root window. -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 34e4291de2c261f9dd047a7e18cf46eeaf84662a Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 7 23:04:23 2019 +0100 Screen.c: simplify and fix handling of rootless mode Fixes: ArcticaProject/nx-libs#765 --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 40 ++++++++++++----------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 19057df..103cd1d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1050,8 +1050,22 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, nxagentChangeOption(RootY, (h - nxagentOption(RootHeight)) / 2); } } - else + else if (nxagentOption(Rootless)) { + nxagentChangeOption(X, 0); + nxagentChangeOption(Y, 0); + + nxagentChangeOption(RootX, 0); + nxagentChangeOption(RootY, 0); + + nxagentChangeOption(RootWidth, w); + nxagentChangeOption(RootHeight, h); + + nxagentChangeOption(Width, w); + nxagentChangeOption(Height, h); + } + else /* window mode */ + { /* * screen is initialized for the first time */ @@ -1080,26 +1094,12 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, if (nxagentOption(Width) > w) { - if (nxagentOption(Rootless)) - { - nxagentChangeOption(Width, w); - } - else - { - nxagentChangeOption(Width, w * 3 / 4); - } + nxagentChangeOption(Width, w * 3 / 4); } if (nxagentOption(Height) > h) { - if (nxagentOption(Rootless)) - { - nxagentChangeOption(Height, h); - } - else - { - nxagentChangeOption(Height, h * 3 / 4); - } + nxagentChangeOption(Height, h * 3 / 4); } /* @@ -1135,12 +1135,6 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, nxagentChangeOption(SavedHeight, nxagentOption(RootHeight)); } - if (nxagentOption(Rootless)) - { - nxagentChangeOption(RootWidth, w); - nxagentChangeOption(RootHeight, h); - } - nxagentChangeOption(SavedRootWidth, nxagentOption(RootWidth)); nxagentChangeOption(SavedRootHeight, nxagentOption(RootHeight)); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit a3dc87d6b45c09a1c8959976b18513635fdca225 Merge: 24d7d0f f1b27c4 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Feb 15 11:48:27 2019 +0100 Merge branch 'uli42-pr/fix_keystrokes' into 3.6.x Attributes GH PR #774: https://github.com/ArcticaProject/nx-libs/pull/774 etc/keystrokes.cfg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit de421e4fe03013735f550255f082ebb58f339bd5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Feb 20 10:40:20 2019 +0100 Revert "Fix parsing ports set to unix sockets" This reverts commit 889de46f759913742478d2cfe20f1f4a6c2effdc. Fixes ArcticaProject/nx-libs#775. --- nxcomp/src/Loop.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp index 8e6f20e..ddffcd1 100644 --- a/nxcomp/src/Loop.cpp +++ b/nxcomp/src/Loop.cpp @@ -7803,7 +7803,6 @@ int ParseEnvironmentOptions(const char *env, int force) strcpy(opts, env); char *nextOpts = opts; - bool nxdisplay_found = false; // // Ensure that DISPLAY environment variable @@ -7825,17 +7824,14 @@ int ParseEnvironmentOptions(const char *env, int force) else if (strncasecmp(opts, "nx/nx,", 6) == 0) { nextOpts += 6; - nxdisplay_found = true; } else if (strncasecmp(opts, "nx,", 3) == 0) { nextOpts += 3; - nxdisplay_found = true; } else if (strncasecmp(opts, "nx:", 3) == 0) { nextOpts += 3; - nxdisplay_found = true; } else if (force == 0) { @@ -7864,7 +7860,7 @@ int ParseEnvironmentOptions(const char *env, int force) value = strrchr(nextOpts, ':'); - if (value != NULL && nxdisplay_found ) + if (value != NULL) { char *check = value + 1; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 66315e4f34417a794d3cc5f4145fe2ea35850e68 Merge: a3dc87d fc29077 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Feb 18 08:47:40 2019 +0100 Merge branch 'uli42-pr/session_types' into 3.6.x Attributes GH PR #776: https://github.com/ArcticaProject/nx-libs/pull/776 nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 3 +-- nxcomp/src/Misc.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit fc29077594fa20fb5243cfa8b5daf073d357b020 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Feb 18 08:45:11 2019 +0100 Keyboard.c: fix comment. --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index af27c6e..05adab4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -870,8 +870,7 @@ XkbError: * when cloning we do not want X2Go to set the keyboard * via a keyboard file generated by nxagent. The defined * method for switching that off is the creation of a dir - * instead of a file. Which is achieved by passing NULL to - * nxagentWriteKeyboardFile. + * instead of a file. */ if (nxagentX2go == 1) nxagentWriteKeyboardDir(); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 3572b251eb21d310ad49e6bdab11e36018b67d7c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Feb 20 10:37:16 2019 +0100 Regression fix for bfc05af7. Properly end lines in help/usage text. Fixes ArcticaProject/nx-libs#777. --- nxcomp/src/Misc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxcomp/src/Misc.cpp b/nxcomp/src/Misc.cpp index 5194892..c626eb9 100644 --- a/nxcomp/src/Misc.cpp +++ b/nxcomp/src/Misc.cpp @@ -165,7 +165,7 @@ static const char UsageInfo[] = \n\ type=s Type of session. Known types are: 'agent', 'proxy' and\n\ 'shadow'. The following types are also allowed and will\n\ - map to one of the three mentioned before: 'desktop',\n\ \ + map to one of the three mentioned before: 'desktop',\n\ 'rootless', 'console', 'default', 'gnome', 'kde',\n\ 'cde', 'xdm', 'win', 'vnc', 'application', 'raw'\n\ \n\ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit bfc05af73df842ed48ee46ae6e4df516335024fe Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Feb 17 18:00:28 2019 +0100 nxproxy: list known session types in help output The old unix-* session types are deprecated and will always lead to a warning message "Unrecognized session type". Internally there are only three session types: agent, proxy and shadow, all the others are mapped to one of those three. --- nxcomp/src/Misc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nxcomp/src/Misc.cpp b/nxcomp/src/Misc.cpp index 4f1af0e..5194892 100644 --- a/nxcomp/src/Misc.cpp +++ b/nxcomp/src/Misc.cpp @@ -163,8 +163,11 @@ static const char UsageInfo[] = 'wan', 'lan', 'local' or a bandwidth specification,\n\ like for example '56k', '1m', '100m', etc.\n\ \n\ - type=s Type of session, for example 'windows', 'unix-kde'.\n\ - 'unix-application', etc.\n\ + type=s Type of session. Known types are: 'agent', 'proxy' and\n\ + 'shadow'. The following types are also allowed and will\n\ + map to one of the three mentioned before: 'desktop',\n\ \ + 'rootless', 'console', 'default', 'gnome', 'kde',\n\ + 'cde', 'xdm', 'win', 'vnc', 'application', 'raw'\n\ \n\ display=s Specify the real display where X connections have\n\ to be forwarded by the proxy running on the client.\n\ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit f1b27c4fd46f6961535d908ead695d9c6d2701d4 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Feb 15 09:27:29 2019 +0100 keystrokes.cfg: Add missing Shift=1 for viewport_move_up/down/right These keystrokes where the same as their viewport_scroll variants and made the latter being disabled. Fixes ArcticaProject/nx-libs#770 --- etc/keystrokes.cfg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/keystrokes.cfg b/etc/keystrokes.cfg index b482119..c57d2ef 100644 --- a/etc/keystrokes.cfg +++ b/etc/keystrokes.cfg @@ -10,12 +10,12 @@ <keystroke action="resize" Control="1" AltMeta="1" key="r" /> <keystroke action="viewport_move_left" Control="1" Shift="1" AltMeta="1" key="Left" /> <keystroke action="viewport_move_left" Control="1" Shift="1" AltMeta="1" key="KP_Left" /> -<keystroke action="viewport_move_up" Control="1" AltMeta="1" key="Up" /> -<keystroke action="viewport_move_up" Control="1" AltMeta="1" key="KP_Up" /> -<keystroke action="viewport_move_right" Control="1" AltMeta="1" key="Right" /> -<keystroke action="viewport_move_right" Control="1" AltMeta="1" key="KP_Right" /> -<keystroke action="viewport_move_down" Control="1" AltMeta="1" key="Down" /> -<keystroke action="viewport_move_down" Control="1" AltMeta="1" key="KP_Down" /> +<keystroke action="viewport_move_up" Control="1" Shift="1" AltMeta="1" key="Up" /> +<keystroke action="viewport_move_up" Control="1" Shift="1" AltMeta="1" key="KP_Up" /> +<keystroke action="viewport_move_right" Control="1" Shift="1" AltMeta="1" key="Right" /> +<keystroke action="viewport_move_right" Control="1" Shift="1" AltMeta="1" key="KP_Right" /> +<keystroke action="viewport_move_down" Control="1" Shift="1" AltMeta="1" key="Down" /> +<keystroke action="viewport_move_down" Control="1" Shift="1" AltMeta="1" key="KP_Down" /> <keystroke action="viewport_scroll_left" Control="1" AltMeta="1" key="Left" /> <keystroke action="viewport_scroll_left" Control="1" AltMeta="1" key="KP_Left" /> <keystroke action="viewport_scroll_up" Control="1" AltMeta="1" key="Up" /> -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 71a3b8447d2de86db7d4a7f26b3b2c0bc9e01541 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Feb 20 22:25:46 2019 +0100 nx-X11/lib/configure.ac: fix version number reflect the version of libX11 we are basing on --- nx-X11/lib/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/lib/configure.ac b/nx-X11/lib/configure.ac index 0c04f91..990ed31 100644 --- a/nx-X11/lib/configure.ac +++ b/nx-X11/lib/configure.ac @@ -1,6 +1,6 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libNX_X11], [1.6.5], +AC_INIT([libNX_X11], [1.6.7], [https://github.com/ArcticaProject/nx-libs/issues], [libNX_X11]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([Makefile.am]) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit f2e48fb73463b7047b7b9907819a14ad2052368e Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Feb 20 22:39:48 2019 +0100 nx-X11/lib/configure.ac: add forgotten status line --- nx-X11/lib/configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/nx-X11/lib/configure.ac b/nx-X11/lib/configure.ac index 990ed31..025d271 100644 --- a/nx-X11/lib/configure.ac +++ b/nx-X11/lib/configure.ac @@ -332,6 +332,7 @@ AC_OUTPUT echo "" echo "NX_X11 will be built with the following settings:" +echo " Loadable xcursor library support: "$XLIB_LOADABLE_XCURSOR echo " Threading support: "$xthreads echo " Use Threads safe API: "$mtsafeapi echo " Threads stubs in libNX_X11: "$thrstubs -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 36a7f04133f64e0d4b8a0ff8f1339059bc7c7c62 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Feb 20 13:14:43 2019 +0100 nx-X11/lib/configure.ac: Assure that the USE_DYNAMIC_XCURSOR macro is defined at build-time. Fixes ArcticaProject/nx-libs#768. --- nx-X11/lib/configure.ac | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/nx-X11/lib/configure.ac b/nx-X11/lib/configure.ac index a4da045..0c04f91 100644 --- a/nx-X11/lib/configure.ac +++ b/nx-X11/lib/configure.ac @@ -54,6 +54,39 @@ m4_pattern_forbid([^NX_XTRANS_CONNECTION_FLAGS$]) # Transport selection macro from nx-xtrans.m4 NX_XTRANS_CONNECTION_FLAGS +# Check for dlopen +AC_MSG_CHECKING([if run-time linking is supported]) +AC_SEARCH_LIBS(dlopen,[dl svld]) +if test "x$ac_cv_search_dlopen" = xno; then + AC_SEARCH_LIBS(shl_load,[dld]) + if test "x$ac_cv_search_shl_load" != xno; then + AC_DEFINE(HAVE_SHL_LOAD,1, + [Use shl_load to load shared libraries]) + AC_CHECK_HEADERS([dl.h]) + fi +else + AC_DEFINE(HAVE_DLOPEN,1,[Use dlopen to load shared libraries]) + AC_CHECK_HEADERS([dlfcn.h]) +fi +if test "x$ac_cv_header_dlfcn_h" = xyes -o "x$ac_cv_header_dl_h" = xyes; then + HAVE_LOADABLE_MODULES=yes +else + HAVE_LOADABLE_MODULES=no +fi +AC_MSG_RESULT($HAVE_LOADABLE_MODULES) + +AC_MSG_CHECKING([if loadable Xcursor library support should be enabled]) +AC_ARG_ENABLE(loadable-xcursor, + AS_HELP_STRING([--disable-loadable-xcursor], + [Controls loadable xcursor library support]), + [XLIB_LOADABLE_XCURSOR=$enableval], + [XLIB_LOADABLE_XCURSOR=$HAVE_LOADABLE_MODULES]) +if test x$XLIB_LOADABLE_XCURSOR = xyes; then + AC_DEFINE(USE_DYNAMIC_XCURSOR,1, + [Use the X cursor library to load cursors]) +fi +AC_MSG_RESULT($XLIB_LOADABLE_XCURSOR) + # Checks for header files. AC_CHECK_HEADERS([sys/select.h]) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 0eb71d78a13e8876aaa61a9fa08bb20046a8f17b Merge: de421e4 36a7f04 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Feb 20 22:05:01 2019 +0100 Merge branch 'gh-sunweaver/pr/xlib-loadable-modules' into 3.6.x Attributes GH PR 778: https://github.com/ArcticaProject/nx-libs/pull/778 nx-X11/lib/configure.ac | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit a70e36c8114c0358258e8c3964b9d897884e265e Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 28 22:09:28 2019 +0100 ConnDis.c: remove obsolete MNX_TCPCONN Fixes ArcticaProject/nx-libs#399 --- nx-X11/lib/src/ConnDis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/lib/src/ConnDis.c b/nx-X11/lib/src/ConnDis.c index dfc0227..06ba957 100644 --- a/nx-X11/lib/src/ConnDis.c +++ b/nx-X11/lib/src/ConnDis.c @@ -498,7 +498,7 @@ _X11TransConnectDisplay ( #endif -#if defined(TCPCONN) || defined(UNIXCONN) || defined(LOCALCONN) || defined(MNX_TCPCONN) +#if defined(TCPCONN) || defined(UNIXCONN) || defined(LOCALCONN) if (!pprotocol) { #if defined(UNIXCONN) if (phostname && (strcmp (phostname, "unix") == 0)) { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 471342933b19bb0648d4f339be6e160545013f51 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 18 22:10:54 2019 +0100 Fix: clang does not know about gnu_printf Found via Travis CI --- nxcompshad/src/Logger.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h index 876cb04..e0b9997 100644 --- a/nxcompshad/src/Logger.h +++ b/nxcompshad/src/Logger.h @@ -46,17 +46,17 @@ class Logger { public: - void user(const char *format, ...) __attribute__((format(gnu_printf, 2, 3))); + void user(const char *format, ...) __attribute__((format(printf, 2, 3))); void error(const char *name, int error); - void warning(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); + void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); - void test(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); + void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); void trace(const char *name); - void debug(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); + void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); void dump(const char *name, const char *data, int size); }; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit d156ce5ab6afa3bc67189f4985e1517d5aca52b3 Merge: a70e36c e7a5007 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 11:59:55 2019 +0100 Merge branch 'uli42-pr/xfixes_memset' into 3.6.x Attributes GH PR #788: https://github.com/ArcticaProject/nx-libs/pull/788 nx-X11/programs/Xserver/GL/glx/glxcmds.c | 4 +-- nx-X11/programs/Xserver/Xext/sync.c | 2 +- nx-X11/programs/Xserver/damageext/damageext.c | 10 ++++---- nx-X11/programs/Xserver/dbe/dbe.c | 34 ++++++++++++++------------ nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 15 ++++++------ nx-X11/programs/Xserver/record/record.c | 35 ++++++++++++++++----------- nx-X11/programs/Xserver/render/render.c | 18 +++++++------- nx-X11/programs/Xserver/xfixes/cursor.c | 24 +++++++++--------- nx-X11/programs/Xserver/xfixes/region.c | 4 +-- nx-X11/programs/Xserver/xfixes/xfixes.c | 11 +++++---- 10 files changed, 85 insertions(+), 72 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit c81a45785970aa198736d8dc578beb2d7bbd1b2f Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 28 23:11:23 2019 +0100 Use calloc to zero fill buffers being allocated for replies & events commit cdf5bcd420e5bcf4a4a24a275d3133a4e16ce41e Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon Jul 9 19:12:42 2012 -0700 Use calloc to zero fill buffers being allocated for replies & events Ensures padding bytes are zero-filled Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org> Attributes ArcticaProject/nx-libs#382 --- nx-X11/programs/Xserver/GL/glx/glxcmds.c | 4 ++-- nx-X11/programs/Xserver/Xext/sync.c | 2 +- nx-X11/programs/Xserver/render/render.c | 4 ++-- nx-X11/programs/Xserver/xfixes/cursor.c | 8 ++++---- nx-X11/programs/Xserver/xfixes/region.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/nx-X11/programs/Xserver/GL/glx/glxcmds.c b/nx-X11/programs/Xserver/GL/glx/glxcmds.c index 3536977..16ecdb1 100644 --- a/nx-X11/programs/Xserver/GL/glx/glxcmds.c +++ b/nx-X11/programs/Xserver/GL/glx/glxcmds.c @@ -2084,7 +2084,7 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc) reply.n = n; /* Allocate buffer to make sure it's a multiple of 4 bytes big.*/ - buf = (char *) malloc(length << 2); + buf = calloc(length, 4); if (buf == NULL) return BadAlloc; memcpy(buf, ptr, n); @@ -2141,7 +2141,7 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc) reply.length = length; reply.n = n; - if ((buf = (char *) malloc(length << 2)) == NULL) { + if ((buf = calloc(length, 4)) == NULL) { return BadAlloc; } memcpy(buf, ptr, n); diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index bc7cb40..00f30e4 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -590,7 +590,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events) if (client->clientGone) return; pev = pEvents = (xSyncCounterNotifyEvent *) - malloc(num_events * sizeof(xSyncCounterNotifyEvent)); + calloc(num_events, sizeof(xSyncCounterNotifyEvent)); if (!pEvents) return; UpdateCurrentTime(); diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 3c1cbe5..78677b7 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -580,7 +580,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) num = pFormat->index.nvalues; rlength = (sizeof (xRenderQueryPictIndexValuesReply) + num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) malloc (rlength); + reply = (xRenderQueryPictIndexValuesReply *) calloc (1, rlength); if (!reply) return BadAlloc; @@ -1746,7 +1746,7 @@ ProcRenderQueryFilters (ClientPtr client) } len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2); total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) malloc (total_bytes); + reply = (xRenderQueryFiltersReply *) calloc (1, total_bytes); if (!reply) return BadAlloc; aliases = (INT16 *) (reply + 1); diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 152bda5..b80bd90 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -364,8 +364,8 @@ ProcXFixesGetCursorImage (ClientPtr client) width = pCursor->bits->width; height = pCursor->bits->height; npixels = width * height; - rep = malloc (sizeof (xXFixesGetCursorImageReply) + - npixels * sizeof (CARD32)); + rep = calloc (sizeof (xXFixesGetCursorImageReply) + + npixels * sizeof (CARD32), 1); if (!rep) return BadAlloc; @@ -508,8 +508,8 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) name = pCursor->name ? NameForAtom (pCursor->name) : ""; nbytes = strlen (name); nbytesRound = (nbytes + 3) & ~3; - rep = malloc (sizeof (xXFixesGetCursorImageAndNameReply) + - npixels * sizeof (CARD32) + nbytesRound); + rep = calloc (sizeof (xXFixesGetCursorImageAndNameReply) + + npixels * sizeof (CARD32) + nbytesRound, 1); if (!rep) return BadAlloc; diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index ba8c628..849df68 100644 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -570,8 +570,8 @@ ProcXFixesFetchRegion (ClientPtr client) pBox = RegionRects (pRegion); nBox = RegionNumRects (pRegion); - reply = malloc (sizeof (xXFixesFetchRegionReply) + - nBox * sizeof (xRectangle)); + reply = calloc (sizeof (xXFixesFetchRegionReply) + + nBox * sizeof (xRectangle), 1); if (!reply) return BadAlloc; reply->type = X_Reply; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit c6b6a8fcb75023b89ec1d4b9f3ce3c9eb44764e1 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 28 23:13:49 2019 +0100 Use C99 designated initializers in various extension Replies commit cc5f09c86f7bea23b7546c3491b2c52ce8100a71 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon Jul 9 19:12:43 2012 -0700 Use C99 designated initializers in various extension Replies Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org> Attributes ArcticaProject/nx-libs#382 --- nx-X11/programs/Xserver/damageext/damageext.c | 10 ++++---- nx-X11/programs/Xserver/dbe/dbe.c | 34 ++++++++++++++------------ nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 15 ++++++------ nx-X11/programs/Xserver/record/record.c | 35 ++++++++++++++++----------- nx-X11/programs/Xserver/render/render.c | 14 +++++------ nx-X11/programs/Xserver/xfixes/cursor.c | 12 +++++---- nx-X11/programs/Xserver/xfixes/xfixes.c | 11 +++++---- 7 files changed, 72 insertions(+), 59 deletions(-) diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c index b9d99a5..56677e3 100644 --- a/nx-X11/programs/Xserver/damageext/damageext.c +++ b/nx-X11/programs/Xserver/damageext/damageext.c @@ -132,15 +132,15 @@ static int ProcDamageQueryVersion(ClientPtr client) { DamageClientPtr pDamageClient = GetDamageClient (client); - xDamageQueryVersionReply rep; + xDamageQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xDamageQueryVersionReq); REQUEST_SIZE_MATCH(xDamageQueryVersionReq); - memset(&rep, 0, sizeof(xDamageQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index 588dd05..4465713 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -312,16 +312,16 @@ static int ProcDbeGetVersion(ClientPtr client) { /* REQUEST(xDbeGetVersionReq); */ - xDbeGetVersionReply rep; + xDbeGetVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = DBE_MAJOR_VERSION, + .minorVersion = DBE_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xDbeGetVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = DBE_MAJOR_VERSION; - rep.minorVersion = DBE_MINOR_VERSION; - if (client->swapped) { swaps(&rep.sequenceNumber); @@ -946,10 +946,12 @@ ProcDbeGetVisualInfo(ClientPtr client) length += pScrVisInfo[i].count * sizeof(xDbeVisInfo); } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = length >> 2; - rep.m = count; + rep = (xDbeGetVisualInfoReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = length >> 2, + .m = count + }; if (client->swapped) { @@ -1041,7 +1043,11 @@ static int ProcDbeGetBackBufferAttributes(ClientPtr client) { REQUEST(xDbeGetBackBufferAttributesReq); - xDbeGetBackBufferAttributesReply rep; + xDbeGetBackBufferAttributesReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; DbeWindowPrivPtr pDbeWindowPriv; REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); @@ -1056,10 +1062,6 @@ ProcDbeGetBackBufferAttributes(ClientPtr client) rep.attributes = pDbeWindowPriv->pWindow->drawable.id; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - if (client->swapped) { swaps(&rep.sequenceNumber); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index ce4ea9d..fd9c0be 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -135,7 +135,14 @@ static int ProcRenderQueryVersion (ClientPtr client) { RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryVersionReply rep; + xRenderQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = nxagentRenderVersionMajor, + .minorVersion = nxagentRenderVersionMinor + }; + REQUEST(xRenderQueryVersionReq); REQUEST_SIZE_MATCH(xRenderQueryVersionReq); @@ -143,12 +150,6 @@ ProcRenderQueryVersion (ClientPtr client) pRenderClient->major_version = stuff->majorVersion; pRenderClient->minor_version = stuff->minorVersion; - memset(&rep, 0, sizeof(xRenderQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = nxagentRenderVersionMajor; - rep.minorVersion = nxagentRenderVersionMinor; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index c18b96e..31803a2 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -1949,14 +1949,16 @@ static int ProcRecordQueryVersion(ClientPtr client) { /* REQUEST(xRecordQueryVersionReq); */ - xRecordQueryVersionReply rep; + xRecordQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_RECORD_MAJOR_VERSION, + .minorVersion = SERVER_RECORD_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xRecordQueryVersionReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.majorVersion = SERVER_RECORD_MAJOR_VERSION; - rep.minorVersion = SERVER_RECORD_MINOR_VERSION; + if(client->swapped) { swaps(&rep.sequenceNumber); @@ -2287,6 +2289,7 @@ ProcRecordGetContext(ClientPtr client) GetContextRangeInfoPtr pri; int i; int err; + CARD32 nClients, length; REQUEST_SIZE_MATCH(xRecordGetContextReq); VERIFY_CONTEXT(pContext, stuff->context, client); @@ -2359,24 +2362,28 @@ ProcRecordGetContext(ClientPtr client) /* calculate number of clients and reply length */ - rep.nClients = 0; - rep.length = 0; + nClients = 0; + length = 0; for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo; pRCAP; pRCAP = pRCAP->pNextRCAP, pri++) { - rep.nClients += pRCAP->numClients; - rep.length += pRCAP->numClients * + nClients += pRCAP->numClients; + length += pRCAP->numClients * ( (sizeof(xRecordClientInfo) >> 2) + pri->nRanges * (sizeof(xRecordRange) >> 2)); } /* write the reply header */ - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.enabled = pContext->pRecordingClient != NULL; - rep.elementHeader = pContext->elemHeaders; + rep = (xRecordGetContextReply) { + .type = X_Reply, + .enabled = pContext->pRecordingClient != NULL, + .sequenceNumber = client->sequence, + .length = length, + .elementHeader = pContext->elemHeaders, + .nClients = nClients + }; if(client->swapped) { swaps(&rep.sequenceNumber); diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 78677b7..e4d8a3f 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -274,7 +274,13 @@ static int ProcRenderQueryVersion (ClientPtr client) { RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryVersionReply rep; + xRenderQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_RENDER_MAJOR_VERSION, + .minorVersion = SERVER_RENDER_MINOR_VERSION + }; REQUEST(xRenderQueryVersionReq); @@ -283,12 +289,6 @@ ProcRenderQueryVersion (ClientPtr client) pRenderClient->major_version = stuff->majorVersion; pRenderClient->minor_version = stuff->minorVersion; - memset(&rep, 0, sizeof(xRenderQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_RENDER_MAJOR_VERSION; - rep.minorVersion = SERVER_RENDER_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index b80bd90..8f258e3 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -456,11 +456,13 @@ ProcXFixesGetCursorName (ClientPtr client) str = ""; len = strlen (str); - reply.type = X_Reply; - reply.length = (len + 3) >> 2; - reply.sequenceNumber = client->sequence; - reply.atom = pCursor->name; - reply.nbytes = len; + reply = (xXFixesGetCursorNameReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = (len + 3) >> 2, + .atom = pCursor->name, + .nbytes = len + }; if (client->swapped) { swaps(&reply.sequenceNumber); swapl(&reply.length); diff --git a/nx-X11/programs/Xserver/xfixes/xfixes.c b/nx-X11/programs/Xserver/xfixes/xfixes.c index fadaf73..7fe94a9 100644 --- a/nx-X11/programs/Xserver/xfixes/xfixes.c +++ b/nx-X11/programs/Xserver/xfixes/xfixes.c @@ -56,14 +56,15 @@ static int ProcXFixesQueryVersion(ClientPtr client) { XFixesClientPtr pXFixesClient = GetXFixesClient (client); - xXFixesQueryVersionReply rep; + xXFixesQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xXFixesQueryVersionReq); REQUEST_SIZE_MATCH(xXFixesQueryVersionReq); - memset(&rep, 0, sizeof(xXFixesQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + if (stuff->majorVersion < SERVER_XFIXES_MAJOR_VERSION) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit e7a50079ed90bd9f9f292d3f40ed3905c034a4cc Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 28 23:15:22 2019 +0100 xfixes: use calloc for some structs Attributes ArcticaProject/nx-libs#382 --- nx-X11/programs/Xserver/xfixes/cursor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 8f258e3..fc4c1d8 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -201,7 +201,7 @@ XFixesSelectCursorInput (ClientPtr pClient, } if (!e) { - e = (CursorEventPtr) malloc (sizeof (CursorEventRec)); + e = (CursorEventPtr) calloc (1, sizeof (CursorEventRec)); if (!e) return BadAlloc; @@ -759,7 +759,7 @@ createCursorHideCount (ClientPtr pClient, ScreenPtr pScreen) CursorScreenPtr cs = GetCursorScreen(pScreen); CursorHideCountPtr pChc; - pChc = (CursorHideCountPtr) malloc(sizeof(CursorHideCountRec)); + pChc = (CursorHideCountPtr) calloc(1, sizeof(CursorHideCountRec)); if (pChc == NULL) { return BadAlloc; } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit a8ed28234ab8f5bdedc18a60c37e7f427090e8b1 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 18 22:47:38 2019 +0100 Xlib: remove register keywords storage class specifier is deprecated and incompatible with C++17 --- nx-X11/lib/include/X11/Xlibint.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/nx-X11/lib/include/X11/Xlibint.h b/nx-X11/lib/include/X11/Xlibint.h index d38c87e..ce20b9a 100644 --- a/nx-X11/lib/include/X11/Xlibint.h +++ b/nx-X11/lib/include/X11/Xlibint.h @@ -709,12 +709,12 @@ extern void _XFlushGCCache(Display *dpy, GC gc); #define Data32(dpy, data, len) _XData32(dpy, (_Xconst long *)data, len) extern int _XData32( Display *dpy, - register _Xconst long *data, + _Xconst long *data, unsigned len ); extern void _XRead32( Display *dpy, - register long *data, + long *data, long len ); #else @@ -1415,10 +1415,10 @@ extern int _XF86LoadQueryLocaleFont( ); extern void _XProcessWindowAttributes ( - register Display *dpy, + Display *dpy, xChangeWindowAttributesReq *req, - register unsigned long valuemask, - register XSetWindowAttributes *attributes); + unsigned long valuemask, + XSetWindowAttributes *attributes); extern int _XDefaultError( Display *dpy, @@ -1428,7 +1428,7 @@ extern int _XDefaultIOError( Display *dpy); extern void _XSetClipRectangles ( - register Display *dpy, + Display *dpy, GC gc, int clip_x_origin, int clip_y_origin, XRectangle *rectangles, @@ -1436,13 +1436,13 @@ extern void _XSetClipRectangles ( int ordering); Status _XGetWindowAttributes( - register Display *dpy, + Display *dpy, Window w, XWindowAttributes *attr); int _XPutBackEvent ( - register Display *dpy, - register XEvent *event); + Display *dpy, + XEvent *event); extern Bool _XIsEventCookie( Display *dpy, -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit a53c655474c96fc24e38009804291882793c2a3f Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 18 23:44:47 2019 +0100 Logger.h: fix missing compiler attribute --- nxcompshad/src/Logger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h index e0b9997..88908f7 100644 --- a/nxcompshad/src/Logger.h +++ b/nxcompshad/src/Logger.h @@ -68,7 +68,7 @@ static inline void logError(const char *name, int error) \ __attribute__((__unused__)); static inline void logWarning(const char *name, const char *format, ...) \ - __attribute__((__unused__)); + __attribute__((format(printf, 2, 3))) __attribute__((__unused__)); static inline void logTest(const char *name, const char *format, ...) \ __attribute__((format(printf, 2, 3))) __attribute__((__unused__)); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit e1f2a24f637cb1727667f68076fbe66fe9c1660e Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 18 22:44:21 2019 +0100 xlib: remove superflous parens --- nx-X11/lib/src/xkb/XKBBind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/lib/src/xkb/XKBBind.c b/nx-X11/lib/src/xkb/XKBBind.c index c679dc5..068e8f2 100644 --- a/nx-X11/lib/src/xkb/XKBBind.c +++ b/nx-X11/lib/src/xkb/XKBBind.c @@ -165,7 +165,7 @@ XKeysymToKeycode(Display *dpy, KeySym ks) for (i = dpy->min_keycode; i <= dpy->max_keycode; i++) { if (j < (int) XkbKeyNumSyms(xkb, i)) { gotOne = 1; - if ((XkbKeySym(xkb, i, j) == ks)) + if (XkbKeySym(xkb, i, j) == ks) return i; } } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 0934b1e673d002c69a0c6fa846931df62acd5fb8 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 18 22:41:05 2019 +0100 nxcomp: fix unused variables --- nxcomp/src/TranslateCoords.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nxcomp/src/TranslateCoords.h b/nxcomp/src/TranslateCoords.h index 997d079..fd9b159 100644 --- a/nxcomp/src/TranslateCoords.h +++ b/nxcomp/src/TranslateCoords.h @@ -84,10 +84,10 @@ class TranslateCoordsMessage : public Message unsigned int src_x; unsigned int src_y; - unsigned char r_same_screen; - unsigned int r_child_window; - unsigned int r_dst_x; - unsigned int r_dst_y; + // unsigned char r_same_screen; + // unsigned int r_child_window; + // unsigned int r_dst_x; + // unsigned int r_dst_y; }; class TranslateCoordsStore : public MessageStore -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 0e481f8aaf5faf0aed4cf5ea9bdbb7d458d9efdc Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 18 22:38:31 2019 +0100 nxcomp: fix unused variable --- nxcomp/src/Timestamp.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/nxcomp/src/Timestamp.cpp b/nxcomp/src/Timestamp.cpp index 4a9dd33..273f282 100644 --- a/nxcomp/src/Timestamp.cpp +++ b/nxcomp/src/Timestamp.cpp @@ -49,7 +49,6 @@ std::string strTimestamp(const T_timestamp &ts) std::string ret; char ctime_now[26] = { }; - bool err = true; #if HAVE_CTIME_S errno_t retval = ::ctime_s(ctime_now, sizeof(ctime_now), static_cast<const time_t*>(&ts.tv_sec)); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 74fe99dab760eb1bc2aa7b64ab32a19bd26baabc Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 18 22:51:40 2019 +0100 xcompshad: remove unused variables --- nxcompshad/src/X11.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nxcompshad/src/X11.h b/nxcompshad/src/X11.h index 87dd31f..0fe8ca0 100644 --- a/nxcompshad/src/X11.h +++ b/nxcompshad/src/X11.h @@ -77,10 +77,6 @@ class Poller : public CorePoller Damage damage_; - Region repair_; - - char damageChanges_; - XShmSegmentInfo *shminfo_; XImage *image_; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit ebd1ea036470c103692933ec7252fdad307411cb Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Fri Jan 18 19:10:03 2019 +0100 .travis.yml: move from Ubuntu Trusty to Xenial. --- .travis.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index bc684b5..3454d47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ -# Use new trusty images, should yield newer compilers and packages +# Use new xenial images, should yield newer compilers and packages sudo: true -dist: trusty +dist: xenial language: cpp matrix: @@ -9,16 +9,18 @@ matrix: addons: apt: sources: - - sourceline: 'deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse' + - sourceline: 'deb http://archive.ubuntu.com/ubuntu main restricted universe multiverse' - ubuntu-toolchain-r-test packages: - - cppcheck/trusty-backports + - cppcheck # imake - xutils-dev # X11 libaries - libxcomposite-dev + - libxdamage-dev - libxfont-dev - libxinerama-dev + - libxpm-dev - libxrandr-dev - libxtst-dev - x11proto-fonts-dev @@ -39,8 +41,10 @@ matrix: - xutils-dev # X11 libaries - libxcomposite-dev + - libxdamage-dev - libxfont-dev - libxinerama-dev + - libxpm-dev - libxrandr-dev - libxtst-dev - x11proto-fonts-dev @@ -53,15 +57,17 @@ matrix: addons: apt: sources: - - llvm-toolchain-trusty-3.9 + - llvm-toolchain-xenial-3.9 packages: - clang-3.9 # imake - xutils-dev # X11 libaries - libxcomposite-dev + - libxdamage-dev - libxfont-dev - libxinerama-dev + - libxpm-dev - libxrandr-dev - libxtst-dev - x11proto-fonts-dev @@ -74,7 +80,7 @@ matrix: addons: apt: sources: - - llvm-toolchain-trusty-6.0 + - llvm-toolchain-xenial-6.0 - ubuntu-toolchain-r-test packages: - clang-6.0 @@ -83,8 +89,10 @@ matrix: - xutils-dev # X11 libaries - libxcomposite-dev + - libxdamage-dev - libxfont-dev - libxinerama-dev + - libxpm-dev - libxrandr-dev - libxtst-dev - x11proto-fonts-dev -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 059028ce72267de69cb6b1983fc3599ee6491d9d Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 18 23:45:26 2019 +0100 Logger.h: remove pragma, correct attributes Instead of using a pragma which will be valid for the whole file this only affects the functions where it is actually required and supresses "format string is not a string literal" warnings. According to GCC documentation the second attribute parameter should be 0: "For functions where the arguments are not available to be checked (such as vprintf), specify the third parameter as zero". --- nxcompshad/src/Logger.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h index 88908f7..8436c5f 100644 --- a/nxcompshad/src/Logger.h +++ b/nxcompshad/src/Logger.h @@ -29,9 +29,6 @@ #include <cerrno> #include <cstdarg> -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" - // // Error handling macros. // @@ -46,17 +43,17 @@ class Logger { public: - void user(const char *format, ...) __attribute__((format(printf, 2, 3))); + void user(const char *format, ...) __attribute__((format(printf, 2, 0))); void error(const char *name, int error); - void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); + void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); - void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); + void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); void trace(const char *name); - void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); + void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); void dump(const char *name, const char *data, int size); }; @@ -167,6 +164,4 @@ static inline void logDump(const char *name, const char *data, int size) #endif } -#pragma GCC diagnostic pop - #endif /* Logger_H */ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 440ce3f54b042050afd4c5a49f37ed5ceaaa554f Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sat Jan 19 12:17:32 2019 +0100 .travis.yml: add some soft requirements --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9e46c55..108e9bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,9 @@ matrix: - libxrandr-dev - libxtst-dev - x11proto-fonts-dev + # soft requirements + - quilt + - x11-xkb-utils env: - MATRIX_EVAL="CC=gcc && CXX=g++" @@ -48,6 +51,9 @@ matrix: - libxrandr-dev - libxtst-dev - x11proto-fonts-dev + # soft requirements + - quilt + - x11-xkb-utils env: - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" @@ -71,6 +77,9 @@ matrix: - libxrandr-dev - libxtst-dev - x11proto-fonts-dev + # soft requirements + - quilt + - x11-xkb-utils env: - MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9" @@ -95,6 +104,9 @@ matrix: - libxrandr-dev - libxtst-dev - x11proto-fonts-dev + # soft requirements + - quilt + - x11-xkb-utils env: - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit f2a1e877db4ce8c2152aca7cda456818fe51da42 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Fri Jan 18 20:38:03 2019 +0100 .travis.yml: Update clang-6.0 to clang-7 --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3454d47..9e46c55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,11 +80,10 @@ matrix: addons: apt: sources: - - llvm-toolchain-xenial-6.0 + - llvm-toolchain-xenial-7 - ubuntu-toolchain-r-test packages: - - clang-6.0 - - g++-4.9 + - clang-7 # imake - xutils-dev # X11 libaries @@ -98,7 +97,7 @@ matrix: - x11proto-fonts-dev env: - - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" + - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" - STATIC_ANALYSIS="no" before_install: -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 7c8214f31fd3d83e641067941573ebb89f4f4ddb Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 18 23:57:04 2019 +0100 GenericReply.h: remove unused variable --- nxcomp/src/GenericReply.h | 1 - 1 file changed, 1 deletion(-) diff --git a/nxcomp/src/GenericReply.h b/nxcomp/src/GenericReply.h index e899b84..2b35235 100644 --- a/nxcomp/src/GenericReply.h +++ b/nxcomp/src/GenericReply.h @@ -83,7 +83,6 @@ class GenericReplyMessage : public Message private: unsigned char byte_data; - unsigned int int_data[6]; unsigned short short_data[12]; }; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 176f9b471b2ec67dd95e054d9a22ab87c8110b7c Merge: d156ce5 7c8214f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 12:04:25 2019 +0100 Merge branch 'uli42-pr/fix_clang_warnings' into 3.6.x Attributes GH PR #763: https://github.com/ArcticaProject/nx-libs/pull/763 nx-X11/lib/include/X11/Xlibint.h | 18 +++++++++--------- nx-X11/lib/src/xkb/XKBBind.c | 2 +- nxcomp/src/GenericReply.h | 1 - nxcomp/src/Timestamp.cpp | 1 - nxcomp/src/TranslateCoords.h | 8 ++++---- nxcompshad/src/Logger.h | 15 +++++---------- nxcompshad/src/X11.h | 4 ---- 7 files changed, 19 insertions(+), 30 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 2aa575f0db642fc9a5820488440a48f235d8a89c Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 28 17:46:48 2019 +0100 nxdialog: pylint improvements --- nxdialog/nxdialog | 449 +++++++++++++++++++++++++++--------------------------- 1 file changed, 228 insertions(+), 221 deletions(-) diff --git a/nxdialog/nxdialog b/nxdialog/nxdialog index 78fa62a..f7c061e 100755 --- a/nxdialog/nxdialog +++ b/nxdialog/nxdialog @@ -76,294 +76,301 @@ VALID_DLG_TYPES = frozenset([ DLG_TYPE_QUIT, DLG_TYPE_YESNO, DLG_TYPE_YESNOSUSPEND, - ]) +]) + class PullDownMenu(object): - """ Shows a popup menu to disconnect/terminate session. """ + """ Shows a popup menu to disconnect/terminate session. """ - def __init__(self, window_id): - """ Initializes this class. + def __init__(self, window_id): + """ Initializes this class. - @type window_id: int - @param window_id: X11 window id of target window + @type window_id: int + @param window_id: X11 window id of target window - """ - self._window_id = window_id - self._result = None + """ + self.window_id = window_id + self.result = None - def Show(self): - """ Shows popup and returns result. """ + def show(self): + """ Shows popup and returns result. """ - win = gtk.gdk.window_foreign_new(self._window_id) + win = gtk.gdk.window_foreign_new(self.window_id) - menu = gtk.Menu() - menu.connect("deactivate", self._MenuDeactivate) + menu = gtk.Menu() + menu.connect("deactivate", self.menu_deactivate) - # TODO: Show title item in bold font - title = gtk.MenuItem(label="Session control") - title.set_sensitive(False) - menu.append(title) + # TODO: Show title item in bold font + title = gtk.MenuItem(label="Session control") + title.set_sensitive(False) + menu.append(title) - disconnect = gtk.MenuItem(label=DISCONNECT_TEXT) - disconnect.connect("activate", self._ItemActivate, DISCONNECT) - menu.append(disconnect) + disconnect = gtk.MenuItem(label=DISCONNECT_TEXT) + disconnect.connect("activate", self.item_activate, DISCONNECT) + menu.append(disconnect) - terminate = gtk.MenuItem(label=TERMINATE_TEXT) - terminate.connect("activate", self._ItemActivate, TERMINATE) - menu.append(terminate) + terminate = gtk.MenuItem(label=TERMINATE_TEXT) + terminate.connect("activate", self.item_activate, TERMINATE) + menu.append(terminate) - menu.append(gtk.SeparatorMenuItem()) + menu.append(gtk.SeparatorMenuItem()) - cancel = gtk.MenuItem(label=CANCEL_TEXT) - menu.append(cancel) + cancel = gtk.MenuItem(label=CANCEL_TEXT) + menu.append(cancel) - menu.show_all() + menu.show_all() - menu.popup(parent_menu_shell=None, parent_menu_item=None, - func=self._PosMenu, data=win, - button=0, activate_time=gtk.get_current_event_time()) + menu.popup(parent_menu_shell=None, parent_menu_item=None, + func=self.pos_menu, data=win, + button=0, activate_time=gtk.get_current_event_time()) - gtk.main() + gtk.main() - return self._result + return self.result - def _ItemActivate(self, _, result): - """ called when a menu item is selected """ - self._result = result - gtk.main_quit() + def item_activate(self, _, result): + """ called when a menu item is selected """ + self.result = result + gtk.main_quit() - def _MenuDeactivate(self, _): - """ called when menu is deactivated """ - gtk.main_quit() + @staticmethod + def menu_deactivate(_): + """ called when menu is deactivated """ + gtk.main_quit() - def _PosMenu(self, menu, parent): - """ Positions menu at the top center of the parent window. """ - # Get parent geometry and origin - (_, _, win_width, _, _) = parent.get_geometry() - (win_x, win_y) = parent.get_origin() + @staticmethod + def pos_menu(menu, parent): + """ Positions menu at the top center of the parent window. """ + # Get parent geometry and origin + (_, _, win_width, _, _) = parent.get_geometry() + (win_x, win_y) = parent.get_origin() - # Calculate width of menu - (menu_width, _) = menu.size_request() + # Calculate width of menu + (menu_width, _) = menu.size_request() - # Calculate center - x = win_x + ((win_width - menu_width) / 2) + # Calculate center + center_x = win_x + ((win_width - menu_width) / 2) - return (x, win_y, True) + return (center_x, win_y, True) -def ShowYesNoSuspendBox(title, text): - """ Shows a message box to disconnect/terminate session. +def show_yes_no_suspend_box(title, text): + """ Shows a message box to disconnect/terminate session. - @type title: str - @param title: Message box title - @type text: str - @param text: Message box text - @return: Choosen action + @type title: str + @param title: Message box title + @type text: str + @param text: Message box text + @return: Choosen action - """ - dlg = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION, flags=gtk.DIALOG_MODAL) - dlg.set_title(title) - dlg.set_markup(text) - dlg.add_button(DISCONNECT_TEXT, DISCONNECT) - dlg.add_button(TERMINATE_TEXT, TERMINATE) - dlg.add_button(CANCEL_TEXT, gtk.RESPONSE_CANCEL) + """ + dlg = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION, flags=gtk.DIALOG_MODAL) + dlg.set_title(title) + dlg.set_markup(text) + dlg.add_button(DISCONNECT_TEXT, DISCONNECT) + dlg.add_button(TERMINATE_TEXT, TERMINATE) + dlg.add_button(CANCEL_TEXT, gtk.RESPONSE_CANCEL) - res = dlg.run() + res = dlg.run() - if res in (DISCONNECT, TERMINATE): - return res + if res in (DISCONNECT, TERMINATE): + return res - # Everything else is cancel - return None + # Everything else is cancel + return None -def ShowYesNoBox(title, text): - """ Shows a message box with answers yes and no. +def show_yes_no_box(title, text): + """ Shows a message box with answers yes and no. - @type title: str - @param title: Message box title - @type text: str - @param text: Message box text - @return: Choosen action + @type title: str + @param title: Message box title + @type text: str + @param text: Message box text + @return: Choosen action - """ - dlg = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION, flags=gtk.DIALOG_MODAL) - dlg.set_title(title) - dlg.set_markup(text) - dlg.add_button(YES_TEXT, TERMINATE) - dlg.add_button(NO_TEXT, gtk.RESPONSE_CANCEL) + """ + dlg = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION, flags=gtk.DIALOG_MODAL) + dlg.set_title(title) + dlg.set_markup(text) + dlg.add_button(YES_TEXT, TERMINATE) + dlg.add_button(NO_TEXT, gtk.RESPONSE_CANCEL) - res = dlg.run() + res = dlg.run() - if res == TERMINATE: - return res + if res == TERMINATE: + return res - # Everything else is cancel - return None + # Everything else is cancel + return None -def HandleSessionAction(agentpid, action): - """ Execute session action choosen by user. +def handle_session_action(agentpid, action): + """ Execute session action choosen by user. - @type agentpid: int - @param agentpid: Nxagent process id as passed by command line - @type action: int or None - @param action: Choosen action + @type agentpid: int + @param agentpid: Nxagent process id as passed by command line + @type action: int or None + @param action: Choosen action - """ + """ - if action == DISCONNECT: - print "Disconnecting from session, sending SIGHUP to %s" % (agentpid) - os.kill(agentpid, signal.SIGHUP) + if action == DISCONNECT: + print "Disconnecting from session, sending SIGHUP to %s" % (agentpid) + os.kill(agentpid, signal.SIGHUP) - elif action == TERMINATE: - print "Terminating session, sending SIGTERM to process %s" % (agentpid) - os.kill(agentpid, signal.SIGTERM) + elif action == TERMINATE: + print "Terminating session, sending SIGTERM to process %s" % (agentpid) + os.kill(agentpid, signal.SIGTERM) - elif action is None: - pass + elif action is None: + pass - else: - raise NotImplementedError() + else: + raise NotImplementedError() -def ShowSimpleMessageBox(icon, title, text): - """ Shows a simple message box. +def show_simple_message_box(icon, title, text): + """ Shows a simple message box. - @type icon: QMessageBox.Icon - @param icon: Icon for message box - @type title: str - @param title: Message box title - @type text: str - @param text: Message box text + @type icon: QMessageBox.Icon + @param icon: Icon for message box + @type title: str + @param title: Message box title + @type text: str + @param text: Message box text - """ - dlg = gtk.MessageDialog(type=icon, flags=gtk.DIALOG_MODAL, - buttons=gtk.BUTTONS_OK) - dlg.set_title(title) - dlg.set_markup(text) - dlg.run() + """ + dlg = gtk.MessageDialog(type=icon, flags=gtk.DIALOG_MODAL, + buttons=gtk.BUTTONS_OK) + dlg.set_title(title) + dlg.set_markup(text) + dlg.run() class NxDialogProgram(object): - """ the main program """ - def __init__(self): - self.args = None - self.options = None - - def Main(self): - """ let's do something """ - try: - (self.options, self.args) = self.ParseArgs() - - self.Run() - - except (SystemExit, KeyboardInterrupt): - raise - - except Exception, e: - sys.stderr.write("Caught exception: %s\n" % (e)) - sys.exit(EXIT_FAILURE) - - def ParseArgs(self): - """ init parser """ - parser = optparse.OptionParser(option_list=self.BuildOptions(), - formatter=optparse.TitledHelpFormatter()) - return parser.parse_args() - - def BuildOptions(self): - """ build options for the parser """ - return [ - # nxagent 3.5.99.18 only uses yesno, ok, pulldown and yesnosuspend - # yesno dialogs will always kill the session if "yes" is selected - optparse.make_option("--dialog", type="string", dest="dialog_type", - help='type of dialog to show, one of "yesno", \ - "ok", "error", "panic", "quit", "pulldown", \ - "yesnosuspend"'), - optparse.make_option("--message", type="string", dest="text", - help="message text to display in the dialog"), - optparse.make_option("--caption", type="string", dest="caption", - help="window title of the dialog"), - optparse.make_option("--display", type="string", dest="display", - help="X11 display where the dialog should be \ - shown"), - optparse.make_option("--parent", type="int", dest="agentpid", - help="pid of the nxagent"), - optparse.make_option("--window", type="int", dest="window", - help="id of window where to embed the \ - pulldown dialog type"), - # -class, -local, -allowmultiple are unused in nxlibs 3.5.99.18 - optparse.make_option("--class", type="string", dest="dlgclass", - default="info", - help="class of the message (info, warning, error) \ - default: info) [currently unimplemented]"), - optparse.make_option("--local", action="store_true", dest="local", - help="specify that proxy mode is used \ + """ the main program """ + + def __init__(self): + self.args = None + self.options = None + + def main(self): + """ let's do something """ + try: + (self.options, self.args) = self.parse_args() + + self.run() + + except (SystemExit, KeyboardInterrupt): + raise + + except Exception, expt: + sys.stderr.write("Caught exception: %s\n" % (expt)) + sys.exit(EXIT_FAILURE) + + def parse_args(self): + """ init parser """ + parser = optparse.OptionParser(option_list=self.build_options(), + formatter=optparse.TitledHelpFormatter()) + return parser.parse_args() + + @staticmethod + def build_options(): + """ build options for the parser """ + return [ + # nxagent 3.5.99.18 only uses yesno, ok, pulldown and yesnosuspend + # yesno dialogs will always kill the session if "yes" is selected + optparse.make_option("--dialog", type="string", dest="dialog_type", + help='type of dialog to show, one of "yesno", \ + "ok", "error", "panic", "quit", "pulldown", \ + "yesnosuspend"'), + optparse.make_option("--message", type="string", dest="text", + help="message text to display in the dialog"), + optparse.make_option("--caption", type="string", dest="caption", + help="window title of the dialog"), + optparse.make_option("--display", type="string", dest="display", + help="X11 display where the dialog should be \ + shown"), + optparse.make_option("--parent", type="int", dest="agentpid", + help="pid of the nxagent"), + optparse.make_option("--window", type="int", dest="window", + help="id of window where to embed the \ + pulldown dialog type"), + # -class, -local, -allowmultiple are unused in nxlibs 3.5.99.18 + optparse.make_option("--class", type="string", dest="dlgclass", + default="info", + help="class of the message (info, warning, error) \ + default: info) [currently unimplemented]"), + optparse.make_option("--local", action="store_true", dest="local", + help="specify that proxy mode is used \ [currently unimplemented]"), - optparse.make_option("--allowmultiple", action="store_true", - dest="allowmultiple", - help="allow launching more than one dialog with \ - the same message [currently unimplemented]"), - ] + optparse.make_option("--allowmultiple", action="store_true", + dest="allowmultiple", + help="allow launching more than one dialog with \ + the same message [currently unimplemented]"), + ] - def Run(self): - """ Disconnect/terminate NX session upon user's request. """ + def run(self): + """ Disconnect/terminate NX session upon user's request. """ - if not self.options.dialog_type: - sys.stderr.write("Dialog type not supplied via --type\n") - sys.exit(EXIT_FAILURE) + if not self.options.dialog_type: + sys.stderr.write("Dialog type not supplied via --type\n") + sys.exit(EXIT_FAILURE) - dlgtype = self.options.dialog_type + dlgtype = self.options.dialog_type - if dlgtype not in VALID_DLG_TYPES: - sys.stderr.write("Invalid dialog type '%s'\n" % (dlgtype)) - sys.exit(EXIT_FAILURE) + if dlgtype not in VALID_DLG_TYPES: + sys.stderr.write("Invalid dialog type '%s'\n" % (dlgtype)) + sys.exit(EXIT_FAILURE) - if dlgtype in (DLG_TYPE_PULLDOWN, - DLG_TYPE_YESNOSUSPEND, - DLG_TYPE_YESNO) and not self.options.agentpid: - sys.stderr.write("Agent pid not supplied via --parent\n") - sys.exit(EXIT_FAILURE) + if dlgtype in (DLG_TYPE_PULLDOWN, + DLG_TYPE_YESNOSUSPEND, + DLG_TYPE_YESNO) and not self.options.agentpid: + sys.stderr.write("Agent pid not supplied via --parent\n") + sys.exit(EXIT_FAILURE) - if dlgtype == DLG_TYPE_PULLDOWN and not self.options.window: - sys.stderr.write("Window id not supplied via --window\n") - sys.exit(EXIT_FAILURE) + if dlgtype == DLG_TYPE_PULLDOWN and not self.options.window: + sys.stderr.write("Window id not supplied via --window\n") + sys.exit(EXIT_FAILURE) - if self.options.caption: - message_caption = self.options.caption - else: - message_caption = sys.argv[0] + if self.options.caption: + message_caption = self.options.caption + else: + message_caption = sys.argv[0] - if self.options.text: - message_text = self.options.text - else: - message_text = "" + if self.options.text: + message_text = self.options.text + else: + message_text = "" - if self.options.display: - os.environ["DISPLAY"] = self.options.display + if self.options.display: + os.environ["DISPLAY"] = self.options.display - if dlgtype == DLG_TYPE_OK: - ShowSimpleMessageBox(gtk.MESSAGE_INFO, message_caption, message_text) + if dlgtype == DLG_TYPE_OK: + show_simple_message_box( + gtk.MESSAGE_INFO, message_caption, message_text) - elif dlgtype in (DLG_TYPE_ERROR, DLG_TYPE_PANIC): - ShowSimpleMessageBox(gtk.MESSAGE_ERROR, message_caption, message_text) + elif dlgtype in (DLG_TYPE_ERROR, DLG_TYPE_PANIC): + show_simple_message_box( + gtk.MESSAGE_ERROR, message_caption, message_text) - elif dlgtype == DLG_TYPE_PULLDOWN: - HandleSessionAction(self.options.agentpid, - PullDownMenu(self.options.window).Show()) + elif dlgtype == DLG_TYPE_PULLDOWN: + handle_session_action(self.options.agentpid, + PullDownMenu(self.options.window).show()) - elif dlgtype == DLG_TYPE_YESNOSUSPEND: - HandleSessionAction(self.options.agentpid, - ShowYesNoSuspendBox(message_caption, message_text)) + elif dlgtype == DLG_TYPE_YESNOSUSPEND: + handle_session_action(self.options.agentpid, + show_yes_no_suspend_box(message_caption, message_text)) - elif dlgtype == DLG_TYPE_YESNO: - HandleSessionAction(self.options.agentpid, - ShowYesNoBox(message_caption, message_text)) + elif dlgtype == DLG_TYPE_YESNO: + handle_session_action(self.options.agentpid, + show_yes_no_box(message_caption, message_text)) - else: - # TODO: Implement all dialog types - sys.stderr.write("Dialog type '%s' not implemented" % (dlgtype)) - sys.exit(EXIT_FAILURE) + else: + # TODO: Implement all dialog types + sys.stderr.write("Dialog type '%s' not implemented" % (dlgtype)) + sys.exit(EXIT_FAILURE) -NxDialogProgram().Main() +NxDialogProgram().main() -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 3a097e6e08ecafc280c1c13dd4329cb5fbcd3284 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 28 17:49:28 2019 +0100 nxdialog: use gtk3 instead of gtk2 --- nxdialog/nxdialog | 63 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/nxdialog/nxdialog b/nxdialog/nxdialog index f7c061e..5414691 100755 --- a/nxdialog/nxdialog +++ b/nxdialog/nxdialog @@ -30,6 +30,7 @@ # - added missing docstrings # - pylint improvements # - removed neatx entry from the pulldoww menu +# - use PyGObject instead of PyGtk and thus Gtk3 """nxdialog program for handling dialog display.""" @@ -41,10 +42,10 @@ import os import signal import sys -import gtk - -import pygtk -pygtk.require("2.0") +import gi +gi.require_version('Gtk', '3.0') +# pylint: disable=wrong-import-position +from gi.repository import Gtk, Gdk, GdkX11 PROGRAM = "nxdialog" @@ -95,58 +96,62 @@ class PullDownMenu(object): def show(self): """ Shows popup and returns result. """ - win = gtk.gdk.window_foreign_new(self.window_id) + display = Gdk.Display.get_default() + win = GdkX11.X11Window.foreign_new_for_display(display, self.window_id) - menu = gtk.Menu() + menu = Gtk.Menu() menu.connect("deactivate", self.menu_deactivate) # TODO: Show title item in bold font - title = gtk.MenuItem(label="Session control") + title = Gtk.MenuItem(label="Session control") title.set_sensitive(False) menu.append(title) - disconnect = gtk.MenuItem(label=DISCONNECT_TEXT) + disconnect = Gtk.MenuItem(label=DISCONNECT_TEXT) disconnect.connect("activate", self.item_activate, DISCONNECT) menu.append(disconnect) - terminate = gtk.MenuItem(label=TERMINATE_TEXT) + terminate = Gtk.MenuItem(label=TERMINATE_TEXT) terminate.connect("activate", self.item_activate, TERMINATE) menu.append(terminate) - menu.append(gtk.SeparatorMenuItem()) + menu.append(Gtk.SeparatorMenuItem()) - cancel = gtk.MenuItem(label=CANCEL_TEXT) + cancel = Gtk.MenuItem(label=CANCEL_TEXT) menu.append(cancel) menu.show_all() menu.popup(parent_menu_shell=None, parent_menu_item=None, func=self.pos_menu, data=win, - button=0, activate_time=gtk.get_current_event_time()) + button=0, activate_time=Gtk.get_current_event_time()) - gtk.main() + Gtk.main() return self.result def item_activate(self, _, result): """ called when a menu item is selected """ self.result = result - gtk.main_quit() + Gtk.main_quit() @staticmethod def menu_deactivate(_): """ called when menu is deactivated """ - gtk.main_quit() + Gtk.main_quit() @staticmethod - def pos_menu(menu, parent): + def pos_menu(menu, _xpos, _ypos, *data): """ Positions menu at the top center of the parent window. """ + parent = data[0] + # Get parent geometry and origin - (_, _, win_width, _, _) = parent.get_geometry() - (win_x, win_y) = parent.get_origin() + _, _, win_width, _ = parent.get_geometry() + _, win_x, win_y = parent.get_origin() # Calculate width of menu - (menu_width, _) = menu.size_request() + #menu_width = menu.get_preferred_width().natural_width + menu_width = menu.get_allocated_width() # Calculate center center_x = win_x + ((win_width - menu_width) / 2) @@ -164,12 +169,13 @@ def show_yes_no_suspend_box(title, text): @return: Choosen action """ - dlg = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION, flags=gtk.DIALOG_MODAL) + dlg = Gtk.MessageDialog(type=Gtk.MessageType.QUESTION, + flags=Gtk.DialogFlags.MODAL) dlg.set_title(title) dlg.set_markup(text) dlg.add_button(DISCONNECT_TEXT, DISCONNECT) dlg.add_button(TERMINATE_TEXT, TERMINATE) - dlg.add_button(CANCEL_TEXT, gtk.RESPONSE_CANCEL) + dlg.add_button(CANCEL_TEXT, Gtk.ResponseType.CANCEL) res = dlg.run() @@ -190,11 +196,12 @@ def show_yes_no_box(title, text): @return: Choosen action """ - dlg = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION, flags=gtk.DIALOG_MODAL) + dlg = Gtk.MessageDialog(type=Gtk.MessageType.QUESTION, + flags=Gtk.DialogFlags.MODAL) dlg.set_title(title) dlg.set_markup(text) dlg.add_button(YES_TEXT, TERMINATE) - dlg.add_button(NO_TEXT, gtk.RESPONSE_CANCEL) + dlg.add_button(NO_TEXT, Gtk.ResponseType.CANCEL) res = dlg.run() @@ -241,8 +248,8 @@ def show_simple_message_box(icon, title, text): @param text: Message box text """ - dlg = gtk.MessageDialog(type=icon, flags=gtk.DIALOG_MODAL, - buttons=gtk.BUTTONS_OK) + dlg = Gtk.MessageDialog(type=icon, flags=Gtk.DialogFlags.MODAL, + buttons=Gtk.ButtonsType.OK) dlg.set_title(title) dlg.set_markup(text) dlg.run() @@ -304,7 +311,7 @@ class NxDialogProgram(object): default: info) [currently unimplemented]"), optparse.make_option("--local", action="store_true", dest="local", help="specify that proxy mode is used \ - [currently unimplemented]"), + [currently unimplemented]"), optparse.make_option("--allowmultiple", action="store_true", dest="allowmultiple", help="allow launching more than one dialog with \ @@ -349,11 +356,11 @@ class NxDialogProgram(object): if dlgtype == DLG_TYPE_OK: show_simple_message_box( - gtk.MESSAGE_INFO, message_caption, message_text) + Gtk.MessageType.INFO, message_caption, message_text) elif dlgtype in (DLG_TYPE_ERROR, DLG_TYPE_PANIC): show_simple_message_box( - gtk.MESSAGE_ERROR, message_caption, message_text) + Gtk.MessageType.ERROR, message_caption, message_text) elif dlgtype == DLG_TYPE_PULLDOWN: handle_session_action(self.options.agentpid, -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 57700cd6b2c6285c27a78758b741247faf9cf6b0 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 28 18:13:47 2019 +0100 nxdialog: convert from optparse to argparse --- nxdialog/nxdialog | 76 ++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/nxdialog/nxdialog b/nxdialog/nxdialog index 5414691..ff453e2 100755 --- a/nxdialog/nxdialog +++ b/nxdialog/nxdialog @@ -31,13 +31,14 @@ # - pylint improvements # - removed neatx entry from the pulldoww menu # - use PyGObject instead of PyGtk and thus Gtk3 +# - replace optparse by argparse """nxdialog program for handling dialog display.""" # If an "NX_CLIENT" environment variable is not provided to nxagent # nxcomp library assumes this script is located in /usr/NX/bin/nxclient -import optparse +import argparse import os import signal import sys @@ -265,7 +266,7 @@ class NxDialogProgram(object): def main(self): """ let's do something """ try: - (self.options, self.args) = self.parse_args() + self.options = self.parse_args() self.run() @@ -278,45 +279,40 @@ class NxDialogProgram(object): def parse_args(self): """ init parser """ - parser = optparse.OptionParser(option_list=self.build_options(), - formatter=optparse.TitledHelpFormatter()) - return parser.parse_args() - @staticmethod - def build_options(): - """ build options for the parser """ - return [ - # nxagent 3.5.99.18 only uses yesno, ok, pulldown and yesnosuspend - # yesno dialogs will always kill the session if "yes" is selected - optparse.make_option("--dialog", type="string", dest="dialog_type", - help='type of dialog to show, one of "yesno", \ - "ok", "error", "panic", "quit", "pulldown", \ - "yesnosuspend"'), - optparse.make_option("--message", type="string", dest="text", - help="message text to display in the dialog"), - optparse.make_option("--caption", type="string", dest="caption", - help="window title of the dialog"), - optparse.make_option("--display", type="string", dest="display", - help="X11 display where the dialog should be \ - shown"), - optparse.make_option("--parent", type="int", dest="agentpid", - help="pid of the nxagent"), - optparse.make_option("--window", type="int", dest="window", - help="id of window where to embed the \ - pulldown dialog type"), - # -class, -local, -allowmultiple are unused in nxlibs 3.5.99.18 - optparse.make_option("--class", type="string", dest="dlgclass", - default="info", - help="class of the message (info, warning, error) \ - default: info) [currently unimplemented]"), - optparse.make_option("--local", action="store_true", dest="local", - help="specify that proxy mode is used \ - [currently unimplemented]"), - optparse.make_option("--allowmultiple", action="store_true", - dest="allowmultiple", - help="allow launching more than one dialog with \ - the same message [currently unimplemented]"), - ] + parser = argparse.ArgumentParser(description="Helper for nxagent to display dialogs") + + # nxagent 3.5.99.18 only uses yesno, ok, pulldown and yesnosuspend + # yesno dialogs will always kill the session if "yes" is selected + parser.add_argument("--dialog", dest="dialog_type", + help='type of dialog to show, one of "yesno", \ + "ok", "error", "panic", "quit", "pulldown", \ + "yesnosuspend"') + parser.add_argument("--message", dest="text", + help="message text to display in the dialog") + parser.add_argument("--caption", dest="caption", + help="window title of the dialog") + parser.add_argument("--display", dest="display", + help="X11 display where the dialog should be \ + shown") + parser.add_argument("--parent", type=int, dest="agentpid", + help="pid of the nxagent") + parser.add_argument("--window", type=int, dest="window", + help="id of window where to embed the \ + pulldown dialog type") + # -class, -local, -allowmultiple are unused in nxlibs 3.5.99.18 + parser.add_argument("--class", dest="dlgclass", default="info", + help="class of the message (info, warning, error) \ + default: info) [currently unimplemented]") + parser.add_argument("--local", action="store_true", dest="local", + help="specify that proxy mode is used \ + [currently unimplemented]") + parser.add_argument("--allowmultiple", action="store_true", + dest="allowmultiple", + help="allow launching more than one dialog with \ + the same message [currently unimplemented]") + + return parser.parse_args() def run(self): """ Disconnect/terminate NX session upon user's request. """ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 4538d2133a06719c1d07be19b95b5ad3ac9f5800 Merge: 176f9b4 440ce3f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 12:12:58 2019 +0100 Merge branch 'mjtrangoni-move-to-xenial' into 3.6.x Attributes GH PR #762: https://github.com/ArcticaProject/nx-libs/pull/762 .travis.yml | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit acffe15b58c352914a63499d29a12f72671afc5b Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 28 20:17:39 2019 +0100 nxdialog: make code compatible to python2 _and_ python3 --- nxdialog/nxdialog | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/nxdialog/nxdialog b/nxdialog/nxdialog index ff453e2..58e773c 100755 --- a/nxdialog/nxdialog +++ b/nxdialog/nxdialog @@ -1,5 +1,11 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # +# ^^^ This is working with python2 and python3 so we choose a shebang +# that will find either version. +# Citing PEP394: "One exception to this is scripts that are +# deliberately written to be source compatible with both Python +# 2.x and 3.x. Such scripts may continue to use python on their +# shebang line. # Copyright (C) 2008 Google Inc. # Copyright (C) 2019 Ulrich Sibiller <uli42@gmx.de> @@ -32,12 +38,15 @@ # - removed neatx entry from the pulldoww menu # - use PyGObject instead of PyGtk and thus Gtk3 # - replace optparse by argparse +# - make code compatible to python2 and python3. """nxdialog program for handling dialog display.""" # If an "NX_CLIENT" environment variable is not provided to nxagent # nxcomp library assumes this script is located in /usr/NX/bin/nxclient +from __future__ import print_function + import argparse import os import signal @@ -155,7 +164,7 @@ class PullDownMenu(object): menu_width = menu.get_allocated_width() # Calculate center - center_x = win_x + ((win_width - menu_width) / 2) + center_x = int(win_x + ((win_width - menu_width) / 2)) return (center_x, win_y, True) @@ -224,11 +233,11 @@ def handle_session_action(agentpid, action): """ if action == DISCONNECT: - print "Disconnecting from session, sending SIGHUP to %s" % (agentpid) + print("Disconnecting from session, sending SIGHUP to %s" % (agentpid)) os.kill(agentpid, signal.SIGHUP) elif action == TERMINATE: - print "Terminating session, sending SIGTERM to process %s" % (agentpid) + print("Terminating session, sending SIGTERM to process %s" % (agentpid)) os.kill(agentpid, signal.SIGTERM) elif action is None: @@ -273,11 +282,12 @@ class NxDialogProgram(object): except (SystemExit, KeyboardInterrupt): raise - except Exception, expt: + except Exception as expt: sys.stderr.write("Caught exception: %s\n" % (expt)) sys.exit(EXIT_FAILURE) - def parse_args(self): + @staticmethod + def parse_args(): """ init parser """ parser = argparse.ArgumentParser(description="Helper for nxagent to display dialogs") -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 486cc6f502e35b958fcf531ba157c1c420e6c95c Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Feb 9 01:55:59 2019 +0100 add nxdialog for displaying dialogs By adding NX_CLIENT=<path to nxdialog> to the envrionment certain actions in nx will open dialogs. If the options string contains "menu=1" rootless windows will show a popup menu when the mouse hits the center of the title bar offering session disconnect/terminatation. --- nxdialog/nxdialog | 369 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 369 insertions(+) diff --git a/nxdialog/nxdialog b/nxdialog/nxdialog new file mode 100755 index 0000000..78fa62a --- /dev/null +++ b/nxdialog/nxdialog @@ -0,0 +1,369 @@ +#!/usr/bin/env python2 +# + +# Copyright (C) 2008 Google Inc. +# Copyright (C) 2019 Ulrich Sibiller <uli42@gmx.de> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# This version is based on the nxdialog.py of the long abandoned +# Google project "neatx" (https://code.google.com/archive/p/neatx/). +# List of changes: +# - pulled in the few parts of the neatx python modules that are actually +# to make it a standlone script +# - added usage output +# - dropped logging code, print errors to stderr +# - can handle the "yesno" dialog type +# - added missing docstrings +# - pylint improvements +# - removed neatx entry from the pulldoww menu + +"""nxdialog program for handling dialog display.""" + +# If an "NX_CLIENT" environment variable is not provided to nxagent +# nxcomp library assumes this script is located in /usr/NX/bin/nxclient + +import optparse +import os +import signal +import sys + +import gtk + +import pygtk +pygtk.require("2.0") + +PROGRAM = "nxdialog" + +DISCONNECT = 1 +TERMINATE = 2 + +EXIT_SUCCESS = 0 +EXIT_FAILURE = 1 + +CANCEL_TEXT = "Cancel" +DISCONNECT_TEXT = "Disconnect" +TERMINATE_TEXT = "Terminate" +YES_TEXT = "Yes" +NO_TEXT = "No" + +DLG_TYPE_ERROR = "error" +DLG_TYPE_OK = "ok" +DLG_TYPE_PANIC = "panic" +DLG_TYPE_PULLDOWN = "pulldown" +DLG_TYPE_QUIT = "quit" +DLG_TYPE_YESNO = "yesno" +DLG_TYPE_YESNOSUSPEND = "yesnosuspend" + +VALID_DLG_TYPES = frozenset([ + DLG_TYPE_ERROR, + DLG_TYPE_OK, + DLG_TYPE_PANIC, + DLG_TYPE_PULLDOWN, + DLG_TYPE_QUIT, + DLG_TYPE_YESNO, + DLG_TYPE_YESNOSUSPEND, + ]) + +class PullDownMenu(object): + """ Shows a popup menu to disconnect/terminate session. """ + + def __init__(self, window_id): + """ Initializes this class. + + @type window_id: int + @param window_id: X11 window id of target window + + """ + self._window_id = window_id + self._result = None + + def Show(self): + """ Shows popup and returns result. """ + + win = gtk.gdk.window_foreign_new(self._window_id) + + menu = gtk.Menu() + menu.connect("deactivate", self._MenuDeactivate) + + # TODO: Show title item in bold font + title = gtk.MenuItem(label="Session control") + title.set_sensitive(False) + menu.append(title) + + disconnect = gtk.MenuItem(label=DISCONNECT_TEXT) + disconnect.connect("activate", self._ItemActivate, DISCONNECT) + menu.append(disconnect) + + terminate = gtk.MenuItem(label=TERMINATE_TEXT) + terminate.connect("activate", self._ItemActivate, TERMINATE) + menu.append(terminate) + + menu.append(gtk.SeparatorMenuItem()) + + cancel = gtk.MenuItem(label=CANCEL_TEXT) + menu.append(cancel) + + menu.show_all() + + menu.popup(parent_menu_shell=None, parent_menu_item=None, + func=self._PosMenu, data=win, + button=0, activate_time=gtk.get_current_event_time()) + + gtk.main() + + return self._result + + def _ItemActivate(self, _, result): + """ called when a menu item is selected """ + self._result = result + gtk.main_quit() + + def _MenuDeactivate(self, _): + """ called when menu is deactivated """ + gtk.main_quit() + + def _PosMenu(self, menu, parent): + """ Positions menu at the top center of the parent window. """ + # Get parent geometry and origin + (_, _, win_width, _, _) = parent.get_geometry() + (win_x, win_y) = parent.get_origin() + + # Calculate width of menu + (menu_width, _) = menu.size_request() + + # Calculate center + x = win_x + ((win_width - menu_width) / 2) + + return (x, win_y, True) + + +def ShowYesNoSuspendBox(title, text): + """ Shows a message box to disconnect/terminate session. + + @type title: str + @param title: Message box title + @type text: str + @param text: Message box text + @return: Choosen action + + """ + dlg = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION, flags=gtk.DIALOG_MODAL) + dlg.set_title(title) + dlg.set_markup(text) + dlg.add_button(DISCONNECT_TEXT, DISCONNECT) + dlg.add_button(TERMINATE_TEXT, TERMINATE) + dlg.add_button(CANCEL_TEXT, gtk.RESPONSE_CANCEL) + + res = dlg.run() + + if res in (DISCONNECT, TERMINATE): + return res + + # Everything else is cancel + return None + + +def ShowYesNoBox(title, text): + """ Shows a message box with answers yes and no. + + @type title: str + @param title: Message box title + @type text: str + @param text: Message box text + @return: Choosen action + + """ + dlg = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION, flags=gtk.DIALOG_MODAL) + dlg.set_title(title) + dlg.set_markup(text) + dlg.add_button(YES_TEXT, TERMINATE) + dlg.add_button(NO_TEXT, gtk.RESPONSE_CANCEL) + + res = dlg.run() + + if res == TERMINATE: + return res + + # Everything else is cancel + return None + + +def HandleSessionAction(agentpid, action): + """ Execute session action choosen by user. + + @type agentpid: int + @param agentpid: Nxagent process id as passed by command line + @type action: int or None + @param action: Choosen action + + """ + + if action == DISCONNECT: + print "Disconnecting from session, sending SIGHUP to %s" % (agentpid) + os.kill(agentpid, signal.SIGHUP) + + elif action == TERMINATE: + print "Terminating session, sending SIGTERM to process %s" % (agentpid) + os.kill(agentpid, signal.SIGTERM) + + elif action is None: + pass + + else: + raise NotImplementedError() + + +def ShowSimpleMessageBox(icon, title, text): + """ Shows a simple message box. + + @type icon: QMessageBox.Icon + @param icon: Icon for message box + @type title: str + @param title: Message box title + @type text: str + @param text: Message box text + + """ + dlg = gtk.MessageDialog(type=icon, flags=gtk.DIALOG_MODAL, + buttons=gtk.BUTTONS_OK) + dlg.set_title(title) + dlg.set_markup(text) + dlg.run() + + +class NxDialogProgram(object): + """ the main program """ + def __init__(self): + self.args = None + self.options = None + + def Main(self): + """ let's do something """ + try: + (self.options, self.args) = self.ParseArgs() + + self.Run() + + except (SystemExit, KeyboardInterrupt): + raise + + except Exception, e: + sys.stderr.write("Caught exception: %s\n" % (e)) + sys.exit(EXIT_FAILURE) + + def ParseArgs(self): + """ init parser """ + parser = optparse.OptionParser(option_list=self.BuildOptions(), + formatter=optparse.TitledHelpFormatter()) + return parser.parse_args() + + def BuildOptions(self): + """ build options for the parser """ + return [ + # nxagent 3.5.99.18 only uses yesno, ok, pulldown and yesnosuspend + # yesno dialogs will always kill the session if "yes" is selected + optparse.make_option("--dialog", type="string", dest="dialog_type", + help='type of dialog to show, one of "yesno", \ + "ok", "error", "panic", "quit", "pulldown", \ + "yesnosuspend"'), + optparse.make_option("--message", type="string", dest="text", + help="message text to display in the dialog"), + optparse.make_option("--caption", type="string", dest="caption", + help="window title of the dialog"), + optparse.make_option("--display", type="string", dest="display", + help="X11 display where the dialog should be \ + shown"), + optparse.make_option("--parent", type="int", dest="agentpid", + help="pid of the nxagent"), + optparse.make_option("--window", type="int", dest="window", + help="id of window where to embed the \ + pulldown dialog type"), + # -class, -local, -allowmultiple are unused in nxlibs 3.5.99.18 + optparse.make_option("--class", type="string", dest="dlgclass", + default="info", + help="class of the message (info, warning, error) \ + default: info) [currently unimplemented]"), + optparse.make_option("--local", action="store_true", dest="local", + help="specify that proxy mode is used \ + [currently unimplemented]"), + optparse.make_option("--allowmultiple", action="store_true", + dest="allowmultiple", + help="allow launching more than one dialog with \ + the same message [currently unimplemented]"), + ] + + def Run(self): + """ Disconnect/terminate NX session upon user's request. """ + + if not self.options.dialog_type: + sys.stderr.write("Dialog type not supplied via --type\n") + sys.exit(EXIT_FAILURE) + + dlgtype = self.options.dialog_type + + if dlgtype not in VALID_DLG_TYPES: + sys.stderr.write("Invalid dialog type '%s'\n" % (dlgtype)) + sys.exit(EXIT_FAILURE) + + if dlgtype in (DLG_TYPE_PULLDOWN, + DLG_TYPE_YESNOSUSPEND, + DLG_TYPE_YESNO) and not self.options.agentpid: + sys.stderr.write("Agent pid not supplied via --parent\n") + sys.exit(EXIT_FAILURE) + + if dlgtype == DLG_TYPE_PULLDOWN and not self.options.window: + sys.stderr.write("Window id not supplied via --window\n") + sys.exit(EXIT_FAILURE) + + if self.options.caption: + message_caption = self.options.caption + else: + message_caption = sys.argv[0] + + if self.options.text: + message_text = self.options.text + else: + message_text = "" + + if self.options.display: + os.environ["DISPLAY"] = self.options.display + + if dlgtype == DLG_TYPE_OK: + ShowSimpleMessageBox(gtk.MESSAGE_INFO, message_caption, message_text) + + elif dlgtype in (DLG_TYPE_ERROR, DLG_TYPE_PANIC): + ShowSimpleMessageBox(gtk.MESSAGE_ERROR, message_caption, message_text) + + elif dlgtype == DLG_TYPE_PULLDOWN: + HandleSessionAction(self.options.agentpid, + PullDownMenu(self.options.window).Show()) + + elif dlgtype == DLG_TYPE_YESNOSUSPEND: + HandleSessionAction(self.options.agentpid, + ShowYesNoSuspendBox(message_caption, message_text)) + + elif dlgtype == DLG_TYPE_YESNO: + HandleSessionAction(self.options.agentpid, + ShowYesNoBox(message_caption, message_text)) + + else: + # TODO: Implement all dialog types + sys.stderr.write("Dialog type '%s' not implemented" % (dlgtype)) + sys.exit(EXIT_FAILURE) + + +NxDialogProgram().Main() -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 6812657f04d0e9a1e2fe92c0180f482a693df9ec Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 13:50:31 2019 +0100 Makefile: Integrate new subproject "nxdialog". --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 2fa75d3..0657bcb 100644 --- a/Makefile +++ b/Makefile @@ -170,6 +170,9 @@ build-full: build-env # build nxproxy fifth cd nxproxy && autoreconf -vfsi && (${CONFIGURE}) && ${MAKE} + # "build" nxdialog last + cd nxdialog && autoreconf -vfsi && (${CONFIGURE}) && ${MAKE} + build: if ! test -d nx-X11; then \ ${MAKE} build-lite; \ @@ -247,6 +250,9 @@ install-full: $(MAKE) -C nx-X11/lib install + # install the nxdialog executable and its man page + $(MAKE) -C nxdialog install + uninstall: $(MAKE) uninstall-lite [ ! -d nx-X11 ] || $(MAKE) uninstall-full @@ -269,3 +275,5 @@ uninstall-full: $(RM_DIR_REC) $(DESTDIR)$(NXLIBDIR) $(RM_DIR_REC) $(DESTDIR)$(INCLUDEDIR)/nx + + test -f nxdialog/Makefile && ${MAKE} -C nxdialog "$@" -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit df79c3b35a30a957be0125c42e766a7ea2f51123 Merge: 4538d21 d0e40f8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 12:50:32 2019 +0100 Merge branch 'uli42-pr/add_nxdialog' into 3.6.x Attributes GH PR #767: https://github.com/ArcticaProject/nx-libs/pull/767 nxdialog/nxdialog | 394 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 394 insertions(+) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 57ca69fe09285ed7572d86f94e257484caa015a2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 13:47:39 2019 +0100 nxdialog: Turn into autotools project, add man page. --- nxdialog/Makefile.am | 21 +++++++++++++ nxdialog/README.md | 23 +++++++++++++++ nxdialog/VERSION | 1 + nxdialog/bin/Makefile.am | 3 ++ nxdialog/{ => bin}/nxdialog | 0 nxdialog/configure.ac | 22 ++++++++++++++ nxdialog/man/Makefile.am | 5 ++++ nxdialog/man/nxdialog.1 | 72 +++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 147 insertions(+) diff --git a/nxdialog/Makefile.am b/nxdialog/Makefile.am new file mode 100644 index 0000000..e444af1 --- /dev/null +++ b/nxdialog/Makefile.am @@ -0,0 +1,21 @@ +NULL = + +SUBDIRS = bin man + +ACLOCAL_AMFLAGS = -I m4 + +MAINTAINERCLEANFILES = \ + $(srcdir)/autom4te.cache/* \ + $(srcdir)/build-aux/* \ + $(srcdir)/Makefile.in \ + $(srcdir)/man/Makefile.in \ + $(srcdir)/src/Makefile.in \ + $(srcdir)/aclocal.m4 \ + $(srcdir)/config.h.in \ + $(srcdir)/config.h.in~ \ + $(srcdir)/config.guess \ + $(srcdir)/config.sub \ + $(srcdir)/configure \ + $(NULL) + +DISTCLEANFILES=$(MAINTAINERCLEANFILES) diff --git a/nxdialog/README.md b/nxdialog/README.md new file mode 100644 index 0000000..68422b1 --- /dev/null +++ b/nxdialog/README.md @@ -0,0 +1,23 @@ +# NX Dialog Helper Tool + +The ``nxdialog`` script can be executed with Python 2.6.x (or higher) and +Python 3.4.x (or higher) alike. + +## Runtime Dependencies + +Required Python modules: + + * argparse + * gi + +Required GIR namespaces: + + * Gtk + * Gdk + * GdkX11 + +See the man page for more details. + +## License + +The ``nxdialog`` script and related files have been licensed under GPLv2+. diff --git a/nxdialog/VERSION b/nxdialog/VERSION new file mode 120000 index 0000000..6ff19de --- /dev/null +++ b/nxdialog/VERSION @@ -0,0 +1 @@ +../VERSION \ No newline at end of file diff --git a/nxdialog/bin/Makefile.am b/nxdialog/bin/Makefile.am new file mode 100644 index 0000000..fa1942a --- /dev/null +++ b/nxdialog/bin/Makefile.am @@ -0,0 +1,3 @@ +NULL = + +dist_bin_SCRIPTS = nxdialog diff --git a/nxdialog/nxdialog b/nxdialog/bin/nxdialog similarity index 100% rename from nxdialog/nxdialog rename to nxdialog/bin/nxdialog diff --git a/nxdialog/configure.ac b/nxdialog/configure.ac new file mode 100644 index 0000000..bc8e81b --- /dev/null +++ b/nxdialog/configure.ac @@ -0,0 +1,22 @@ +dnl *************************************************************************** +dnl *** configure.ac for nxdialog *** +dnl *************************************************************************** + +m4_define([nxdialog_version], m4_esyscmd([tr -d '\n' < VERSION])) + +# Initialize Autoconf +AC_PREREQ(2.60) + +AC_INIT([NX Dialog], [nxdialog_version], [https://github.com/ArcticaProject/nx-libs/issues]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_PREFIX_DEFAULT([/usr/local]) + +AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-bzip2]) + +AC_CONFIG_FILES([ +Makefile +bin/Makefile +man/Makefile +]) + +AC_OUTPUT diff --git a/nxdialog/man/Makefile.am b/nxdialog/man/Makefile.am new file mode 100644 index 0000000..a862b1e --- /dev/null +++ b/nxdialog/man/Makefile.am @@ -0,0 +1,5 @@ +NULL = + +dist_man_MANS = \ + nxdialog.1 \ + $(NULL) diff --git a/nxdialog/man/nxdialog.1 b/nxdialog/man/nxdialog.1 new file mode 100644 index 0000000..636d59f --- /dev/null +++ b/nxdialog/man/nxdialog.1 @@ -0,0 +1,72 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH nxdialog 1 "Jan 2019" "Version 3.5.99.18" "NX Dialog" +.SH NAME +nxdialog \- NX Dialog Helper +.SH SYNOPSIS +'nh +.fi +.ad l +\fBnxdialog\fR \fI[-h] [--dialog DIALOG_TYPE] [--message TEXT] + [--caption CAPTION] [--display DISPLAY] [--parent AGENTPID] + [--window WINDOW] [--class DLGCLASS] [--local] + [--allowmultiple]\fR + +.SH DESCRIPTION +\fBnxdialog\fR is a GUI helper that can be used with nxagent to provide +user interaction on certain events inside nxagent. It adds graphical +widgets (menus, dialog boxes, etc.) to nxagent that allow a smarter user +interaction with the agent. +.PP +\fBnxagent\fR is not using \fBnxdialog\fR by default, set the +\fI$NX_CLIENT\fR environment variable to make the \fBnxdialog\fR path known to +\fBnxagent\fR. +.PP +If you want to disable \fBnxdialog\fR usage in \fBnxagent\fR, then make +sure that the \fI$NX_CLIENT\fR environment variable is unset. +.PP +.SH COMMAND LINE OPTIONS +.TP 8 +.B \-h, \-\-help +Show this help message and exit. +.TP 8 +.B --dialog DIALOG_TYPE +Type of dialog to show, one of "yesno", "ok", "error", "panic", "quit", "pulldown", "yesnosuspend". +.TP 8 +.B --message \fITEXT\fR +Message text to display in the dialog. +.TP 8 +.B --caption CAPTION +Window title of the dialog. +.TP 8 +.B --display DISPLAY +X11 display where the dialog should be shown (default: \fI$DISPLAY\fR). +.TP 8 +.B --parent AGENTPID +PID of the nxagent. The agent PID can be 0 for testing \fBnxdialog\fR. +.TP 8 +.B --window WINDOW +X11 id of window where to embed the pulldown dialog type. +.TP 8 +.B --class DLGCLASS +Class of the message (info, warning, error) default: info) [currently unimplemented]. +.TP 8 +.B --local +Specify that proxy mode is used [currently unimplemented]. +.TP 8 +.B --allowmultiple +Allow launching more than one dialog with the same message [currently unimplemented]. + +.SH AUTHOR +The \fBnxdialog\fR application has been derived from Google's +NeatX client application by Ulrich Sibiller <uli42@gmx.de>. +.PP +This manual has been written by Mike Gabriel +<mike.gabriel@das\-netzwerkteam.de> for the X2Go Project +(https://wiki.x2go.org) and the Arctica Project +(https://arctica-project.org). -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit ae565e1da04b8e01d4cef1a09eca96af23cecb5c Merge: df79c3b 6812657 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 15:22:03 2019 +0100 Merge branch 'sunweaver-pr/nxdialog-autotools' into 3.6.x Attributes GH PR #789: https://github.com/ArcticaProject/nx-libs/pull/789 Approved by Ulrich Sibiller <uli42@gmx.de>, Fri, 01 Mar 2019 05:41:23 -0800 Makefile | 8 +++++ nxdialog/Makefile.am | 21 +++++++++++++ nxdialog/README.md | 23 +++++++++++++++ nxdialog/VERSION | 1 + nxdialog/bin/Makefile.am | 3 ++ nxdialog/{ => bin}/nxdialog | 0 nxdialog/configure.ac | 22 ++++++++++++++ nxdialog/man/Makefile.am | 5 ++++ nxdialog/man/nxdialog.1 | 72 +++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 155 insertions(+) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 07052a25c0295806b50cf52191f98986b40e8b38 Author: Ulrich Sibiller <ulrich.sibiller@atos.net> Date: Fri Mar 1 10:50:16 2019 +0100 nxdialog: allow to provide --parent 0 for testing Agent PID 0 can be used for testing --- nxdialog/nxdialog | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nxdialog/nxdialog b/nxdialog/nxdialog index 58e773c..d3a7c0b 100755 --- a/nxdialog/nxdialog +++ b/nxdialog/nxdialog @@ -234,11 +234,13 @@ def handle_session_action(agentpid, action): if action == DISCONNECT: print("Disconnecting from session, sending SIGHUP to %s" % (agentpid)) - os.kill(agentpid, signal.SIGHUP) + if agentpid != 0: + os.kill(agentpid, signal.SIGHUP) elif action == TERMINATE: print("Terminating session, sending SIGTERM to process %s" % (agentpid)) - os.kill(agentpid, signal.SIGTERM) + if agentpid != 0: + os.kill(agentpid, signal.SIGTERM) elif action is None: pass @@ -339,7 +341,7 @@ class NxDialogProgram(object): if dlgtype in (DLG_TYPE_PULLDOWN, DLG_TYPE_YESNOSUSPEND, - DLG_TYPE_YESNO) and not self.options.agentpid: + DLG_TYPE_YESNO) and self.options.agentpid is None: sys.stderr.write("Agent pid not supplied via --parent\n") sys.exit(EXIT_FAILURE) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit d0e40f8b2aea32643708892a26a72349ecc82299 Author: Ulrich Sibiller <ulrich.sibiller@atos.net> Date: Fri Mar 1 10:52:39 2019 +0100 nxdialog: add example call --- nxdialog/nxdialog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nxdialog/nxdialog b/nxdialog/nxdialog index d3a7c0b..e7ca10a 100755 --- a/nxdialog/nxdialog +++ b/nxdialog/nxdialog @@ -44,6 +44,9 @@ # If an "NX_CLIENT" environment variable is not provided to nxagent # nxcomp library assumes this script is located in /usr/NX/bin/nxclient +# +# Example: +# nxdialog --dialog yesno --message "message text" --caption "message title" --parent 0 from __future__ import print_function -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit ca8d889dac9bf0f5934ea810448fea9cf2755fad Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 15:24:44 2019 +0100 debian/libnx-x11-6.symbols: Update symbols. --- debian/libnx-x11-6.symbols | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/libnx-x11-6.symbols b/debian/libnx-x11-6.symbols index 14b0e37..06a787d 100644 --- a/debian/libnx-x11-6.symbols +++ b/debian/libnx-x11-6.symbols @@ -875,8 +875,8 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XLockMutex_fn@Base 3.5.0.29 _XLookupKeysym@Base 3.5.0.29 _XLookupString@Base 3.5.0.29 -#MISSING: 3.5.99.9# _XNoticeCreateBitmap@Base 3.5.0.29 -#MISSING: 3.5.99.9# _XNoticePutBitmap@Base 3.5.0.29 + _XNoticeCreateBitmap@Base 2:3.5.99.18-0 + _XNoticePutBitmap@Base 2:3.5.99.18-0 _XOpenLC@Base 3.5.0.29 _XParseBaseFontNameList@Base 3.5.0.29 _XPollfdCacheAdd@Base 3.5.0.29 @@ -910,7 +910,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XTextHeight@Base 3.5.0.29 _XTranslateKey@Base 3.5.0.29 _XTranslateKeySym@Base 3.5.0.29 -#MISSING: 2:3.5.99.9# _XTryShapeBitmapCursor@Base 3.5.0.29 + _XTryShapeBitmapCursor@Base 2:3.5.99.18-0 _XUnknownCopyEventCookie@Base 3.5.99.2 _XUnknownNativeEvent@Base 3.5.0.29 _XUnknownWireEvent@Base 3.5.0.29 -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 00f8d49a3c34b7a050edf352f03a29558525c205 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 15:23:49 2019 +0100 debian/*: Debianize package inclusion of nxdialog (ships with nxagent bin:pkg for now). --- debian/control | 5 ++++- debian/nxagent.install | 2 ++ debian/patches/2003_nxdialog-use-python3.patch | 11 +++++++++++ debian/patches/series | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 98c143d..1c1a6d3 100644 --- a/debian/control +++ b/debian/control @@ -330,9 +330,12 @@ Depends: libnx-x11-6 (= ${binary:Version}), libxcomp3 (= ${binary:Version}), libxcompshad3 (= ${binary:Version}), + python3, + python3-gi, + gir1.2-gtk-3.0, x11-xkb-utils, ${misc:Depends}, - ${shlibs:Depends} + ${shlibs:Depends}, Recommends: xfonts-base, xkb-data Breaks: libxcompext3 (<< 2:3.5.99.3~), nxauth Replaces: libxcompext3, nxauth diff --git a/debian/nxagent.install b/debian/nxagent.install index 402b3b5..1f2a796 100644 --- a/debian/nxagent.install +++ b/debian/nxagent.install @@ -1,7 +1,9 @@ etc/nxagent/keystrokes.cfg usr/bin/nxagent +usr/bin/nxdialog usr/lib/*/nx/X11/ usr/share/man/man1/nxagent.1* +usr/share/man/man1/nxdialog.1* usr/share/nx/VERSION.nxagent usr/share/pixmaps/nxagent.xpm # FIXME: compatibility symlink, drop for 3.6.0 release diff --git a/debian/patches/2003_nxdialog-use-python3.patch b/debian/patches/2003_nxdialog-use-python3.patch new file mode 100644 index 0000000..08c2995 --- /dev/null +++ b/debian/patches/2003_nxdialog-use-python3.patch @@ -0,0 +1,11 @@ +Description: Enforce usage of Python3 +Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + +--- a/nxdialog/bin/nxdialog ++++ b/nxdialog/bin/nxdialog +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + # ^^^ This is working with python2 and python3 so we choose a shebang + # that will find either version. diff --git a/debian/patches/series b/debian/patches/series index 79df365..e1ec9c5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 2001_nx-X11_install-location.debian.patch 2002_xserver-xext_set-securitypolicy-path.debian.patch +2003_nxdialog-use-python3.patch -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit ff1b3e9e8a45dcb9e95d121f8b5f2fbc0a961fae Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Mar 1 15:25:36 2019 +0100 nxdialog: Allow user to specify hexadecimal X11 window IDs. --- nxdialog/bin/nxdialog | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nxdialog/bin/nxdialog b/nxdialog/bin/nxdialog index e7ca10a..379ce00 100755 --- a/nxdialog/bin/nxdialog +++ b/nxdialog/bin/nxdialog @@ -45,8 +45,9 @@ # If an "NX_CLIENT" environment variable is not provided to nxagent # nxcomp library assumes this script is located in /usr/NX/bin/nxclient # -# Example: +# Examples: # nxdialog --dialog yesno --message "message text" --caption "message title" --parent 0 +# nxdialog --dialog yesno --message "message text" --caption "message title" --window 0x123456 --parent 0 from __future__ import print_function @@ -110,7 +111,7 @@ class PullDownMenu(object): """ Shows popup and returns result. """ display = Gdk.Display.get_default() - win = GdkX11.X11Window.foreign_new_for_display(display, self.window_id) + win = GdkX11.X11Window.foreign_new_for_display(display, int(self.window_id, 0)) menu = Gtk.Menu() menu.connect("deactivate", self.menu_deactivate) @@ -312,7 +313,7 @@ class NxDialogProgram(object): shown") parser.add_argument("--parent", type=int, dest="agentpid", help="pid of the nxagent") - parser.add_argument("--window", type=int, dest="window", + parser.add_argument("--window", dest="window", help="id of window where to embed the \ pulldown dialog type") # -class, -local, -allowmultiple are unused in nxlibs 3.5.99.18 -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 400b627e4e1275730640aa668f1a395e0db5c51f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 15:32:12 2019 +0100 nx-libs.spec: Dropping nxdialog files from installation for now when building RPMs. Postponing nxdialog integration with RPM packaging for now. --- nx-libs.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nx-libs.spec b/nx-libs.spec index 585ddd1..03a3815 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -459,6 +459,10 @@ rm -r %{buildroot}%{_includedir}/nx-X11/Xtrans #Remove our shared libraries' .la files before wrapping up the packages rm %{buildroot}%{_libdir}/*.la +#FIXME: leaving nxdialog integration to Ionic +rm -f %{buildroot}%{_bindir}/nxdialog +rm -f %{buildroot}%{_datadir}/man/man1/nxdialog.1* + %if 0%{?fdupes:1} %fdupes %{buildroot}%{_prefix} %endif -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit da9a1bc0b9a42a9f586d5ac0d0392a89f4fe821b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 16:48:04 2019 +0100 debian/patches: Add 2004_enforce-lpthread.patch. On Debian, enforce -lpthread when building nxcomp. This is a nasty work around for a missing symbols issue that needs to get addressed otherwise in later release. --- debian/patches/2004_enforce-lpthread.patch | 33 ++++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 34 insertions(+) diff --git a/debian/patches/2004_enforce-lpthread.patch b/debian/patches/2004_enforce-lpthread.patch new file mode 100644 index 0000000..474feb0 --- /dev/null +++ b/debian/patches/2004_enforce-lpthread.patch @@ -0,0 +1,33 @@ +Description: Enforce -lpthread when linking nxcomp. +Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +Abstract: + This is a workaround for a nasty libtool bug!!! + . + We actually compile libXcomp with pthread support, but libtool uses g++ + ... -nostdlib ... -pthread on Linux. -nostdlib causes -pthread to be + ignored. + . + According to GCC upstream, this is not a bug: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 + . + GCC upstream insists that libtool needs to handle -pthread in a special + way when using -nostdlib. + . + A patch has been submitted to the libtool project: + http://lists.gnu.org/archive/html/libtool-patches/2013-11/msg00015.html + but never applied to the code base. Boo. + . + We will work around this bug by hard-coding the linking with pthread + support in libXcomp for now. + +--- a/nxcomp/src/Makefile.am ++++ b/nxcomp/src/Makefile.am +@@ -139,7 +139,7 @@ + libXcomp_la_LDFLAGS = \ + -version-number @LT_COMP_VERSION@ \ + -no-undefined \ +- $(PTHREAD_LDFLAGS) \ ++ $(PTHREAD_LDFLAGS) -lpthread \ + $(NULL) + + libXcompincludedir = $(includedir)/nx diff --git a/debian/patches/series b/debian/patches/series index e1ec9c5..745ba5c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ 2001_nx-X11_install-location.debian.patch 2002_xserver-xext_set-securitypolicy-path.debian.patch 2003_nxdialog-use-python3.patch +2004_enforce-lpthread.patch -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository nx-libs. commit 59305c8b98d1046806e1cb80e2c7ba023c6f49cd Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Mar 1 16:48:17 2019 +0100 release 3.5.99.19 --- ChangeLog | 228 ++++++++++++++++++++++- VERSION | 2 +- debian/changelog | 7 + nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 2 +- nx-libs.spec | 2 +- nxdialog/bin/nxdialog | 4 +- nxdialog/man/nxdialog.1 | 2 +- nxproxy/man/nxproxy.1 | 2 +- 8 files changed, 240 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index c363e9b..553df3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,230 @@ -2019-01-31 14:10:36 +0100 Mike Gabriel (b5d411337) +2019-03-01 16:48:17 +0100 Mike Gabriel (3339072a7) - * release 3.5.99.18 (HEAD -> 3.6.x, tag: 3.5.99.18) + * release 3.5.99.19 (HEAD -> 3.6.x, tag: 3.5.99.19) + +2019-03-01 16:48:04 +0100 Mike Gabriel (da9a1bc0b) + + * debian/patches: Add 2004_enforce-lpthread.patch. On Debian, enforce + -lpthread when building nxcomp. This is a nasty work + around for a missing symbols issue that needs to get + addressed otherwise in later release. + +2019-03-01 15:32:12 +0100 Mike Gabriel (400b627e4) + + * nx-libs.spec: Dropping nxdialog files from installation for now + when building RPMs. Postponing nxdialog integration with + RPM packaging for now. + +2019-03-01 15:25:36 +0100 Ulrich Sibiller (ff1b3e9e8) + + * nxdialog: Allow user to specify hexadecimal X11 window IDs. + +2019-03-01 15:24:44 +0100 Mike Gabriel (ca8d889da) + + * debian/libnx-x11-6.symbols: Update symbols. + +2019-03-01 15:23:49 +0100 Mike Gabriel (00f8d49a3) + + * debian/*: Debianize package inclusion of nxdialog (ships with + nxagent bin:pkg for now). + +2019-03-01 15:22:03 +0100 Mike Gabriel (ae565e1da) + + * Merge branch 'sunweaver-pr/nxdialog-autotools' into 3.6.x + +2019-03-01 13:50:31 +0100 Mike Gabriel (6812657f0) + + * Makefile: Integrate new subproject "nxdialog". + +2019-03-01 13:47:39 +0100 Mike Gabriel (57ca69fe0) + + * nxdialog: Turn into autotools project, add man page. + +2019-03-01 12:50:32 +0100 Mike Gabriel (df79c3b35) + + * Merge branch 'uli42-pr/add_nxdialog' into 3.6.x + +2019-03-01 10:52:39 +0100 Ulrich Sibiller (d0e40f8b2) + + * nxdialog: add example call + +2019-03-01 10:50:16 +0100 Ulrich Sibiller (07052a25c) + + * nxdialog: allow to provide --parent 0 for testing + +2019-02-28 20:17:39 +0100 Ulrich Sibiller (acffe15b5) + + * nxdialog: make code compatible to python2 _and_ python3 + +2019-02-28 18:13:47 +0100 Ulrich Sibiller (57700cd6b) + + * nxdialog: convert from optparse to argparse + +2019-02-28 17:49:28 +0100 Ulrich Sibiller (3a097e6e0) + + * nxdialog: use gtk3 instead of gtk2 + +2019-02-28 17:46:48 +0100 Ulrich Sibiller (2aa575f0d) + + * nxdialog: pylint improvements + +2019-02-09 01:55:59 +0100 Ulrich Sibiller (486cc6f50) + + * add nxdialog for displaying dialogs + +2019-03-01 12:12:58 +0100 Mike Gabriel (4538d2133) + + * Merge branch 'mjtrangoni-move-to-xenial' into 3.6.x + +2019-01-19 12:17:32 +0100 Mario Trangoni (440ce3f54) + + * .travis.yml: add some soft requirements + +2019-01-18 20:38:03 +0100 Mario Trangoni (f2a1e877d) + + * .travis.yml: Update clang-6.0 to clang-7 + +2019-01-18 19:10:03 +0100 Mario Trangoni (ebd1ea036) + + * .travis.yml: move from Ubuntu Trusty to Xenial. + +2019-03-01 12:04:25 +0100 Mike Gabriel (176f9b471) + + * Merge branch 'uli42-pr/fix_clang_warnings' into 3.6.x + +2019-01-18 23:57:04 +0100 Ulrich Sibiller (7c8214f31) + + * GenericReply.h: remove unused variable + +2019-01-18 23:45:26 +0100 Ulrich Sibiller (059028ce7) + + * Logger.h: remove pragma, correct attributes + +2019-01-18 23:44:47 +0100 Ulrich Sibiller (a53c65547) + + * Logger.h: fix missing compiler attribute + +2019-01-18 22:51:40 +0100 Ulrich Sibiller (74fe99dab) + + * xcompshad: remove unused variables + +2019-01-18 22:47:38 +0100 Ulrich Sibiller (a8ed28234) + + * Xlib: remove register keywords + +2019-01-18 22:44:21 +0100 Ulrich Sibiller (e1f2a24f6) + + * xlib: remove superflous parens + +2019-01-18 22:41:05 +0100 Ulrich Sibiller (0934b1e67) + + * nxcomp: fix unused variables + +2019-01-18 22:38:31 +0100 Ulrich Sibiller (0e481f8aa) + + * nxcomp: fix unused variable + +2019-01-18 22:10:54 +0100 Ulrich Sibiller (471342933) + + * Fix: clang does not know about gnu_printf + +2019-03-01 11:59:55 +0100 Mike Gabriel (d156ce5ab) + + * Merge branch 'uli42-pr/xfixes_memset' into 3.6.x + +2019-02-28 23:15:22 +0100 Ulrich Sibiller (e7a50079e) + + * xfixes: use calloc for some structs + +2019-02-28 23:13:49 +0100 Ulrich Sibiller (c6b6a8fcb) + + * Use C99 designated initializers in various extension Replies + +2019-02-28 23:11:23 +0100 Ulrich Sibiller (c81a45785) + + * Use calloc to zero fill buffers being allocated for replies & + events + +2019-02-28 22:09:28 +0100 Ulrich Sibiller (a70e36c81) + + * ConnDis.c: remove obsolete MNX_TCPCONN + +2019-02-20 22:39:48 +0100 Ulrich Sibiller (f2e48fb73) + + * nx-X11/lib/configure.ac: add forgotten status line + +2019-02-20 22:25:46 +0100 Ulrich Sibiller (71a3b8447) + + * nx-X11/lib/configure.ac: fix version number + +2019-02-20 22:05:01 +0100 Ulrich Sibiller (0eb71d78a) + + * Merge branch 'gh-sunweaver/pr/xlib-loadable-modules' into 3.6.x + +2019-02-20 13:14:43 +0100 Mike Gabriel (36a7f0413) + + * nx-X11/lib/configure.ac: Assure that the USE_DYNAMIC_XCURSOR macro + is defined at build-time. + +2019-02-20 10:40:20 +0100 Mike Gabriel (de421e4fe) + + * Revert "Fix parsing ports set to unix sockets" + +2019-02-20 10:37:16 +0100 Mike Gabriel (3572b251e) + + * Regression fix for bfc05af7. Properly end lines in help/usage text. + +2019-02-18 08:47:40 +0100 Mike Gabriel (66315e4f3) + + * Merge branch 'uli42-pr/session_types' into 3.6.x + +2019-02-18 08:45:11 +0100 Mike Gabriel (fc2907759) + + * Keyboard.c: fix comment. + +2019-02-17 18:00:28 +0100 Ulrich Sibiller (bfc05af73) + + * nxproxy: list known session types in help output + +2019-02-15 11:48:27 +0100 Mike Gabriel (a3dc87d6b) + + * Merge branch 'uli42-pr/fix_keystrokes' into 3.6.x + +2019-02-15 09:27:29 +0100 Ulrich Sibiller (f1b27c4fd) + + * keystrokes.cfg: Add missing Shift=1 for viewport_move_up/down/right + +2019-02-15 11:45:14 +0100 Mike Gabriel (24d7d0faa) + + * Merge branch 'uli42-pr/revert' into 3.6.x + +2019-02-15 09:37:18 +0100 Ulrich Sibiller (586742b71) + + * Revert "nxagent: rework Bool handling" + +2019-02-13 12:32:06 +0100 Mike Gabriel (b61934be2) + + * Merge branch 'uli42-pr/misc' into 3.6.x + +2019-02-08 00:44:48 +0100 Ulrich Sibiller (16cd2bbe1) + + * nxagent: rework Bool handling + +2019-02-07 23:06:58 +0100 Ulrich Sibiller (5bbab001a) + + * Screen.c: code optimization for rootless mode + +2019-02-07 23:04:23 +0100 Ulrich Sibiller (34e4291de) + + * Screen.c: simplify and fix handling of rootless mode + +2019-02-07 21:40:05 +0100 Ulrich Sibiller (f729ac996) + + * rrdispatch.c: remove obsolete ifdef + +2019-01-31 14:10:36 +0100 Mike Gabriel (427ac344c) + + * release 3.5.99.18 (tag: 3.5.99.18) 2019-01-25 16:37:29 +0100 Mike Gabriel (26e483d49) diff --git a/VERSION b/VERSION index 3919e36..df5f09d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.5.99.18 +3.5.99.19 diff --git a/debian/changelog b/debian/changelog index ea77705..751bbf8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +nx-libs (2:3.5.99.19-0) UNRELEASED; urgency=medium + + * Upstream-provided Debian package for nx-libs. + See upstream ChangeLog for recent changes. + + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Fri, 01 Mar 2019 15:33:30 +0100 + nx-libs (2:3.5.99.18-0) unstable; urgency=medium * Upstream-provided Debian package for nx-libs. diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 index ac06806..c52c24f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 +++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 @@ -23,7 +23,7 @@ .\" other dealings in this Software without prior written authorization .\" from The Open Group. .ds q \N'34' -.TH nxagent 1 "Jan 2019" "Version 3.5.99.18" "NX Agent (Xserver)" +.TH nxagent 1 "Mar 2019" "Version 3.5.99.19" "NX Agent (Xserver)" .SH NAME nxagent \- nested Xserver optimized for remote computing .SH SYNOPSIS diff --git a/nx-libs.spec b/nx-libs.spec index 03a3815..a59a443 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -10,7 +10,7 @@ %endif Name: nx-libs -Version: 3.5.99.18 +Version: 3.5.99.19 Release: 0.0build1%{?dist} Summary: NX X11 protocol compression libraries diff --git a/nxdialog/bin/nxdialog b/nxdialog/bin/nxdialog index 379ce00..0678ee4 100755 --- a/nxdialog/bin/nxdialog +++ b/nxdialog/bin/nxdialog @@ -298,7 +298,7 @@ class NxDialogProgram(object): parser = argparse.ArgumentParser(description="Helper for nxagent to display dialogs") - # nxagent 3.5.99.18 only uses yesno, ok, pulldown and yesnosuspend + # nxagent 3.5.99.19 only uses yesno, ok, pulldown and yesnosuspend # yesno dialogs will always kill the session if "yes" is selected parser.add_argument("--dialog", dest="dialog_type", help='type of dialog to show, one of "yesno", \ @@ -316,7 +316,7 @@ class NxDialogProgram(object): parser.add_argument("--window", dest="window", help="id of window where to embed the \ pulldown dialog type") - # -class, -local, -allowmultiple are unused in nxlibs 3.5.99.18 + # -class, -local, -allowmultiple are unused in nxlibs 3.5.99.19 parser.add_argument("--class", dest="dlgclass", default="info", help="class of the message (info, warning, error) \ default: info) [currently unimplemented]") diff --git a/nxdialog/man/nxdialog.1 b/nxdialog/man/nxdialog.1 index 636d59f..6fe6d3f 100644 --- a/nxdialog/man/nxdialog.1 +++ b/nxdialog/man/nxdialog.1 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH nxdialog 1 "Jan 2019" "Version 3.5.99.18" "NX Dialog" +.TH nxdialog 1 "Mar 2019" "Version 3.5.99.19" "NX Dialog" .SH NAME nxdialog \- NX Dialog Helper .SH SYNOPSIS diff --git a/nxproxy/man/nxproxy.1 b/nxproxy/man/nxproxy.1 index cebfd39..57df5b0 100644 --- a/nxproxy/man/nxproxy.1 +++ b/nxproxy/man/nxproxy.1 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH nxproxy 1 "Jan 2019" "Version 3.5.99.18" "NX Proxy" +.TH nxproxy 1 "Mar 2019" "Version 3.5.99.19" "NX Proxy" .SH NAME nxproxy \- NX Proxy Tool .SH SYNOPSIS -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git