This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch 3.6.x in repository nx-libs. from e10302404 Merge branch 'mjtrangoni-add-pvs-studio' into 3.6.x new 53ace2743 Create SECURITY.md new ee77e9706 Update SECURITY.md new 67330d9ea Update SECURITY.md new d1a967f3a randr: fix broken macros / memory corruption new bc68b4aad Merge branch 'uli42-pr/fix_wrap_macros' into 3.6.x new 870a9491c travisci: Fix PVS job new 6857e26b4 Merge branch 'mjtrangoni-fix-pvs-ci' into 3.6.x new 2ef652d35 nx-libs.spec: create nxdialog rpm new d121f2a9c Merge branch 'uli42-pr/nxdialog_rpm' into 3.6.x new 475d6c1f2 libNX_X11: reintroduce HASXDMAUTH new 3335f2503 libNX_X11: reintroduce SECURE_RPC new b4124219a nx-xtrans.m4: reintroduce HAS_STICKY_DIR_BIT new 94fcba361 libNX_X11: set FAIL_HARD new 1215c36f7 libNX_X11: set XTRANS_SEND_FDS=0 new 05cb09a5f Merge branch 'uli42-pr/libNX_X11_defines' into 3.6.x new e74b99117 Keyboard.c: fix indentation of ifdef new ffc2c3840 Keyboard.c: improve capslock and numlock handling new 2b0976e93 Merge branch 'uli42-pr/fix_caps_handling' into 3.6.x new ae037701f nxagent: fix stack smashing new 7a02b4aba Merge branch 'uli42-pr/fix_stack_smashing' into 3.6.x new 0f8ed4d10 Screen.c: fix resizing bug with mutter window manager new abe5e8479 Display.c: factor out confinement window creation new 8deda7bd4 nxagent: Prevent resize loop new 337afd839 Events.c: add more DEBUG output new ffbc63f91 Events.c: add some comments/FIXMEs new a4dd6a462 Events.c: store parent window from event to meaningful variable new 210db3163 Display.c: disable confine window new ce649c027 nxagent: add names to some windows in DEBUG mode new e48ceedcc Screen.c: improve debug output new 1af470a23 Screen.c: improve output of nxagentPrintAgentGeometry new 2ada71fba Screen.c: simplify nxagentResizeScreen new 2a92ed0f5 Window.c: -reportprivatewids reports root window as such new 601a57849 Window.c: simplify setting of isMapped private var new 832e02811 NXwindow.c: fix some format specifiers new 3a7c37593 Init.c: small simplification new 00d60a82e Screen.c: cleanup auto dpi handling new ed4cbaeda Screen.c: scope improvement new 2c6b9117f Screen.c: remove code that will have no effect new d07c78881 Screen.c: remove another pointless code block new d7a091a64 Screen.c: drop unneccessary mask variable new f534a4860 Screen.c: move attributes/valuemask to inner scopes new 42fb68331 Screen.c: scope improvements new 199c32eaf Screen.c: some more (cosmetic) changes new 4c6940cdd Window.c: some more TEST and DEBUG output new 2d99cdd1c Events.c: More cosmetics new 13211ec6a Merge branch 'uli42-pr/window_resize_bug' into 3.6.x new dee4a560a fix spec file new ca7b33103 Merge pull request #960 from uli42/pr/fix_specfile new 12b22e97e yConnDis.c: fix memory leak new 14df32cdb Merge branch 'uli42-pr/xlib_memleak' into 3.6.x new db45683a6 NXdixfonts.c: fix memory leak new ced973e36 Merge branch 'uli42-pr/font_memleak' into 3.6.x new fbde6d285 NXdixfonts.c: Rename BREAK_XFONT_LOOP to NXAGENT_DANGEROUS_XFONT_LOOP_EXIT (better macro name). new 7da2ee0bd NXdixfonts.c: Hard-code the enablement of NXAGENT_DANGEROUS_XFONT_LOOP_EXIT. new 6cd4f1232 Merge branch 'sunweaver-pr/default-to-NXAGENT_DANGEROUS_XFONT_LOOP_EXIT' into 3.6.x new edb5a918a Clipboard.c: fix missing ) new 447ee1570 Compext.c: use SAFE_free macro new 8bfe760d5 Atoms.c: drop double include new ee379d3a7 GCs.h: fix typo new 06173efd3 Compext.c: scope improvements new ebee6af05 Clipboard.c: add missing ifdefs new 1701a4a44 Xext/panoramiX.c: rename shadowing variables new 5bd72aec3 nx-libs.spec: Set python shebang to python3 on fedora and rhel8 new 2c66355c2 Channel.h: rename variable to prevent shadowing new e66d2c86b Log.h: fix some shadow warnings new 8b0bb28eb Events.c: scope improvement new 4460183a6 Atoms.c: improve debug output new f1e543b09 Atoms.c: fix FIXME comment new b1efdd94d Screen.c: fix indentation in nxagentMaximizeToFullScreen new 522eea6f2 compext/Png.c: fix shadowing new b07b6c537 Clipboard.c: fix bug in special optimization for nested settings new 1af077648 NXdixfonts.c: Rename BREAK_XFONT_LOOP to NXAGENT_DANGEROUS_XFONT_LOOP_EXIT (better macro name). new 252b86ee2 NXdixfonts.c: Hard-code the enablement of NXAGENT_DANGEROUS_XFONT_LOOP_EXIT. new 48b914810 Merge branch 'uli42-pr/various5' into 3.6.x new f2973029d release 3.5.99.25 new 5ca9a6b1e NXdixfonts.c: Regression fix for db45683a. Fix typo in libXfont1 function call (FreeFontName -> FreeFontNames). Fixes FTBFS on Ubuntu 14.04 and 16.04. new ad275d507 Events.c: fix leftover DEBUG and TEST definitions new d5a3b4401 CVE-2020-14360: Check SetMap request length carefully. new e7d5ba4e5 Handlers.c: ensure regular yields if suspended new d545afdf3 Merge branch 'uli42-pr/fix_resume' into 3.6.x new de5eb54c6 nxagent: make Fullscreen and AllScreens Booleans new a85adf5ea nxagent: treat DesktopResize and nxagentResizeDesktopAtStartup as Booleans new 2b4ccc30a nxagent: treat several nxagentOptions as real Booleans new f6cebfd85 nxagent: make nxagentOption Shadow a Boolean new 7b299a4ce Options.h: mark Booleans new bd336c92b nxagent: make Desktop, Rootless and Binder options Booleans (again) new 42f76ddee nxagent: make nxagentVerbose a Boolean new fec462906 nxagent: treat all Traps as Booleans everywhere new a72f77fc9 nxagent: treat nxagentLastWindowDestroyed as Boolean new 73bdca0f8 nxagent: some more Boolean improvements new 41f7a8b4a nxagent: make nxagentDoFullgeneration a Boolean new fbc4a9158 nxagent: make nxagentShadowResize a Boolean new f4adcbc59 nxagent: make nxagentUserDefinedFontPath a Boolean new 84bad7324 nxagent: rework some Boolean checks new 06833b964 Split.c, Image.c: make some internal variables Booleans new b8017065d nxagent: handle RegionNil macro as Boolean new f98114c95 Drawable.c: make some variables Booleans new 1239dffec GCOps.c: handle some internal variables as Booleans new 714a212fd GCOps.c: make internal function Boolean new 3cb0a134d nxagent: make XDMCP variables Booleans new 41d75f6b2 nxagent: improve Boolean handling for Reconnect functions new 94fd6d234 Render.c: improve Boolean handling of nxagentCheckPictureRemoteValue new e2ff39e04 nxagent: make nxagentBlocking an Boolean new 3151736d3 GCOps.c: make internal variable an function Booleans new 2ce0fa8f0 GC.c: make internal variable and function Boolean new 54dd29cc6 Client.c: cleanup Boolean handling for nxagentNeedWakeup*() macros new 5d7b6db0c Drawable.c: make abort flag a Boolean new c035ddead nxagent: make nxagentForceSynchronization a Boolean new a9d3050c5 nxagent: make nxagentSkipImage a Boolean new b814aef39 Handlers.c: make synchronize a Boolean variable new b76dddcdc Drawable.c: make doRoundRobin a Boolean new feb7b9773 nxagent: make nxagentXFixesInfo.Initialized a Boolean new 9e9568028 Events.h: fix wrong prototype new 0bca321fb nxagent: make nxagentXkbState.Initialized a Boolean new 91cef61a0 Font.c: Use Booleans where appropriate new d78837ec3 Keyboard.c: noXkbExtension is a Boolean new b44ecc0f8 nxagent: nxagent(Default)WindowIsVisible() are Booleans new faae65fb3 Merge branch 'uli42-pr/rework_booleans_v2' into 3.6.x new 89b37de7c Init.c: Initialize nxagentGrabServerInfo new 4eba4f53a CVE-2020-14360: Check SetMap request length carefully. new 262fe771c Handlers.c: ensure regular yields if suspended new 6e9b3a7f8 nxagent: make Fullscreen and AllScreens Booleans new ca5a14743 nxagent: treat DesktopResize and nxagentResizeDesktopAtStartup as Booleans new 2565484f5 nxagent: treat several nxagentOptions as real Booleans new acb861df4 nxagent: make nxagentOption Shadow a Boolean new 1e4d8e32b Options.h: mark Booleans new 8bb7d2cd1 nxagent: make Desktop, Rootless and Binder options Booleans (again) new c3b6dfe2e nxagent: make nxagentVerbose a Boolean new 616d8619f nxagent: treat all Traps as Booleans everywhere new 92c8325f3 nxagent: treat nxagentLastWindowDestroyed as Boolean new 090742b3b nxagent: some more Boolean improvements new 3e093f9eb nxagent: make nxagentDoFullgeneration a Boolean new 1b7f37a80 nxagent: make nxagentShadowResize a Boolean new 6f4dbefbf nxagent: make nxagentUserDefinedFontPath a Boolean new 5920e36e1 nxagent: rework some Boolean checks new 059a37205 Split.c, Image.c: make some internal variables Booleans new f6b386e65 nxagent: handle RegionNil macro as Boolean new acf3e21f1 Drawable.c: make some variables Booleans new 4303b1131 GCOps.c: handle some internal variables as Booleans new 1b91c8ac1 GCOps.c: make internal function Boolean new 6c09c0b7e nxagent: make XDMCP variables Booleans new 99ca67c2f nxagent: improve Boolean handling for Reconnect functions new af2964c7e Render.c: improve Boolean handling of nxagentCheckPictureRemoteValue new db3efd45c nxagent: make nxagentBlocking an Boolean new e8a5e3287 GCOps.c: make internal variable an function Booleans new 15cf1eee0 GC.c: make internal variable and function Boolean new ab83e4688 Client.c: cleanup Boolean handling for nxagentNeedWakeup*() macros new 1ed28c85b Drawable.c: make abort flag a Boolean new 48279ae79 nxagent: make nxagentForceSynchronization a Boolean new 90178b548 nxagent: make nxagentSkipImage a Boolean new 9aa339176 Handlers.c: make synchronize a Boolean variable new b9c2db67b Drawable.c: make doRoundRobin a Boolean new af7d8e3fa nxagent: make nxagentXFixesInfo.Initialized a Boolean new f10e9d9ac Events.h: fix wrong prototype new d2ba4ddb8 nxagent: make nxagentXkbState.Initialized a Boolean new f4dd9d76a Font.c: Use Booleans where appropriate new 108ed9d92 Keyboard.c: noXkbExtension is a Boolean new f8b759263 nxagent: nxagent(Default)WindowIsVisible() are Booleans new 013a6ba3c Merge branch 'uli42-pr/fix_unusable_mouse_in_fullscreen' into 3.6.x new 125756157 Revert "CVE-2020-14360: Check SetMap request length carefully." new e7b4440f2 nxagent: make full screen mode selectable at startup new 3523d15e2 Merge branch 'uli42-pr/fullscreen_select' into 3.6.x new 7c22dbfda NXDispatch.c: remove double nxagentFreeAtomMap() new 432cc0ca4 manpage: document defaults for options -defer and -tile new c1843ef88 Handlers.c: use the same boolean values as in NXdispatch.c new dd5d8bc89 Client.h: conditionally add unused field new 599334aff Screen.c: clarify that characters are compared new 63a39619c Handlers.c: add FIXME new c7f9ff0b6 nxagent: Drop unused nxagentRootTileWindow new 6aff5bfdf fix formatting and spelling in various files new 21c631f4d Window.c: suppress warning new 97a69b95a Display.c: fix and reformat broken comment new b66699555 Merge branch 'uli42-pr/various6' into 3.6.x new 1529b3217 Atoms.c: fix strlen(NULL) new e991dbae9 Atoms.c: cosmetics in nxagentWriteAtom() new 36d7e152f Atoms.c: silence PVS Studio warning new 28fef3bc0 Colormap.c: fix parentheses new 5735e164e Colormap.c: remove unneccessary check new 41bf83979 Keyboard.c: simplify code new 5871100dd NXpicture.c: remove unneccessary check new db134de3b Atoms.c: add explanation for PVS Studio warning new 67c7513bf Display.c: prevent PVS Studio realloc warning new e664d8201 Drawable.c: Prevent PVS Studio warning new 7443fea69 Keyboard.c: fix possible NULL pointer dereference new 948bbe50a NXglyph.c: check for malloc error new 8bb77997f Reconnect.c: fix possible realloc() memory loss new c1cae3c66 Render.c: Init BoxRec new 1251e8347 Rootless.c: prevent PVS error new a57097ad0 Splash.c: remove unneccessary check new 6214c71b3 Screen.c: check for malloc failures new 5ad0b4dde Window.c: check for malloc failure new 4d95e29b8 Window.c: check for malloc failure new 35556cac9 NXDispatch.c: remove double nxagentFreeAtomMap() new eef306c2d manpage: document defaults for options -defer and -tile new f64fac47e Handlers.c: use the same boolean values as in NXdispatch.c new d1136ea2f Client.h: conditionally add unused field new cc781ae2e Screen.c: clarify that characters are compared new 7aec57a40 Handlers.c: add FIXME new 0a06ee77a nxagent: Drop unused nxagentRootTileWindow new 12b96fd9a fix formatting and spelling in various files new 669299de3 Window.c: suppress warning new 1b80750f6 Display.c: fix and reformat broken comment new 8c3bb2715 Merge branch 'uli42-pr/pvs_findings' into 3.6.x new 8b6d454cf Mesa: make compilation with work with musl new 46c9c493f Xext: include limits.h new f60ac5777 Merge branch 'uli42-pr/musl_fixes' into 3.6.x new a83ec33d5 Screen.c: remove superflous code that produces a crash new e156bdc03 Args.c: improve usage string for -geometry new f4782bbd2 Merge branch 'uli42-pr/fix_fullscreen' into 3.6.x new 689f811ba Xext: use $USRDATADIR/SecurityPolicy new a26011503 Xext: drop NX_ALTERNATIVEPOLICYFILE new 24b903be5 Merge branch 'uli42-pr/drop_alternative_securitypolicy' into 3.6.x new e5746df80 debian/patches: Drop 2002_xserver-xext_set-securitypolicy-path.debian.patch. Not required anymore since 689f811b. new 57e662b83 nxagent: drop unused nxagentVisibility variables new ee60cc50c Window.c: Fix 32bit code path new 5a00da5ec NXproperty.c: clean returns new 8b2b41113 NXproperty.c: simplify and reformat GetWindowProperty() new b8b1edb2b NXproperty.c: GetWindowProperty(): add more comments, restruct prototype new d627e948f NXproperty.c, dix.c: simplify ProcDeleteProperty() new 5121188f0 NXproperty.c: reorder functions new cbd9875e5 Window.c: add another FIXME new 770f468cd Merge branch 'uli42-pr/windowfixes' into 3.6.x new f92e1a5a2 Screen.c: Fix fullscreen (onescreen) at startup new 06724dfe0 Screen.c: rephrase comment new f696a57f8 Merge branch 'uli42-pr/fix_onescreen' into 3.6.x new 5b628e2d7 shellcheck: Fix SC2006 issue new daeb82e33 shellcheck: Fix SC2162 issue new cb6e3b7d3 shellcheck: Fix SC2148 issues new 18aca1f69 shellcheck: Fix SC2059 issue new 747a33744 shellcheck: Fix some SC2086 issues new 2168bc689 shellcheck: Fix SC2045 issue new 22b40e690 shellcheck: Fix SC2002 issue new 930fbe08b shellcheck: Fix SC2034 issue new afe0c1473 shellcheck: Fix SC2196 issues new 407651b39 shellcheck: Fix SC2048 issue new 8ce12d613 shellcheck: Fix SC2061 issue new 150e9bda9 nxagent: drop unused nxagentVisibility variables new 19b639b91 Window.c: Fix 32bit code path new 513418ace NXproperty.c: clean returns new 3cabdfa2a NXproperty.c: simplify and reformat GetWindowProperty() new 969d9af23 NXproperty.c: GetWindowProperty(): add more comments, restruct prototype new da9ac92e9 NXproperty.c, dix.c: simplify ProcDeleteProperty() new 82028465c NXproperty.c: reorder functions new 6d8ccec75 Window.c: add another FIXME new b09f5e03e Screen.c: Fix fullscreen (onescreen) at startup new 9d0364198 Screen.c: rephrase comment new 3e02494cb Merge branch 'mjtrangoni-fix-shellcheck-issues' into 3.6.x new 0e2b79713 release 3.5.99.26 new e0e999f4c Implement github actions basics new 763a9ee0e Add build jobs on containers new 637d6d733 Add shellcheck and cppcheck linters new 1620c93f0 Replace TravisCI with GitHub Actions new 3da6e9c3a Move PVS run to GitHub Actions new 3dfd7a711 linters: Enable shellcheck new 899c2a6f1 Build nx-libs on different architectures new d570730e6 Fix missing quilt on CentOS7 new 077089c4e Add linter references new b42544cf4 Install build-essentials on clang new 69864ad11 Add pylint to GitHub Actions new f4d654e6b Merge branch 'test-github-actions' into 3.6.x new ffba3aab3 shellcheck: Fix SC2164 issues new dfee5a988 shellcheck: Fix SC2064 issues new 71ae04011 shellcheck: Fix SC2022 issue new 6bada8f63 shellcheck: Fix SC2230 issue new 1fc5c689e Merge branch 'mjtrangoni-fix-shellcheck-issues' into 3.6.x new 420754489 nxdialog: fix/suppress some pylint findings new 5c09159ae Merge branch 'uli42-pr/pylint_fixes' into 3.6.x new 940b7843f .github/workflows/nx-libs.yml: In Fedora 34 and beyond, files from xorg-x11-xkb-utils-devel have been moved into bin:pkg xkbcomp-devel. new bbc59f214 nx-libs.spec: In Fedora 34 and beyond, files from xorg-x11-xkb-utils-devel have been moved into bin:pkg xkbcomp-devel. new 90728fadc Merge branch 'sunweaver-pr/fix-ci-builds-against-fedora-greater-than-33' into 3.6.x new 36f804e54 Forward ClientMessages to nxproxy side new c3476b6a8 Merge branch 'uli42-pr/forward_clientmessages' into 3.6.x new d7a49834e nxcomp/Children.cpp: display dialog text in output new 90ff3d025 nxcomp/Children.cpp: add macro checks around some log/stderr prints new 31beb51df nxcomp/Children.cpp: also try searching nxdialog, not only nxclient new 2e3fe61d1 nxcomp/Children.cpp: reformat code new 1338cffc9 nxcomp/Children.cpp: print a message if the dialog could not be displayed new 5dcb19b3d nxagent: fix RESIZE dialog text to not end with a linefeed new 9815f32d5 Merge branch 'uli42-pr/dialog_text' into 3.6.x new 46258974d nxcomp: Support Cygwin64. new ff0c2b148 nxcomp/src/BlockCacheSet.cpp: Amend comment behind if-clause closure. new 00711f914 Merge branch 'vatral-support_cygwin64' into 3.6.x new 1b4ebce2c Compext.c: fix comparisons of 16bit sequence numbers new 1bd98ef77 Merge branch 'uli42-pr/fix_async_replies' into 3.6.x new a14e1a59a randr: Do not update ConnectionInfo if NULL new b73374805 Merge branch 'uli42-pr/fix_randr_crash' into 3.6.x new 605a26691 fix building with binutils >= 2.36. new 6208dade8 Merge branch 'Ponce-binutils-2.36' into 3.6.x new f0f91ed26 Compext.c: some scope improvements new 906aa0714 Compext.c: add specific DEBUG and TEST macros new 8fe2c1140 Use NXAGENT_ONSTART define at more locations new 111ac2eed nxagent: make X2GO support optional new 666c4d16a nxagent: drop NXAGENT_SHAPE define new 3fcb7ae3f nxagent: drop NXAGENT_SHAPE2 define new 5271eed2d Error.c: untabify new 9b1dd3401 document additional options only nxagent knows about new d3573613f Compext.c: document function return codes new e9a0f94d0 Compext.c: print received vs expected sequence number new 3228dcfc5 Compext.c: fix misleading error message new 2739d0868 Compext.c: fix comparisons of 16bit sequence numbers new 555cbcb32 nxagent: add command line switch to enable composite new 31c456bf3 Composite.c: fix comment new 3823b0a5b nxagent: make nxagentCompositeEnable a Boolean new af5cf2659 nxagent: treat enableBackingStore as Boolean new a6d018bef nxagent: make nxagentAlpha* Booleans new 4a6ca0033 nxagent: make nxagentX2go a Boolean everywhere new 18a8a3610 nxagent: fix some variable types in Init new 9f1d0a807 Trap.h: fix type of traps new fcc1b57fb nxagent: add missing command line switches to usage text new 59a0620f6 Merge branch 'uli42-pr/various7' into 3.6.x new 6be4f87c6 debian/control: Add B-D: libtirpc-dev. new b67b910a6 debian/rules: Define -DUseTIRPC=1 for nx-X11 build on Debian and Ubuntu versions that already have libtirpc. new 972a92cab Clipboard.c: add/fix comments new 18c91fd94 Clipboard.c: improve error message new 32e194d46 Clipboard.c: improve debugging output new 2742fde00 Clipboard.c: improve explanations/FIXMEs new 12ed2c635 Clipboard.c: print times unsigned new 60380a6a5 Clipboard.c: do not set stage to new value if already set to that value new e9a25e794 Clipboard.c: catch selection failure from real X server new 94fd5f590 Clipboard.c: rework LastClient stuff to work _per selection_ new 717661b1d Clipboard.c: improve function names once more new 619236b98 Clipboard.c: reformat for better readability new 550742511 Clipboard.c: rename selection fields to {int,rem}Selection new edfea3cd1 Clipboard.c: introduce translateLocalToRemote* helpers new 0ad6b8bd6 Clipboard.c: use index everywhere new e8b00edb5 Clipboard.c: simplify nxagentHandleSelectionRequestFromXServer new 4701db7bc Clipboard.c: improve debug/test messages new e526e1cd0 Clipboard.c: fix nxagentConvertSelection new a8d09f815 Clipboard.c: have lastServer* per selection new d2370a1ba Clipboard.c: rename function to better reflect meaning new 3682be594 Clipboard.c: mark self-initiated event new d79db429d Clipboard.c: always print SelectionCallBackKind in debug output new a3adf6641 Clipboard.c: remove superflous index determination new 278ebeb70 Clipboard.c: split if clause new d32b4f5b1 Clipboard.c: fix memleaks in DEBUG mode new 6753eb592 Clipboard.c: use for loops everywhere. new bf0e05fd1 Clipboard.c: restructure request accumulation code new bff23cb94 Clipboard.c: rephrase FIXME new 9d3683896 Clipboard.c: move selection Atoms into separate arrays new 59ee58ee7 Clipboard.c: drop clientCLIPBOARD new 29413b32a Clipboard.c: fix comment position and init array pointer new a31353bdd Clipboard.c: compact clipboard status output new 27ecb8959 Atoms.c: add helper to easily print Atom names in debugging new 204bbef04 Clipboard.c: make use of the new helpers from Atoms.c new a470de000 Atoms.c: ensure to always return a valid string... new 855ddf281 Clipboard.c: avoid superflous atom conversion new 87eb4236a Clipboard.c: fix type in status output new 9dd509c01 Clipboard.c: fix: use XlibWindow instead of Window new eba654ea7 Clipboard.c: target forwarding (Part 1/2) new a87ee1e8f Clipboard.c: target forwarding (Part 2/2) new 8316d614a Clipboard.c: add some more selection atoms new ba02ad3ad Clipboard.c: add FIXMEs new 533f08ddb Clipboard.c: add TARGET_SIZES new 9ec417484 Clipboard.c: extend comments new 90947c1f7 nxagent: add option -textclipboard new 710d5c5f9 Clipboard.c: disable TEXT and COMPOUND_TEXT new a296b437d Clipboard.c: replace loop by helper new 6b659fe4a Clipboard.c: another round of debug improvements new a4f2dd3fe Clipboard.c: print separator when receiving events/requests in debug mode new a8b375079 Clipboard: init variable new e42ab9831 Clipboard.c: fix some whitepace, comments and FIXMEs new 2d4b0f846 Clipboard.c: fix transfer from agent to X server new 9ca972705 Events.c: use index instead of i new b66b99a83 Clipboard.c: use NullClient instead of NULL where appropriate new 177d76179 Clipboard.c: fix: remove wrong optimization new 6a1ee6c0b Clipboard.c: once again improved DEBUG output new 7e548faa2 Clipboard.c: remove obsolete FIXME comment new 53c03eaf3 Clipboard.c: fix: return after denying request new 41ea3b684 Clipboard.c: correctly pass back failure to real X server new 63ef52c63 Clipboard.c: fix indentation new 99a2d6e29 Clipboard.c: implement target caching new 55f9c94b2 Clipboard.c: improve some comments new cf85c7258 Clipboard.c: reset lastServer[].requestor on reconnect new b7021c675 Events.c: use already available variable instead of repeating conversion new 7746358b6 Clipboard.c: move some (currently commented) code to inner scope new 8f182cd74 Clipboard.c: introduce replyPendingRequestSelectionToXServer helper new ff4a1967c Clipboard.c: cancel pending requests in certain situations new 1fd98b193 Clipboard.c: add another FIXME new 51dae621f Clipboard.c: extend target caching for the other direction new 7a2c743ac Clipboard.c: move property transfer to separate function new 75acbbf29 Clipboard.c: make index the first argument everywhere new f578b86d3 Clipboard.c: rework nxagentFind*SelectionIndex() helpers new 9d8771562 Clipboard.c: limit selection nxagentFindCurrentSelectionIndex can return new d335fc8fb Clipboard.c: do not handle unknown selections in Callback handler new 65c260edf Clipboard.c: improve debugging output once more new 6ba180937 Clipboard.c: delete property before/after certain operations new 9eb76cf5d Clipboard.c: move comment to correct location new 04ca25eb1 Clipboard.c: fix some comments, add FIXME new d97e5022e Clipboard.c: check target cache for valid targets new 5c205f57a Clipboard.c: fix wrong debug message new 03502b36e Clipboard.c: print clipboard content only on explicit request new 9293348c8 Clipboard.c: print more debug details for reply new 124f5a5c6 Clipboard.c: sanity check for invalid resource new 6fe8bf8fb Clipboard.c: always flush after XConvertSelection() call new 1723afb64 Clipboard.c: improve comments new ba898dfcd Clipboard.c: improve debug output in special case new 0631eece9 Clipboard.c: add FIXMEs new bee3d3205 NXEvents.c: improve debugging new 34e1413cd Clipboard.c: improve some comments as requested by reviewer new 535104db2 Clipboard.c: use NXAGENT_ONSTART macro on one more location new 55af71edc Clipboard.c: harmonize naming regarding internal/local new 9fb5949b0 Clipboard.c: remove old code new f03c589ab Clipboard.c: remove superfluous brackets new e8217798d Clipboard.c: add helper variable new 4eba9d6b1 Clipboard.c: extend comment new ad69d4a0e Clipboard.c: improve output for PRINT_CLIPBOARD_CONTENT_ON_DEBUG new e65e71512 Clipboard.c: Fix: forward the correct type and format new 15a60b1c1 Clipboard.c: fix typos in comment new d42ebd2ae Clipboard.c: fix format specifier new 62775ed67 Clipboard.c: rename intermediate variable new c775bedbc Clipboard.c: rename nxagentFindLastSelectionOwnerIndex() new 2b156c397 Events.c: fix unused variable new 9b4602847 Clipboard.c: add missing target cache invalidation to some (currently unused) code new 1c8869b92 Clipboard.c: remove obsolete (disabled) code new 423caaf0f Clipboard.c: extend setSelectionOwnerOnXServer() new 5e017044f Clipboard.c: do not process requests if we do not have a local owner new 30e9b82ce Clipboard.c: restruct setSelectionOwnerOnXServer new 289ac3dfd Clipboard.c: remove superflous check new eae0eff3a Clipboard.c: improve some comments new 65d29df13 Clipboard.c: Only take full clipboard clearing action if non-empty new bbf9d74c4 Clipboard.c: print debug message if selection is already cleared new 15ee25b7d NXdispatch.c: add an explaining comment new 7aa969cd4 Fix Xfixes event handling new 5da2be394 Events.c: add another comment new 987402309 Clipboard.c: check for invalid index new 8264b03e8 Clipboard.c: Add debug output when selection is already cleared new 46b75d818 debian/control: Add B-D: libtirpc-dev. new 31057d00b debian/rules: Define -DUseTIRPC=1 for nx-X11 build on Debian and Ubuntu versions that already have libtirpc. new b7034724a Merge branch 'uli42-pr/many_clipboard_fixes' into 3.6.x The 429 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: .github/workflows/linters.yml | 126 + .github/workflows/nx-libs-archs.yml | 81 + .github/workflows/nx-libs.yml | 186 ++ .pvs-studio.sh | 29 - .travis.yml | 172 -- .../Xserver/composite/.gitignore => AUTHORS | 0 ChangeLog | 1060 ++++++- README.md | 2 +- SECURITY.md | 19 + VERSION | 2 +- debian/changelog | 14 + debian/control | 1 + ...erver-xext_set-securitypolicy-path.debian.patch | 19 - debian/patches/series | 1 - debian/rules | 42 +- m4/nx-xtrans.m4 | 11 + nx-X11/config/cf/Imake.tmpl | 12 - nx-X11/extras/Mesa.patches_6.4.2/1001_support_musl | 12 + nx-X11/extras/Mesa.patches_6.4.2/series | 1 + nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb | Bin 206452 -> 206452 bytes nx-X11/lib/configure.ac | 43 + nx-X11/lib/src/ConnDis.c | 40 +- nx-X11/lib/src/Makefile.am | 2 + nx-X11/lib/src/util/mkks.sh | 4 +- nx-X11/programs/Xserver/Xext/Imakefile | 5 +- nx-X11/programs/Xserver/Xext/panoramiX.c | 14 +- nx-X11/programs/Xserver/Xext/security.c | 202 -- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 1 + nx-X11/programs/Xserver/composite/compext.c | 6 + nx-X11/programs/Xserver/dix/property.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Args.c | 202 +- nx-X11/programs/Xserver/hw/nxagent/Args.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 101 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 20 +- nx-X11/programs/Xserver/hw/nxagent/Client.c | 16 +- nx-X11/programs/Xserver/hw/nxagent/Client.h | 7 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 3107 +++++++++++++------- nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 9 +- nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 20 +- nx-X11/programs/Xserver/hw/nxagent/Composite.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Dialog.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 135 +- nx-X11/programs/Xserver/hw/nxagent/Display.h | 2 + nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 116 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Error.c | 152 +- nx-X11/programs/Xserver/hw/nxagent/Error.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 417 ++- nx-X11/programs/Xserver/hw/nxagent/Events.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 24 +- nx-X11/programs/Xserver/hw/nxagent/Font.c | 36 +- nx-X11/programs/Xserver/hw/nxagent/GC.c | 46 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 96 +- nx-X11/programs/Xserver/hw/nxagent/GCs.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 80 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Icons.h | 2 + nx-X11/programs/Xserver/hw/nxagent/Image.c | 102 +- nx-X11/programs/Xserver/hw/nxagent/Image.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 5 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 27 +- nx-X11/programs/Xserver/hw/nxagent/Init.h | 8 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 71 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.h | 3 +- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 14 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 22 +- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 69 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 17 +- nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 7 + nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 40 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 155 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 13 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 51 +- nx-X11/programs/Xserver/hw/nxagent/Options.h | 65 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 12 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 52 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 34 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 5 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 583 ++-- nx-X11/programs/Xserver/hw/nxagent/Screen.h | 6 +- nx-X11/programs/Xserver/hw/nxagent/Splash.c | 24 +- nx-X11/programs/Xserver/hw/nxagent/Split.c | 12 +- nx-X11/programs/Xserver/hw/nxagent/Trap.c | 8 - nx-X11/programs/Xserver/hw/nxagent/Trap.h | 33 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 229 +- nx-X11/programs/Xserver/hw/nxagent/Windows.h | 2 - nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h | 2 +- .../programs/Xserver/hw/nxagent/compext/Compext.c | 727 ++--- .../programs/Xserver/hw/nxagent/compext/Compext.h | 12 + nx-X11/programs/Xserver/hw/nxagent/compext/Jpeg.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/compext/Png.c | 28 +- nx-X11/programs/Xserver/hw/nxagent/compext/Z.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 59 +- nx-X11/programs/Xserver/os/utils.c | 4 +- nx-X11/programs/Xserver/randr/randr.c | 6 +- nx-X11/programs/Xserver/randr/rrscreen.c | 3 + nx-X11/x-indent-all.sh | 2 +- nx-X11/x-indent.sh | 2 +- nx-libs.spec | 34 +- nxcomp/include/NX.h | 2 +- nxcomp/src/Auth.cpp | 2 +- nxcomp/src/BlockCacheSet.cpp | 4 +- nxcomp/src/Channel.h | 8 +- nxcomp/src/ChannelEndPoint.cpp | 2 +- nxcomp/src/Children.cpp | 64 +- nxcomp/src/Control.h | 2 +- nxcomp/src/Fork.cpp | 2 +- nxcomp/src/Log.h | 14 +- nxcomp/src/Loop.cpp | 16 +- nxcomp/src/MD5.c | 4 +- nxcomp/src/Message.h | 2 +- nxcomp/src/Misc.cpp | 41 +- nxcomp/src/Proxy.cpp | 4 +- nxcomp/src/ServerChannel.cpp | 4 +- nxcomp/src/Socket.cpp | 8 +- nxdialog/bin/nxdialog | 65 +- nxdialog/man/nxdialog.1 | 2 +- nxproxy/man/nxproxy.1 | 48 +- regenerate-symbol-docs.sh | 40 +- replace.sh | 2 + roll-tarballs.sh | 24 +- run-static-analysis.sh | 14 - version.sh | 2 +- 129 files changed, 6296 insertions(+), 3387 deletions(-) create mode 100644 .github/workflows/linters.yml create mode 100644 .github/workflows/nx-libs-archs.yml create mode 100644 .github/workflows/nx-libs.yml delete mode 100644 .pvs-studio.sh delete mode 100644 .travis.yml copy nx-X11/programs/Xserver/composite/.gitignore => AUTHORS (100%) create mode 100644 SECURITY.md delete mode 100644 debian/patches/2002_xserver-xext_set-securitypolicy-path.debian.patch create mode 100644 nx-X11/extras/Mesa.patches_6.4.2/1001_support_musl delete mode 100755 run-static-analysis.sh -- 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 3.6.x in repository nx-libs. commit 53ace27435c5f01b682badcd7245d9f39a6d7a0e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Oct 1 20:59:25 2020 +0200 Create SECURITY.md --- SECURITY.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..7623781d0 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| -------- | ------------------ | +| 3.5.99.x | :white_check_mark: | +| 3.6.x | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. -- 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 3.6.x in repository nx-libs. commit ee77e970628fb60b4555903be471df32adbc2906 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Oct 1 21:00:05 2020 +0200 Update SECURITY.md --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 7623781d0..f581c85d4 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -7,8 +7,8 @@ currently being supported with security updates. | Version | Supported | | -------- | ------------------ | -| 3.5.99.x | :white_check_mark: | -| 3.6.x | :x: | +| 3.5.99.x | :green_check_mark: | +| 3.6.x | :white_check_mark: | ## Reporting a Vulnerability -- 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 3.6.x in repository nx-libs. commit 67330d9ea185de0f08731c684363078e349b1845 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Oct 1 21:00:17 2020 +0200 Update SECURITY.md --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index f581c85d4..1050e56e8 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -7,7 +7,7 @@ currently being supported with security updates. | Version | Supported | | -------- | ------------------ | -| 3.5.99.x | :green_check_mark: | +| 3.5.99.x | :white_check_mark: | | 3.6.x | :white_check_mark: | ## Reporting a Vulnerability -- 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 3.6.x in repository nx-libs. commit d1a967f3aefcffc6babeb25fccc912c0bfdb9fe3 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 16 18:57:47 2020 +0200 randr: fix broken macros / memory corruption By casting the rrScrPriv to ScreenPtr we are using the offsets from the Screen structure for referencing data in the rrScrPriv structure causing data corruption. As both macros use the same casting this still works until the location where the data resides is overwritten. For 64bit the location was the "rotations" member in rrScrPriv which was not problematic because it is barely used. But on 32bit it was "numCrtcs" which is heavily used. On unwrap this was 0 and lead to a segfault. Fixes ArcticaProject/nx-libs#943 --- nx-X11/programs/Xserver/randr/randr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/randr/randr.c b/nx-X11/programs/Xserver/randr/randr.c index c742cf6e0..f8401a5cd 100644 --- a/nx-X11/programs/Xserver/randr/randr.c +++ b/nx-X11/programs/Xserver/randr/randr.c @@ -69,12 +69,12 @@ static int RRNScreens; #define wrap(priv,real,mem,func) {\ - ((ScreenPtr)priv)->mem = ((ScreenPtr)real)->mem; \ - ((ScreenPtr)real)->mem = func; \ + priv->mem = real->mem; \ + real->mem = func; \ } #define unwrap(priv,real,mem) {\ - ((ScreenPtr)real)->mem = ((ScreenPtr)priv)->mem; \ + real->mem = priv->mem; \ } static int ProcRRDispatch(ClientPtr pClient); -- 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 3.6.x in repository nx-libs. commit 475d6c1f26fa44a4b4e2ee25b40656e4a8f3eac6 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Feb 26 20:57:21 2019 +0100 libNX_X11: reintroduce HASXDMAUTH Fixes ArcticaProject/nx-libs#779 --- nx-X11/lib/configure.ac | 24 ++++++++++++++++++++++++ nx-X11/lib/src/Makefile.am | 2 ++ 2 files changed, 26 insertions(+) diff --git a/nx-X11/lib/configure.ac b/nx-X11/lib/configure.ac index 025d27111..205a4f1f9 100644 --- a/nx-X11/lib/configure.ac +++ b/nx-X11/lib/configure.ac @@ -42,6 +42,19 @@ PKG_PROG_PKG_CONFIG X11_REQUIRES='nx-xproto nx-xextproto nx-xtrans' X11_EXTRA_DEPS="" +X11_REQUIRES="${X11_REQUIRES} xau xcmiscproto bigreqsproto" +X11_EXTRA_DEPS="xau" +PKG_CHECK_MODULES(XDMCP, xdmcp, + AC_CHECK_LIB(Xdmcp, XdmcpWrap, + [ + AC_CHECK_LIB(Xdmcp, XdmcpWrap, [xdmauth="yes"], [xdmauth="no"], [$XDMCP_LIBS]) + X11_EXTRA_DEPS="$X11_EXTRA_DEPS xdmcp" + ], + [ + XDMCP_CFLAGS= + XDMCP_LIBS= + ], [$XDMCP_LIBS]), + [AC_MSG_RESULT(no)]) AC_SUBST(X11_EXTRA_DEPS) # Silence warning: ar: 'u' modifier ignored since 'D' is the default @@ -156,6 +169,17 @@ fi AC_SUBST(XTHREADLIB) AC_SUBST(XTHREAD_CFLAGS) +case x$xdmauth in +xyes) + XDMCP_CFLAGS="$XDMCP_CFLAGS -DHASXDMAUTH" + ;; +xno) + XDMCP_LIBS="" + ;; +esac +AC_SUBST(XDMCP_CFLAGS) +AC_SUBST(XDMCP_LIBS) + AC_CHECK_FUNC(poll, [has_poll="yes"], [has_poll="no"]) AC_ARG_ENABLE([poll], diff --git a/nx-X11/lib/src/Makefile.am b/nx-X11/lib/src/Makefile.am index 90011f602..016dbc5cf 100644 --- a/nx-X11/lib/src/Makefile.am +++ b/nx-X11/lib/src/Makefile.am @@ -28,6 +28,7 @@ AM_CPPFLAGS= \ AM_CFLAGS= \ $(X11_CFLAGS) \ $(BIGFONT_CFLAGS) \ + $(XDMCP_CFLAGS) \ $(XMALLOC_ZERO_CFLAGS) \ $(CWARNFLAGS) \ $(NULL) @@ -364,6 +365,7 @@ libNX_X11_la_LIBADD = \ $(USE_XCMS_LIBS) \ $(USE_XKB_LIBS) \ $(X11_LIBS) \ + $(XDMCP_LIBS) \ -L$(top_srcdir)/../../nxcomp/src/.libs -lXcomp \ $(NULL) -- 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 3.6.x in repository nx-libs. commit bc68b4aad96fa1819842b43c95715d5f2598546d Merge: 67330d9ea d1a967f3a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Oct 17 21:49:35 2020 +0200 Merge branch 'uli42-pr/fix_wrap_macros' into 3.6.x Attributes GH PR #944: https://github.com/ArcticaProject/nx-libs/pull/944 nx-X11/programs/Xserver/randr/randr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 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 3.6.x in repository nx-libs. commit 870a9491ca8ce2e9d984a5112afcf52bdf0b77f2 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Tue Jul 7 18:53:51 2020 +0200 travisci: Fix PVS job Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .pvs-studio.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.pvs-studio.sh b/.pvs-studio.sh index cf9f0d1ee..9e9f0370c 100644 --- a/.pvs-studio.sh +++ b/.pvs-studio.sh @@ -13,11 +13,19 @@ before_install() { build_script() { if [ "$PVS_ANALYZE" = "yes" ]; then - pvs-studio-analyzer credentials "${PVS_USERNAME}" "${PVS_KEY}" -o PVS-Studio.lic - pvs-studio-analyzer trace -- make -j2 - pvs-studio-analyzer analyze --quiet -j2 -l PVS-Studio.lic -o "PVS-Studio-${CC}.log" - plog-converter -a "GA:1,2" -t tasklist -o "PVS-Studio-${CC}.tasks" "PVS-Studio-${CC}.log" - cat "PVS-Studio-${CC}.tasks" + if [[ -z "${PVS_USERNAME}" ]]; then + echo '"PVS_USERNAME" environment variable not set' + exit 0 + elif [[ -z "${PVS_KEY}" ]]; then + echo '"PVS_KEY" environment variable not set' + exit 0 + else + pvs-studio-analyzer credentials -o "PVS-Studio.lic" "${PVS_USERNAME}" "${PVS_KEY}" + pvs-studio-analyzer trace -- make -j2 + pvs-studio-analyzer analyze --quiet -j2 --lic-file "PVS-Studio.lic" --output-file "PVS-Studio-${CC}.log" + plog-converter -a "GA:1,2" -t tasklist -o "PVS-Studio-${CC}.tasks" "PVS-Studio-${CC}.log" + cat "PVS-Studio-${CC}.tasks" + fi else make -j2 fi -- 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 3.6.x in repository nx-libs. commit d121f2a9c2cc156fa63bba83d2cbcb0c7fbb6631 Merge: 6857e26b4 2ef652d35 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Oct 17 21:57:24 2020 +0200 Merge branch 'uli42-pr/nxdialog_rpm' into 3.6.x Attributes GH PR #939: https://github.com/ArcticaProject/nx-libs/pull/939 nx-libs.spec | 23 +++++++++++++++++++---- 1 file changed, 19 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 3.6.x in repository nx-libs. commit 3335f250350b892e231dfb3fbd1527a8db2898f3 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Feb 26 22:35:58 2019 +0100 libNX_X11: reintroduce SECURE_RPC Fixes ArcticaProject/nx-libs#780 --- nx-X11/lib/configure.ac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nx-X11/lib/configure.ac b/nx-X11/lib/configure.ac index 205a4f1f9..81647aee7 100644 --- a/nx-X11/lib/configure.ac +++ b/nx-X11/lib/configure.ac @@ -67,6 +67,9 @@ m4_pattern_forbid([^NX_XTRANS_CONNECTION_FLAGS$]) # Transport selection macro from nx-xtrans.m4 NX_XTRANS_CONNECTION_FLAGS +# Secure RPC detection macro from xtrans.m4 +NX_XTRANS_SECURE_RPC_FLAGS + # Check for dlopen AC_MSG_CHECKING([if run-time linking is supported]) AC_SEARCH_LIBS(dlopen,[dl svld]) -- 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 3.6.x in repository nx-libs. commit 05cb09a5f9edff28466c736dd4601d17068d4c12 Merge: d121f2a9c 1215c36f7 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Oct 17 22:02:41 2020 +0200 Merge branch 'uli42-pr/libNX_X11_defines' into 3.6.x Attributes GH PR #787: https://github.com/ArcticaProject/nx-libs/pull/787 m4/nx-xtrans.m4 | 11 +++++++++++ nx-X11/lib/configure.ac | 43 +++++++++++++++++++++++++++++++++++++++++++ nx-X11/lib/src/Makefile.am | 2 ++ 3 files changed, 56 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 3.6.x in repository nx-libs. commit 94fcba361060b2e8da9eba395ffc5d4b7978ea47 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Feb 28 23:57:36 2019 +0100 libNX_X11: set FAIL_HARD as it has been in the imake builds Fixes ArcticaProject/nx-libs#783 --- nx-X11/lib/configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nx-X11/lib/configure.ac b/nx-X11/lib/configure.ac index 81647aee7..09204bba6 100644 --- a/nx-X11/lib/configure.ac +++ b/nx-X11/lib/configure.ac @@ -67,9 +67,22 @@ m4_pattern_forbid([^NX_XTRANS_CONNECTION_FLAGS$]) # Transport selection macro from nx-xtrans.m4 NX_XTRANS_CONNECTION_FLAGS + # Secure RPC detection macro from xtrans.m4 NX_XTRANS_SECURE_RPC_FLAGS +# Original comments regarding FAIL_HARD from libxtrans: +# "fail hard if socket directories cannot be chowned to root or +# chmod'ed to the requested mode if 'sticky' bit is requested for this +# directory instead of just print a warning that will remain unnoticed +# most of the times. +# Set the define XtransFailSoft to restore the old +# behavior to fail softly when socket directory cannot chowned/chmod +# to correct user/group." +# +# -> we want to always fail in that scenario. +AC_DEFINE(FAIL_HARD,1,[Fail if the xtrans socket directory has wrong permissions]) + # Check for dlopen AC_MSG_CHECKING([if run-time linking is supported]) AC_SEARCH_LIBS(dlopen,[dl svld]) -- 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 3.6.x in repository nx-libs. commit b4124219afdf4c5bb5dc2e9584bbec8ab5c19758 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Feb 26 23:20:46 2019 +0100 nx-xtrans.m4: reintroduce HAS_STICKY_DIR_BIT Fixes ArcticaProject/nx-libs#781 --- m4/nx-xtrans.m4 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/m4/nx-xtrans.m4 b/m4/nx-xtrans.m4 index 1ac7b0e75..fb0b1f70e 100644 --- a/m4/nx-xtrans.m4 +++ b/m4/nx-xtrans.m4 @@ -166,3 +166,14 @@ AC_DEFUN([NX_XTRANS_SECURE_RPC_FLAGS], fi AC_MSG_RESULT($SECURE_RPC) ]) # NX_XTRANS_SECURE_RPC_FLAGS + +# the following originates from libxtrans/configure.ac + +# sticky bit +# +# if any system exists without sticky dir bits this +# needs to be redone with a real autoconf test + +sticky_bit_define="-DHAS_STICKY_DIR_BIT" + +AC_SUBST(sticky_bit_define) -- 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 3.6.x in repository nx-libs. commit 6857e26b4c256a2660f52f5a23680c4a730dd59a Merge: bc68b4aad 870a9491c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Oct 17 21:54:03 2020 +0200 Merge branch 'mjtrangoni-fix-pvs-ci' into 3.6.x Attributes GH PR #938: https://github.com/ArcticaProject/nx-libs/pull/938 .pvs-studio.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 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 3.6.x in repository nx-libs. commit 2ef652d35fe27c46128b0fce6c37e036ef986d54 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Jul 12 13:14:12 2020 +0200 nx-libs.spec: create nxdialog rpm --- nx-libs.spec | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/nx-libs.spec b/nx-libs.spec index 8f21de0d9..7d7af876e 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -380,6 +380,20 @@ applications over a network, especially a slow one. This package provides the NX proxy (client) binary. +%package -n nxdialog +Group: Applications/System +Summary: NX Dialog +Provides: nxdialog = %{version}-%{release} +Provides: nxdialog%{?_isa} = %{version}-%{release} + +%description -n nxdialog +NX is a software suite which implements very efficient compression of +the X11 protocol. This increases performance when using X +applications over a network, especially a slow one. + +This package provides the nxdialog helper script. + + %prep %setup -q # remove build cruft that is in Git (also taken from roll-tarball.sh) @@ -459,10 +473,6 @@ 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 @@ -621,6 +631,11 @@ rm -f %{buildroot}%{_datadir}/man/man1/nxdialog.1* %dir %{_datadir}/nx %{_datadir}/nx/VERSION.nxproxy +%files -n nxdialog +%defattr(-,root,root) +%doc doc/nxdialog/README.md +%{_bindir}/nxdialog +%{_datadir}/man/man1/nxdialog.1* %changelog * Sun May 31 2020 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> 3.5.99.24 -- 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 3.6.x in repository nx-libs. commit 1215c36f77032ad4f08e1150d98101478a57cbf7 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Mar 1 00:08:43 2019 +0100 libNX_X11: set XTRANS_SEND_FDS=0 NX does not support passing around FDs for local connections. This will not cause any change in the resulting code as this variable had been unset by default. Fixes ArcticaProject/nx-libs#784 --- nx-X11/lib/configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nx-X11/lib/configure.ac b/nx-X11/lib/configure.ac index 09204bba6..c616dab57 100644 --- a/nx-X11/lib/configure.ac +++ b/nx-X11/lib/configure.ac @@ -81,7 +81,10 @@ NX_XTRANS_SECURE_RPC_FLAGS # to correct user/group." # # -> we want to always fail in that scenario. -AC_DEFINE(FAIL_HARD,1,[Fail if the xtrans socket directory has wrong permissions]) +AC_DEFINE(FAIL_HARD,1,[Fail if the xtrans socket directory cannot be chowned/chmod'ed]) + +# Actually disable all of the FD passing code, NX does not support it. +AC_DEFINE(XTRANS_SEND_FDS,0,[Disable xtrans FD passing code.]) # Check for dlopen AC_MSG_CHECKING([if run-time linking is supported]) -- 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 3.6.x in repository nx-libs. commit 8deda7bd4f1ada976010c2edcd7cab9a4bdf8140 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 19 20:59:02 2020 +0200 nxagent: Prevent resize loop This only happened with certain window managers like mutter. Fixes ArcticaProject/nx-libs#925 --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 19 +++++++++++++------ nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 21 +++++++++++++++------ nx-X11/programs/Xserver/hw/nxagent/Screen.h | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Window.c | 4 ++-- 6 files changed, 35 insertions(+), 19 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 847d40918..bf6e20e20 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -588,7 +588,7 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentLaunchDialog(DIALOG_ENABLE_DESKTOP_RESIZE_MODE); - nxagentChangeScreenConfig(0, nxagentOption(Width), nxagentOption(Height)); + nxagentChangeScreenConfig(0, nxagentOption(Width), nxagentOption(Height), True); if (nxagentOption(ClientOs) == ClientOsWinnt) { @@ -2082,7 +2082,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already X.xmap.window == nxagentDefaultWindows[nxagentScreen(X.xmap.window)->myNum]) { nxagentChangeScreenConfig(nxagentScreen(X.xmap.window)->myNum, nxagentOption(Width), - nxagentOption(Height)); + nxagentOption(Height), True); } break; @@ -3412,9 +3412,16 @@ int nxagentHandleConfigureNotify(XEvent* X) fprintf(stderr,"%s: Width %d Height %d.\n", __func__, nxagentOption(Width), nxagentOption(Height)); #endif - + /* + * we are processing a ConfigureNotifyEvent that brought us + * the current window size. If we issue a XResizeWindow() + * again with these values we might end up in loop if the + * window manager adjusts the size, which is perfectly + * legal for it to do. So we prevent the XResizeWindow call + * from happening. + */ nxagentChangeScreenConfig(0, nxagentOption(Width), - nxagentOption(Height)); + nxagentOption(Height), False); } } @@ -3435,7 +3442,7 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentChangeOption(RootHeight, X -> xconfigure.height); nxagentChangeScreenConfig(0, nxagentOption(Width), - nxagentOption(Height)); + nxagentOption(Height), True); return 1; } @@ -4310,7 +4317,7 @@ int nxagentHandleRRScreenChangeNotify(XEvent *X) #endif nxagentResizeScreen(screenInfo.screens[DefaultScreen(nxagentDisplay)], Xr -> width, Xr -> height, - Xr -> mwidth, Xr -> mheight); + Xr -> mwidth, Xr -> mheight, True); nxagentShadowCreateMainWindow(screenInfo.screens[DefaultScreen(nxagentDisplay)], screenInfo.screens[0]->root, Xr -> width, Xr -> height); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 239d84b85..52c3b0375 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -378,7 +378,7 @@ int nxagentRandRSetConfig(ScreenPtr pScreen, Rotation rotation, */ int r = nxagentResizeScreen(pScreen, pSize -> width, pSize -> height, - pSize -> mmWidth, pSize -> mmHeight); + pSize -> mmWidth, pSize -> mmHeight, True); nxagentMoveViewport(pScreen, 0, 0); @@ -448,7 +448,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, nxagentChangeOption(Height, height); } - int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight); + int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True); if (result == 1 && nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 90e796772..602351d10 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -633,7 +633,7 @@ Bool nxagentReconnectSession(void) if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama) == True) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), - nxagentOption(RootHeight)); + nxagentOption(RootHeight), True); nxagentResizeDesktopAtStartup = False; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 4654bbfcd..52ecea854 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2243,7 +2243,7 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) } Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, - int mmWidth, int mmHeight) + int mmWidth, int mmHeight, Bool doresize) { #ifdef TEST nxagentPrintAgentGeometry("Before Resize Screen", "nxagentResizeScreen:"); @@ -2365,10 +2365,19 @@ FIXME: We should try to restore the previously { nxagentSetWMNormalHints(pScreen->myNum, width, height); - XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); + if (doresize) + { + #ifdef DEBUG + fprintf(stderr, "%s: resizing DefaultWindow to [%d]x[%d]\n", __func__, width, height); + #endif + XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); + } if (nxagentOption(Rootless) == 0) { + #ifdef DEBUG + fprintf(stderr, "%s: resizing InputWindow to [%d]x[%d]\n", __func__, width, height); + #endif XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height); } } @@ -2691,7 +2700,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) AddResource(accessWindowID, RT_WINDOW, (void *)nxagentShadowWindowPtr); - nxagentResizeScreen(pScreen, nxagentShadowWidth, nxagentShadowHeight, pScreen -> mmWidth, pScreen -> mmHeight); + nxagentResizeScreen(pScreen, nxagentShadowWidth, nxagentShadowHeight, pScreen -> mmWidth, pScreen -> mmHeight, True); nxagentShadowCreateMainWindow(pScreen, pWin, nxagentShadowWidth, nxagentShadowHeight); @@ -3646,10 +3655,10 @@ void nxagentAdjustCustomMode(ScreenPtr pScreen) RRScreenSizeNotify(pScreen); } -int nxagentChangeScreenConfig(int screen, int width, int height) +int nxagentChangeScreenConfig(int screen, int width, int height, Bool doresize) { #ifdef DEBUG - fprintf(stderr, "nxagentChangeScreenConfig: called for screen [%d], width [%d] height [%d]\n", screen, width, height); + fprintf(stderr, "nxagentChangeScreenConfig: called for screen [%d], width [%d] height [%d] doresize [%d]\n", screen, width, height, doresize); #endif #ifdef TEST @@ -3697,7 +3706,7 @@ int nxagentChangeScreenConfig(int screen, int width, int height) fprintf(stderr, "nxagentChangeScreenConfig: Changing config to %d x %d\n", width, height); #endif - int r = nxagentResizeScreen(pScreen, width, height, 0, 0); + int r = nxagentResizeScreen(pScreen, width, height, 0, 0, doresize); if (r != 0) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.h b/nx-X11/programs/Xserver/hw/nxagent/Screen.h index 6d775e1cc..3eb16ea3c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.h @@ -110,9 +110,9 @@ Window nxagentCreateIconWindow(void); Bool nxagentMagicPixelZone(int x, int y); Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, - int mmWidth, int mmHeight); + int mmWidth, int mmHeight, Bool doresize); -int nxagentChangeScreenConfig(int screen, int width, int height); +int nxagentChangeScreenConfig(int screen, int width, int height, Bool doresize); int nxagentAdjustRandRXinerama(ScreenPtr pScreen); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index e6b9c03df..56ca30c4e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -891,7 +891,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) if (nxagentOption(Shadow) == 0) { nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), - HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); + HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), True); } else { @@ -945,7 +945,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) if (nxagentOption(Shadow) == 0) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), - nxagentOption(RootHeight)); + nxagentOption(RootHeight), True); } } -- 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 3.6.x in repository nx-libs. commit 7a02b4aba77a64b38992f1a20d8c851bdcc11500 Merge: 2b0976e93 ae037701f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Oct 17 22:37:22 2020 +0200 Merge branch 'uli42-pr/fix_stack_smashing' into 3.6.x Attributes GH PR #942: https://github.com/ArcticaProject/nx-libs/pull/942 nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c | 6 ++++++ nx-X11/programs/Xserver/hw/nxagent/compext/Compext.h | 12 ++++++++++++ 4 files changed, 22 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 3.6.x in repository nx-libs. commit 0f8ed4d103b3f68d5cedaa611b47b7cdb1e0517c Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 11 18:33:01 2020 +0200 Screen.c: fix resizing bug with mutter window manager Not really sure why I introduced the client check years ago. Grabbed is grabbed, so I don't see a reason implementing it this way. Fixes ArcticaProject/nx-libs#925. --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 2bdc4bde5..4654bbfcd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -3675,7 +3675,7 @@ int nxagentChangeScreenConfig(int screen, int width, int height) fprintf(stderr, "nxagentChangeScreenConfig: grabstate [UNKNOWN], client [%p]\n", (void *) nxagentGrabServerInfo.client); #endif - if (nxagentGrabServerInfo.grabstate == SERVER_GRABBED && nxagentGrabServerInfo.client != NULL) + if (nxagentGrabServerInfo.grabstate == SERVER_GRABBED) { /* * If any client grabbed the server it won't expect screen -- 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 3.6.x in repository nx-libs. commit ae037701fe9a6337375d51abb2ea5b7aafdb434e Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 2 22:11:04 2020 +0200 nxagent: fix stack smashing In compext Atom has the size of XlibAtom. Therefore calling functions of Compext.c requires to use/pass XlibAtom. Same for Window/XlibWindow. ==15438==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffcdc0 at pc 0x5555556a81b5 bp 0x7fffffffcd10 sp 0x7fffffffcd08 WRITE of size 8 at 0x7fffffffcdc0 thread T0 #0 0x5555556a81b4 in NXGetCollectedProperty nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c:4124 #1 0x5555557d0488 in nxagentCollectPropertyEvent nx-X11/programs/Xserver/hw/nxagent/Clipboard.c:1202 #2 0x555555723340 in nxagentHandleCollectPropertyEvent nx-X11/programs/Xserver/hw/nxagent/Events.c:3923 #3 0x55555571d4db in nxagentHandleProxyEvent nx-X11/programs/Xserver/hw/nxagent/Events.c:3007 #4 0x55555571bb92 in nxagentHandleClientMessageEvent nx-X11/programs/Xserver/hw/nxagent/Events.c:2595 #5 0x555555717dfc in nxagentDispatchEvents nx-X11/programs/Xserver/hw/nxagent/Events.c:1827 #6 0x555555750813 in nxagentBlockHandler nx-X11/programs/Xserver/hw/nxagent/Handlers.c:437 #7 0x5555556c1b5d in BlockHandler nx-X11/programs/Xserver/dix/dixutils.c:403 #8 0x5555556d47ff in WaitForSomething nx-X11/programs/Xserver/os/WaitFor.c:232 #9 0x555555665b22 in Dispatch nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c:365 #10 0x5555555ed760 in main nx-X11/programs/Xserver/dix/main.c:350 #11 0x7ffff604909a in __libc_start_main ../csu/libc-start.c:308 #12 0x5555555edc09 in _start (nx-X11/programs/Xserver/nxagent+0x99c09) Address 0x7fffffffcdc0 is located in stack of thread T0 at offset 32 in frame #0 0x5555557d0324 in nxagentCollectPropertyEvent nx-X11/programs/Xserver/hw/nxagent/Clipboard.c:1190 This frame has 5 object(s): [32, 36) 'atomReturnType' <== Memory access at offset 32 partially overflows this variable [96, 100) 'resultFormat' [160, 168) 'ulReturnItems' [224, 232) 'ulReturnBytesLeft' [288, 296) 'pszReturnData' HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c:4124 in NXGetCollectedProperty ... --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c | 6 ++++++ nx-X11/programs/Xserver/hw/nxagent/compext/Compext.h | 12 ++++++++++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index ecc3f19be..7ca22ffad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1188,7 +1188,7 @@ static void transferSelection(int resource) void nxagentCollectPropertyEvent(int resource) { - Atom atomReturnType; + XlibAtom atomReturnType; int resultFormat; unsigned long ulReturnItems; unsigned long ulReturnBytesLeft; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 346ee48d8..847d40918 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -3924,7 +3924,7 @@ void nxagentHandleCollectPropertyEvent(XEvent *X) } else { - Atom atomReturnType; + XlibAtom atomReturnType; int resultFormat; unsigned long ulReturnItems; unsigned long ulReturnBytesLeft; @@ -3940,8 +3940,8 @@ void nxagentHandleCollectPropertyEvent(XEvent *X) if (result == True) { - Window window = nxagentPropertyRequests[resource].window; - Atom property = nxagentPropertyRequests[resource].property; + XlibWindow window = nxagentPropertyRequests[resource].window; + XlibAtom property = nxagentPropertyRequests[resource].property; nxagentImportProperty(window, property, atomReturnType, resultFormat, ulReturnItems, ulReturnBytesLeft, pszReturnData); diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c index 230c9abae..3492ef473 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c @@ -23,6 +23,12 @@ /* */ /**************************************************************************/ +/* + * let the types be the Xlib types by undefining _XSERVER64. This + * means, when calling the functions of this file from nxagent (where + * Agent.h has been included) you need to use/provide XlibAtom and + * XlibWindow instead of Atom and Window + */ #undef _XSERVER64 #include <sys/socket.h> diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.h b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.h index c0259a939..885d262a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.h +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.h @@ -827,19 +827,31 @@ extern int NXCollectProperty( Display* /* display */, unsigned int /* resource */, Window /* window */, +#ifdef XlibAtom + XlibAtom /* property */, +#else Atom /* property */, +#endif long /* long_offset */, long /* long_length */, Bool /* delete */, +#ifdef XlibAtom + XlibAtom /* req_type */ +#else Atom /* req_type */ #endif +#endif ); extern int NXGetCollectedProperty( #if NeedFunctionPrototypes Display* /* display */, unsigned int /* resource */, +#ifdef XlibAtom + XlibAtom* /* actual_type_return */, +#else Atom* /* actual_type_return */, +#endif int* /* actual_format_return */, unsigned long* /* nitems_return */, unsigned long* /* bytes_after_return */, -- 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 3.6.x in repository nx-libs. commit e74b99117727152904e994f37f1cc98b4ba54292 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jun 19 00:17:43 2020 +0200 Keyboard.c: fix indentation of ifdef --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 233b6df74..48ab721f5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -706,12 +706,12 @@ XkbError: { XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb); } -#ifdef TEST + #ifdef TEST else { fprintf(stderr, "%s: No current keyboard.\n", __func__); } -#endif + #endif #ifdef DEBUG fprintf(stderr, "%s: Going to set rules and init device: " -- 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 3.6.x in repository nx-libs. commit 2b0976e93809291eaff0725a5c0772e00a450e2b Merge: 05cb09a5f ffc2c3840 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Oct 17 22:21:02 2020 +0200 Merge branch 'uli42-pr/fix_caps_handling' into 3.6.x Attributes GH PR #937: https://github.com/ArcticaProject/nx-libs/pull/937 nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 46 +++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 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 3.6.x in repository nx-libs. commit ffc2c3840466ed50abc35cba40fdc697e478ebd6 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jun 19 00:18:34 2020 +0200 Keyboard.c: improve capslock and numlock handling Fixes ArcticaProject/nx-libs#935 --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 48ab721f5..14d811877 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -713,6 +713,48 @@ XkbError: } #endif + #ifdef TEST + if (nxagentCapsLockKeycode != 0) + { + fprintf(stderr, "%s: Modifiers for CapsLock (%d): 0x%x\n", __func__, nxagentCapsLockKeycode, xkb->map->modmap[nxagentCapsLockKeycode]); + } + if (nxagentNumLockKeycode != 0) + { + fprintf(stderr, "%s: Modifiers for NumLock (%d): 0x%x\n", __func__, nxagentNumLockKeycode, xkb->map->modmap[nxagentNumLockKeycode]); + } + #endif + + /* Users can add options to their xkb setup. E.g. setxkbmap + * -option caps:ctrl_modifier makes CapsLock behave like the + * Ctrl key. As we have special treatment for CapsLock and + * NumLock to keep them in sync with the real X server we + * check if they are assigned to another modifier. In that + * case we disable the sync treatment by setting the according + * keycode to 0. + */ + if (xkb && xkb->map && xkb->map->modmap) + { + if (nxagentCapsLockKeycode != 0 && xkb->map->modmap[nxagentCapsLockKeycode] != LockMask) + { + nxagentCapsLockKeycode = 0; + #ifdef TEST + fprintf(stderr, "%s: CapsLock key is mapped to some other modifier - disabling special treatment\n", __func__); + #endif + } + + /* I have not found an xkb option definition for remapping + * NumLock. But users can still do that manually so let's be + * safe here. + */ + if (xkb->map->modmap[nxagentNumLockKeycode] != Mod2Mask) + { + nxagentNumLockKeycode = 0; + #ifdef TEST + fprintf(stderr, "%s: Numock key is mapped to some other modifier - disabling special treatment\n", __func__); + #endif + } + } + #ifdef DEBUG fprintf(stderr, "%s: Going to set rules and init device: " "[rules='%s',model='%s',layout='%s',variant='%s',options='%s'].\n", __func__, -- 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 3.6.x in repository nx-libs. commit 337afd839b99733baed52e7b1d01d24c737a8849 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 18:36:21 2020 +0200 Events.c: add more DEBUG output --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 89 +++++++++++++++++++++++++---- 1 file changed, 78 insertions(+), 11 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index bf6e20e20..899afcce6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -3135,8 +3135,26 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X) return 1; } +#define DEBUG +#define TEST + int nxagentHandleConfigureNotify(XEvent* X) { + #ifdef DEBUG + fprintf(stderr, "%s: Event info:\n", __func__); + fprintf(stderr, "%s: X->serial [%ld]\n", __func__, X->xconfigure.serial); + fprintf(stderr, "%s: X->override_redirect [%d]\n", __func__, X->xconfigure.override_redirect); + fprintf(stderr, "%s: X->border_width [%d]\n", __func__, X->xconfigure.border_width); + fprintf(stderr, "%s: X->send_event [%d]\n", __func__, X->xconfigure.send_event); + fprintf(stderr, "%s: X->window [0x%lx]\n", __func__, X->xconfigure.window); + fprintf(stderr, "%s: X->event [0x%lx]\n", __func__, X->xconfigure.event); + fprintf(stderr, "%s: X->x, X->y [%d][%d]\n", __func__, X->xconfigure.x, X->xconfigure.y); + fprintf(stderr, "%s: X->width, X->height [%d][%d]\n", __func__, X->xconfigure.width, X->xconfigure.height); + fprintf(stderr, "%s: References:\n", __func__); + fprintf(stderr, "%s: DefaultWindow[0]: [0x%x]\n", __func__, nxagentDefaultWindows[0]); + fprintf(stderr, "%s: DefaultRootWindow(DISPLAY) [0x%lx]\n", __func__, DefaultRootWindow(nxagentDisplay)); +#endif + if (nxagentOption(Rootless) == True) { int sendEventAnyway = 0; @@ -3326,6 +3344,10 @@ int nxagentHandleConfigureNotify(XEvent* X) if (!nxagentWMIsRunning || X -> xconfigure.send_event) { updatePos = True; + #ifdef DEBUG + fprintf(stderr, "%s: Accumulating event %d: x [%d] y [%d] width [%d] height [%d]\n", __func__, count, + X -> xconfigure.x, X -> xconfigure.y, X -> xconfigure.width, X -> xconfigure.height); + #endif newX = X -> xconfigure.x; newY = X -> xconfigure.y; } @@ -3340,10 +3362,11 @@ int nxagentHandleConfigureNotify(XEvent* X) } } - if (updatePos) + if (updatePos && (nxagentOption(X) != newX || nxagentOption(Y) != newY)) { #ifdef DEBUG - fprintf(stderr, "%s: Updating nxagent window position [%d,%d]\n", __func__, newX, newY); + fprintf(stderr, "%s: Updating nxagent window position [%d,%d] -> [%d,%d]\n", __func__, + nxagentOption(X), nxagentOption(Y), newX, newY); #endif nxagentChangeOption(X, newX); nxagentChangeOption(Y, newY); @@ -3356,8 +3379,16 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentShadowResize = 1; } - nxagentChangeOption(Width, X -> xconfigure.width); - nxagentChangeOption(Height, X -> xconfigure.height); + if (nxagentOption(Width) != X->xconfigure.width || nxagentOption(Height) != X->xconfigure.height) + { + #ifdef DEBUG + fprintf(stderr, "%s: Updating width and height [%d,%d] -> [%d,%d]\n", __func__, + nxagentOption(Width), nxagentOption(Height), + X->xconfigure.width, X->xconfigure.height); + #endif + nxagentChangeOption(Width, X -> xconfigure.width); + nxagentChangeOption(Height, X -> xconfigure.height); + } nxagentChangeOption(ViewportXSpan, (int) X -> xconfigure.width - (int) nxagentOption(RootWidth)); @@ -3378,9 +3409,6 @@ int nxagentHandleConfigureNotify(XEvent* X) doRandR = False; } - nxagentChangeOption(Width, X -> xconfigure.width); - nxagentChangeOption(Height, X -> xconfigure.height); - XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, X -> xconfigure.width, X -> xconfigure.height); @@ -3449,13 +3477,31 @@ int nxagentHandleConfigureNotify(XEvent* X) } } + #ifdef TEST + fprintf(stderr, "%s: received for unexpected window [%ld]\n", __func__, X -> xconfigure.window); + #endif + return 0; } int nxagentHandleReparentNotify(XEvent* X) { #ifdef TEST - fprintf(stderr, "%s: Going to handle a new reparent event.\n", __func__); + fprintf(stderr, "%s: Going to handle a new reparent event (serial [%ld].\n", __func__, X->xreparent.serial); + #endif + + #ifdef DEBUG + fprintf(stderr, "%s: Event info:\n", __func__); + fprintf(stderr, "%s: X->send_event [%d]\n", __func__, X->xreparent.send_event); + fprintf(stderr, "%s: X->event [0x%lx]\n", __func__, X->xreparent.event); + fprintf(stderr, "%s: X->window [0x%lx]\n", __func__, X->xreparent.window); + fprintf(stderr, "%s: X->parent [0x%lx]\n", __func__, X->xreparent.parent); + fprintf(stderr, "%s: X->x, X->y [%d][%d]\n", __func__, X->xreparent.x, X->xreparent.y); + fprintf(stderr, "%s: X->override_redirect [%d]\n", __func__, X->xreparent.override_redirect); + fprintf(stderr, "%s: References:\n", __func__); + fprintf(stderr, "%s: DefaultWindow[0]: [0x%x]\n", __func__, nxagentDefaultWindows[0]); + fprintf(stderr, "%s: RootWindow(DISPLAY, 0): [0x%lx]\n", __func__, RootWindow(nxagentDisplay, 0)); + fprintf(stderr, "%s: DefaultRootWindow(DISPLAY): [0x%lx]\n", __func__, DefaultRootWindow(nxagentDisplay)); #endif if (nxagentOption(Rootless)) @@ -3560,21 +3606,30 @@ int nxagentHandleReparentNotify(XEvent* X) &attributes) == 0)) { #ifdef WARNING - fprintf(stderr, "%s: WARNING! XGetWindowAttributes failed.\n", __func__); + fprintf(stderr, "%s: WARNING! XGetWindowAttributes for parent window failed.\n", __func__); #endif return 1; } + XlibWindow junk; int x = attributes.x; int y = attributes.y; - XlibWindow junk; + #ifdef DEBUG + int before_x = x; + int before_y = y; + #endif + XTranslateCoordinates(nxagentDisplay, X -> xreparent.window, attributes.root, -attributes.border_width, -attributes.border_width, &x, &y, &junk); - /* + #ifdef DEBUG + fprintf(stderr, "%s: translated coordinates x,y [%d,%d] -> [%d,%d].\n", __func__, before_x, before_y, x, y); + #endif + + /* * Calculate the parent X and parent Y. */ @@ -3623,6 +3678,18 @@ int nxagentHandleReparentNotify(XEvent* X) nxagentChangeOption(WMBorderWidth, (x - attributes.x)); nxagentChangeOption(WMTitleHeight, (y - attributes.y)); + + #ifdef DEBUG + fprintf(stderr, "%s: WMBorderWidth [%d]\n", __func__, nxagentOption(WMBorderWidth)); + fprintf(stderr, "%s: WMTitleHeight [%d]\n", __func__, nxagentOption(WMTitleHeight)); + fprintf(stderr, "%s: win_gravity [%d]\n", __func__, attributes.win_gravity); + fprintf(stderr, "%s: bit_gravity [%d]\n", __func__, attributes.bit_gravity); + fprintf(stderr, "%s: border_width [%d]\n", __func__, attributes.border_width); + fprintf(stderr, "%s: height [%d]\n", __func__, attributes.height); + fprintf(stderr, "%s: width [%d]\n", __func__, attributes.width); + fprintf(stderr, "%s: x [%d]\n", __func__, attributes.x); + fprintf(stderr, "%s: y [%d]\n", __func__, attributes.y); + #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 3.6.x in repository nx-libs. commit abe5e8479aca9f53ed4778336978bf7bd623c56a Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri May 15 18:25:07 2020 +0200 Display.c: factor out confinement window creation --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 54 +++++++++++++--------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 55e40b461..2db83e9db 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -1105,6 +1105,28 @@ void nxagentResetSignalHandlers(void) nxagentInitTimer(); } +/* + * currently unused it seems + */ +void nxagentOpenConfineWindow(void) +{ + nxagentConfineWindow = XCreateWindow(nxagentDisplay, + DefaultRootWindow(nxagentDisplay), + 0, 0, 1, 1, 0, 0, + InputOnly, + CopyFromParent, + 0L, NULL); + + if (nxagentReportWindowIds) { + fprintf(stderr, "NXAGENT_WINDOW_ID: CONFINEMENT_WINDOW,WID:[0x%x]\n", + nxagentConfineWindow); + } + + #ifdef TEST + fprintf(stderr, "%s: Created agent's confine window with id [0x%x].\n", __func__, nxagentConfineWindow); + #endif +} + void nxagentOpenDisplay(int argc, char *argv[]) { if (!nxagentDoFullGeneration) @@ -1298,21 +1320,7 @@ FIXME: Use of nxagentParentWindow is strongly deprecated. We need fprintf(stderr, "nxagentOpenDisplay: Going to create agent's confine window.\n"); #endif - nxagentConfineWindow = XCreateWindow(nxagentDisplay, - DefaultRootWindow(nxagentDisplay), - 0, 0, 1, 1, 0, 0, - InputOnly, - CopyFromParent, - 0L, NULL); - - if (nxagentReportWindowIds) { - fprintf(stderr, "NXAGENT_WINDOW_ID: CONFINEMENT_WINDOW,WID:[0x%x]\n", - nxagentConfineWindow); - } - #ifdef TEST - fprintf(stderr, "nxagentOpenDisplay: Created agent's confine window with id [0x%x].\n", - nxagentConfineWindow); - #endif + nxagentOpenConfineWindow(); if (!(nxagentUserGeometry.flag & XValue)) { @@ -2665,21 +2673,7 @@ Bool nxagentReconnectDisplay(void *p0) fprintf(stderr, "nxagentReconnectDisplay: Going to create agent's confine window.\n"); #endif - nxagentConfineWindow = XCreateWindow(nxagentDisplay, - DefaultRootWindow(nxagentDisplay), - 0, 0, 1, 1, 0, 0, - InputOnly, - CopyFromParent, - 0L, NULL); - - if (nxagentReportWindowIds) { - fprintf(stderr, "NXAGENT_WINDOW_ID: CONFINEMENT_WINDOW,WID:[0x%x]\n", - nxagentConfineWindow); - } - #ifdef TEST - fprintf(stderr, "nxagentReconnectDisplay: Created agent's confine window with id [0x%x].\n", - nxagentConfineWindow); - #endif + nxagentOpenConfineWindow(); useXpmIcon = nxagentMakeIcon(nxagentDisplay, &nxagentIconPixmap, &nxagentIconShape); -- 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 3.6.x in repository nx-libs. commit ce649c02747e45208dedfed1ee7a329a24652ecd Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 19:54:15 2020 +0200 nxagent: add names to some windows in DEBUG mode --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 12 +++++++ nx-X11/programs/Xserver/hw/nxagent/Screen.c | 51 ++++++++++++++++++++++++---- nx-X11/programs/Xserver/hw/nxagent/Window.c | 26 ++++++++++++++ 3 files changed, 83 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 5ba3d5d12..9adc67a21 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -1125,6 +1125,18 @@ void nxagentOpenConfineWindow(void) nxagentConfineWindow); } + #ifdef DEBUG + { + char *winname = NULL; + if (-1 != asprintf(&winname, "%s Confine", nxagentWindowName)) + { + Xutf8SetWMProperties(nxagentDisplay, nxagentConfineWindow, + winname, winname, NULL , 0 , NULL, NULL, NULL); + SAFE_free(winname); + } + } + #endif + #ifdef TEST fprintf(stderr, "%s: Created agent's confine window with id [0x%x].\n", __func__, nxagentConfineWindow); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 52ecea854..e2ceede23 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -466,9 +466,23 @@ Window nxagentCreateIconWindow(void) } } + char *winname = NULL; + #ifdef DEBUG + if (-1 == asprintf(&winname, "%s Icon", nxagentWindowName)) + { + /* If memory allocation wasn't possible, or some other error + occurs, these functions will return -1, and the contents of + winname are undefined. */ + winname = NULL; + } + #endif + Xutf8SetWMProperties(nxagentDisplay, w, - nxagentWindowName, nxagentWindowName, - NULL , 0 , sizeHints, wmHints, NULL); + winname ? winname : nxagentWindowName, + winname ? winname : nxagentWindowName, + NULL , 0 , sizeHints, wmHints, NULL); + + SAFE_free(winname); SAFE_XFree(sizeHints); SAFE_XFree(wmHints); @@ -1768,6 +1782,18 @@ N/A fprintf(stderr, "NXAGENT_WINDOW_ID: INPUT_WINDOW:[%d],WID:[0x%x]\n", pScreen->myNum, nxagentInputWindows[pScreen->myNum]); } + #ifdef DEBUG + { + char *winname = NULL; + if (-1 != asprintf(&winname, "%s Input", nxagentWindowName)) + { + Xutf8SetWMProperties(nxagentDisplay, nxagentInputWindows[pScreen->myNum], + winname, winname, NULL , 0 , NULL, NULL, NULL); + SAFE_free(winname); + } + } + #endif + #ifdef TEST fprintf(stderr, "nxagentOpenScreen: Created new input window for screen [%d] with id [0x%x].\n", pScreen->myNum, nxagentInputWindows[pScreen->myNum]); @@ -1873,11 +1899,24 @@ N/A } } + char *winname = NULL; + #ifdef DEBUG + if (-1 == asprintf(&winname, "%s Default[%d]", nxagentWindowName, pScreen->myNum)) + { + /* If memory allocation wasn't possible, or some other error + occurs, these functions will return -1, and the contents of + winname are undefined. */ + winname = NULL; + } + #endif + Xutf8SetWMProperties(nxagentDisplay, - nxagentDefaultWindows[pScreen->myNum], - nxagentWindowName, - nxagentWindowName, - argv , argc , sizeHints, wmHints, NULL); + nxagentDefaultWindows[pScreen->myNum], + winname ? winname : nxagentWindowName, + winname ? winname : nxagentWindowName, + argv , argc , sizeHints, wmHints, NULL); + + SAFE_free(winname); SAFE_XFree(sizeHints); SAFE_XFree(wmHints); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 56ca30c4e..97c4700e4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -403,6 +403,19 @@ Bool nxagentCreateWindow(WindowPtr pWin) { fprintf(stderr, "NXAGENT_WINDOW_ID: PRIVATE_WINDOW,WID:[0x%x],INT:[0x%x]\n", nxagentWindowPriv(pWin)->window, pWin->drawable.id); } + + #ifdef DEBUG + { + char *winname = NULL; + if (-1 != asprintf(&winname, "%s Private[0x%lx]", nxagentWindowName, pWin->drawable.id)) + { + Xutf8SetWMProperties(nxagentDisplay, nxagentWindowPriv(pWin)->window, + winname, winname, NULL , 0 , NULL, NULL, NULL); + SAFE_free(winname); + } + } + #endif + #ifdef TEST fprintf(stderr, "nxagentCreateWindow: Created new window with id [0x%x].\n", nxagentWindowPriv(pWin)->window); @@ -2995,6 +3008,19 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer { fprintf(stderr, "NXAGENT_WINDOW_ID: PRIVATE_WINDOW,WID:[0x%x],INT:[0x%x]\n", nxagentWindowPriv(pWin)->window, pWin->drawable.id); } + + #ifdef DEBUG + { + char *winname = NULL; + if (-1 != asprintf(&winname, "%s Private[0x%lx]", nxagentWindowName, pWin->drawable.id)) + { + Xutf8SetWMProperties(nxagentDisplay, nxagentWindowPriv(pWin)->window, + winname, winname, NULL , 0 , NULL, NULL, NULL); + SAFE_free(winname); + } + } + #endif + #ifdef TEST fprintf(stderr, "nxagentReconnectWindow: Created new window with id [0x%x].\n", nxagentWindowPriv(pWin)->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 3.6.x in repository nx-libs. commit a4dd6a462d79c5c85ba43923fb5414cef62574f3 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 18:52:36 2020 +0200 Events.c: store parent window from event to meaningful variable --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index bfce2f012..172715987 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -3602,9 +3602,9 @@ int nxagentHandleReparentNotify(XEvent* X) * Calculate the absolute upper-left X e Y */ + XlibWindow parent = X -> xreparent.parent; XWindowAttributes attributes; - if ((XGetWindowAttributes(nxagentDisplay, X -> xreparent.window, - &attributes) == 0)) + if ((XGetWindowAttributes(nxagentDisplay, parent, &attributes) == 0)) { #ifdef WARNING fprintf(stderr, "%s: WARNING! XGetWindowAttributes for parent window failed.\n", __func__); @@ -3622,7 +3622,7 @@ int nxagentHandleReparentNotify(XEvent* X) int before_y = y; #endif - XTranslateCoordinates(nxagentDisplay, X -> xreparent.window, + XTranslateCoordinates(nxagentDisplay, parent, attributes.root, -attributes.border_width, -attributes.border_width, &x, &y, &junk); @@ -3634,9 +3634,7 @@ int nxagentHandleReparentNotify(XEvent* X) * Calculate the parent X and parent Y. */ - XlibWindow w = X -> xreparent.parent; - - if (w != DefaultRootWindow(nxagentDisplay)) + if (parent != DefaultRootWindow(nxagentDisplay)) { XlibWindow rootReturn = 0; XlibWindow parentReturn = 0; @@ -3645,7 +3643,7 @@ int nxagentHandleReparentNotify(XEvent* X) do { - Status result = XQueryTree(nxagentDisplay, w, &rootReturn, &parentReturn, + Status result = XQueryTree(nxagentDisplay, parent, &rootReturn, &parentReturn, &childrenReturn, &nchildrenReturn); SAFE_XFree(childrenReturn); @@ -3655,7 +3653,7 @@ int nxagentHandleReparentNotify(XEvent* X) break; } - w = parentReturn; + parent = parentReturn; } while (True); @@ -3663,7 +3661,7 @@ int nxagentHandleReparentNotify(XEvent* X) * WM reparented. Find edge of the frame. */ - if (XGetWindowAttributes(nxagentDisplay, w, &attributes) == 0) + if (XGetWindowAttributes(nxagentDisplay, parent, &attributes) == 0) { #ifdef WARNING fprintf(stderr, "%s: WARNING! XGetWindowAttributes failed for parent window.\n", __func__); -- 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 3.6.x in repository nx-libs. commit 210db316300c9a24f74963fc90d0eb59db9555a5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 19:31:29 2020 +0200 Display.c: disable confine window We are not using it anywhere so let's disable it via a macro for now. --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 4 ++++ nx-X11/programs/Xserver/hw/nxagent/Display.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 2db83e9db..5ba3d5d12 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -159,6 +159,7 @@ Pixmap nxagentScreenSaverPixmap; XlibGC nxagentBitmapGC; +#ifdef NX_CONFINE_WINDOW /* * The "confine" window is used in the nxagentConstrainCursor * procedure. We are currently overriding the original Xnest @@ -166,6 +167,7 @@ XlibGC nxagentBitmapGC; */ Window nxagentConfineWindow; +#endif Pixmap nxagentIconPixmap; Pixmap nxagentIconShape; @@ -1110,6 +1112,7 @@ void nxagentResetSignalHandlers(void) */ void nxagentOpenConfineWindow(void) { +#ifdef NX_CONFINE_WINDOW nxagentConfineWindow = XCreateWindow(nxagentDisplay, DefaultRootWindow(nxagentDisplay), 0, 0, 1, 1, 0, 0, @@ -1125,6 +1128,7 @@ void nxagentOpenConfineWindow(void) #ifdef TEST fprintf(stderr, "%s: Created agent's confine window with id [0x%x].\n", __func__, nxagentConfineWindow); #endif +#endif } void nxagentOpenDisplay(int argc, char *argv[]) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.h b/nx-X11/programs/Xserver/hw/nxagent/Display.h index 759b0de35..2d4119a46 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.h @@ -59,6 +59,7 @@ extern Pixel nxagentWhitePixel; extern Drawable nxagentDefaultDrawables[MAXDEPTH + 1]; extern Pixmap nxagentScreenSaverPixmap; +#ifdef NX_CONFINE_WINDOW /* * The "confine" window is used in nxagentConstrainCursor(). * We are currently overriding the original Xnest behaviour @@ -66,6 +67,7 @@ extern Pixmap nxagentScreenSaverPixmap; */ extern Window nxagentConfineWindow; +#endif /* * Keyboard and pointer are handled as they were hardware -- 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 3.6.x in repository nx-libs. commit 1af470a235b5ab46ba486d6dda143808f47512d9 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 21:55:03 2020 +0200 Screen.c: improve output of nxagentPrintAgentGeometry --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 20 ++++++++++++-------- nx-X11/programs/Xserver/hw/nxagent/Window.c | 6 +++--- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 4db4785df..18e5410a0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -780,32 +780,36 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix) if (hdrMessage) { - fprintf(stderr, "--------------- %s -----------------.\n", hdrMessage); + fprintf(stderr, "%s /--------------- %s -----------------.\n", prefix, hdrMessage); } - fprintf(stderr, "%s Root window at offset (%d,%d) size (%d,%d).\n", prefix, + fprintf(stderr, "%s | Root window at offset (%d,%d) size (%d,%d).\n", prefix, nxagentOption(RootX), nxagentOption(RootY), nxagentOption(RootWidth), nxagentOption(RootHeight)); - fprintf(stderr, "%s Default window at offset (%d,%d) size (%d,%d) border size %d.\n", prefix, + fprintf(stderr, "%s | Default window at offset (%d,%d) size (%d,%d) border size %d.\n", prefix, nxagentOption(X), nxagentOption(Y), nxagentOption(Width), nxagentOption(Height), nxagentOption(BorderWidth)); - fprintf(stderr, "%s Span between root window and default window is (%d,%d).\n", prefix, + fprintf(stderr, "%s | Span between root window and default window is (%d,%d).\n", prefix, nxagentOption(ViewportXSpan), nxagentOption(ViewportYSpan)); - fprintf(stderr, "%s Default window in window mode has offset (%d,%d) and size (%d,%d).\n", prefix, + fprintf(stderr, "%s | Default window in window mode has offset (%d,%d) and size (%d,%d).\n", prefix, nxagentOption(SavedX), nxagentOption(SavedY), nxagentOption(SavedWidth), nxagentOption(SavedHeight)); - fprintf(stderr, "%s Fullscreen is %s.\n", prefix, + fprintf(stderr, "%s | Fullscreen is %s.\n", prefix, nxagentOption(Fullscreen) ? "ON" : "OFF"); - fprintf(stderr, "%s Desktop resize mode is %s.\n", prefix, + fprintf(stderr, "%s | Desktop resize mode is %s.\n", prefix, nxagentOption(DesktopResize) ? "ON" : "OFF"); - fprintf(stderr, "%s Resize desktop at startup is %s.\n", prefix, + fprintf(stderr, "%s | Resize desktop at startup is %s.\n", prefix, nxagentResizeDesktopAtStartup ? "ON" : "OFF"); + if (hdrMessage) + { + fprintf(stderr, "%s \\--------------- %s -----------------.\n", prefix, hdrMessage); + } #endif } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 97c4700e4..f528696d8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -417,7 +417,7 @@ Bool nxagentCreateWindow(WindowPtr pWin) #endif #ifdef TEST - fprintf(stderr, "nxagentCreateWindow: Created new window with id [0x%x].\n", + fprintf(stderr, "%s: Created new window with id [0x%x].\n", __func__, nxagentWindowPriv(pWin)->window); #endif @@ -817,7 +817,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) for (i = 0; i < 100 && nxagentWMIsRunning; i++) { #ifdef TEST - fprintf(stderr, "nxagentSwitchAllScreens: WARNING! Going to wait for the ReparentNotify event.\n"); + fprintf(stderr, "%s: WARNING! Going to wait for the ReparentNotify event.\n", __func__); #endif if (XCheckTypedWindowEvent(nxagentDisplay, w, ReparentNotify, &e)) @@ -920,7 +920,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) */ #ifdef WARNING - fprintf(stderr, "nxagentSwitchAllScreens: WARNING! Expected ReparentNotify event missing.\n"); + fprintf(stderr, "%s: WARNING! Expected ReparentNotify event missing.\n", __func__); #endif nxagentWMIsRunning = 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 3.6.x in repository nx-libs. commit e48ceedcce8d9560b53bc8b58cf8bf3d23b1b63e Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 20:19:26 2020 +0200 Screen.c: improve debug output --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 42 ++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index e2ceede23..4db4785df 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1757,7 +1757,7 @@ N/A } #ifdef TEST - fprintf(stderr, "nxagentOpenScreen: Created new default window for screen [%d] with id [0x%x].\n", + fprintf(stderr, "%s: Created new default window for screen [%d] with id [0x%x].\n", __func__, pScreen->myNum, nxagentDefaultWindows[pScreen->myNum]); #endif @@ -1795,7 +1795,7 @@ N/A #endif #ifdef TEST - fprintf(stderr, "nxagentOpenScreen: Created new input window for screen [%d] with id [0x%x].\n", + fprintf(stderr, "%s: Created new input window for screen [%d] with id [0x%x].\n", __func__, pScreen->myNum, nxagentInputWindows[pScreen->myNum]); #endif } @@ -2284,6 +2284,11 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, int mmWidth, int mmHeight, Bool doresize) { + #ifdef DEBUG + fprintf(stderr, "%s: called with w [%d] (%dmm) h [%d] (%dmm) doresize [%d]\n", + __func__, width, mmWidth, height, mmHeight, doresize); + #endif + #ifdef TEST nxagentPrintAgentGeometry("Before Resize Screen", "nxagentResizeScreen:"); #endif @@ -2345,6 +2350,11 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, pScreen -> mmWidth = mmWidth; pScreen -> mmHeight = mmHeight; + #ifdef DEBUG + fprintf(stderr, "%s: old w [%d] (%dmm) h [%d] (%dmm) new w [%d] (%dmm) h [%d] (%dmm)\n", + __func__, oldWidth, oldMmWidth, oldHeight, oldMmHeight, width, mmWidth, height, mmHeight); + #endif + PixmapPtr pPixmap = fbGetScreenPixmap(pScreen); char *fbBits = realloc(pPixmap -> devPrivate.ptr, PixmapBytePad(width, pScreen->rootDepth) * @@ -2368,15 +2378,13 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, FIXME: We should try to restore the previously reallocated frame buffer pixmap. */ - - pScreen -> width = oldWidth; - pScreen -> height = oldHeight; - pScreen -> mmWidth = oldMmWidth; - pScreen -> mmHeight = oldMmHeight; - goto nxagentResizeScreenError; } + #ifdef DEBUG + fprintf(stderr, "%s: setting RootWidth/Height to [%d]x[%d]\n", __func__, width, height); + #endif + nxagentChangeOption(RootWidth, width); nxagentChangeOption(RootHeight, height); @@ -2437,10 +2445,18 @@ FIXME: We should try to restore the previously RegionInit(&pScreen->root -> clipList, &box, 1); RegionInit(&pScreen->root -> borderClip, &box, 1); + #ifdef DEBUG + fprintf(stderr, "%s: calling PositionWindow() [0,0] for root Window\n", __func__); + #endif + (*pScreen -> PositionWindow)(pScreen->root, 0, 0); nxagentSetRootClip(pScreen, 1); + #ifdef DEBUG + fprintf(stderr, "%s: moving root window to [%d,%d]\n", __func__, nxagentOption(RootX), nxagentOption(RootY)); + #endif + XMoveWindow(nxagentDisplay, nxagentWindow(screenInfo.screens[0]->root), nxagentOption(RootX), nxagentOption(RootY)); @@ -2807,7 +2823,7 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width, nxagentShadowPixmapPtr -> drawable.id = accessPixmapID; #ifdef TEST - fprintf(stderr, "nxagentShadowCreateMainWindow: nxagentShadowPixmapPtr [%p] PixmapM -> drawable.id [%lu].\n", + fprintf(stderr, "nxagentShadowCreateMainWindow: nxagentShadowPixmapPtr [%p] PixmapM -> drawable.id [%u].\n", (void *)nxagentShadowPixmapPtr, nxagentShadowPixmapPtr -> drawable.id); fprintf(stderr, "nxagentShadowCreateMainWindow: Create pixmap with width [%d] height [%d] depth [%d].\n", nxagentShadowWidth, nxagentShadowHeight, (int)nxagentShadowDepth); @@ -2884,10 +2900,10 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width, { #ifdef TEST fprintf(stderr, "nxagentShadowCreateMainWindow: Create window with nxagentShadowWindowPtr [%p]" - "nxagentShadowWindowPtr -> drawable.id [%lu].\n", (void *) nxagentShadowWindowPtr, + "nxagentShadowWindowPtr -> drawable.id [%u].\n", (void *) nxagentShadowWindowPtr, nxagentShadowWindowPtr -> drawable.id); - fprintf(stderr, "nxagentShadowCreateMainWindow: parent nxagentShadowWindowPtr [%p] parent -> drawable.id [%lu].\n", + fprintf(stderr, "nxagentShadowCreateMainWindow: parent nxagentShadowWindowPtr [%p] parent -> drawable.id [%u].\n", (void *)nxagentShadowWindowPtr->parent, nxagentShadowWindowPtr -> parent -> drawable.id); #endif @@ -3669,8 +3685,8 @@ void nxagentAdjustCustomMode(ScreenPtr pScreen) } #ifdef TEST - fprintf(stderr, "%s: Going to destroy mode %p with refcnt %d.\n", - __func__, nxagentRRCustomMode, nxagentRRCustomMode->refcnt); + fprintf(stderr, "%s: Going to destroy mode [%p] with refcnt [%d].\n", + __func__, (void *)nxagentRRCustomMode, nxagentRRCustomMode->refcnt); #endif RRModeDestroy(nxagentRRCustomMode); -- 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 3.6.x in repository nx-libs. commit ffbc63f918d1ae1f340a67b96f89906ccc88758e Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 18:49:53 2020 +0200 Events.c: add some comments/FIXMEs --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 899afcce6..bfce2f012 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -3275,7 +3275,7 @@ int nxagentHandleConfigureNotify(XEvent* X) return 1; } } - else + else /* (nxagentOption(Rootless) == True) */ { /* * Save the position of the agent default window. Don't save the @@ -3298,7 +3298,7 @@ int nxagentHandleConfigureNotify(XEvent* X) { /* * - WITHOUT window manager any position change is relevant - * - WITH window manager only synthetic position changes send + * - WITH window manager only synthetic position changes sent * by the window manager are relevant, see ICCCM Chapter 4, * "Configuring the Window" */ @@ -3414,6 +3414,7 @@ int nxagentHandleConfigureNotify(XEvent* X) if (nxagentOption(Fullscreen) == 0) { + /* FIXME: has already been done some lines above */ nxagentMoveViewport(pScreen, 0, 0); } else -- 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 3.6.x in repository nx-libs. commit 832e0281131667de253bf5e64b6afa384ed56943 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 23:58:50 2020 +0200 NXwindow.c: fix some format specifiers --- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 43d00a21d..a8d1849ae 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -149,7 +149,7 @@ InitRootWindow(WindowPtr pWin) if (nxagentOption(Rootless)) { #ifdef TEST - fprintf(stderr, "InitRootWindow: Assigned agent root to window at [%p][%ld] with parent [%p].\n", + fprintf(stderr, "InitRootWindow: Assigned agent root to window at [%p][%d] with parent [%p].\n", (void *) pWin, nxagentWindowPriv(pWin)->window, (void *) pWin -> parent); #endif @@ -381,13 +381,12 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP #ifdef TEST if (nxagentWindowTopLevel(pWin)) { - - fprintf(stderr, "ConfigureWindow: pWin [%p] mask [%lu] client [%p]\n", - pWin, mask, client); + fprintf(stderr, "ConfigureWindow: pWin [%p] mask [%u] client [%p]\n", + (void *)pWin, mask, (void *)client); fprintf(stderr, "ConfigureWindow: x [%d] y [%d] w [%d] h [%d] CWStackMode [%d] " "smode [%d] pSib [%p]\n", - x, y, w, h, (mask & CWStackMode) ? 1 : 0, smode, pSib); + x, y, w, h, (mask & CWStackMode) ? 1 : 0, smode, (void *)pSib); } #endif @@ -683,7 +682,7 @@ MapWindow(register WindowPtr pWin, ClientPtr client) #ifdef TEST if (nxagentWindowTopLevel(pWin)) { - fprintf(stderr, "MapWindow: pWin [%p] client [%p]\n", pWin, client); + fprintf(stderr, "MapWindow: pWin [%p] client [%p]\n", (void *)pWin, (void *)client); } #endif #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 3.6.x in repository nx-libs. commit 2ada71fba786be79a09b4ab657d8d46a5719ce5a Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 22:20:43 2020 +0200 Screen.c: simplify nxagentResizeScreen --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 18e5410a0..0c1c177d6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2310,26 +2310,25 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, pScreen -> height = height; /* - * Compute screen dimensions if they aren't given. + * Compute screen dimensions if they aren't provided. */ if (mmWidth == 0) { if (monitorResolution < 0) { - mmWidth = width * DisplayWidthMM(nxagentDisplay, DefaultScreen(nxagentDisplay)) / - DisplayWidth(nxagentDisplay, DefaultScreen(nxagentDisplay)); + mmWidth = width * DisplayWidthMM(nxagentDisplay, DefaultScreen(nxagentDisplay)) / + DisplayWidth(nxagentDisplay, DefaultScreen(nxagentDisplay)); } else { - mmWidth = (width * 254 + monitorResolution * 5) / (monitorResolution * 10); + mmWidth = (width * 254 + monitorResolution * 5) / (monitorResolution * 10); } if (mmWidth < 1) { mmWidth = 1; } - } if (mmHeight == 0) @@ -2348,7 +2347,6 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, { mmHeight = 1; } - } pScreen -> mmWidth = mmWidth; @@ -2362,14 +2360,9 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, PixmapPtr pPixmap = fbGetScreenPixmap(pScreen); char *fbBits = realloc(pPixmap -> devPrivate.ptr, PixmapBytePad(width, pScreen->rootDepth) * - height * BitsPerPixel(pScreen->rootDepth) / 8); + height * BitsPerPixel(pScreen->rootDepth) / 8); if (fbBits == NULL) { - pScreen -> width = oldWidth; - pScreen -> height = oldHeight; - pScreen -> mmWidth = oldMmWidth; - pScreen -> mmHeight = oldMmHeight; - goto nxagentResizeScreenError; } @@ -2481,6 +2474,14 @@ FIXME: We should try to restore the previously return 1; nxagentResizeScreenError: + #ifdef DEBUG + fprintf(stderr, "%s: nxagentResizeScreenError\n", __func__); + #endif + + pScreen -> width = oldWidth; + pScreen -> height = oldHeight; + pScreen -> mmWidth = oldMmWidth; + pScreen -> mmHeight = oldMmHeight; return 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 3.6.x in repository nx-libs. commit ed4cbaeda12e0d8324c406ae3986274227f5f69f Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 26 00:08:03 2020 +0200 Screen.c: scope improvement --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index dbe1d5d56..909a34b2d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -846,7 +846,6 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int depthIndex; unsigned long valuemask; XSetWindowAttributes attributes; - XWindowAttributes gattributes; Mask mask; Bool resetAgentPosition = False; @@ -1424,6 +1423,8 @@ N/A * and a GetGeometry (asynchronous) reply. */ + XWindowAttributes gattributes; + XGetWindowAttributes(nxagentDisplay, nxagentParentWindow, &gattributes); nxagentChangeOption(Width, gattributes.width); -- 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 3.6.x in repository nx-libs. commit 2c6b9117fecd23ec683bff2986a894ad75f54e36 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 26 00:37:58 2020 +0200 Screen.c: remove code that will have no effect setting a value for an attribute in the structure is pointless if you do not set the valuemask accordingly. Adding the missing valuemask code here would also be pointless because the valuemask is set to a fixed value later on. Therefore we can drop this code here. --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 909a34b2d..172598779 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1431,11 +1431,6 @@ N/A nxagentChangeOption(Height, gattributes.height); } - if (nxagentOption(AllScreens)) - { - attributes.override_redirect = True; - } - if (nxagentOption(Fullscreen)) { /* -- 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 3.6.x in repository nx-libs. commit 601a57849582ff635289e84bf919ebce8fd2fbcf Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 23:49:25 2020 +0200 Window.c: simplify setting of isMapped private var --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 7620284fb..94a1bb9ee 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -380,6 +380,8 @@ Bool nxagentCreateWindow(WindowPtr pWin) if (nxagentOption(Rootless) == 1) { + nxagentWindowPriv(pWin) -> isMapped = 0; + if (pWin != nxagentRootlessWindow) { WindowPtr pParent = pWin -> parent; @@ -388,14 +390,6 @@ Bool nxagentCreateWindow(WindowPtr pWin) { nxagentWindowPriv(pWin) -> isMapped = 1; } - else - { - nxagentWindowPriv(pWin) -> isMapped = 0; - } - } - else - { - nxagentWindowPriv(pWin) -> isMapped = 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 3.6.x in repository nx-libs. commit 00d60a82e7b1b5ba62073ed891266709a59343f3 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 26 00:06:40 2020 +0200 Screen.c: cleanup auto dpi handling new code is easier to read --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 0c1c177d6..dbe1d5d56 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1332,13 +1332,16 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, rootDepth, (long unsigned int)defaultVisual); #endif - if ((monitorResolution < 1) && (nxagentAutoDPI == False)) + if (monitorResolution < 1) { - monitorResolution = NXAGENT_DEFAULT_DPI; - } - else if ((monitorResolution < 1) && (nxagentAutoDPI == True)) - { - monitorResolution = NXAGENT_AUTO_DPI; + if (nxagentAutoDPI) + { + monitorResolution = NXAGENT_AUTO_DPI; + } + else + { + monitorResolution = NXAGENT_DEFAULT_DPI; + } } if (!fbScreenInit(pScreen, pFrameBufferBits, nxagentOption(RootWidth), 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 3.6.x in repository nx-libs. commit 2a92ed0f53b15d15e3b309f9ebc992ee98eb426e Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon May 25 23:48:04 2020 +0200 Window.c: -reportprivatewids reports root window as such and not as a "private" window like all others. --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index f528696d8..7620284fb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -401,13 +401,18 @@ Bool nxagentCreateWindow(WindowPtr pWin) if (nxagentReportPrivateWindowIds) { - fprintf(stderr, "NXAGENT_WINDOW_ID: PRIVATE_WINDOW,WID:[0x%x],INT:[0x%x]\n", nxagentWindowPriv(pWin)->window, pWin->drawable.id); + fprintf(stderr, "NXAGENT_WINDOW_ID: %s_WINDOW,WID:[0x%x],INT:[0x%x]\n", + (pWin->drawable.id == pWin->drawable.pScreen->root->drawable.id) ? "ROOT" : "PRIVATE", + nxagentWindowPriv(pWin)->window, pWin->drawable.id); } #ifdef DEBUG { char *winname = NULL; - if (-1 != asprintf(&winname, "%s Private[0x%lx]", nxagentWindowName, pWin->drawable.id)) + + if (-1 != asprintf(&winname, "%s %s[0x%lx]", nxagentWindowName, + (pWin->drawable.id == pWin->drawable.pScreen->root->drawable.id) ? "Root" : "Private", + pWin->drawable.id)) { Xutf8SetWMProperties(nxagentDisplay, nxagentWindowPriv(pWin)->window, winname, winname, NULL , 0 , NULL, NULL, NULL); @@ -3006,13 +3011,18 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer if (nxagentReportPrivateWindowIds) { - fprintf(stderr, "NXAGENT_WINDOW_ID: PRIVATE_WINDOW,WID:[0x%x],INT:[0x%x]\n", nxagentWindowPriv(pWin)->window, pWin->drawable.id); + fprintf(stderr, "NXAGENT_WINDOW_ID: %s_WINDOW,WID:[0x%x],INT:[0x%x]\n", + (pWin->drawable.id == pWin->drawable.pScreen->root->drawable.id) ? "ROOT" : "PRIVATE", + nxagentWindowPriv(pWin)->window, pWin->drawable.id); } #ifdef DEBUG { char *winname = NULL; - if (-1 != asprintf(&winname, "%s Private[0x%lx]", nxagentWindowName, pWin->drawable.id)) + + if (-1 != asprintf(&winname, "%s %s[0x%lx]", nxagentWindowName, + (pWin->drawable.id == pWin->drawable.pScreen->root->drawable.id) ? "Root" : "Private", + pWin->drawable.id)) { Xutf8SetWMProperties(nxagentDisplay, nxagentWindowPriv(pWin)->window, winname, winname, NULL , 0 , NULL, NULL, NULL); -- 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 3.6.x in repository nx-libs. commit 3a7c375932d5f34be61347c58739e2e47f59aae5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 26 00:05:51 2020 +0200 Init.c: small simplification --- nx-X11/programs/Xserver/hw/nxagent/Init.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index 804c8c43b..b06d8e239 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -405,10 +405,8 @@ void nxagentNotifyConnection(int fd, int ready, void *data) void InitInput(int argc, char *argv[]) { - void *ptr, *kbd; - - ptr = AddInputDevice(nxagentPointerProc, True); - kbd = AddInputDevice(nxagentKeyboardProc, True); + void *ptr = AddInputDevice(nxagentPointerProc, True); + void *kbd = AddInputDevice(nxagentKeyboardProc, True); RegisterPointerDevice(ptr); RegisterKeyboardDevice(kbd); -- 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 3.6.x in repository nx-libs. commit d7a091a6402f625c9213b6d403b8e19f0e133b49 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 26 00:46:18 2020 +0200 Screen.c: drop unneccessary mask variable --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 494750038..c7e158636 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -846,7 +846,6 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int depthIndex; unsigned long valuemask; XSetWindowAttributes attributes; - Mask mask; Bool resetAgentPosition = False; VisualID defaultVisual; @@ -1714,9 +1713,7 @@ N/A { nxagentDefaultWindows[pScreen->myNum] = nxagentParentWindow; - mask = nxagentGetDefaultEventMask(); - - XSelectInput(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], mask); + XSelectInput(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], nxagentGetDefaultEventMask()); } else { @@ -1757,8 +1754,7 @@ N/A if (nxagentOption(Rootless) == 0) { valuemask = CWEventMask; - mask = PointerMotionMask; - attributes.event_mask = mask; + attributes.event_mask = PointerMotionMask; nxagentInputWindows[pScreen->myNum] = XCreateWindow(nxagentDisplay, @@ -1845,9 +1841,7 @@ N/A strlen("X-AGENT")); } - mask = nxagentGetDefaultEventMask(); - - XSelectInput(nxagentDisplay, nxagentFullscreenWindow, mask); + XSelectInput(nxagentDisplay, nxagentFullscreenWindow, nxagentGetDefaultEventMask()); } XSizeHints* sizeHints = XAllocSizeHints(); -- 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 3.6.x in repository nx-libs. commit f534a48601a2b239db48ebb8b984f2951c57dc3e Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 26 00:51:58 2020 +0200 Screen.c: move attributes/valuemask to inner scopes --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index c7e158636..5c543da19 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -844,8 +844,6 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, DepthPtr depths; int numVisuals, numDepths; int depthIndex; - unsigned long valuemask; - XSetWindowAttributes attributes; Bool resetAgentPosition = False; VisualID defaultVisual; @@ -1678,15 +1676,16 @@ N/A if (nxagentDoFullGeneration == 1 || nxagentReconnectTrap == 1) { - valuemask = CWBackPixel | CWEventMask | CWColormap | - (nxagentOption(AllScreens) == 1 ? CWOverrideRedirect : 0); - - attributes.background_pixel = nxagentBlackPixel; - attributes.event_mask = nxagentGetDefaultEventMask(); - attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)); + unsigned long valuemask = CWBackPixel | CWEventMask | CWColormap; + XSetWindowAttributes attributes = { + .background_pixel = nxagentBlackPixel, + .event_mask = nxagentGetDefaultEventMask(), + .colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)) + }; if (nxagentOption(AllScreens) == 1) { + valuemask |= CWOverrideRedirect; attributes.override_redirect = True; } @@ -1753,8 +1752,7 @@ N/A if (nxagentOption(Rootless) == 0) { - valuemask = CWEventMask; - attributes.event_mask = PointerMotionMask; + XSetWindowAttributes inpattributes = {.event_mask = PointerMotionMask}; nxagentInputWindows[pScreen->myNum] = XCreateWindow(nxagentDisplay, @@ -1764,7 +1762,7 @@ N/A nxagentOption(Height), 0, 0, InputOnly, nxagentDefaultVisual(pScreen), - valuemask , &attributes); + CWEventMask, &inpattributes); if (nxagentReportWindowIds) { -- 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 3.6.x in repository nx-libs. commit d07c788813d6e72882e9a30821007be49157adea Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 26 00:43:44 2020 +0200 Screen.c: remove another pointless code block Setting nxagentDefaultWindow[pScreen->myNum] is pointless because it is overwritten in the next code block... --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 172598779..494750038 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1727,16 +1727,6 @@ N/A * handling the splash screen. */ - if (nxagentOption(Rootless) == True) - { - nxagentDefaultWindows[pScreen->myNum] = DefaultRootWindow(nxagentDisplay); - - #ifdef TEST - fprintf(stderr, "nxagentOpenScreen: Using root window id [%ld].\n", - (long int)nxagentDefaultWindows[pScreen->myNum]); - #endif - } - #ifdef TEST fprintf(stderr, "nxagentOpenScreen: Going to create new default window.\n"); #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 3.6.x in repository nx-libs. commit 42fb683315d1472e7aeec6cc98d453d6663803f4 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 26 00:53:32 2020 +0200 Screen.c: scope improvements --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 38 ++++++++++------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 5c543da19..98add8add 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -837,24 +837,10 @@ void freeDepths(DepthPtr depths, int num) SAFE_free(depths); } -Bool nxagentOpenScreen(ScreenPtr pScreen, - int argc, char *argv[]) +Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) { - VisualPtr visuals; - DepthPtr depths; - int numVisuals, numDepths; - int depthIndex; Bool resetAgentPosition = False; - VisualID defaultVisual; - int rootDepth; - - void * pFrameBufferBits; - int bitsPerPixel; - int sizeInBytes; - - int defaultVisualIndex = 0; - #ifdef TEST fprintf(stderr, "nxagentOpenScreen: Called for screen index [%d].\n", pScreen->myNum); @@ -1161,7 +1147,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, * Initialize the depths. */ - depths = (DepthPtr) malloc(nxagentNumDepths * sizeof(DepthRec)); + DepthPtr depths = (DepthPtr) malloc(nxagentNumDepths * sizeof(DepthRec)); for (int i = 0; i < nxagentNumDepths; i++) { @@ -1179,10 +1165,12 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, "[%d].\n", nxagentNumVisuals); #endif - numVisuals = 0; - numDepths = nxagentNumDepths; + int numVisuals = 0; + int numDepths = nxagentNumDepths; - visuals = (VisualPtr) malloc(nxagentNumVisuals * sizeof(VisualRec)); + VisualPtr visuals = (VisualPtr) malloc(nxagentNumVisuals * sizeof(VisualRec)); + + int defaultVisualIndex = 0; for (int i = 0; i < nxagentNumVisuals; i++) { @@ -1231,10 +1219,9 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, if (j < numVisuals) continue; - } - depthIndex = UNDEFINED; + int depthIndex = UNDEFINED; #if defined(DEBUG) || defined(DEBUG_COLORMAP) fprintf(stderr, "Debug: Added visual [%lu].\n" , @@ -1292,12 +1279,13 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, visuals[defaultVisualIndex].nplanes); #endif - defaultVisual = visuals[defaultVisualIndex].vid; - rootDepth = visuals[defaultVisualIndex].nplanes; + VisualID defaultVisual = visuals[defaultVisualIndex].vid; + int rootDepth = visuals[defaultVisualIndex].nplanes; nxagentInitAlphaVisual(); - bitsPerPixel = nxagentBitsPerPixel(rootDepth); + int bitsPerPixel = nxagentBitsPerPixel(rootDepth); + int sizeInBytes; if (bitsPerPixel == 1) { @@ -1313,7 +1301,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, "[%d] bitsPerPixel [%d] sizeInBytes [%d]\n", rootDepth, bitsPerPixel, sizeInBytes); #endif - pFrameBufferBits = (char *) malloc(sizeInBytes); + void * pFrameBufferBits = (char *) malloc(sizeInBytes); if (!pFrameBufferBits) { -- 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 3.6.x in repository nx-libs. commit 199c32eaf3f02d58d9ec560b2838be52608471ef Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 26 00:54:02 2020 +0200 Screen.c: some more (cosmetic) changes --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 110 +++++++++++++--------------- 1 file changed, 49 insertions(+), 61 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 98add8add..f8507aa59 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -177,7 +177,7 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix); */ int nxagentShadowResize = 0; - + WindowPtr nxagentShadowWindowPtr = NULL; static XID accessPixmapID; @@ -971,7 +971,6 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) #endif nxagentChangeOption(Fullscreen, False); - nxagentChangeOption(AllScreens, False); nxagentFullscreenWindow = 0; @@ -1162,7 +1161,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) #if defined(DEBUG) || defined(DEBUG_COLORMAP) fprintf(stderr, "Debug: Setting up visuals. Original array has size " - "[%d].\n", nxagentNumVisuals); + "[%d].\n", nxagentNumVisuals); #endif int numVisuals = 0; @@ -1196,7 +1195,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) #if defined(DEBUG) || defined(DEBUG_COLORMAP) fprintf(stderr, "Debug: Set default visual index [%d].\n" , - defaultVisualIndex); + defaultVisualIndex); #endif } else @@ -1216,7 +1215,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) visuals[numVisuals].offsetBlue == visuals[j].offsetBlue) break; } - + if (j < numVisuals) continue; } @@ -1225,7 +1224,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) #if defined(DEBUG) || defined(DEBUG_COLORMAP) fprintf(stderr, "Debug: Added visual [%lu].\n" , - (long unsigned int)visuals[numVisuals].vid); + (long unsigned int)visuals[numVisuals].vid); #endif for (int j = 0; j < numDepths; j++) @@ -1265,7 +1264,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) #if defined(DEBUG) || defined(DEBUG_COLORMAP) fprintf(stderr, "Debug: Registered visual [%lu] for depth [%d (%d)].\n" , (long unsigned int)visuals[numVisuals].vid, depthIndex, - depths[depthIndex].depth); + depths[depthIndex].depth); #endif numVisuals++; @@ -1276,7 +1275,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) defaultVisualIndex, (long unsigned int)visuals[defaultVisualIndex].vid); fprintf(stderr, "Debug: Setting root depth [%d].\n", - visuals[defaultVisualIndex].nplanes); + visuals[defaultVisualIndex].nplanes); #endif VisualID defaultVisual = visuals[defaultVisualIndex].vid; @@ -1343,9 +1342,8 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) #endif /* - * Complete the initialization of the GLX - * extension. This will add the GLX visuals - * and will modify numVisuals and numDepths. + * Complete the initialization of the GLX extension. This will add + * the GLX visuals and will modify numVisuals and numDepths. */ #if defined(DEBUG) || defined(DEBUG_COLORMAP) @@ -1364,8 +1362,8 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) #endif /* - * Replace the visuals and depths initialized - * by fbScreenInit with our own. + * Replace the visuals and depths initialized by fbScreenInit with + * our own. */ freeDepths(pScreen->allowedDepths, pScreen->numDepths); @@ -1379,9 +1377,8 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) pScreen -> rootVisual = defaultVisual; /* - * Set up the internal structures used for - * tracking the proxy resources associated - * to the unpack and split operations. + * Set up the internal structures used for tracking the proxy + * resources associated to the unpack and split operations. */ nxagentInitSplitResources(); @@ -1419,9 +1416,9 @@ N/A if (nxagentOption(Fullscreen)) { /* - * We need to disable the host's screensaver or - * it will otherwise grab the screen even if it - * is under agent's control. + * We need to disable the host's screensaver or it will + * otherwise grab the screen even if it is under agent's + * control. */ XSetScreenSaver(nxagentDisplay, 0, 0, DefaultExposures, DefaultBlanking); @@ -1444,7 +1441,7 @@ N/A * * if (!miScreenInit(pScreen, NULL, nxagentOption(RootWidth), * nxagentOption(RootHeight), 1, 1, nxagentOption(RootWidth), - * visuals[nxagentDefaultVisualIndex].nplanes, / * Root depth. * / + * visuals[nxagentDefaultVisualIndex].nplanes, / * Root depth. * / * numDepths, depths, * visuals[nxagentDefaultVisualIndex].vid,* Root visual. * / * numVisuals, visuals)) @@ -1494,7 +1491,7 @@ N/A /* * Window Procedures. - * + * * Note that the following functions are not * replaced with nxagent counterparts: * @@ -1528,9 +1525,8 @@ N/A pScreen->DestroyPixmap = nxagentDestroyPixmap; /* - * This is originally miModifyPixmapHeader() - * from miscrinit.c. It is used to recycle - * the scratch pixmap for this screen. + * This is originally miModifyPixmapHeader() from miscrinit.c. It + * is used to recycle the scratch pixmap for this screen. */ pScreen->ModifyPixmapHeader = nxagentModifyPixmapHeader; @@ -1599,18 +1595,16 @@ N/A #ifdef RENDER /* - * Initialize picture support. This have to be - * placed here because miDCInitialize calls - * DamageSetup, that should wrap the picture - * screen functions. So PictureInit has to be - * called before. + * Initialize picture support. This have to be placed here because + * miDCInitialize calls DamageSetup, that should wrap the picture + * screen functions. So PictureInit has to be called before. */ if (nxagentRenderEnable && !nxagentReconnectTrap) { if (!nxagentPictureInit(pScreen, 0, 0)) { - nxagentRenderEnable = False; + nxagentRenderEnable = False; return FALSE; } @@ -1650,8 +1644,7 @@ N/A nxagentOption(Height)) / 32) /* - * Complete the initialization of the RANDR - * extension. + * Complete the initialization of the RANDR extension. */ nxagentInitRandRExtension(pScreen); @@ -1686,7 +1679,6 @@ N/A * it will otherwise grab the screen even if it * is under agent's control. */ - XSetScreenSaver(nxagentDisplay, 0, 0, DefaultExposures, DefaultBlanking); } } @@ -1705,10 +1697,9 @@ N/A else { /* - * Create any top-level window as a child of the - * real root of the remote display. See also the - * InitRootWindow() procedure and the function - * handling the splash screen. + * Create any top-level window as a child of the real root of + * the remote display. See also the InitRootWindow() procedure + * and the function handling the splash screen. */ #ifdef TEST @@ -1943,10 +1934,9 @@ N/A } /* - * The purpose of this check is to verify if there - * is a window manager running. Unfortunately due - * to the way we manage the intern atoms call, the - * atom will always exist. + * The purpose of this check is to verify if there is a window + * manager running. Unfortunately due to the way we manage the + * intern atoms call, the atom will always exist. */ if (nxagentWMIsRunning) @@ -1988,9 +1978,9 @@ N/A else { /* - * We should always enable the configuration of the - * remote X server's devices if we are running full- - * screen and there is no WM running. + * We should always enable the configuration of the remote X + * server's devices if we are running fullscreen and there is no + * WM running. */ if (nxagentOption(Fullscreen)) @@ -2004,9 +1994,8 @@ N/A } /* - * Inform the user whether the agent's clients will - * be able to change the real X server's keyboard - * and pointer settings. + * Inform the user whether the agent's clients will be able to + * change the real X server's keyboard and pointer settings. */ if (nxagentOption(DeviceControl) == False) @@ -2040,9 +2029,8 @@ N/A #endif /* RENDER */ /* - * Check if the composite extension is - * supported on the remote display and - * prepare the agent for its use. + * Check if the composite extension is supported on the remote + * display and prepare the agent for its use. */ nxagentCompositeExtensionInit(); @@ -2265,7 +2253,7 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, #ifdef TEST nxagentPrintAgentGeometry("Before Resize Screen", "nxagentResizeScreen:"); #endif - + /* * Change screen properties. */ @@ -2487,7 +2475,7 @@ void nxagentShadowSetWindowsSize(void) XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], nxagentOption(Width), nxagentOption(Height)); - XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, + XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, nxagentOption(Width), nxagentOption(Height)); } @@ -3439,7 +3427,7 @@ Bool nxagentReconnectScreen(void *p0) return False; } - nxagentPixmap(pPixmap) = XCreatePixmap(nxagentDisplay, + nxagentPixmap(pPixmap) = XCreatePixmap(nxagentDisplay, nxagentDefaultWindows[nxagentDefaultScreen->myNum], pPixmap -> drawable.width, pPixmap -> drawable.height, @@ -3453,10 +3441,10 @@ Bool nxagentReconnectScreen(void *p0) CARD16 h = 16; (*nxagentDefaultScreen->QueryBestSize)(StippleShape, &w, &h, nxagentDefaultScreen); if (!(nxagentPixmap(nxagentDefaultScreen->PixmapPerDepth[0]) = - XCreatePixmap(nxagentDisplay, + XCreatePixmap(nxagentDisplay, nxagentDefaultDrawables[1], - w, - h, + w, + h, 1))); Mask mask = nxagentGetDefaultEventMask(); @@ -3478,7 +3466,7 @@ Bool nxagentReconnectScreen(void *p0) nxagentSetTimeoutTimer(0); - return True; + return True; } /* intersect two rectangles */ @@ -3945,7 +3933,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) sprintf(name, "NX%d", i+1); output = RROutputCreate(pScreen, name, strlen(name), NULL); /* will be done later - RROutputSetConnection(output, RR_Disconnected); + RROutputSetConnection(output, RR_Disconnected); */ #ifdef DEBUG fprintf(stderr, "nxagentAdjustRandRXinerama: created new output [%s]\n", name); @@ -4658,7 +4646,7 @@ void nxagentFbRestoreArea(PixmapPtr pPixmap, WindowPtr pWin, int xSrc, int ySrc, XImage *image = XGetImage(nxagentDisplay, nxagentPixmap(pPixmap), xSrc, ySrc, width, height, AllPlanes, format); */ - + if (image == NULL) { #ifdef WARNING @@ -4683,9 +4671,9 @@ FIXME #ifdef WARNING fprintf(stderr, "nxagentFbRestoreArea: WARNING! Visual not found. Using default visual.\n"); #endif - + pVisual = nxagentVisuals[nxagentDefaultVisualIndex].visual; - } + } image = XCreateImage(nxagentDisplay, pVisual, depth, format, 0, (char *) data, -- 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 3.6.x in repository nx-libs. commit 4c6940cddb10c03127cf7775299e799960581e40 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue May 26 01:08:50 2020 +0200 Window.c: some more TEST and DEBUG output --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 94a1bb9ee..2dea31af0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -821,6 +821,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) if (XCheckTypedWindowEvent(nxagentDisplay, w, ReparentNotify, &e)) { + #ifdef TEST + fprintf(stderr, "%s: found ReparentNotify event in iteration [%d].\n", __func__, i); + #endif break; } @@ -970,6 +973,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) if (nxagentOption(WMBorderWidth) > 0) { + #ifdef DEBUG + fprintf(stderr, "%s: WMBorderWidth [%d]\n", __func__, nxagentOption(WMBorderWidth)); + #endif nxagentChangeOption(X, nxagentOption(SavedX) - nxagentOption(WMBorderWidth)); } else @@ -979,6 +985,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) if (nxagentOption(WMTitleHeight) > 0) { + #ifdef DEBUG + fprintf(stderr, "%s: WMTitleHeight [%d]\n", __func__, nxagentOption(WMTitleHeight)); + #endif nxagentChangeOption(Y, nxagentOption(SavedY) - nxagentOption(WMTitleHeight)); } else -- 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 3.6.x in repository nx-libs. commit 2d99cdd1cf5d8d0e8248d94bc07dca8ff32e4058 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jul 27 18:29:40 2020 +0200 Events.c: More cosmetics --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 172715987..4d9d32bb2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -3402,9 +3402,9 @@ int nxagentHandleConfigureNotify(XEvent* X) /* FIXME: Comment makes no sense */ if (nxagentOption(Shadow) == 1 || (nxagentOption(Width) == nxagentOption(RootWidth) && - nxagentOption(Height) == nxagentOption(RootHeight) && - nxagentOption(X) == nxagentOption(RootX) && - nxagentOption(Y) == nxagentOption(RootY))) + nxagentOption(Height) == nxagentOption(RootHeight) && + nxagentOption(X) == nxagentOption(RootX) && + nxagentOption(Y) == nxagentOption(RootY))) { doRandR = False; } @@ -4382,11 +4382,13 @@ int nxagentHandleRRScreenChangeNotify(XEvent *X) fprintf(stderr, "%s: Called.\n", __func__); #endif - nxagentResizeScreen(screenInfo.screens[DefaultScreen(nxagentDisplay)], Xr -> width, Xr -> height, - Xr -> mwidth, Xr -> mheight, True); + nxagentResizeScreen(screenInfo.screens[DefaultScreen(nxagentDisplay)], + Xr -> width, Xr -> height, + Xr -> mwidth, Xr -> mheight, True); - nxagentShadowCreateMainWindow(screenInfo.screens[DefaultScreen(nxagentDisplay)], screenInfo.screens[0]->root, - Xr -> width, Xr -> height); + nxagentShadowCreateMainWindow(screenInfo.screens[DefaultScreen(nxagentDisplay)], + screenInfo.screens[0]->root, + Xr -> width, Xr -> height); nxagentShadowSetWindowsSize(); -- 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 3.6.x in repository nx-libs. commit 13211ec6a5060db75c93cbb4e75d017b0a49386e Merge: 7a02b4aba 2d99cdd1c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Oct 18 12:30:54 2020 +0200 Merge branch 'uli42-pr/window_resize_bug' into 3.6.x Attributes GH PR #940: https://github.com/ArcticaProject/nx-libs/pull/940 nx-X11/programs/Xserver/hw/nxagent/Display.c | 70 +++-- nx-X11/programs/Xserver/hw/nxagent/Display.h | 2 + nx-X11/programs/Xserver/hw/nxagent/Events.c | 143 ++++++--- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 11 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 372 +++++++++++++----------- nx-X11/programs/Xserver/hw/nxagent/Screen.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 69 ++++- 10 files changed, 416 insertions(+), 267 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 3.6.x in repository nx-libs. commit dee4a560a50ca24304ee84449453ca287de4c9dd Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Nov 2 14:00:02 2020 +0100 fix spec file doc file path for nxdialog was wrong Fixes ArcticaProject/nx-libs#959 --- nx-libs.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-libs.spec b/nx-libs.spec index 7d7af876e..ddbc16799 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -633,7 +633,7 @@ rm %{buildroot}%{_libdir}/*.la %files -n nxdialog %defattr(-,root,root) -%doc doc/nxdialog/README.md +%doc nxdialog/README.md %{_bindir}/nxdialog %{_datadir}/man/man1/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 3.6.x in repository nx-libs. commit ca7b331031151bec7136b9a5d85f2652cb2f1e1c Merge: 13211ec6a dee4a560a Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Nov 2 14:05:24 2020 +0100 Merge pull request #960 from uli42/pr/fix_specfile fix spec file nx-libs.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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 3.6.x in repository nx-libs. commit 14df32cdb8fde8a3807f677af5bd81d718234379 Merge: ca7b33103 12b22e97e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 3 13:43:57 2020 +0100 Merge branch 'uli42-pr/xlib_memleak' into 3.6.x Attributes GH PR #952: https://github.com/ArcticaProject/nx-libs/pull/952 nx-X11/lib/src/ConnDis.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 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 3.6.x in repository nx-libs. commit 12b22e97e7f66bbc9ede261591ecf692b8f1a54a Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Oct 18 16:24:32 2020 +0200 yConnDis.c: fix memory leak Direct leak of 3 byte(s) in 1 object(s) allocated from: #0 0xb79e85d4 in __interceptor_malloc (/lib/i386-linux-gnu/libasan.so.5+0xeb5d4) #1 0xb770b635 in copystring /home/uli/work/nx/nx-libs/nx-X11/lib/src/ConnDis.c:96 #2 0xb770ba56 in _X11TransConnectDisplay /home/uli/work/nx/nx-libs/nx-X11/lib/src/ConnDis.c:229 #3 0xb776b4fd in XOpenDisplay /home/uli/work/nx/nx-libs/nx-X11/lib/src/OpenDis.c:215 #4 0x63e2fd in nxagentInternalOpenDisplay /home/uli/work/nx/nx-libs/nx-X11/programs/Xserver/hw/nxagent/Display.c:608 #5 0x63fa03 in nxagentOpenDisplay /home/uli/work/nx/nx-libs/nx-X11/programs/Xserver/hw/nxagent/Display.c:1140 #6 0x694b5a in InitOutput /home/uli/work/nx/nx-libs/nx-X11/programs/Xserver/hw/nxagent/Init.c:305 #7 0x5f7b11 in main /home/uli/work/nx/nx-libs/nx-X11/programs/Xserver/dix/main.c:278 #8 0xb6f04b40 in __libc_start_main ../csu/libc-start.c:308 I have not investigated the exact location where an XFree() was missing but added multiple Xfree() calls whereever appropriate. Fixes ArcticaProject/nx-libs#951 --- nx-X11/lib/src/ConnDis.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/nx-X11/lib/src/ConnDis.c b/nx-X11/lib/src/ConnDis.c index 06ba9579a..d0348c144 100644 --- a/nx-X11/lib/src/ConnDis.c +++ b/nx-X11/lib/src/ConnDis.c @@ -226,6 +226,7 @@ _X11TransConnectDisplay ( p += 3; } + if (pprotocol) XFree(pprotocol); pprotocol = copystring ("nx", 2); if (!pprotocol) goto bad; @@ -233,7 +234,6 @@ _X11TransConnectDisplay ( #ifdef NX_TRANS_TEST fprintf(stderr, "_X11TransConnectDisplay: Forced protocol to [%s].\n", pprotocol); #endif - } else { @@ -245,9 +245,14 @@ _X11TransConnectDisplay ( * slash ('/'). */ for (lastp = p; *p && *p != ':' && *p != '/'; p++) ; - if (!*p) return NULL; /* must have a colon */ + if (!*p) /* must have a colon */ + { + if (pprotocol) XFree(pprotocol); + return NULL; + } if (p != lastp && *p != ':') { /* protocol given? */ + if (pprotocol) XFree(pprotocol); pprotocol = copystring (lastp, p - lastp); if (!pprotocol) goto bad; /* no memory */ p++; /* skip the '/' */ @@ -288,12 +293,14 @@ _X11TransConnectDisplay ( if (lastc) { + if (phostname) XFree(phostname); phostname = copystring (lastp, lastc - lastp); p = lastc; } else { + if (phostname) XFree(phostname); phostname = copystring (lastp, strlen(lastp)); } @@ -323,7 +330,11 @@ _X11TransConnectDisplay ( if (*p == ':') lastc = p; - if (!lastc) return NULL; /* must have a colon */ + if (!lastc) /* must have a colon */ + { + if (pprotocol) XFree(pprotocol); + return NULL; + } if ((lastp != lastc) && (*(lastc - 1) == ':') #if defined(IPv6) && defined(AF_INET6) @@ -338,6 +349,7 @@ _X11TransConnectDisplay ( hostlen = lastc - lastp; if (hostlen > 0) { /* hostname given? */ + if (phostname) XFree(phostname); phostname = copystring (lastp, hostlen); if (!phostname) goto bad; /* no memory */ } @@ -417,7 +429,7 @@ _X11TransConnectDisplay ( if (value == NULL || strstr(value, "=") != NULL || strstr(name, ",") != NULL || strlen(value) >= 128) { - Xfree(host); + if (host) Xfree(host); goto bad; } @@ -425,17 +437,21 @@ _X11TransConnectDisplay ( { idisplay = atoi(value); + if (pdpynum) XFree(pdpynum); pdpynum = copystring(value, strlen(value)); - if (!pdpynum) goto bad; - + if (!pdpynum) + { + if (host) Xfree(host); + goto bad; + } break; } name = strtok(NULL, "="); } - Xfree(host); + if (host) Xfree(host); if (idisplay == -1) { @@ -486,6 +502,7 @@ _X11TransConnectDisplay ( if (pprotocol && !strcasecmp(pprotocol, "nx")) { + Xfree(pprotocol); pprotocol = copystring ("local", 5); if (!pprotocol) goto bad; @@ -502,18 +519,18 @@ _X11TransConnectDisplay ( if (!pprotocol) { #if defined(UNIXCONN) if (phostname && (strcmp (phostname, "unix") == 0)) { - Xfree(pprotocol); pprotocol = copystring ("unix", 4); } else #endif #ifdef HAVE_LAUNCHD if (phostname && phostname[0]=='/') { - pprotocol = copystring ("local", 5); + pprotocol = copystring ("local", 5); } #endif if (!phostname) { if (local_transport[0] != NULL) { + if (pprotocol) Xfree(pprotocol); pprotocol = Xstrdup(local_transport[0]); local_transport_index = 0; } @@ -611,7 +628,7 @@ _X11TransConnectDisplay ( } #if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST) - fprintf(stderr, "_X11TransConnectDisplay: Out of connection loop.\n"); + fprintf(stderr, "_X11TransConnectDisplay: Out of connection loop.\n"); #endif if (address != addrbuf) Xfree (address); address = addrbuf; @@ -636,7 +653,7 @@ _X11TransConnectDisplay ( * XDisplayString() and XDisplayName() agree. */ if (reset_hostname && (phostname != original_hostname)) { - Xfree (phostname); + if (phostname) Xfree (phostname); phostname = original_hostname; original_hostname = NULL; } @@ -668,7 +685,6 @@ _X11TransConnectDisplay ( #if defined(LOCALCONN) || defined(UNIXCONN) || defined(TCPCONN) if (original_hostname) Xfree (original_hostname); #endif - GetAuthorization(trans_conn, family, (char *) saddr, saddrlen, idisplay, auth_namep, auth_namelenp, auth_datap, auth_datalenp); return trans_conn; -- 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 3.6.x in repository nx-libs. commit 7da2ee0bd3010a8123838ebfd681169d2636c650 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 3 17:05:52 2020 +0100 NXdixfonts.c: Hard-code the enablement of NXAGENT_DANGEROUS_XFONT_LOOP_EXIT. --- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 8ec4145f0..547dac3f4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -91,6 +91,13 @@ static Bool doListFontsAndAliases(ClientPtr client, LFclosurePtr c); #undef TEST #undef DEBUG +/* This enables code that contains copies of code from libXfont. + * We copy+pasted the private _LFWIData type struct into this + * file. If this gets ever changed in libXfont, we must follow-up + * on that change here, too. + */ +#define NXAGENT_DANGEROUS_XFONT_LOOP_EXIT + #define NXFONTPATHLENGTH 1024 char _NXFontPath[NXFONTPATHLENGTH]; -- 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 3.6.x in repository nx-libs. commit fbde6d285a2712892ed05f5b9bd9a2987d64d009 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 3 17:05:28 2020 +0100 NXdixfonts.c: Rename BREAK_XFONT_LOOP to NXAGENT_DANGEROUS_XFONT_LOOP_EXIT (better macro name). --- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 516b7eb02..8ec4145f0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -1199,7 +1199,7 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) if (err == Successful) { -#ifndef BREAK_XFONT_LOOP +#ifndef NXAGENT_DANGEROUS_XFONT_LOOP_EXIT if (tmp[0] != 0) { continue; @@ -1214,7 +1214,7 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) tmp[c->savedNameLen >255 ? 255 : c->savedNameLen] = 0; if (nxagentFontLookUp(tmp)) { -#ifdef BREAK_XFONT_LOOP +#ifdef NXAGENT_DANGEROUS_XFONT_LOOP_EXIT break; #else continue; @@ -1229,7 +1229,7 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) tmp[namelen > 255 ? 255 : namelen] = 0; if (nxagentFontLookUp(tmp)) { -#ifdef BREAK_XFONT_LOOP +#ifdef NXAGENT_DANGEROUS_XFONT_LOOP_EXIT break; #else continue; @@ -1327,7 +1327,7 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) bail: finish: -#ifdef BREAK_XFONT_LOOP +#ifdef NXAGENT_DANGEROUS_XFONT_LOOP_EXIT /* if we allow above loop to be exited via break we need to free the private xfont data somehow. */ if (c->current.list_started) -- 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 3.6.x in repository nx-libs. commit edb5a918a8a79262ce0bfd3924f6a5bb268877cd Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 3 00:38:09 2020 +0200 Clipboard.c: fix missing ) --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 7ca22ffad..73cb1e7e5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -292,7 +292,7 @@ static void printSelectionStat(int sel) #else fprintf(stderr, " CurrentSelections[].client [%p] index [%d]\n", (void *)curSel.client, - CLINDEX(curSel.client); + CLINDEX(curSel.client)); #endif fprintf(stderr, " CurrentSelections[].window [0x%x]\n", curSel.window); return; -- 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 3.6.x in repository nx-libs. commit 8bfe760d5de7cc7f9539f1c943546ba6209ce67c Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 2 21:53:28 2020 +0200 Atoms.c: drop double include --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 1 - 1 file changed, 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index 358d46519..d297a7afb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -42,7 +42,6 @@ #include "Display.h" #include "Screen.h" #include "Options.h" -#include "Agent.h" #include "Utils.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 3.6.x in repository nx-libs. commit db45683a6317a8712bbdbff0615d1b8e39b5d57c Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Oct 18 01:48:34 2020 +0200 NXdixfonts.c: fix memory leak ==15332== 2,500 (96 direct, 2,404 indirect) bytes in 6 blocks are definitely lost in loss record 324 of 342 ==15332== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==15332== by 0x5748B9E: FontFileStartListFonts (in /usr/lib/x86_64-linux-gnu/libXfont.so.1.4.1) ==15332== by 0x5748C4A: FontFileStartListFontsAndAliases (in /usr/lib/x86_64-linux-gnu/libXfont.so.1.4.1) ==15332== by 0x42859A: nxdoListFontsAndAliases (NXdixfonts.c:1163) ==15332== by 0x42C0E0: nxOpenFont (NXdixfonts.c:1541) ==15332== by 0x43392E: ProcOpenFont (NXdispatch.c:902) ==15332== by 0x434585: Dispatch (NXdispatch.c:482) ==15332== by 0x40EF77: main (main.c:355) FontFileStartListFonts[AndAliases]() allocates some private data. This data is used by subsequent calls of FontFileListNextFontOrAlias() in a loop. (Only) the last call to that function will free() the private data and return with BadFontName. FontFileListNextFontOrAlias() is the only libXfont function that free()s the private data. In nxagent the loop is exited as soon as a font exists both locally and remote. Therefore the private data would never be free()d. Solution: do not break the loop but store the first matching result and let the loop run to the end, ignoring all following results. Disadvantage: this can mean hundreds of extra iterations for nothing. I have done no investigation of the time penalty this might cause. Unfortunately this is the only clean way I have found so far. An unclean solution has also been implemented. It can be activated by defining BREAK_XFONT_LOOP. In that case the private data is handled in nxagent by taking assumptions about its structure (taken from the libXfont source). That will break if libXfont changes its internal handling of the private. Therefore it is discouraged. An third alternative would be to drop using libXfont from the system. Instead fork libXfont to the nx-libs tree, add some patches link to that library statically. Fixes ArcticaProject/nx-libs#586 --- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 62 ++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 6bb4ea306..516b7eb02 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -924,6 +924,9 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) ContBadFontName: ; c->current.list_started = FALSE; c->current.current_fpe++; +#ifdef NXAGENT_SERVER + c->current.private = 0; /* BadFontName -> private has been freed */ +#endif err = Successful; if (c->haveSaved) { @@ -1070,6 +1073,7 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) int i; int aliascount = 0; char tmp[256]; + tmp[0] = 0; if (client->clientGone) { @@ -1195,6 +1199,13 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) if (err == Successful) { +#ifndef BREAK_XFONT_LOOP + if (tmp[0] != 0) + { + continue; + } +#endif + if (c->haveSaved) { if (c->savedName) @@ -1202,8 +1213,14 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) memcpy(tmp, c->savedName, c->savedNameLen > 255 ? 255 : c->savedNameLen); tmp[c->savedNameLen >255 ? 255 : c->savedNameLen] = 0; if (nxagentFontLookUp(tmp)) - break; - else tmp[0] = 0; + { +#ifdef BREAK_XFONT_LOOP + break; +#else + continue; +#endif + } + else tmp[0] = 0; } } else @@ -1211,7 +1228,13 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) memcpy(tmp, name, namelen > 255 ? 255 : namelen); tmp[namelen > 255 ? 255 : namelen] = 0; if (nxagentFontLookUp(tmp)) - break; + { +#ifdef BREAK_XFONT_LOOP + break; +#else + continue; +#endif + } else tmp[0] = 0; } } @@ -1282,6 +1305,10 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) ContBadFontName: ; c->current.list_started = FALSE; c->current.current_fpe++; +#ifdef NXAGENT_SERVER + /* clearing a freed pointer helps for debugging */ + c->current.private = 0; /* BadFontName means private has been freed */ +#endif err = Successful; if (c->haveSaved) { @@ -1298,11 +1325,34 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) } } - /* - * send the reply - */ bail: finish: +#ifdef BREAK_XFONT_LOOP + /* if we allow above loop to be exited via break + we need to free the private xfont data somehow. */ + if (c->current.list_started) + { + /* WARNING: this codes makes assumptions about an internal + private structure of libXfont and can therefore break with + ANY libXfont update! */ + typedef struct _LFWIData { + FontNamesPtr names; + int current; + } LFWIDataRec, *LFWIDataPtr; + + LFWIDataPtr data = c->current.private; + if (data) + { +#ifdef HAS_XFONT2 + xfont2_free_font_names(data->names); +#else + FreeFontName(data->names); +#endif + free(data); + } + } +#endif + if (strlen(tmp)) { #ifdef NXAGENT_FONTMATCH_DEBUG -- 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 3.6.x in repository nx-libs. commit 447ee15707c022b6fd9061ce0df3a960fe24fb80 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 2 21:31:58 2020 +0200 Compext.c: use SAFE_free macro --- .../programs/Xserver/hw/nxagent/compext/Compext.c | 241 ++++++++------------- nx-X11/programs/Xserver/hw/nxagent/compext/Jpeg.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/compext/Png.c | 22 +- nx-X11/programs/Xserver/hw/nxagent/compext/Z.c | 6 +- 4 files changed, 106 insertions(+), 169 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c index 3492ef473..f65624c5a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c @@ -69,6 +69,7 @@ #include "Rle.h" #include "Z.h" +#include "../Utils.h" #define PANIC #define WARNING @@ -345,7 +346,7 @@ int _NXInternalResetResources(Display *dpy) { DeqAsyncHandler(dpy, _NXCollectedImages[i] -> handler); - free(_NXCollectedImages[i] -> handler); + SAFE_free(_NXCollectedImages[i] -> handler); } if (_NXCollectedImages[i] -> image != NULL) @@ -353,9 +354,7 @@ int _NXInternalResetResources(Display *dpy) XDestroyImage(_NXCollectedImages[i] -> image); } - free(_NXCollectedImages[i]); - - _NXCollectedImages[i] = NULL; + SAFE_free(_NXCollectedImages[i]); } if (_NXCollectedProperties[i] != NULL) @@ -369,17 +368,12 @@ int _NXInternalResetResources(Display *dpy) { DeqAsyncHandler(dpy, _NXCollectedProperties[i] -> handler); - free(_NXCollectedProperties[i] -> handler); - } - - if (_NXCollectedProperties[i] -> data != NULL) - { - free(_NXCollectedProperties[i] -> data); + SAFE_free(_NXCollectedProperties[i] -> handler); } - free(_NXCollectedProperties[i]); + SAFE_free(_NXCollectedProperties[i] -> data); - _NXCollectedProperties[i] = NULL; + SAFE_free(_NXCollectedProperties[i]); } if (_NXCollectedGrabPointers[i] != NULL) @@ -393,12 +387,10 @@ int _NXInternalResetResources(Display *dpy) { DeqAsyncHandler(dpy, _NXCollectedGrabPointers[i] -> handler); - free(_NXCollectedGrabPointers[i] -> handler); + SAFE_free(_NXCollectedGrabPointers[i] -> handler); } - free(_NXCollectedGrabPointers[i]); - - _NXCollectedGrabPointers[i] = NULL; + SAFE_free(_NXCollectedGrabPointers[i]); } if (_NXCollectedInputFocuses[i] != NULL) @@ -412,12 +404,10 @@ int _NXInternalResetResources(Display *dpy) { DeqAsyncHandler(dpy, _NXCollectedInputFocuses[i] -> handler); - free(_NXCollectedInputFocuses[i] -> handler); + SAFE_free(_NXCollectedInputFocuses[i] -> handler); } - free(_NXCollectedInputFocuses[i]); - - _NXCollectedInputFocuses[i] = NULL; + SAFE_free(_NXCollectedInputFocuses[i]); } } @@ -488,10 +478,7 @@ int NXSetDisplayBuffer(Display *dpy, int size) return -1; } - if (dpy -> buffer != NULL) - { - free(dpy -> buffer); - } + SAFE_free(dpy -> buffer); dpy -> buffer = buffer; dpy -> bufptr = dpy -> buffer; @@ -2190,7 +2177,7 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method) dst_data_size); #endif - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -2224,9 +2211,9 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method) fprintf(stderr, "******NXPackImage: PANIC! Failed to clean the image.\n"); #endif - free(dst_image -> data); + SAFE_free(dst_image -> data); - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -2237,9 +2224,9 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method) fprintf(stderr, "******NXPackImage: PANIC! Failed to apply the color mask.\n"); #endif - free(dst_image -> data); + SAFE_free(dst_image -> data); - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -2273,9 +2260,9 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method) dst_bits_per_pixel, dst_packed_bits_per_pixel); #endif - free(dst_image -> data); + SAFE_free(dst_image -> data); - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -2397,7 +2384,7 @@ XImage *NXInPlacePackImage(Display *dpy, XImage *src_image, unsigned int method) fprintf(stderr, "******NXInPlacePackImage: PANIC! Failed to clean the image.\n"); #endif - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -2408,7 +2395,7 @@ XImage *NXInPlacePackImage(Display *dpy, XImage *src_image, unsigned int method) fprintf(stderr, "******NXInPlacePackImage: PANIC! Failed to apply the color mask.\n"); #endif - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -2671,7 +2658,7 @@ NXPackedImage *NXEncodeRgb(XImage *src_image, unsigned int method, unsigned int fprintf(stderr, "******NXEncodeRgb: PANIC! Rgb compression failed.\n"); #endif - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -2716,7 +2703,7 @@ NXPackedImage *NXEncodeRle(XImage *src_image, unsigned int method, unsigned int fprintf(stderr, "******NXEncodeRle: PANIC! Rle compression failed.\n"); #endif - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -2761,7 +2748,7 @@ NXPackedImage *NXEncodeBitmap(XImage *src_image, unsigned int method, unsigned i fprintf(stderr, "******NXEncodeBitmap: PANIC! Bitmap compression failed.\n"); #endif - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -2821,7 +2808,7 @@ NXPackedImage *NXEncodeJpeg(XImage *src_image, unsigned int method, unsigned int fprintf(stderr, "******NXEncodeJpeg: PANIC! Jpeg compression failed.\n"); #endif - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -2876,7 +2863,7 @@ NXPackedImage *NXEncodePng(XImage *src_image, unsigned int method, unsigned int fprintf(stderr, "******NXEncodePng: PANIC! Png compression failed.\n"); #endif - free(dst_image); + SAFE_free(dst_image); return NULL; } @@ -3151,12 +3138,7 @@ void NXInitCache(Display *dpy, int entries) NXImageCacheSize = 0; - if (NXImageCache != NULL) - { - free(NXImageCache); - - NXImageCache = NULL; - } + SAFE_free(NXImageCache); if (entries > 0) { @@ -3267,7 +3249,7 @@ XImage *NXCacheFindImage(NXPackedImage *src_image, unsigned int *method, unsigne i, NXImageCacheHits, NXImageCacheOps); #endif - free(new_md5); + SAFE_free(new_md5); /* * Move the images down one slot, from @@ -3344,9 +3326,9 @@ int NXCacheAddImage(NXPackedImage *image, unsigned int method, unsigned char *md i--; - free(NXImageCache[NXImageCacheSize - 1].image -> data); - free(NXImageCache[NXImageCacheSize - 1].image); - free(NXImageCache[NXImageCacheSize - 1].md5); + SAFE_free(NXImageCache[NXImageCacheSize - 1].image -> data); + SAFE_free(NXImageCache[NXImageCacheSize - 1].image); + SAFE_free(NXImageCache[NXImageCacheSize - 1].md5); } if (i > 0) @@ -3400,27 +3382,14 @@ void NXFreeCache(Display *dpy) { if (NXImageCache[i].image != NULL) { - if (NXImageCache[i].image -> data != NULL) - { - free(NXImageCache[i].image -> data); - } - - free(NXImageCache[i].image); - - NXImageCache[i].image = NULL; + SAFE_free(NXImageCache[i].image -> data); + SAFE_free(NXImageCache[i].image); } - if (NXImageCache[i].md5 != NULL) - { - free(NXImageCache[i].md5); - - NXImageCache[i].md5 = NULL; - } + SAFE_free(NXImageCache[i].md5); } - free(NXImageCache); - - NXImageCache = NULL; + SAFE_free(NXImageCache); NXImageCacheSize = 0; NXImageCacheHits = 0; @@ -3490,9 +3459,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, DeqAsyncHandler(dpy, state -> handler); - free(state -> handler); - - state -> handler = NULL; + SAFE_free(state -> handler); if (rep -> generic.type == X_Error) { @@ -3505,7 +3472,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedImages[state -> resource] = NULL; - free(state); + SAFE_free(state); return False; } @@ -3530,7 +3497,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedImages[state -> resource] = NULL; - free(state); + SAFE_free(state); return False; } @@ -3553,9 +3520,9 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedImages[state -> resource] = NULL; - free(state); + SAFE_free(state); - free(async_head); + SAFE_free(async_head); return False; } @@ -3582,9 +3549,9 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedImages[state -> resource] = NULL; - free(state); + SAFE_free(state); - free(async_head); + SAFE_free(async_head); return False; } @@ -3628,10 +3595,10 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedImages[state -> resource] = NULL; - free(state); + SAFE_free(state); - free(async_head); - free(async_data); + SAFE_free(async_head); + SAFE_free(async_data); return True; } @@ -3651,7 +3618,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, _NXNotifyImage(dpy, state -> resource, True); - free(async_head); + SAFE_free(async_head); return True; } @@ -3703,7 +3670,7 @@ int NXCollectImage(Display *dpy, unsigned int resource, Drawable drawable, { DeqAsyncHandler(dpy, state -> handler); - free(state -> handler); + SAFE_free(state -> handler); } if (state -> image != NULL) @@ -3711,7 +3678,7 @@ int NXCollectImage(Display *dpy, unsigned int resource, Drawable drawable, XDestroyImage(state -> image); } - free(state); + SAFE_free(state); _NXCollectedImages[resource] = NULL; } @@ -3751,15 +3718,8 @@ int NXCollectImage(Display *dpy, unsigned int resource, Drawable drawable, UnGetReq(GetImage); - if (state != NULL) - { - free(state); - } - - if (handler != NULL) - { - free(handler); - } + SAFE_free(state); + SAFE_free(handler); UnlockDisplay(dpy); @@ -3810,7 +3770,7 @@ int NXGetCollectedImage(Display *dpy, unsigned int resource, XImage **image) *image = state -> image; - free(state); + SAFE_free(state); #ifdef TEST fprintf(stderr, "******NXGetCollectedImage: Returning GetImage data for resource [%u].\n", @@ -3883,9 +3843,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, DeqAsyncHandler(dpy, state -> handler); - free(state -> handler); - - state -> handler = NULL; + SAFE_free(state -> handler); if (rep -> generic.type == X_Error) { @@ -3898,7 +3856,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedProperties[state -> resource] = NULL; - free(state); + SAFE_free(state); return False; } @@ -3923,7 +3881,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedProperties[state -> resource] = NULL; - free(state); + SAFE_free(state); return False; } @@ -3946,9 +3904,9 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedProperties[state -> resource] = NULL; - free(state); + SAFE_free(state); - free(async_head); + SAFE_free(async_head); return False; } @@ -3983,9 +3941,9 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedProperties[state -> resource] = NULL; - free(state); + SAFE_free(state); - free(async_head); + SAFE_free(async_head); return False; } @@ -4019,7 +3977,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, _NXNotifyProperty(dpy, state -> resource, True); - free(async_head); + SAFE_free(async_head); return True; } @@ -4070,15 +4028,11 @@ int NXCollectProperty(Display *dpy, unsigned int resource, Window window, Atom p { DeqAsyncHandler(dpy, state -> handler); - free(state -> handler); + SAFE_free(state -> handler); } - if (state -> data != NULL) - { - free(state -> data); - } - - free(state); + SAFE_free(state->data); + SAFE_free(state); _NXCollectedProperties[resource] = NULL; } @@ -4115,15 +4069,8 @@ int NXCollectProperty(Display *dpy, unsigned int resource, Window window, Atom p resource); #endif - if (state != NULL) - { - free(state); - } - - if (handler != NULL) - { - free(handler); - } + SAFE_free(state); + SAFE_free(handler); UnGetReq(GetProperty); @@ -4183,7 +4130,7 @@ int NXGetCollectedProperty(Display *dpy, unsigned int resource, Atom *actual_typ *data = (unsigned char *) _NXCollectedProperties[resource] -> data; - free(state); + SAFE_free(state); _NXCollectedProperties[resource] = NULL; @@ -4245,9 +4192,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, DeqAsyncHandler(dpy, state -> handler); - free(state -> handler); - - state -> handler = NULL; + SAFE_free(state -> handler); if (rep -> generic.type == X_Error) { @@ -4260,7 +4205,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedGrabPointers[state -> resource] = NULL; - free(state); + SAFE_free(state); return False; } @@ -4285,7 +4230,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedGrabPointers[state -> resource] = NULL; - free(state); + SAFE_free(state); return False; } @@ -4308,9 +4253,9 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedGrabPointers[state -> resource] = NULL; - free(state); + SAFE_free(state); - free(async_head); + SAFE_free(async_head); return False; } @@ -4324,7 +4269,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, _NXNotifyGrabPointer(dpy, state -> resource, True); - free(async_head); + SAFE_free(async_head); return True; } @@ -4376,10 +4321,10 @@ int NXCollectGrabPointer(Display *dpy, unsigned int resource, Window grab_window { DeqAsyncHandler(dpy, state -> handler); - free(state -> handler); + SAFE_free(state -> handler); } - free(state); + SAFE_free(state); _NXCollectedGrabPointers[resource] = NULL; } @@ -4412,15 +4357,9 @@ int NXCollectGrabPointer(Display *dpy, unsigned int resource, Window grab_window resource); #endif - if (state != NULL) - { - free(state); - } + SAFE_free(state); - if (handler != NULL) - { - free(handler); - } + SAFE_free(handler); UnGetReq(GrabPointer); @@ -4467,7 +4406,7 @@ int NXGetCollectedGrabPointer(Display *dpy, unsigned int resource, int *status) *status = state -> status; - free(state); + SAFE_free(state); _NXCollectedGrabPointers[resource] = NULL; @@ -4529,9 +4468,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, DeqAsyncHandler(dpy, state -> handler); - free(state -> handler); - - state -> handler = NULL; + SAFE_free(state -> handler); if (rep -> generic.type == X_Error) { @@ -4544,7 +4481,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedInputFocuses[state -> resource] = NULL; - free(state); + SAFE_free(state); return False; } @@ -4569,7 +4506,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedInputFocuses[state -> resource] = NULL; - free(state); + SAFE_free(state); return False; } @@ -4592,9 +4529,9 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, _NXCollectedInputFocuses[state -> resource] = NULL; - free(state); + SAFE_free(state); - free(async_head); + SAFE_free(async_head); return False; } @@ -4610,7 +4547,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, _NXNotifyInputFocus(dpy, state -> resource, True); - free(async_head); + SAFE_free(async_head); return True; } @@ -4660,10 +4597,10 @@ int NXCollectInputFocus(Display *dpy, unsigned int resource) { DeqAsyncHandler(dpy, state -> handler); - free(state -> handler); + SAFE_free(state -> handler); } - free(state); + SAFE_free(state); _NXCollectedInputFocuses[resource] = NULL; } @@ -4687,15 +4624,9 @@ int NXCollectInputFocus(Display *dpy, unsigned int resource) resource); #endif - if (state != NULL) - { - free(state); - } + SAFE_free(state); - if (handler != NULL) - { - free(handler); - } + SAFE_free(handler); UnGetEmptyReq(); @@ -4745,7 +4676,7 @@ int NXGetCollectedInputFocus(Display *dpy, unsigned int resource, *focus_return = state -> focus; *revert_to_return = state -> revert_to; - free(state); + SAFE_free(state); _NXCollectedInputFocuses[resource] = NULL; diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Jpeg.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Jpeg.c index 690a934f6..bdf3d927a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Jpeg.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Jpeg.c @@ -38,6 +38,8 @@ #include "Mask.h" #include "Jpeg.h" +#include "../Utils.h" + #define PANIC #define WARNING #undef TEST @@ -277,7 +279,7 @@ char *JpegCompressData(XImage *image, int level, int *compressed_size) jpegError); #endif - free(jpegCompBuf); + SAFE_free(jpegCompBuf); return NULL; } @@ -326,7 +328,7 @@ char *JpegCompressData(XImage *image, int level, int *compressed_size) jpegDstDataLen); #endif - free(jpegCompBuf); + SAFE_free(jpegCompBuf); return NULL; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c index 5c3a27612..00f6769f8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c @@ -34,6 +34,8 @@ #include "Mask.h" #include "Png.h" +#include "../Utils.h" + #define PANIC #define WARNING #undef TEST @@ -361,7 +363,7 @@ char *PngCompressData(XImage *image, int *compressed_size) #endif png_destroy_write_struct(&png_ptr, &info_ptr); - free(pngCompBuf); + SAFE_free(pngCompBuf); return NULL; } @@ -373,7 +375,7 @@ char *PngCompressData(XImage *image, int *compressed_size) fprintf(stderr, "******PngCompressData: PANIC! Could not alloc image_index.\n"); #endif - free(pngCompBuf); + SAFE_free(pngCompBuf); return NULL; } @@ -475,8 +477,8 @@ char *PngCompressData(XImage *image, int *compressed_size) png_destroy_write_struct(&png_ptr, &info_ptr); - free(pngCompBuf); - free(image_index); + SAFE_free(pngCompBuf); + SAFE_free(image_index); return NULL; } @@ -500,8 +502,8 @@ char *PngCompressData(XImage *image, int *compressed_size) (int) (count * sizeof(CARD8))); #endif - free(pngCompBuf); - free(image_index); + SAFE_free(pngCompBuf); + SAFE_free(image_index); return NULL; } @@ -532,8 +534,8 @@ char *PngCompressData(XImage *image, int *compressed_size) dy, h); #endif - free(srcBuf); srcBuf = NULL; - free(image_index); image_index = NULL; + SAFE_free(srcBuf); + SAFE_free(image_index); if (setjmp(png_jmpbuf(png_ptr))) { @@ -543,7 +545,7 @@ char *PngCompressData(XImage *image, int *compressed_size) png_destroy_write_struct(&png_ptr, &info_ptr); - free(pngCompBuf); + SAFE_free(pngCompBuf); return NULL; } @@ -594,7 +596,7 @@ char *PngCompressData(XImage *image, int *compressed_size) pngDataLen); #endif - free(pngCompBuf); + SAFE_free(pngCompBuf); return NULL; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Z.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Z.c index 9bf59eaf2..978032c28 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Z.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Z.c @@ -33,6 +33,8 @@ #include "Z.h" +#include "../Utils.h" + #define PANIC #define WARNING #undef TEST @@ -129,7 +131,7 @@ char *ZCompressData(const char *plainData, unsigned int plainSize, int threshold plainSize, zError(result)); #endif - free(compressedData); + SAFE_free(compressedData); *compressedSize = 0; @@ -300,7 +302,7 @@ int ZResetEncoder(void) #endif } - free(zStream); + SAFE_free(zStream); } zInitialized = 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 3.6.x in repository nx-libs. commit ced973e36f67f78cef720d0fc54e47bb8e5b22a6 Merge: 14df32cdb db45683a6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 3 14:00:40 2020 +0100 Merge branch 'uli42-pr/font_memleak' into 3.6.x Attributes GH PR #949: https://github.com/ArcticaProject/nx-libs/pull/949 nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 62 ++++++++++++++++++++++--- 1 file changed, 56 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 3.6.x in repository nx-libs. commit ebee6af050edbd60e0148e5939fdf0aecc48400d Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 2 22:04:59 2020 +0200 Clipboard.c: add missing ifdefs --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 73cb1e7e5..0589d33bb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1937,17 +1937,23 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, */ XlibAtom p = serverTransToAgentProperty; XlibAtom t; + #ifdef DEBUG char * pstr = "NX_CUT_BUFFER_SERVER"; const char * tstr; + #endif if (target == clientUTF8_STRING) { t = serverUTF8_STRING; + #ifdef DEBUG tstr = szAgentUTF8_STRING; + #endif } else { t = XA_STRING; + #ifdef DEBUG tstr = validateString(NameForAtom(XA_STRING)); + #endif } #ifdef DEBUG -- 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 3.6.x in repository nx-libs. commit 5bd72aec3c45664712c4c88875777e955bb53da3 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Nov 3 19:55:07 2020 +0100 nx-libs.spec: Set python shebang to python3 on fedora and rhel8 *** ERROR: ambiguous python shebang in /usr/bin/nxdialog: #!/usr/bin/env python. Change it to python3 (or python2) explicitly. Fedora offers a pythfix.py but I could not test with that so I simply used sed... Fixes ArcticaProject/nx-libs#955 --- nx-libs.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nx-libs.spec b/nx-libs.spec index ddbc16799..7886be14d 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -473,6 +473,11 @@ rm -r %{buildroot}%{_includedir}/nx-X11/Xtrans #Remove our shared libraries' .la files before wrapping up the packages rm %{buildroot}%{_libdir}/*.la +# Fix python scripts +%if 0%{?fedora} >= 23 || 0%{?rhel} >= 8 || 0%{?py_ver} == 3 +sed -i '1 s/python/python3/' %{buildroot}%{_bindir}/nxdialog +%endif + %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 3.6.x in repository nx-libs. commit 06173efd3843f7b4cb406d9935c578d82e7c42e6 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 2 21:54:31 2020 +0200 Compext.c: scope improvements --- nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c index f65624c5a..4a8dacaf4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c @@ -3194,7 +3194,7 @@ XImage *NXCacheFindImage(NXPackedImage *src_image, unsigned int *method, unsigne { md5_state_t new_state; md5_byte_t *new_md5; - unsigned int data_size, i; + unsigned int data_size; if (NXImageCache == NULL) { @@ -3228,7 +3228,7 @@ XImage *NXCacheFindImage(NXPackedImage *src_image, unsigned int *method, unsigne md5_finish(&new_state, new_md5); - for (i = 0; i < NXImageCacheSize; i++) + for (unsigned int i = 0; i < NXImageCacheSize; i++) { if (NXImageCache[i].image != NULL) { @@ -3984,9 +3984,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, int NXGetCollectPropertyResource(Display *dpy) { - int i; - - for (i = 0; i < NXNumberOfResources; i++) + for (int i = 0; i < NXNumberOfResources; i++) { if (_NXCollectedProperties[i] == NULL) { @@ -4276,9 +4274,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, int NXGetCollectGrabPointerResource(Display *dpy) { - int i; - - for (i = 0; i < NXNumberOfResources; i++) + for (int i = 0; i < NXNumberOfResources; i++) { if (_NXCollectedGrabPointers[i] == NULL) { @@ -4554,9 +4550,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, int NXGetCollectInputFocusResource(Display *dpy) { - int i; - - for (i = 0; i < NXNumberOfResources; i++) + for (int i = 0; i < NXNumberOfResources; i++) { if (_NXCollectedInputFocuses[i] == NULL) { @@ -4696,13 +4690,11 @@ void _NXDumpData(const unsigned char *buffer, unsigned int size) { unsigned int i = 0; - unsigned int ii; - while (i < size) { fprintf(stderr, "[%d]\t", i); - for (ii = 0; i < size && ii < 8; i++, ii++) + for (unsinged int ii = 0; i < size && ii < 8; i++, ii++) { fprintf(stderr, "%d\t", (unsigned int) (buffer[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 3.6.x in repository nx-libs. commit 1701a4a441d719cd5660cf3550cf2e5a62027a1d Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 2 22:19:07 2020 +0200 Xext/panoramiX.c: rename shadowing variables --- nx-X11/programs/Xserver/Xext/panoramiX.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index 6eab7f36d..e85ba33d7 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -601,8 +601,8 @@ extern Bool CreateConnectionBlock(void); Bool PanoramiXCreateConnectionBlock(void) { int i, j, length; - Bool disableBackingStore = FALSE; - Bool disableSaveUnders = FALSE; + Bool disable_backing_store = FALSE; + Bool disable_save_unders = FALSE; int old_width, old_height; float width_mult, height_mult; xWindowRoot *root; @@ -627,17 +627,17 @@ Bool PanoramiXCreateConnectionBlock(void) return FALSE; } if(pScreen->backingStoreSupport != screenInfo.screens[0]->backingStoreSupport) - disableBackingStore = TRUE; + disable_backing_store = TRUE; if(pScreen->saveUnderSupport != screenInfo.screens[0]->saveUnderSupport) - disableSaveUnders = TRUE; + disable_save_unders = TRUE; } - if(disableBackingStore || disableSaveUnders) { + if(disable_backing_store || disable_save_unders) { for(i = 0; i < screenInfo.numScreens; i++) { pScreen = screenInfo.screens[i]; - if(disableBackingStore) + if(disable_backing_store) pScreen->backingStoreSupport = NotUseful; - if(disableSaveUnders) + if(disable_save_unders) pScreen->saveUnderSupport = NotUseful; } } -- 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 3.6.x in repository nx-libs. commit ee379d3a7372cb81d3ef8aefd26ed110b027331b Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 2 21:53:52 2020 +0200 GCs.h: fix typo --- nx-X11/programs/Xserver/hw/nxagent/GCs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCs.h b/nx-X11/programs/Xserver/hw/nxagent/GCs.h index 84b0063ab..51ec85af0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCs.h +++ b/nx-X11/programs/Xserver/hw/nxagent/GCs.h @@ -42,7 +42,7 @@ is" without express or implied warranty. extern RESTYPE RT_NX_GC; -/* This file uses the GC definition form Xlib.h as XlibGC. */ +/* This file uses the GC definition from Xlib.h as XlibGC. */ typedef struct { XlibGC gc; -- 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 3.6.x in repository nx-libs. commit e66d2c86beb330d420d8208d28d9da52b7a9dfa3 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Nov 3 20:41:16 2020 +0100 Log.h: fix some shadow warnings "warning: declaration of '<something>' shadows a member of 'this' This shows up in gcc 4.8.5 and has been fixed in gcc 5.0, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57709 Change the variable names anyway to be on the safe side. Fixes ArcticaProject/nx-libs#958 --- nxcomp/src/Log.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nxcomp/src/Log.h b/nxcomp/src/Log.h index 95436a55d..52482f5a6 100644 --- a/nxcomp/src/Log.h +++ b/nxcomp/src/Log.h @@ -105,7 +105,7 @@ class NXLogStamp } - NXLogStamp(NXLogLevel level, const char *file = "", const char *function = "", size_t line = 0) : file_(file), function_(function), line_(line), level_(level) + NXLogStamp(NXLogLevel _level, const char *_file = "", const char *_function = "", size_t _line = 0) : file_(_file), function_(_function), line_(_line), level_(_level) { gettimeofday(×tamp_, NULL); } @@ -300,9 +300,9 @@ class NXLog return level_; } - void level(NXLogLevel level) + void level(NXLogLevel _level) { - level_ = level; + level_ = _level; } @@ -312,9 +312,9 @@ class NXLog return get_data()->current_level; } - void current_level(NXLogLevel level) + void current_level(NXLogLevel _level) { - get_data()->current_level = level; + get_data()->current_level = _level; } /** Source file from which messages are currently originating */ @@ -333,10 +333,10 @@ class NXLog return stream_; } - void stream(std::ostream *stream) + void stream(std::ostream *_stream) { flush(); - stream_ = stream; + stream_ = _stream; } bool synchronized() const { -- 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 3.6.x in repository nx-libs. commit 2c66355c229bd10ad9f0c34e9ea31ed50c715955 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Nov 3 20:31:11 2020 +0100 Channel.h: rename variable to prevent shadowing In file included from Proxy.h:39:0, from ServerProxy.h:32, from ServerProxy.cpp:36: Channel.h: In member function 'int Channel::handleEncodeIdentity(EncodeBuffer&, ChannelCache*, MessageStore*, const unsigned char*, unsigned int, int)': Channel.h:369:3: warning: declaration of 'bigEndian' shadows a member of 'this' [-Wshadow] { ^ Channel.h: In member function 'int Channel::handleDecodeIdentity(DecodeBuffer&, ChannelCache*, MessageStore*, unsigned char*&, unsigned int&, int, WriteBuffer*)': Channel.h:378:3: warning: declaration of 'bigEndian' shadows a member of 'this' [-Wshadow] { ^ RHEL7's g++ 4.8.5 reports this while Debian's g++ 10.2.0-15 does not. This is described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57709 and fixed in gcc 5.0. Rename the variables anyway to be on the safe side. Fixes ArcticaProject/nx-libs#956 --- nxcomp/src/Channel.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nxcomp/src/Channel.h b/nxcomp/src/Channel.h index 7e432416a..3b37fa60d 100644 --- a/nxcomp/src/Channel.h +++ b/nxcomp/src/Channel.h @@ -365,18 +365,18 @@ class Channel int handleEncodeIdentity(EncodeBuffer &encodeBuffer, ChannelCache *channelCache, MessageStore *store, const unsigned char *buffer, - const unsigned int size, int bigEndian) + const unsigned int size, int _bigEndian) { return (store -> encodeIdentity(encodeBuffer, buffer, size, - bigEndian, channelCache)); + _bigEndian, channelCache)); } int handleDecodeIdentity(DecodeBuffer &decodeBuffer, ChannelCache *channelCache, MessageStore *store, unsigned char *&buffer, - unsigned int &size, int bigEndian, + unsigned int &size, int _bigEndian, WriteBuffer *writeBuffer) { - return (store -> decodeIdentity(decodeBuffer, buffer, size, bigEndian, + return (store -> decodeIdentity(decodeBuffer, buffer, size, _bigEndian, writeBuffer, channelCache)); } -- 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 3.6.x in repository nx-libs. commit b1efdd94da317f376106895b787b549900716da3 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 3 00:09:40 2020 +0200 Screen.c: fix indentation in nxagentMaximizeToFullScreen --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 74 ++++++++++++++--------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index f8507aa59..148f9e1dd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -341,7 +341,7 @@ void nxagentMaximizeToFullScreen(ScreenPtr pScreen) XUnmapWindow(nxagentDisplay, nxagentIconWindow); */ - Window root = RootWindow(nxagentDisplay, DefaultScreen(nxagentDisplay)); + Window root = RootWindow(nxagentDisplay, DefaultScreen(nxagentDisplay)); /* FIXME: We'll check for ReparentNotify and LeaveNotify events after @@ -351,55 +351,55 @@ FIXME: We'll check for ReparentNotify and LeaveNotify events after unnecessary. */ - /* only reparent if necessary. FIXME: also check if the desired coordinates match */ + /* only reparent if necessary. FIXME: also check if the desired coordinates match */ - if (!nxagentIsParentOf(nxagentDisplay, root, nxagentFullscreenWindow)) - { - XReparentWindow(nxagentDisplay, nxagentFullscreenWindow, - root, 0, 0); + if (!nxagentIsParentOf(nxagentDisplay, root, nxagentFullscreenWindow)) + { + XReparentWindow(nxagentDisplay, nxagentFullscreenWindow, + root, 0, 0); - for (int i = 0; i < 100 && nxagentWMIsRunning; i++) - { - XEvent e; + for (int i = 0; i < 100 && nxagentWMIsRunning; i++) + { + XEvent e; - #ifdef TEST - fprintf(stderr, "nxagentMaximizeToFullscreen: WARNING! Going to wait for the ReparentNotify event [%d].\n", i); - #endif + #ifdef TEST + fprintf(stderr, "nxagentMaximizeToFullscreen: WARNING! Going to wait for the ReparentNotify event [%d].\n", i); + #endif - if (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, ReparentNotify, &e)) - { - break; - } + if (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, ReparentNotify, &e)) + { + break; + } - XSync(nxagentDisplay, 0); + XSync(nxagentDisplay, 0); - nxagentWaitEvents(nxagentDisplay, 50); - } - } - else - { - #ifdef TEST - fprintf(stderr, "%s: FullscreenWindow already is child of root window - skipping reparenting,\n", __func__); - #endif + nxagentWaitEvents(nxagentDisplay, 50); } + } + else + { + #ifdef TEST + fprintf(stderr, "%s: FullscreenWindow already is child of root window - skipping reparenting,\n", __func__); + #endif + } XMapRaised(nxagentDisplay, nxagentFullscreenWindow); XIconifyWindow(nxagentDisplay, nxagentIconWindow, DefaultScreen(nxagentDisplay)); - /* swallow all LeaveNotify events for the FullscreenWindow; - Normally this does not swallow anything these days, but when - using fvwm you see one of these events here. */ - while (1) - { - XEvent e; - if (!XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, LeaveNotify, &e)) - break; - #ifdef TEST - fprintf(stderr, "%s: swallowing LeaveNotify event\n", __func__); - #endif - } + /* swallow all LeaveNotify events for the FullscreenWindow; + Normally this does not swallow anything these days, but when + using fvwm you see one of these events here. */ + while (1) + { + XEvent e; + if (!XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, LeaveNotify, &e)) + break; + #ifdef TEST + fprintf(stderr, "%s: swallowing LeaveNotify event\n", __func__); + #endif + } /* XMapWindow(nxagentDisplay, nxagentIconWindow); -- 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 3.6.x in repository nx-libs. commit 6cd4f12322ffccdbbfa10ce9e282e54a932b995c Merge: ced973e36 7da2ee0bd Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Nov 4 13:03:31 2020 +0100 Merge branch 'sunweaver-pr/default-to-NXAGENT_DANGEROUS_XFONT_LOOP_EXIT' into 3.6.x Attributes GH PR #961: https://github.com/ArcticaProject/nx-libs/pull/961 Approved by Ulrich Sibiller <uli42@gmx.de>, Tue, 03 Nov 2020 08:14:04 -0800 nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 15 +++++++++++---- 1 file changed, 11 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 3.6.x in repository nx-libs. commit 8b0bb28ebbe5622fc9550543a022b77e24d8a61e Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 30 19:47:12 2020 +0100 Events.c: scope improvement --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 4d9d32bb2..2487db69f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2851,10 +2851,10 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) fprintf(stderr, "%s: Handling event.\n", __func__); #endif - Atom local = nxagentRemoteToLocalAtom(xfixesEvent -> xfixesselection.selection); - if (SelectionCallback) { + Atom local = nxagentRemoteToLocalAtom(xfixesEvent -> xfixesselection.selection); + int i = nxagentFindCurrentSelectionIndex(local); if (i < NumCurrentSelections) { -- 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 3.6.x in repository nx-libs. commit 522eea6f2ce2a61ef965268e2d2ec5346bf6b30c Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Nov 3 22:50:13 2020 +0100 compext/Png.c: fix shadowing Png.c: In function ‘PngWriteData’: Png.c:603:38: warning: declaration of ‘png_ptr’ shadows a global declaration [-Wshadow] 603 | static void PngWriteData(png_structp png_ptr, png_bytep data, png_size_t length) | ~~~~~~~~~~~~^~~~~~~ Png.c:77:13: note: shadowed declaration is here 77 | png_structp png_ptr; | ^~~~~~~ Png.c: In function ‘PngFlushData’: Png.c:610:38: warning: declaration of ‘png_ptr’ shadows a global declaration [-Wshadow] 610 | static void PngFlushData(png_structp png_ptr) | ~~~~~~~~~~~~^~~~~~~ Png.c:77:13: note: shadowed declaration is here 77 | png_structp png_ptr; | ^~~~~~~ --- nx-X11/programs/Xserver/hw/nxagent/compext/Png.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c index 00f6769f8..48acb6e88 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c @@ -602,14 +602,14 @@ char *PngCompressData(XImage *image, int *compressed_size) } } -static void PngWriteData(png_structp png_ptr, png_bytep data, png_size_t length) +static void PngWriteData(png_structp _png_ptr, png_bytep data, png_size_t length) { - memcpy(((char *) png_get_io_ptr(png_ptr) + pngDataLen), data, length); + memcpy(((char *) png_get_io_ptr(_png_ptr) + pngDataLen), data, length); pngDataLen += length; } -static void PngFlushData(png_structp png_ptr) +static void PngFlushData(png_structp _png_ptr) { } -- 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 3.6.x in repository nx-libs. commit f1e543b0923cbd7e321103bb6a235a0867bfb466 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Oct 12 23:58:07 2020 +0200 Atoms.c: fix FIXME comment --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index e633fc34a..52c75e805 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -717,7 +717,7 @@ XlibAtom nxagentLocalToRemoteAtom(Atom local) { const char *string = NameForAtom(local); - /* FIXME: why False? */ + /* False means "create Atom if it does not exist yet" */ XlibAtom remote = XInternAtom(nxagentDisplay, string, False); if (remote == None) -- 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 3.6.x in repository nx-libs. commit b07b6c537285c0182ef4fb6df17cf309d2bfc814 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Sep 23 12:17:18 2020 +0200 Clipboard.c: fix bug in special optimization for nested settings Fixes ArcticaProject/nx-libs#941 --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 0589d33bb..ceb47b669 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2031,11 +2031,12 @@ int nxagentSendNotify(xEvent *event) * communication happens completely between our own clients (some of * which can be nxagents themselves). In that case we return 0 (tell * dix to go on) and do nothing! + * Be sure to not let this trigger for the failure answer (property 0) */ - if (event->u.selectionNotify.property != clientCutProperty || lastServerRequestor == None) + if (!(event->u.selectionNotify.property == clientCutProperty || event->u.selectionNotify.property == 0) || lastServerRequestor == None) { #ifdef DEBUG - fprintf(stderr, "%s: sent nothing.\n", __func__); + fprintf(stderr, "%s: sent nothing - message to real X server is not required.\n", __func__); #endif return 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 3.6.x in repository nx-libs. commit 4460183a6458f05e82bf7b64832c84bb6cfda398 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Oct 12 23:57:54 2020 +0200 Atoms.c: improve debug output --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index d297a7afb..e633fc34a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -708,7 +708,7 @@ XlibAtom nxagentLocalToRemoteAtom(Atom local) if (current->string) fprintf(stderr, "%s: local [%d] -> remote [%d (%s)]\n", __func__, local, current->remote, current->string); else - fprintf(stderr, "%s: local [%d] -> remote [%d]\n", __func__, local, current->remote); + fprintf(stderr, "%s: local [%d] -> remote [%d] (no string cached)\n", __func__, local, current->remote); #endif return current->remote; -- 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 3.6.x in repository nx-libs. commit 1af0776481c203765cbb73ec9540991e4f946a70 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 3 17:05:28 2020 +0100 NXdixfonts.c: Rename BREAK_XFONT_LOOP to NXAGENT_DANGEROUS_XFONT_LOOP_EXIT (better macro name). --- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 516b7eb02..8ec4145f0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -1199,7 +1199,7 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) if (err == Successful) { -#ifndef BREAK_XFONT_LOOP +#ifndef NXAGENT_DANGEROUS_XFONT_LOOP_EXIT if (tmp[0] != 0) { continue; @@ -1214,7 +1214,7 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) tmp[c->savedNameLen >255 ? 255 : c->savedNameLen] = 0; if (nxagentFontLookUp(tmp)) { -#ifdef BREAK_XFONT_LOOP +#ifdef NXAGENT_DANGEROUS_XFONT_LOOP_EXIT break; #else continue; @@ -1229,7 +1229,7 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) tmp[namelen > 255 ? 255 : namelen] = 0; if (nxagentFontLookUp(tmp)) { -#ifdef BREAK_XFONT_LOOP +#ifdef NXAGENT_DANGEROUS_XFONT_LOOP_EXIT break; #else continue; @@ -1327,7 +1327,7 @@ nxdoListFontsAndAliases(ClientPtr client, nxFsPtr fss) bail: finish: -#ifdef BREAK_XFONT_LOOP +#ifdef NXAGENT_DANGEROUS_XFONT_LOOP_EXIT /* if we allow above loop to be exited via break we need to free the private xfont data somehow. */ if (c->current.list_started) -- 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 3.6.x in repository nx-libs. commit 48b914810291f405fd5ba8e9db9dfab3ccaf906c Merge: 6cd4f1232 252b86ee2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Nov 4 13:38:30 2020 +0100 Merge branch 'uli42-pr/various5' into 3.6.x Attributes GH PR #963: https://github.com/ArcticaProject/nx-libs/pull/963 nx-X11/programs/Xserver/Xext/panoramiX.c | 14 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 5 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 13 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/GCs.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 74 +++--- .../programs/Xserver/hw/nxagent/compext/Compext.c | 261 ++++++++------------- nx-X11/programs/Xserver/hw/nxagent/compext/Jpeg.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/compext/Png.c | 28 ++- nx-X11/programs/Xserver/hw/nxagent/compext/Z.c | 6 +- nx-libs.spec | 5 + nxcomp/src/Channel.h | 8 +- nxcomp/src/Log.h | 14 +- 13 files changed, 190 insertions(+), 250 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 3.6.x in repository nx-libs. commit f2973029daeffa90d3b9894e2658f5e134d1b9ad Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Nov 4 13:43:58 2020 +0100 release 3.5.99.25 --- ChangeLog | 358 ++++++++++++++++++++++- VERSION | 2 +- debian/changelog | 7 + nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb | Bin 206452 -> 206452 bytes nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 2 +- nx-libs.spec | 4 +- nxdialog/bin/nxdialog | 4 +- nxdialog/man/nxdialog.1 | 2 +- nxproxy/man/nxproxy.1 | 2 +- 9 files changed, 371 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index df83b7bac..ff0901620 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,360 @@ -2020-05-31 12:59:09 +0200 Mike Gabriel +2020-11-04 13:43:58 +0100 Mike Gabriel - * release 3.5.99.24 (HEAD -> 3.6.x, tag: 3.5.99.24) + * release 3.5.99.25 (HEAD -> 3.6.x, tag: 3.5.99.25) + +2020-11-04 13:38:30 +0100 Mike Gabriel (48b914810) + + * Merge branch 'uli42-pr/various5' into 3.6.x + +2020-11-03 17:05:52 +0100 Mike Gabriel (252b86ee2) + + * NXdixfonts.c: Hard-code the enablement of + NXAGENT_DANGEROUS_XFONT_LOOP_EXIT. + +2020-11-03 17:05:28 +0100 Mike Gabriel (1af077648) + + * NXdixfonts.c: Rename BREAK_XFONT_LOOP to + NXAGENT_DANGEROUS_XFONT_LOOP_EXIT (better macro name). + +2020-11-04 13:03:31 +0100 Mike Gabriel (6cd4f1232) + + * Merge branch + 'sunweaver-pr/default-to-NXAGENT_DANGEROUS_XFONT_LOOP_EXIT' + into 3.6.x + +2020-09-23 12:17:18 +0200 Ulrich Sibiller (b07b6c537) + + * Clipboard.c: fix bug in special optimization for nested settings + +2020-11-03 22:50:13 +0100 Ulrich Sibiller (522eea6f2) + + * compext/Png.c: fix shadowing + +2020-06-03 00:09:40 +0200 Ulrich Sibiller (b1efdd94d) + + * Screen.c: fix indentation in nxagentMaximizeToFullScreen + +2020-10-12 23:58:07 +0200 Ulrich Sibiller (f1e543b09) + + * Atoms.c: fix FIXME comment + +2020-10-12 23:57:54 +0200 Ulrich Sibiller (4460183a6) + + * Atoms.c: improve debug output + +2020-10-30 19:47:12 +0100 Ulrich Sibiller (8b0bb28eb) + + * Events.c: scope improvement + +2020-11-03 20:41:16 +0100 Ulrich Sibiller (e66d2c86b) + + * Log.h: fix some shadow warnings + +2020-11-03 20:31:11 +0100 Ulrich Sibiller (2c66355c2) + + * Channel.h: rename variable to prevent shadowing + +2020-11-03 19:55:07 +0100 Ulrich Sibiller (5bd72aec3) + + * nx-libs.spec: Set python shebang to python3 on fedora and rhel8 + +2020-10-02 22:19:07 +0200 Ulrich Sibiller (1701a4a44) + + * Xext/panoramiX.c: rename shadowing variables + +2020-10-02 22:04:59 +0200 Ulrich Sibiller (ebee6af05) + + * Clipboard.c: add missing ifdefs + +2020-10-02 21:54:31 +0200 Ulrich Sibiller (06173efd3) + + * Compext.c: scope improvements + +2020-10-02 21:53:52 +0200 Ulrich Sibiller (ee379d3a7) + + * GCs.h: fix typo + +2020-10-02 21:53:28 +0200 Ulrich Sibiller (8bfe760d5) + + * Atoms.c: drop double include + +2020-10-02 21:31:58 +0200 Ulrich Sibiller (447ee1570) + + * Compext.c: use SAFE_free macro + +2020-06-03 00:38:09 +0200 Ulrich Sibiller (edb5a918a) + + * Clipboard.c: fix missing ) + +2020-11-03 17:05:52 +0100 Mike Gabriel (7da2ee0bd) + + * NXdixfonts.c: Hard-code the enablement of + NXAGENT_DANGEROUS_XFONT_LOOP_EXIT. + +2020-11-03 17:05:28 +0100 Mike Gabriel (fbde6d285) + + * NXdixfonts.c: Rename BREAK_XFONT_LOOP to + NXAGENT_DANGEROUS_XFONT_LOOP_EXIT (better macro name). + +2020-11-03 14:00:40 +0100 Mike Gabriel (ced973e36) + + * Merge branch 'uli42-pr/font_memleak' into 3.6.x + +2020-10-18 01:48:34 +0200 Ulrich Sibiller (db45683a6) + + * NXdixfonts.c: fix memory leak + +2020-11-03 13:43:57 +0100 Mike Gabriel (14df32cdb) + + * Merge branch 'uli42-pr/xlib_memleak' into 3.6.x + +2020-10-18 16:24:32 +0200 Ulrich Sibiller (12b22e97e) + + * yConnDis.c: fix memory leak + +2020-11-02 14:05:24 +0100 Ulrich Sibiller (ca7b33103) + + * Merge pull request #960 from uli42/pr/fix_specfile + +2020-11-02 14:00:02 +0100 Ulrich Sibiller (dee4a560a) + + * fix spec file + +2020-10-18 12:30:54 +0200 Mike Gabriel (13211ec6a) + + * Merge branch 'uli42-pr/window_resize_bug' into 3.6.x + +2020-07-27 18:29:40 +0200 Ulrich Sibiller (2d99cdd1c) + + * Events.c: More cosmetics + +2020-05-26 01:08:50 +0200 Ulrich Sibiller (4c6940cdd) + + * Window.c: some more TEST and DEBUG output + +2020-05-26 00:54:02 +0200 Ulrich Sibiller (199c32eaf) + + * Screen.c: some more (cosmetic) changes + +2020-05-26 00:53:32 +0200 Ulrich Sibiller (42fb68331) + + * Screen.c: scope improvements + +2020-05-26 00:51:58 +0200 Ulrich Sibiller (f534a4860) + + * Screen.c: move attributes/valuemask to inner scopes + +2020-05-26 00:46:18 +0200 Ulrich Sibiller (d7a091a64) + + * Screen.c: drop unneccessary mask variable + +2020-05-26 00:43:44 +0200 Ulrich Sibiller (d07c78881) + + * Screen.c: remove another pointless code block + +2020-05-26 00:37:58 +0200 Ulrich Sibiller (2c6b9117f) + + * Screen.c: remove code that will have no effect + +2020-05-26 00:08:03 +0200 Ulrich Sibiller (ed4cbaeda) + + * Screen.c: scope improvement + +2020-05-26 00:06:40 +0200 Ulrich Sibiller (00d60a82e) + + * Screen.c: cleanup auto dpi handling + +2020-05-26 00:05:51 +0200 Ulrich Sibiller (3a7c37593) + + * Init.c: small simplification + +2020-05-25 23:58:50 +0200 Ulrich Sibiller (832e02811) + + * NXwindow.c: fix some format specifiers + +2020-05-25 23:49:25 +0200 Ulrich Sibiller (601a57849) + + * Window.c: simplify setting of isMapped private var + +2020-05-25 23:48:04 +0200 Ulrich Sibiller (2a92ed0f5) + + * Window.c: -reportprivatewids reports root window as such + +2020-05-25 22:20:43 +0200 Ulrich Sibiller (2ada71fba) + + * Screen.c: simplify nxagentResizeScreen + +2020-05-25 21:55:03 +0200 Ulrich Sibiller (1af470a23) + + * Screen.c: improve output of nxagentPrintAgentGeometry + +2020-05-25 20:19:26 +0200 Ulrich Sibiller (e48ceedcc) + + * Screen.c: improve debug output + +2020-05-25 19:54:15 +0200 Ulrich Sibiller (ce649c027) + + * nxagent: add names to some windows in DEBUG mode + +2020-05-25 19:31:29 +0200 Ulrich Sibiller (210db3163) + + * Display.c: disable confine window + +2020-05-25 18:52:36 +0200 Ulrich Sibiller (a4dd6a462) + + * Events.c: store parent window from event to meaningful variable + +2020-05-25 18:49:53 +0200 Ulrich Sibiller (ffbc63f91) + + * Events.c: add some comments/FIXMEs + +2020-05-25 18:36:21 +0200 Ulrich Sibiller (337afd839) + + * Events.c: add more DEBUG output + +2020-05-19 20:59:02 +0200 Ulrich Sibiller (8deda7bd4) + + * nxagent: Prevent resize loop + +2020-05-15 18:25:07 +0200 Ulrich Sibiller (abe5e8479) + + * Display.c: factor out confinement window creation + +2020-05-11 18:33:01 +0200 Ulrich Sibiller (0f8ed4d10) + + * Screen.c: fix resizing bug with mutter window manager + +2020-10-17 22:37:22 +0200 Mike Gabriel (7a02b4aba) + + * Merge branch 'uli42-pr/fix_stack_smashing' into 3.6.x + +2020-10-02 22:11:04 +0200 Ulrich Sibiller (ae037701f) + + * nxagent: fix stack smashing + +2020-10-17 22:21:02 +0200 Mike Gabriel (2b0976e93) + + * Merge branch 'uli42-pr/fix_caps_handling' into 3.6.x + +2020-06-19 00:18:34 +0200 Ulrich Sibiller (ffc2c3840) + + * Keyboard.c: improve capslock and numlock handling + +2020-06-19 00:17:43 +0200 Ulrich Sibiller (e74b99117) + + * Keyboard.c: fix indentation of ifdef + +2020-10-17 22:02:41 +0200 Mike Gabriel (05cb09a5f) + + * Merge branch 'uli42-pr/libNX_X11_defines' into 3.6.x + +2019-03-01 00:08:43 +0100 Ulrich Sibiller (1215c36f7) + + * libNX_X11: set XTRANS_SEND_FDS=0 + +2019-02-28 23:57:36 +0100 Ulrich Sibiller (94fcba361) + + * libNX_X11: set FAIL_HARD + +2019-02-26 23:20:46 +0100 Ulrich Sibiller (b4124219a) + + * nx-xtrans.m4: reintroduce HAS_STICKY_DIR_BIT + +2019-02-26 22:35:58 +0100 Ulrich Sibiller (3335f2503) + + * libNX_X11: reintroduce SECURE_RPC + +2019-02-26 20:57:21 +0100 Ulrich Sibiller (475d6c1f2) + + * libNX_X11: reintroduce HASXDMAUTH + +2020-10-17 21:57:24 +0200 Mike Gabriel (d121f2a9c) + + * Merge branch 'uli42-pr/nxdialog_rpm' into 3.6.x + +2020-07-12 13:14:12 +0200 Ulrich Sibiller (2ef652d35) + + * nx-libs.spec: create nxdialog rpm + +2020-10-17 21:54:03 +0200 Mike Gabriel (6857e26b4) + + * Merge branch 'mjtrangoni-fix-pvs-ci' into 3.6.x + +2020-07-07 18:53:51 +0200 Mario Trangoni (870a9491c) + + * travisci: Fix PVS job + +2020-10-17 21:49:35 +0200 Mike Gabriel (bc68b4aad) + + * Merge branch 'uli42-pr/fix_wrap_macros' into 3.6.x + +2020-10-16 18:57:47 +0200 Ulrich Sibiller (d1a967f3a) + + * randr: fix broken macros / memory corruption + +2020-10-01 21:00:17 +0200 Mike Gabriel (67330d9ea) + + * Update SECURITY.md + +2020-10-01 21:00:05 +0200 Mike Gabriel (ee77e9706) + + * Update SECURITY.md + +2020-10-01 20:59:25 +0200 Mike Gabriel (53ace2743) + + * Create SECURITY.md + +2020-06-29 22:10:09 +0200 Mike Gabriel (e10302404) + + * Merge branch 'mjtrangoni-add-pvs-studio' into 3.6.x + +2020-06-06 16:01:31 +0200 Mario Trangoni (61859da35) + + * travis-ci: add PVS Studio + +2020-06-29 22:07:14 +0200 Mike Gabriel (a3d493a60) + + * Merge branch 'uli42-pr/clarify_sleep' into 3.6.x + +2020-06-02 21:50:31 +0200 Ulrich Sibiller (ede842c21) + + * Extend sleep documentation + +2020-06-02 21:48:41 +0200 Ulrich Sibiller (bf0861aa0) + + * nxagent: clarify sleep time units + +2020-06-29 21:59:32 +0200 Mike Gabriel (4213bf46c) + + * Merge branch 'uli42-pr/extend_manpage' into 3.6.x + +2020-06-02 23:18:34 +0200 Ulrich Sibiller (470228698) + + * Args.c: adapt message to use same format as similar messages + +2020-06-02 23:18:07 +0200 Ulrich Sibiller (23f18a825) + + * manpage: document copysize parameter + +2020-06-02 23:17:07 +0200 Ulrich Sibiller (536c849fa) + + * manpage and usage output: add -irlimit + +2020-06-02 22:51:12 +0200 Ulrich Sibiller (70d4f9117) + + * Extend some manpage entries + +2020-06-29 21:54:02 +0200 Mike Gabriel (16cfb8d33) + + * Merge branch 'uli42-pr/hint_on_current_builds' into 3.6.x + +2020-06-18 18:17:00 +0200 Ulrich Sibiller (a2549e27c) + + * README.md: Add a "Binary Builds" section + +2020-05-31 12:59:09 +0200 Mike Gabriel (a593481b3) + + * release 3.5.99.24 (tag: 3.5.99.24) 2020-05-31 12:53:30 +0200 Mike Gabriel (3f7bb584e) diff --git a/VERSION b/VERSION index 97b1b09c1..e6e337051 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.5.99.24 +3.5.99.25 diff --git a/debian/changelog b/debian/changelog index 7e3bb2e48..2d53e2fad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +nx-libs (2:3.5.99.25-0) unstable; urgency=medium + + * Upstream-provided Debian package for nx-libs. + See upstream ChangeLog for recent changes. + + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Wed, 04 Nov 2020 13:43:53 +0100 + nx-libs (2:3.5.99.24-0) unstable; urgency=medium * Upstream-provided Debian package for nx-libs. diff --git a/nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb b/nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb index 3ee4fc716..9c08d6237 100644 Binary files a/nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb and b/nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb differ diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 index 6b3ade715..e6fad9ba5 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 "May 2020" "Version 3.5.99.24" "NX Agent (Xserver)" +.TH nxagent 1 "Nov 2020" "Version 3.5.99.25" "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 7886be14d..13538c4af 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -10,7 +10,7 @@ %endif Name: nx-libs -Version: 3.5.99.24 +Version: 3.5.99.25 Release: 0.0build1%{?dist} Summary: NX X11 protocol compression libraries @@ -643,5 +643,5 @@ sed -i '1 s/python/python3/' %{buildroot}%{_bindir}/nxdialog %{_datadir}/man/man1/nxdialog.1* %changelog -* Sun May 31 2020 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> 3.5.99.24 +* Sun May 31 2020 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> 3.5.99.25 - See upstream ChangeLog and debian/changelog for details. diff --git a/nxdialog/bin/nxdialog b/nxdialog/bin/nxdialog index c08ad86ef..42dba964a 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.24 only uses yesno, ok, pulldown and yesnosuspend + # nxagent 3.5.99.25 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.24 + # -class, -local, -allowmultiple are unused in nxlibs 3.5.99.25 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 881eca528..f8cdda737 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 "May 2020" "Version 3.5.99.24" "NX Dialog" +.TH nxdialog 1 "Nov 2020" "Version 3.5.99.25" "NX Dialog" .SH NAME nxdialog \- NX Dialog Helper .SH SYNOPSIS diff --git a/nxproxy/man/nxproxy.1 b/nxproxy/man/nxproxy.1 index f25968a68..9a145d2c0 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 "May 2020" "Version 3.5.99.24" "NX Proxy" +.TH nxproxy 1 "Nov 2020" "Version 3.5.99.25" "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
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch 3.6.x in repository nx-libs. commit 252b86ee23cf110e7aef2c3605c5be7ff1cd5a69 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 3 17:05:52 2020 +0100 NXdixfonts.c: Hard-code the enablement of NXAGENT_DANGEROUS_XFONT_LOOP_EXIT. --- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 8ec4145f0..547dac3f4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -91,6 +91,13 @@ static Bool doListFontsAndAliases(ClientPtr client, LFclosurePtr c); #undef TEST #undef DEBUG +/* This enables code that contains copies of code from libXfont. + * We copy+pasted the private _LFWIData type struct into this + * file. If this gets ever changed in libXfont, we must follow-up + * on that change here, too. + */ +#define NXAGENT_DANGEROUS_XFONT_LOOP_EXIT + #define NXFONTPATHLENGTH 1024 char _NXFontPath[NXFONTPATHLENGTH]; -- 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 3.6.x in repository nx-libs. commit ad275d50720fbbaf65bc0668eed0297df5d27cad Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 3 01:00:59 2020 +0100 Events.c: fix leftover DEBUG and TEST definitions causing DEBUG output in regular builds. --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 2487db69f..332cb2f32 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -3135,9 +3135,6 @@ int nxagentCheckWindowConfiguration(XConfigureEvent* X) return 1; } -#define DEBUG -#define TEST - int nxagentHandleConfigureNotify(XEvent* X) { #ifdef DEBUG @@ -3153,7 +3150,7 @@ int nxagentHandleConfigureNotify(XEvent* X) fprintf(stderr, "%s: References:\n", __func__); fprintf(stderr, "%s: DefaultWindow[0]: [0x%x]\n", __func__, nxagentDefaultWindows[0]); fprintf(stderr, "%s: DefaultRootWindow(DISPLAY) [0x%lx]\n", __func__, DefaultRootWindow(nxagentDisplay)); -#endif + #endif if (nxagentOption(Rootless) == True) { -- 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 3.6.x in repository nx-libs. commit 5ca9a6b1e0f51b3ff65d1b5d8010ec5a71432078 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Nov 4 13:51:16 2020 +0100 NXdixfonts.c: Regression fix for db45683a. Fix typo in libXfont1 function call (FreeFontName -> FreeFontNames). Fixes FTBFS on Ubuntu 14.04 and 16.04. --- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 547dac3f4..e222842b8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -1353,7 +1353,7 @@ finish: #ifdef HAS_XFONT2 xfont2_free_font_names(data->names); #else - FreeFontName(data->names); + FreeFontNames(data->names); #endif free(data); } -- 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 3.6.x in repository nx-libs. commit d5a3b440130257e08f7e507eae711885b4f4db50 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Dec 10 10:24:29 2020 +0100 CVE-2020-14360: Check SetMap request length carefully. Backported from X.org: From 446ff2d3177087b8173fa779fa5b77a2a128988b Mon Sep 17 00:00:00 2001 From: Matthieu Herrb <matthieu@herrb.eu> Date: Thu, 12 Nov 2020 19:15:07 +0100 Subject: [PATCH] Check SetMap request length carefully. Avoid out of bounds memory accesses on too short request. ZDI-CAN 11572 / CVE-2020-14360 This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Fixes ArcticaProject/nx-libs#972. --- nx-X11/programs/Xserver/xkb/xkb.c | 91 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 7b392fa09..654b33fe7 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -2202,6 +2202,92 @@ XkbServerMapPtr srv = xkbi->desc->server; return (char *)wire; } +#define _add_check_len(new) \ + if (len > UINT32_MAX - (new) || len > req_len - (new)) goto bad; \ + else len += new + +/** + * Check the length of the SetMap request + */ +static int +_XkbSetMapCheckLength(xkbSetMapReq *req) +{ + size_t len = sz_xkbSetMapReq, req_len = req->length << 2; + xkbKeyTypeWireDesc *keytype; + xkbSymMapWireDesc *symmap; + BOOL preserve; + int i, map_count, nSyms; + + if (req_len < len) + goto bad; + /* types */ + if (req->present & XkbKeyTypesMask) { + keytype = (xkbKeyTypeWireDesc *)(req + 1); + for (i = 0; i < req->nTypes; i++) { + _add_check_len(XkbPaddedSize(sz_xkbKeyTypeWireDesc)); + if (req->flags & XkbSetMapResizeTypes) { + _add_check_len(keytype->nMapEntries + * sz_xkbKTSetMapEntryWireDesc); + preserve = keytype->preserve; + map_count = keytype->nMapEntries; + if (preserve) { + _add_check_len(map_count * sz_xkbModsWireDesc); + } + keytype += 1; + keytype = (xkbKeyTypeWireDesc *) + ((xkbKTSetMapEntryWireDesc *)keytype + map_count); + if (preserve) + keytype = (xkbKeyTypeWireDesc *) + ((xkbModsWireDesc *)keytype + map_count); + } + } + } + /* syms */ + if (req->present & XkbKeySymsMask) { + symmap = (xkbSymMapWireDesc *)((char *)req + len); + for (i = 0; i < req->nKeySyms; i++) { + _add_check_len(sz_xkbSymMapWireDesc); + nSyms = symmap->nSyms; + _add_check_len(nSyms*sizeof(CARD32)); + symmap += 1; + symmap = (xkbSymMapWireDesc *)((CARD32 *)symmap + nSyms); + } + } + /* actions */ + if (req->present & XkbKeyActionsMask) { + _add_check_len(req->totalActs * sz_xkbActionWireDesc + + XkbPaddedSize(req->nKeyActs)); + } + /* behaviours */ + if (req->present & XkbKeyBehaviorsMask) { + _add_check_len(req->totalKeyBehaviors * sz_xkbBehaviorWireDesc); + } + /* vmods */ + if (req->present & XkbVirtualModsMask) { + _add_check_len(XkbPaddedSize(Ones(req->virtualMods))); + } + /* explicit */ + if (req->present & XkbExplicitComponentsMask) { + /* two bytes per non-zero explicit componen */ + _add_check_len(XkbPaddedSize(req->totalKeyExplicit * sizeof(CARD16))); + } + /* modmap */ + if (req->present & XkbModifierMapMask) { + /* two bytes per non-zero modmap component */ + _add_check_len(XkbPaddedSize(req->totalModMapKeys * sizeof(CARD16))); + } + /* vmodmap */ + if (req->present & XkbVirtualModMapMask) { + _add_check_len(req->totalVModMapKeys * sz_xkbVModMapWireDesc); + } + if (len == req_len) + return Success; +bad: + ErrorF("[xkb] BOGUS LENGTH in SetMap: expected %ld got %ld\n", + len, req_len); + return BadLength; +} + int ProcXkbSetMap(ClientPtr client) { @@ -2225,6 +2311,11 @@ ProcXkbSetMap(ClientPtr client) CHK_KBD_DEVICE(dev,stuff->deviceSpec); CHK_MASK_LEGAL(0x01,stuff->present,XkbAllMapComponentsMask); + /* first verify the request length carefully */ + rc = _XkbSetMapCheckLength(stuff); + if (rc != Success) + return rc; + XkbSetCauseXkbReq(&cause,X_kbSetMap,client); xkbi= dev->key->xkbInfo; xkb = xkbi->desc; -- 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 3.6.x in repository nx-libs. commit de5eb54c65a15949e9631ded61d1ca5e16f7c8e1 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 19:20:56 2020 +0100 nxagent: make Fullscreen and AllScreens Booleans There's no need/sense in having a tri-state with the third state being UNDEFINED. --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 14 ++------------ nx-X11/programs/Xserver/hw/nxagent/Events.c | 18 +++++++++--------- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 12 ++++++------ nx-X11/programs/Xserver/hw/nxagent/Options.c | 3 ++- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 13 ++++++++----- nx-X11/programs/Xserver/hw/nxagent/Window.c | 4 ++-- 6 files changed, 29 insertions(+), 35 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 1ae1b570b..554f7ae38 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -589,7 +589,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) } } - if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen) == 1)) + if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen))) { return 2; } @@ -1749,7 +1749,7 @@ N/A #endif - if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen) == 1) + if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen)) { #ifdef TEST fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); @@ -1974,16 +1974,6 @@ N/A * Set the other defaults. */ - if (nxagentOption(Fullscreen) == UNDEFINED) - { - nxagentChangeOption(Fullscreen, False); - } - - if (nxagentOption(AllScreens) == UNDEFINED) - { - nxagentChangeOption(AllScreens, False); - } - if (nxagentOption(Binder) == UNDEFINED) { nxagentChangeOption(Binder, False); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 332cb2f32..471e3f6a1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -575,7 +575,7 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE); - if (nxagentOption(Fullscreen) == 0) + if (!nxagentOption(Fullscreen)) { nxagentSetWMNormalHintsMaxsize(pScreen, nxagentOption(RootWidth), @@ -1724,7 +1724,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already nxagentScreenTrap = False; } - if (nxagentOption(Fullscreen) == 1 && + if (nxagentOption(Fullscreen) && X.xcrossing.window == nxagentFullscreenWindow && X.xcrossing.detail != NotifyInferior) { @@ -2057,7 +2057,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentOption(AllScreens) == 1) + if (nxagentOption(AllScreens)) { if (X.xmap.window == nxagentIconWindow) { @@ -2066,7 +2066,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { nxagentVisibility = VisibilityUnobscured; nxagentVisibilityStop = False; @@ -2185,7 +2185,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (switchFullscreen) { - if (nxagentOption(AllScreens) == 1 && nxagentOption(Fullscreen) == 1) + if (nxagentOption(AllScreens) && nxagentOption(Fullscreen)) { nxagentSwitchAllScreens(pScreen, 0); } @@ -2197,7 +2197,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (switchAllScreens) { - if (nxagentOption(AllScreens) == 0 && nxagentOption(Fullscreen) == 1) + if (!nxagentOption(AllScreens) && nxagentOption(Fullscreen)) { nxagentSwitchFullscreen(pScreen, False); } @@ -3291,7 +3291,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 @@ -3409,7 +3409,7 @@ int nxagentHandleConfigureNotify(XEvent* X) XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, X -> xconfigure.width, X -> xconfigure.height); - if (nxagentOption(Fullscreen) == 0) + if (!nxagentOption(Fullscreen)) { /* FIXME: has already been done some lines above */ nxagentMoveViewport(pScreen, 0, 0); @@ -3592,7 +3592,7 @@ int nxagentHandleReparentNotify(XEvent* X) return 1; } - else if (nxagentWMIsRunning && nxagentOption(Fullscreen) == 0 && + else if (nxagentWMIsRunning && !nxagentOption(Fullscreen) && nxagentOption(WMBorderWidth) == -1) { /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 52c3b0375..835d05d19 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -393,7 +393,7 @@ void nxagentRandRSetWindowsSize(int width, int height) { if (width == 0) { - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } @@ -405,7 +405,7 @@ void nxagentRandRSetWindowsSize(int width, int height) if (height == 0) { - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } @@ -430,7 +430,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, UpdateCurrentTime(); if (nxagentOption(DesktopResize) == 1 && - (nxagentOption(Fullscreen) == 1 || + (nxagentOption(Fullscreen) || width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) || height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)))) { @@ -441,8 +441,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, } } - if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 && - nxagentOption(AllScreens) == 0) + if (nxagentOption(DesktopResize) == 1 && !nxagentOption(Fullscreen) && + !nxagentOption(AllScreens)) { nxagentChangeOption(Width, width); nxagentChangeOption(Height, height); @@ -451,7 +451,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True); if (result == 1 && nxagentOption(DesktopResize) == 1 && - nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0) + !nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) { nxagentRandRSetWindowsSize(width, height); nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index 0da504f06..660aa9a4d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -62,7 +62,8 @@ void nxagentInitOptions(void) nxagentOptions.Desktop = UNDEFINED; nxagentOptions.Persistent = 1; nxagentOptions.Rootless = UNDEFINED; - nxagentOptions.Fullscreen = UNDEFINED; + nxagentOptions.Fullscreen = False; + nxagentOptions.AllScreens = False; nxagentOptions.NoRootlessExit = False; nxagentOptions.X = 0; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 148f9e1dd..f5aa11e5f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -800,6 +800,9 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix) fprintf(stderr, "%s | Fullscreen is %s.\n", prefix, nxagentOption(Fullscreen) ? "ON" : "OFF"); + fprintf(stderr, "%s | AllScreens is %s.\n", prefix, + nxagentOption(AllScreens) ? "ON" : "OFF"); + fprintf(stderr, "%s | Desktop resize mode is %s.\n", prefix, nxagentOption(DesktopResize) ? "ON" : "OFF"); @@ -1664,13 +1667,13 @@ N/A .colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)) }; - if (nxagentOption(AllScreens) == 1) + if (nxagentOption(AllScreens)) { valuemask |= CWOverrideRedirect; attributes.override_redirect = True; } - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { if (nxagentReconnectTrap) { @@ -1833,7 +1836,7 @@ N/A sizeHints->width = nxagentOption(RootWidth); sizeHints->height = nxagentOption(RootHeight); - if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) + if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen)) { sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -2362,7 +2365,7 @@ 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); @@ -2566,7 +2569,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) return -1; } - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 2dea31af0..ab61c101b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -2500,7 +2500,7 @@ void nxagentRefreshWindows(WindowPtr pWin) void nxagentUnmapWindows(void) { - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { for (int i = 0; i < screenInfo.numScreens; i++) { @@ -2556,7 +2556,7 @@ void nxagentMapDefaultWindows(void) XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); - if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning) + if (nxagentOption(Fullscreen) && nxagentWMIsRunning) { nxagentMaximizeToFullScreen(pScreen); } -- 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 3.6.x in repository nx-libs. commit 89b37de7c923337cc403480e6db44000bdd0674a Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Jan 12 22:11:49 2021 +0100 Init.c: Initialize nxagentGrabServerInfo Fixes ArcticaProject/nx-libs#983 --- nx-X11/programs/Xserver/hw/nxagent/Init.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index b06d8e239..4e2b28a59 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -610,7 +610,14 @@ void OsVendorEndRedirectErrorFFunction(void) nxagentEndRedirectToClientsLog(); } -ServerGrabInfoRec nxagentGrabServerInfo; + +/* + * In an uninialized nxagentGrabServerInfo .grabstate is 0 which is the + * value of SERVER_GRABBED. Therefore we need to initialize .grabstate + * with SERVER_UNGRABBED. A check in Screen.c would go wrong + * otherwise. + */ +ServerGrabInfoRec nxagentGrabServerInfo = {.grabstate = SERVER_UNGRABBED, .client = NULL}; static void nxagentGrabServerCallback(CallbackListPtr *callbacks, void *data, void *args) -- 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 3.6.x in repository nx-libs. commit e7d5ba4e5a5394633dbd3ce5a3fd5314309bc641 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 14:36:23 2020 +0100 Handlers.c: ensure regular yields if suspended Fixes ArcticaProject/nx-libs#903 --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 9f0a3c9d9..62974b9c1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -1070,7 +1070,28 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) * into the inner dispatch loop forever. */ - if (!SmartScheduleSignalEnable) + /* + * The behaviour described in the comment above also happens with the + * smart scheduler if all of the following conditions are met: + * - the agent is suspended + * - SleepTimeMillis is set (the default is sufficient to trigger this) + * - a client is doing a lot of image operations + * - nxagentShadowCounter is 0 + * In that case the agent will slow down the image operations by calling + * an intermediate sleep resulting in the client's request queue never + * being empty. Which in turn leads to the drain loop described above. + * isItTimeToYield will then never be set. The (dramatic) result of this + * is that nxagent will not process any signals and therefore cannot be + * resumed anymore! + * For this reason we do not limit below code to the dumb scheduler but also + * run it if above conditions are met - ensuring regular yields. + * See issue #903 + */ + + if (!SmartScheduleSignalEnable || + (nxagentShadowCounter == 0 && + NXDisplayError(nxagentDisplay) == 1 && + nxagentOption(SleepTimeMillis) > 0)) { if (client -> index != nxagentDispatch.client) { -- 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 3.6.x in repository nx-libs. commit d545afdf3967b0305c1215bb9f8a545b81fc24e8 Merge: d5a3b4401 e7d5ba4e5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Jan 15 15:48:49 2021 +0100 Merge branch 'uli42-pr/fix_resume' into 3.6.x Attributes GH PR #977: https://github.com/ArcticaProject/nx-libs/pull/977 nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) -- 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 3.6.x in repository nx-libs. commit a85adf5ea25ed8c3b7f72ffbd04cda0122f1b5a1 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 19:27:15 2020 +0100 nxagent: treat DesktopResize and nxagentResizeDesktopAtStartup as Booleans The already where Booleans but where not using True/False values everywhere --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Events.c | 10 +++++----- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 8 ++++---- nx-X11/programs/Xserver/hw/nxagent/Options.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Window.c | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 554f7ae38..6d63f768a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1220,13 +1220,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 { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 471e3f6a1..f2f9c5119 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -569,7 +569,7 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentChangeOption(DesktopResize, !desktopResize); - if (nxagentOption(DesktopResize) == 0) + if (!nxagentOption(DesktopResize)) { fprintf(stderr,"Info: Disabled desktop resize mode in agent.\n"); @@ -607,7 +607,7 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen) nxagentChangeOption(DesktopResize, !desktopResize); - if (nxagentOption(DesktopResize) == 0) + if (!nxagentOption(DesktopResize)) { nxagentShadowSetRatio(1.0, 1.0); @@ -1229,7 +1229,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentOption(DesktopResize) == False && + if (!nxagentOption(DesktopResize) && (X.xbutton.state & (ControlMask | Mod1Mask)) == (ControlMask | Mod1Mask)) { /* @@ -3303,7 +3303,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 || @@ -3369,7 +3369,7 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentChangeOption(Y, newY); } - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 && + if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) && (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height)) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 835d05d19..77f2d6b38 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -429,7 +429,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, { UpdateCurrentTime(); - if (nxagentOption(DesktopResize) == 1 && + if (nxagentOption(DesktopResize) && (nxagentOption(Fullscreen) || width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) || height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)))) @@ -437,11 +437,11 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, if (nxagentOption(ClientOs) != ClientOsWinnt /*&& nxagentOption(ClientOs) != ClientNXPlayer*/) { - nxagentChangeOption(DesktopResize, 0); + nxagentChangeOption(DesktopResize, False); } } - if (nxagentOption(DesktopResize) == 1 && !nxagentOption(Fullscreen) && + if (nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) { nxagentChangeOption(Width, width); @@ -450,7 +450,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True); - if (result == 1 && nxagentOption(DesktopResize) == 1 && + if (result == 1 && nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) { nxagentRandRSetWindowsSize(width, height); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index 660aa9a4d..d4a7479e3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -108,7 +108,7 @@ void nxagentInitOptions(void) nxagentOptions.ViewportXSpan = 0; nxagentOptions.ViewportYSpan = 0; - nxagentOptions.DesktopResize = 1; + nxagentOptions.DesktopResize = True; nxagentOptions.Ratio = DONT_SCALE; nxagentOptions.XRatio = DONT_SCALE; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index f5aa11e5f..d8f79f015 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -966,7 +966,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) if (nxagentOption(Fullscreen) && nxagentWMIsRunning && nxagentReconnectTrap && - nxagentResizeDesktopAtStartup == False && + !nxagentResizeDesktopAtStartup && nxagentXServerGeometryChanged()) { #ifdef TEST @@ -1836,7 +1836,7 @@ N/A sizeHints->width = nxagentOption(RootWidth); sizeHints->height = nxagentOption(RootHeight); - if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen)) + if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen)) { sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -4399,7 +4399,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/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index ab61c101b..f1c21e12c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -901,7 +901,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e); nxagentFullscreenWindow = w; - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize)) { if (nxagentOption(Shadow) == 0) { @@ -952,7 +952,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentIconWindow = nxagentFullscreenWindow = None; - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize)) { nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); @@ -998,7 +998,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) == 1 && nxagentOption(DesktopResize)) { nxagentShadowAdaptToRatio(); } -- 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 3.6.x in repository nx-libs. commit 7b299a4ce6537947a9e2bddc4599e07c7bf2627c Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 21:22:40 2020 +0100 Options.h: mark Booleans Many variables are used as Booleans. By adding the Bool define to Options.h we can now make that visible. --- nx-X11/programs/Xserver/hw/nxagent/Options.h | 58 +++++++++++++++------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h index e56860f04..a99f4aee2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -26,6 +26,12 @@ #ifndef __Options_H__ #define __Options_H__ +/* Bool is defined in Xlib.h but we do not want to include that here, so let's + clone the definition */ +#ifndef Bool +#define Bool int +#endif + #ifndef True #define True 1 #endif @@ -122,33 +128,33 @@ typedef struct _AgentOptions /* * Is agent running in desktop mode? This is presently the default. */ - int Desktop; + Bool Desktop; /* * True if user activated rootless mode. */ - int Rootless; + Bool Rootless; /* * True for shadow mode. */ - int Shadow; + Bool Shadow; /* * True if user activated persistent mode. */ - int Persistent; + Bool Persistent; /* * True if user activated fullscreen mode. */ - int Fullscreen; + Bool Fullscreen; /* * True if the fullscreen NX session will extend on all available * screens. */ - int AllScreens; + Bool AllScreens; /* * Set to the auto-disconnect timeout, if the user activated this @@ -176,7 +182,7 @@ typedef struct _AgentOptions /* * Set if agent is running nested in another agent X server. */ - int Nested; + Bool Nested; /* * Selected backing-store mode. @@ -192,12 +198,12 @@ typedef struct _AgentOptions * Enable agent to use the MITSHM extension in path from remote * proxy to the real X server. */ - int SharedMemory; + Bool SharedMemory; /* * Enable agent to use shared Pixmaps */ - int SharedPixmaps; + Bool SharedPixmaps; /* * Enable agent to propagate keyboard and pointer device @@ -214,12 +220,12 @@ typedef struct _AgentOptions * Resuming keyboard device corrects keymap if session migrates * across platforms with different keycode layout. */ - int ResetKeyboardAtResume; + Bool ResetKeyboardAtResume; /* * Reset server when the last client disconnects. */ - int Reset; + Bool Reset; /* * Geometry of the agent root window, relative to the agent default @@ -236,7 +242,7 @@ typedef struct _AgentOptions * True if the user can resize the desktop by dragging the window * border. */ - int DesktopResize; + Bool DesktopResize; /* * The scaling ratio of the shadow agent. @@ -248,19 +254,19 @@ typedef struct _AgentOptions /* * The shadow agent uses the Damage extension. */ - int UseDamage; + Bool UseDamage; /* * Was the agent run with the -B option? */ - int Binder; + Bool Binder; char *BinderOptions; /* * Set if the agent has to connect to a desktop manager to start the * session. */ - int Xdmcp; + Bool Xdmcp; /* * Size of the Xlib display buffer. The default is set according to @@ -276,31 +282,31 @@ typedef struct _AgentOptions /* * Use the composite extension when available on the remote display. */ - int Composite; + Bool Composite; /* * If set, don't skip internal operations when the agent window is * not fully visible. */ - int IgnoreVisibility; + Bool IgnoreVisibility; /* * If set, prevent the shadow session to interact with master * display. */ - int ViewOnly; + Bool ViewOnly; /* * If true select a lossy or lossless compression method based on * the characteristics of the image. */ - int Adaptive; + Bool Adaptive; /* * Stream the images and update the display when the image has been * completely transerred. */ - int Streaming; + Bool Streaming; /* * Use a lazy approach in updating the remote display. This means @@ -323,12 +329,12 @@ typedef struct _AgentOptions /* * Enabling/disabling the pulldown menu. */ - int Menu; + Bool Menu; /* * Enabling/disabling the magic pixel. */ - int MagicPixel; + Bool MagicPixel; /* * Specify the Operative System of the client. @@ -338,7 +344,7 @@ typedef struct _AgentOptions /* * Inhibit some XKEYBOARD requests. */ - int InhibitXkb; + Bool InhibitXkb; /* * Maximum number of bytes that can be pasted from an NX session @@ -355,7 +361,7 @@ typedef struct _AgentOptions * True if agent should not exit if there are no clients in rootless * mode */ - int NoRootlessExit; + Bool NoRootlessExit; /* * Store if the user wants Xinerama. There are variables called @@ -365,7 +371,7 @@ typedef struct _AgentOptions * the user preference provided by the -/+(rr)xinerama parameter(s) * before initializing those extensions. */ - int Xinerama; + Bool Xinerama; /* * Sleep delay in milliseconds. @@ -386,7 +392,7 @@ typedef struct _AgentOptions * True if agent should grab the input in windowed mode whenever the * agent window gets the focus */ - int AutoGrab; /* Should be Bool but I do not want to include Xlib.h here */ + Bool AutoGrab; } AgentOptionsRec; -- 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 3.6.x in repository nx-libs. commit 42f76ddeefb18c6e5120d10abc3e13354ff543a0 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:25:22 2020 +0100 nxagent: make nxagentVerbose a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Error.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Error.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Font.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 52aa055fc..7902e441d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -178,7 +178,7 @@ static void nxagentParseOptionString(char*); static int nxagentGetDialogName(void); -char nxagentVerbose = 0; +Bool nxagentVerbose = False; char *nxagentKeystrokeFile = NULL; @@ -964,7 +964,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-verbose")) { - nxagentVerbose = 1; + nxagentVerbose = True; return 1; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.c b/nx-X11/programs/Xserver/hw/nxagent/Error.c index add5fae85..8c9a52d2e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c @@ -106,7 +106,7 @@ static int nxagentPrintError(Display *dpy, XErrorEvent *event, FILE *fp); int nxagentErrorHandler(Display *dpy, XErrorEvent *event) { - if (nxagentVerbose == 1) + if (nxagentVerbose) { nxagentPrintError(dpy, event, stderr); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.h b/nx-X11/programs/Xserver/hw/nxagent/Error.h index 9f5cfef74..76f120ff3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.h @@ -32,7 +32,7 @@ extern char *nxagentClientsLogName; -extern char nxagentVerbose; +extern Bool nxagentVerbose; int nxagentErrorHandler(Display *dpy, XErrorEvent *event); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 5eef6c0a4..b854bf29b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1959,7 +1959,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (nxagentExposeQueue.exposures[nxagentExposeQueue.start].serial != X.xconfigure.x) { #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "%s: Requested ConfigureNotify changes didn't take place.\n", __func__); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index dcbd6949a..0ce5b87ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -750,7 +750,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP if (numFontFields <= FIELDS) { #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Font name in non standard format.\n"); } @@ -817,7 +817,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP } #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Failed to load font '%s'. Replacing with '%s'.\n", fontName, substFontBuf); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 9807a8e3b..ed1e673a8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -598,7 +598,7 @@ Bool nxagentReconnectSession(void) if (nxagentResetKeyboard() == 0) { #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "%s: Failed to reset keyboard device.\n", __func__); } @@ -699,7 +699,7 @@ nxagentReconnectError: if (*nxagentGetReconnectError() == '\0') { #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "nxagentReconnectSession: WARNING! The reconnect error message is not set. Failed step is [%d].\n", failedStep); -- 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 3.6.x in repository nx-libs. commit f6cebfd8560c93149924c1c5668e105b0bc7990d Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 21:21:19 2020 +0100 nxagent: make nxagentOption Shadow a Boolean and add the missing init code. --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 14 +++++++------- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Events.c | 14 +++++++------- nx-X11/programs/Xserver/hw/nxagent/Image.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 1 + nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 8 ++++---- 9 files changed, 26 insertions(+), 25 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 3505c9319..76669e39e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -507,7 +507,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); @@ -830,7 +830,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-S")) { - nxagentChangeOption(Shadow, 1); + nxagentChangeOption(Shadow, True); nxagentChangeOption(DeferLevel, 0); nxagentChangeOption(Persistent, False); return 1; @@ -1749,7 +1749,7 @@ N/A #endif - if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen)) + if ((nxagentOption(Rootless) == True) && nxagentOption(Fullscreen)) { #ifdef TEST fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); @@ -2029,7 +2029,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. nxagentAlphaEnabled = False; } - if ((nxagentOption(Rootless) == 1) && nxagentOption(Xdmcp)) + if ((nxagentOption(Rootless) == True) && nxagentOption(Xdmcp)) { FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n"); } @@ -2353,7 +2353,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"); @@ -2368,7 +2368,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"); @@ -2472,7 +2472,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/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index bdbf4fcf8..4d643a97e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -799,7 +799,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)) { @@ -852,7 +852,7 @@ nxagentSynchronizeRegionStop: success = 1; - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { if (nxagentSynchronization.abort == 1) { @@ -921,7 +921,7 @@ nxagentSynchronizeRegionStop: int w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1; int h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1; - if (nxagentOption(Shadow) == 1 && + if (nxagentOption(Shadow) && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE)) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 88375cbe1..9d58e814b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1043,7 +1043,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } case doSwitchResizeMode: { - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { if (nxagentNoDialogIsRunning) { @@ -1097,7 +1097,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentRemoveDuplicatedKeys(&X); } - if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) == 1 && result == doNothing) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && result == doNothing) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1492,7 +1492,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already NXShadowEvent(nxagentDisplay, X); } - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentInputEvent = 1; } @@ -3369,7 +3369,7 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentChangeOption(Y, newY); } - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) && + if (nxagentOption(Shadow) && nxagentOption(DesktopResize) && (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height)) { @@ -3397,7 +3397,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) && @@ -4323,7 +4323,7 @@ int nxagentUserInput(void *p) * eventually change the nxagentInputEvent status. */ - if (nxagentOption(Shadow) == 1 && + if (nxagentOption(Shadow) && nxagentPendingEvents(nxagentDisplay) > 0) { nxagentDispatchEvents(NULL); @@ -4342,7 +4342,7 @@ int nxagentUserInput(void *p) * browser's page), in order to update the screen smoothly. */ - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow)) { return result; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index 946cb7bf8..79d8c365f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -925,7 +925,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int 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) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 14d811877..c9c9bb33b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -776,7 +776,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 bbc30ee01..6573ac0b9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -575,7 +575,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/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index dd474e3dd..c9b07db97 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -62,6 +62,7 @@ void nxagentInitOptions(void) nxagentOptions.Desktop = UNDEFINED; nxagentOptions.Persistent = True; nxagentOptions.Rootless = UNDEFINED; + nxagentOptions.Shadow = False; nxagentOptions.Fullscreen = False; nxagentOptions.AllScreens = False; nxagentOptions.NoRootlessExit = False; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 316d147ac..07f57621e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -97,7 +97,7 @@ while (0) nxagentUserInput(NULL) == 1) #define canBreakOnTimeout(mask) \ - (((mask) != NEVER_BREAK) && nxagentOption(Shadow) == 0) + (((mask) != NEVER_BREAK) && !nxagentOption(Shadow)) /* * Macros defining the conditions to diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index f1c21e12c..592d76dfd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -903,7 +903,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) if (nxagentOption(DesktopResize)) { - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), True); @@ -957,7 +957,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentOption(RootHeight), True); @@ -998,7 +998,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentChangeOption(Width, nxagentOption(SavedWidth)); nxagentChangeOption(Height, nxagentOption(SavedHeight)); - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize)) + if (nxagentOption(Shadow) && nxagentOption(DesktopResize)) { nxagentShadowAdaptToRatio(); } @@ -2547,7 +2547,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", -- 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 3.6.x in repository nx-libs. commit 2b4ccc30a7c35593cdd0ec9c19f74cc8217d2a94 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 20:07:57 2020 +0100 nxagent: treat several nxagentOptions as real Booleans Adaptive, Composite, DeviceControl, DeviceControlUserDefined, IgnoreVisibility, InhibitXkb, Nested, Menu, MagicPixel, Persistent, Reset, ResetzKeyboardAtResume, SharedMemory, SharedPixmaps, Streaming, UseDamage, ViewOnly, Xdmcp, Xinerama --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 56 ++++++++++++------------- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Client.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 18 ++++---- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 8 ++-- nx-X11/programs/Xserver/hw/nxagent/Init.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 38 ++++++++--------- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 6 +-- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 4 +- 16 files changed, 77 insertions(+), 77 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 6d63f768a..3505c9319 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -488,11 +488,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) { if (!strcmp(argv[i], "0")) { - nxagentChangeOption(Streaming, 0); + nxagentChangeOption(Streaming, False); } else { - nxagentChangeOption(Streaming, 1); + nxagentChangeOption(Streaming, True); } return 2; } @@ -670,7 +670,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-nomagicpixel")) { - nxagentChangeOption(MagicPixel, 0); + nxagentChangeOption(MagicPixel, False); return 1; } @@ -725,13 +725,13 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-nocomposite")) { - nxagentChangeOption(Composite, 0); + nxagentChangeOption(Composite, False); return 1; } if (!strcmp(argv[i], "-nodamage")) { - nxagentChangeOption(UseDamage, 0); + nxagentChangeOption(UseDamage, False); return 1; } @@ -779,7 +779,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-noignore")) { nxagentChangeOption(DeviceControl, True); - nxagentChangeOption(DeviceControlUserDefined , True); + nxagentChangeOption(DeviceControlUserDefined, True); return 1; } @@ -791,7 +791,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-noxkblock")) { - nxagentChangeOption(InhibitXkb, 0); + nxagentChangeOption(InhibitXkb, False); return 1; } @@ -832,7 +832,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) { nxagentChangeOption(Shadow, 1); nxagentChangeOption(DeferLevel, 0); - nxagentChangeOption(Persistent, 0); + nxagentChangeOption(Persistent, False); return 1; } @@ -858,11 +858,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) { if (!strcmp(argv[i], "0")) { - nxagentChangeOption(ViewOnly, 1); + nxagentChangeOption(ViewOnly, True); } else { - nxagentChangeOption(ViewOnly, 0); + nxagentChangeOption(ViewOnly, False); } return 2; } @@ -998,7 +998,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) * has been disabled on the cmdline. */ if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); return 0; } @@ -1174,11 +1174,11 @@ static void nxagentParseSingleOption(char *name, char *value) { if (!strcmp(value, "1")) { - nxagentChangeOption(Composite, 1); + nxagentChangeOption(Composite, True); } else if (!strcmp(value, "0")) { - nxagentChangeOption(Composite, 0); + nxagentChangeOption(Composite, False); } else { @@ -1190,25 +1190,25 @@ static void nxagentParseSingleOption(char *name, char *value) else if (!strcmp(name, "xinerama")) { #if !defined(PANORAMIX) && !defined(RANDR) - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); fprintf(stderr, "Warning: No Xinerama support compiled into %s.\n", nxagentProgName); return; #else if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) { - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", nxagentProgName); return; } if (!strcmp(value, "1")) { - nxagentChangeOption(Xinerama, 1); + nxagentChangeOption(Xinerama, True); return; } else if (!strcmp(value, "0")) { - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); } else { @@ -1251,11 +1251,11 @@ static void nxagentParseSingleOption(char *name, char *value) { if (!strcmp(value, "0")) { - nxagentChangeOption(Menu, 0); + nxagentChangeOption(Menu, False); } else { - nxagentChangeOption(Menu, 1); + nxagentChangeOption(Menu, True); } return; } @@ -1263,11 +1263,11 @@ static void nxagentParseSingleOption(char *name, char *value) { if (!strcmp(value, "0")) { - nxagentChangeOption(MagicPixel, 0); + nxagentChangeOption(MagicPixel, False); } else { - nxagentChangeOption(MagicPixel, 1); + nxagentChangeOption(MagicPixel, True); } return; } @@ -2038,7 +2038,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. * We enable server reset only for indirect XDMCP sessions. */ - if (nxagentOption(Reset) == True && nxagentMaxAllowedResets == 0) + if (nxagentOption(Reset) && nxagentMaxAllowedResets == 0) { #ifdef WARNING fprintf(stderr, "nxagentPostProcessArgs: Disabling the server reset.\n"); @@ -2054,7 +2054,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. * passing the -noreset option 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"); @@ -2166,7 +2166,7 @@ void nxagentSetPackMethod(void) if (nxagentOption(LinkType) == LINK_TYPE_NONE) { - nxagentChangeOption(Streaming, 0); + nxagentChangeOption(Streaming, False); nxagentPackMethod = PACK_NONE; nxagentPackLossless = PACK_NONE; @@ -2189,7 +2189,7 @@ void nxagentSetPackMethod(void) fprintf(stderr, "nxagentSetPackMethod: Using adaptive mode for image compression.\n"); #endif - nxagentChangeOption(Adaptive, 1); + nxagentChangeOption(Adaptive, True); } else { @@ -2197,7 +2197,7 @@ void nxagentSetPackMethod(void) fprintf(stderr, "nxagentSetPackMethod: Not using adaptive mode for image compression.\n"); #endif - nxagentChangeOption(Adaptive, 0); + nxagentChangeOption(Adaptive, False); } if (method == PACK_LOSSY || method == PACK_ADAPTIVE) @@ -2326,11 +2326,11 @@ void nxagentSetDeferLevel(void) * version of the agent. */ - if (nxagentOption(Streaming) == 1) + if (nxagentOption(Streaming)) { fprintf(stderr, "Warning: Streaming of images not available in this agent.\n"); - nxagentChangeOption(Streaming, 0); + nxagentChangeOption(Streaming, False); } switch (nxagentOption(LinkType)) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index 52c75e805..c15674f5e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -336,7 +336,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen) * server. */ - nxagentChangeOption(Nested, 1); + nxagentChangeOption(Nested, True); /* * Avoid the image degradation caused by diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.c b/nx-X11/programs/Xserver/hw/nxagent/Client.c index 83554e573..e0adef3bc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.c @@ -332,7 +332,7 @@ void nxagentGuessShadowHint(ClientPtr client, Atom property) * the windows updated. */ - nxagentChangeOption(IgnoreVisibility, 1); + nxagentChangeOption(IgnoreVisibility, True); } } } @@ -373,7 +373,7 @@ static void checkIfShadowAgent(ClientPtr client) fprintf(stderr, "nxagentCheckIfShadowAgent: The last shadow nxagent has been detached.\n"); #endif - nxagentChangeOption(IgnoreVisibility, 0); + nxagentChangeOption(IgnoreVisibility, False); } } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index af29f8ebc..45799051c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -57,7 +57,7 @@ void nxagentCompositeExtensionInit(void) nxagentCompositeEnable = 0; - if (nxagentOption(Composite) == 1) + if (nxagentOption(Composite)) { int eventBase, errorBase; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 9adc67a21..e3857043b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -312,7 +312,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/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index f2f9c5119..88375cbe1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1097,7 +1097,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentRemoveDuplicatedKeys(&X); } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) == 1 && result == doNothing) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1190,7 +1190,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already CriticalOutputPending = 1; - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1219,7 +1219,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already 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); @@ -1285,7 +1285,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already CriticalOutputPending = 1; } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xbutton.x -= nxagentOption(RootX); X.xbutton.y -= nxagentOption(RootY); @@ -1359,7 +1359,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already CriticalOutputPending = 1; } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xbutton.x -= nxagentOption(RootX); X.xbutton.y -= nxagentOption(RootY); @@ -1420,7 +1420,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already (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); } @@ -1474,7 +1474,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already 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); @@ -1609,7 +1609,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already x.u.u.detail = i * 8 + k; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { XEvent xM = {0}; xM.type = KeyRelease; @@ -2020,7 +2020,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && - nxagentOption(Nested) == 0 && + !nxagentOption(Nested) && X.xmap.window != nxagentIconWindow) { nxagentVisibility = VisibilityFullyObscured; diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 5cc29234a..b36550b9a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -698,7 +698,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * 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))) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 62974b9c1..b8c6ff18a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -648,7 +648,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 db174a9de..946cb7bf8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -524,7 +524,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, * window. */ - if (nxagentOption(IgnoreVisibility) == 0 && pDrawable -> type == DRAWABLE_WINDOW && + if (!nxagentOption(IgnoreVisibility) && pDrawable -> type == DRAWABLE_WINDOW && (nxagentWindowIsVisible((WindowPtr) pDrawable) == 0 || (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) { @@ -667,11 +667,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, we @@ -1284,7 +1284,7 @@ FIXME: There should be a callback registered by the agent that * lossless encoder will 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/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index b06d8e239..a7574ab14 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -518,7 +518,7 @@ FIXME: Do we need to check the key grab if the fprintf(stderr, "Info: Auto-terminating session with no client running.\n"); raise(SIGTERM); } - else if (nxagentOption(Persistent) == 0) + else if (!nxagentOption(Persistent)) { fprintf(stderr, "Info: Auto-terminating session with persistence not allowed.\n"); raise(SIGTERM); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index f91dc248d..bbc30ee01 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -330,7 +330,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio clientReady[0] = 0; - if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)) + if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0)) { #ifdef TEST fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n", @@ -343,7 +343,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 [%u].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index e72a37494..90d0e5f10 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; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index d4a7479e3..dd474e3dd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -60,7 +60,7 @@ void nxagentInitOptions(void) nxagentOptions.LinkType = UNDEFINED; nxagentOptions.Desktop = UNDEFINED; - nxagentOptions.Persistent = 1; + nxagentOptions.Persistent = True; nxagentOptions.Rootless = UNDEFINED; nxagentOptions.Fullscreen = False; nxagentOptions.AllScreens = False; @@ -82,23 +82,23 @@ void nxagentInitOptions(void) nxagentOptions.Timeout = 0; - nxagentOptions.Nested = 0; + nxagentOptions.Nested = False; nxagentOptions.BackingStore = BackingStoreUndefined; nxagentOptions.Clipboard = ClipboardBoth; - nxagentOptions.SharedMemory = 1; + nxagentOptions.SharedMemory = True; - nxagentOptions.SharedPixmaps = 1; + nxagentOptions.SharedPixmaps = True; - nxagentOptions.DeviceControl = 0; + nxagentOptions.DeviceControl = False; - nxagentOptions.DeviceControlUserDefined = 0; + nxagentOptions.DeviceControlUserDefined = False; - nxagentOptions.ResetKeyboardAtResume = 1; + nxagentOptions.ResetKeyboardAtResume = True; - nxagentOptions.Reset = 0; + nxagentOptions.Reset = False; nxagentOptions.RootX = 0; nxagentOptions.RootY = 0; @@ -118,25 +118,25 @@ void nxagentInitOptions(void) nxagentOptions.FloatXRatio = 1.0; nxagentOptions.FloatYRatio = 1.0; - nxagentOptions.UseDamage = 1; + nxagentOptions.UseDamage = True; nxagentOptions.Binder = UNDEFINED; nxagentOptions.BinderOptions = NULL; - nxagentOptions.Xdmcp = 0; + nxagentOptions.Xdmcp = False; nxagentOptions.DisplayBuffer = UNDEFINED; nxagentOptions.DisplayCoalescence = 0; - nxagentOptions.Composite = 1; + nxagentOptions.Composite = True; - nxagentOptions.IgnoreVisibility = 0; + nxagentOptions.IgnoreVisibility = False; - nxagentOptions.ViewOnly = 0; + nxagentOptions.ViewOnly = False; - nxagentOptions.Adaptive = 0; + nxagentOptions.Adaptive = False; - nxagentOptions.Streaming = 0; + nxagentOptions.Streaming = False; nxagentOptions.DeferLevel = UNDEFINED; nxagentOptions.DeferTimeout = 200; @@ -144,19 +144,19 @@ void nxagentInitOptions(void) nxagentOptions.TileWidth = UNDEFINED; nxagentOptions.TileHeight = UNDEFINED; - nxagentOptions.Menu = 1; + nxagentOptions.Menu = True; - nxagentOptions.MagicPixel = 1; + nxagentOptions.MagicPixel = True; nxagentOptions.ClientOs = UNDEFINED; - nxagentOptions.InhibitXkb = 1; + nxagentOptions.InhibitXkb = True; nxagentOptions.CopyBufferSize = COPY_UNLIMITED; nxagentOptions.ImageRateLimit = 0; - nxagentOptions.Xinerama = 1; + nxagentOptions.Xinerama = True; nxagentOptions.SleepTimeMillis = DEFAULT_SLEEP_TIME_MILLIS; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index b5d47623a..1191049ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -84,7 +84,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) * leaves the agent's window. */ - if (nxagentOption(DeviceControl) == True) + if (nxagentOption(DeviceControl)) { #ifdef TEST fprintf(stderr, "%s: WARNING! Propagating changes to pointer settings.\n", __func__); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 602351d10..ffdab066a 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 the state became SESSION_DOWN. */ nxagentException.ioError = 0; - if (nxagentOption(Persistent) == 1 && nxagentSessionState != SESSION_STARTING) + if (nxagentOption(Persistent) && nxagentSessionState != SESSION_STARTING) { if (nxagentSessionState == SESSION_UP) { @@ -588,7 +588,7 @@ Bool nxagentReconnectSession(void) } /* Reset the keyboard only if we detect any changes. */ - if (nxagentOption(ResetKeyboardAtResume) == 1) + if (nxagentOption(ResetKeyboardAtResume)) { if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || @@ -630,7 +630,7 @@ Bool nxagentReconnectSession(void) nxagentRedirectDefaultWindows(); - if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama) == True) + if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama)) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentOption(RootHeight), True); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index d8f79f015..e0e86b2ce 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2001,7 +2001,7 @@ N/A * change the real X server's keyboard and pointer settings. */ - if (nxagentOption(DeviceControl) == False) + if (!nxagentOption(DeviceControl)) { fprintf(stderr, "Info: Not using local device configuration changes.\n"); } @@ -2532,7 +2532,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) NXShadowSetDisplayUid(nxagentShadowUid); } - if (nxagentOption(UseDamage) == 0) + if (nxagentOption(UseDamage)) { NXShadowDisableDamage(); } -- 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 3.6.x in repository nx-libs. commit bd336c92bf100e037c19f500786a94eac02e2e92 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:19:50 2020 +0100 nxagent: make Desktop, Rootless and Binder options Booleans (again) They have been changed to tri-state variables (1, 0 and UNDEFINED) between nxagent 1.5.0-90 and -93, for no obvious reason. --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 35 +++++-------------------- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 4 +-- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 12 ++++----- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 4 +-- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 6 ++--- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 8 +++--- nx-X11/programs/Xserver/hw/nxagent/Window.c | 12 ++++----- 11 files changed, 33 insertions(+), 56 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 76669e39e..52aa055fc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -801,14 +801,9 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-R")) { - if (nxagentOption(Binder) == UNDEFINED || - nxagentOption(Desktop) == UNDEFINED || - nxagentOption(Rootless) == UNDEFINED) - { - nxagentChangeOption(Binder, False); - nxagentChangeOption(Desktop, False); - nxagentChangeOption(Rootless, True); - } + nxagentChangeOption(Binder, False); + nxagentChangeOption(Desktop, False); + nxagentChangeOption(Rootless, True); return 1; } @@ -1749,13 +1744,14 @@ N/A #endif - if ((nxagentOption(Rootless) == True) && nxagentOption(Fullscreen)) + if (nxagentOption(Rootless) && nxagentOption(Fullscreen)) { #ifdef TEST fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); #endif nxagentChangeOption(Fullscreen, False); + nxagentChangeOption(AllScreens, False); } /* @@ -1970,25 +1966,6 @@ N/A nxagentSetCoalescence(); - /* - * Set the other defaults. - */ - - if (nxagentOption(Binder) == UNDEFINED) - { - nxagentChangeOption(Binder, False); - } - - if (nxagentOption(Rootless) == UNDEFINED) - { - nxagentChangeOption(Rootless, False); - } - - if (nxagentOption(Desktop) == UNDEFINED) - { - nxagentChangeOption(Desktop, True); - } - /* * The enableBackingStore flag is defined * in window.c in the dix. @@ -2029,7 +2006,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. nxagentAlphaEnabled = False; } - if ((nxagentOption(Rootless) == True) && nxagentOption(Xdmcp)) + if (nxagentOption(Rootless) && nxagentOption(Xdmcp)) { FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n"); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index 45799051c..745696219 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -115,7 +115,7 @@ void nxagentCompositeExtensionInit(void) void nxagentRedirectDefaultWindows(void) { - if (nxagentOption(Rootless) == 1 || + if (nxagentOption(Rootless) || nxagentCompositeEnable == 0) { #ifdef TEST @@ -154,7 +154,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 05c78e0ad..dcee721a2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -127,7 +127,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor) Cursor 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/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 9d58e814b..5eef6c0a4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1851,7 +1851,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already { int value = X.xvisibility.state; - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { TraverseTree(pWin, nxagentChangeVisibilityPrivate, &value); } @@ -2003,7 +2003,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already fprintf(stderr, "%s: Going to handle new UnmapNotify event.\n", __func__); #endif - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { WindowPtr pWin; @@ -2019,7 +2019,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && + if (nxagentUseNXTrans == 1 && !nxagentOption(Rootless) && !nxagentOption(Nested) && X.xmap.window != nxagentIconWindow) { @@ -2034,7 +2034,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already fprintf(stderr, "%s: Going to handle new MapNotify event.\n", __func__); #endif - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { WindowPtr pWin; @@ -3152,7 +3152,7 @@ int nxagentHandleConfigureNotify(XEvent* X) fprintf(stderr, "%s: DefaultRootWindow(DISPLAY) [0x%lx]\n", __func__, DefaultRootWindow(nxagentDisplay)); #endif - if (nxagentOption(Rootless) == True) + if (nxagentOption(Rootless)) { int sendEventAnyway = 0; @@ -3272,7 +3272,7 @@ int nxagentHandleConfigureNotify(XEvent* X) return 1; } } - else /* (nxagentOption(Rootless) == True) */ + else /* (nxagentOption(Rootless)) */ { /* * Save the position of the agent default window. Don't save the diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 77f2d6b38..9ca7711b2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -417,7 +417,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); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index ff50c9965..84414c11f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -189,7 +189,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, * } */ - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { /* * from nxagent-1.5.0-20 changelog: @@ -238,7 +238,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse) * by the agent (for example if the focus had left the window), so * that agent could be unable to update the mouse button state. */ - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { XUngrabPointer(nxagentDisplay, CurrentTime); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 11e66720f..97665d22e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -193,7 +193,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/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index c9b07db97..afc6899e3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -59,9 +59,9 @@ void nxagentInitOptions(void) { nxagentOptions.LinkType = UNDEFINED; - nxagentOptions.Desktop = UNDEFINED; + nxagentOptions.Desktop = True; nxagentOptions.Persistent = True; - nxagentOptions.Rootless = UNDEFINED; + nxagentOptions.Rootless = False; nxagentOptions.Shadow = False; nxagentOptions.Fullscreen = False; nxagentOptions.AllScreens = False; @@ -121,7 +121,7 @@ void nxagentInitOptions(void) nxagentOptions.UseDamage = True; - nxagentOptions.Binder = UNDEFINED; + nxagentOptions.Binder = False; nxagentOptions.BinderOptions = NULL; nxagentOptions.Xdmcp = False; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index ffdab066a..9807a8e3b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -630,7 +630,7 @@ Bool nxagentReconnectSession(void) nxagentRedirectDefaultWindows(); - if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama)) + if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) || nxagentOption(Xinerama)) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentOption(RootHeight), True); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index e0e86b2ce..85114c95a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -948,7 +948,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) * 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"); @@ -1732,7 +1732,7 @@ N/A pScreen->myNum, nxagentDefaultWindows[pScreen->myNum]); #endif - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { XSetWindowAttributes inpattributes = {.event_mask = PointerMotionMask}; @@ -1953,7 +1953,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 @@ -2377,7 +2377,7 @@ FIXME: We should try to restore the previously XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); } - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { #ifdef DEBUG fprintf(stderr, "%s: resizing InputWindow to [%d]x[%d]\n", __func__, width, height); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 592d76dfd..be310ec67 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -378,7 +378,7 @@ Bool nxagentCreateWindow(WindowPtr pWin) nxagentWindowPriv(pWin) -> corruptedTimestamp = 0; nxagentWindowPriv(pWin) -> splitResource = NULL; - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { nxagentWindowPriv(pWin) -> isMapped = 0; @@ -700,7 +700,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) { - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { return; } @@ -1259,7 +1259,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) return; } - if (nxagentOption(Rootless) == 1 && + if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) == 1) { mask &= ~(CWSibling | CWStackMode); @@ -2527,7 +2527,7 @@ void nxagentMapDefaultWindows(void) */ MapWindow(pWin, serverClient); - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { /* * Show the NX splash screen. @@ -2760,7 +2760,7 @@ Bool nxagentReconnectAllWindows(void *p0) * raised. */ - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { for (int i = 0; i < screenInfo.numScreens; i++) { @@ -3274,7 +3274,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 3.6.x in repository nx-libs. commit fec462906588e9adc4533b3814b200531e527f64 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:31:01 2020 +0100 nxagent: treat all Traps as Booleans everywhere --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 8 +++---- nx-X11/programs/Xserver/hw/nxagent/GC.c | 24 ++++++++++----------- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 28 ++++++++++++------------ nx-X11/programs/Xserver/hw/nxagent/Image.c | 30 +++++++++++++------------- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 16 +++++++------- nx-X11/programs/Xserver/hw/nxagent/Window.c | 12 +++++------ 12 files changed, 67 insertions(+), 67 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 7902e441d..a18b4f0f9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1075,7 +1075,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"); @@ -1106,7 +1106,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"); @@ -1268,7 +1268,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"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index ceb47b669..2e14c08e7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1571,7 +1571,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, * way to identify that situation during callback processing we * could get rid of the Trap... */ - if (nxagentExternalClipboardEventTrap != 0) + if (nxagentExternalClipboardEventTrap) { #ifdef DEBUG fprintf(stderr, "%s: Trap is set, doing nothing\n", __func__); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 4d643a97e..1cd0a692f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -144,7 +144,7 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre { pDrawable = nxagentSplitDrawable(pDrawable); - if (nxagentLosslessTrap == 0) + if (!nxagentLosslessTrap) { if (nxagentDrawableStatus(pDrawable) == Synchronized) { @@ -257,7 +257,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask * copy with lossless compression turned off. */ - if (nxagentLosslessTrap == 1) + if (nxagentLosslessTrap) { #ifdef TEST fprintf(stderr, "%s: Forcing synchronization of pixmap at [%p] with lossless compression.\n", @@ -266,7 +266,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask return reallySynchronizeDrawableData(pDrawable); } - else if (nxagentReconnectTrap == 1) + else if (nxagentReconnectTrap) { /* * The pixmap data is not synchronized unless we need it. We @@ -277,7 +277,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask if (pDrawable -> depth == 1) { #ifdef TEST - if (nxagentReconnectTrap == 1) + if (nxagentReconnectTrap) { static int totalLength; static int totalReconnectedPixmaps; diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 21e888b8a..d39f743e6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -317,7 +317,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 large, it can be @@ -367,7 +367,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", @@ -425,7 +425,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); @@ -434,7 +434,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) CHECKGCVAL(GCArcMode, arc_mode, pGC->arcMode); - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { #ifdef TEST fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n", @@ -544,7 +544,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); } @@ -552,7 +552,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_REGION: { - if (clipsMatch == 0 && nxagentGCTrap == 0) + if (clipsMatch == 0 && !nxagentGCTrap) { XRectangle *pRects; nRects = RegionNumRects((RegionPtr)pValue); @@ -576,7 +576,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)); @@ -594,7 +594,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, @@ -604,7 +604,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, @@ -614,7 +614,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, @@ -624,7 +624,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, @@ -679,7 +679,7 @@ void nxagentDestroyClip(GCPtr pGC) nxagentDestroyClipHelper(pGC); - if (nxagentGCTrap == 0) + if (!nxagentGCTrap) { XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index b36550b9a..093e16a77 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -664,7 +664,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } - if (nxagentGCTrap == 1 || nxagentShmTrap == 1) + if (nxagentGCTrap || nxagentShmTrap) { if (pSrcDrawable -> type == DRAWABLE_PIXMAP && pDstDrawable -> type == DRAWABLE_PIXMAP) @@ -890,7 +890,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) @@ -1073,7 +1073,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) { @@ -1130,7 +1130,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) { @@ -1203,7 +1203,7 @@ void nxagentPolySegment(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1280,7 +1280,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1345,7 +1345,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) { @@ -1404,7 +1404,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, { xPoint *newPoints = NULL; - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1518,7 +1518,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1663,7 +1663,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) { @@ -1739,7 +1739,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int width = XTextWidth(nxagentFontStruct(pGC->font), string, count); - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1809,7 +1809,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int width = XTextWidth16(nxagentFontStruct(pGC->font), (XChar2b *)string, count); - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1868,7 +1868,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) { @@ -1925,7 +1925,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/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index 79d8c365f..e1f424a16 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -403,7 +403,7 @@ FIXME: Here the split trap is always set and so the caching of the 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) { @@ -562,8 +562,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) { @@ -579,11 +579,11 @@ 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); @@ -683,8 +683,8 @@ FIXME: Do we stream the images from GLX or Xv? If we do that, we /* FIXME: Temporarily stream the GLX data. - && nxagentGlxTrap == 0 - && nxagentXvTrap == 0 + && !nxagentGlxTrap + && !nxagentXvTrap */ ); @@ -692,11 +692,11 @@ FIXME: Temporarily stream the GLX data. * Never split images whose depth 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); @@ -734,7 +734,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"); @@ -1145,7 +1145,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) { @@ -1219,8 +1219,8 @@ FIXME: Should try to locate the image anyway, if the lossless trap is 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 cleaned before calculating diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index a8d1849ae..d339a12d5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -392,7 +392,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/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 07f57621e..181537009 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 13ac47d00..c04fe6f8b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -200,7 +200,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, * checksum. */ - if (width != 0 && height != 0 && nxagentGCTrap == 0) + if (width != 0 && height != 0 && !nxagentGCTrap) { pPixmapPriv -> id = XCreatePixmap(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum], diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index f38319858..44d52f8e0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -2252,7 +2252,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2) { GlyphSetPtr pGly = (GlyphSetPtr) p0; - if (nxagentReconnectTrap == 0) + if (!nxagentReconnectTrap) { int i; XRenderPictFormat *pForm = NULL; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 85114c95a..e27ed2ec6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -849,7 +849,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) pScreen->myNum); #endif - if (nxagentRenderEnable && nxagentReconnectTrap == False) + if (nxagentRenderEnable && !nxagentReconnectTrap) { PictureScreenPrivateIndex = -1; } @@ -904,7 +904,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) * user geometry then. */ - if (nxagentReconnectTrap == False && !nxagentOption(Rootless)) + if (!nxagentReconnectTrap && !nxagentOption(Rootless)) { if (nxagentUserGeometry.flag & XValue) { @@ -957,7 +957,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) nxagentChangeOption(Fullscreen, True); if (nxagentOption(ClientOs) == ClientOsWinnt && - (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)) + (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup)) { NXSetExposeParameters(nxagentDisplay, 0, 0, 0); } @@ -996,7 +996,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) nxagentChangeOption(Height, h); /* first time screen initialization or resize during reconnect */ - if (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup) + if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup) { if (nxagentOption(RootWidth) >= w) { @@ -1049,7 +1049,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) * screen is initialized for the first time. */ - if (nxagentReconnectTrap == False) + if (!nxagentReconnectTrap) { nxagentChangeOption(RootX, 0); nxagentChangeOption(RootY, 0); @@ -1088,7 +1088,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) * the root window isn't bigger than the X server root window.. */ - if (nxagentReconnectTrap == False) + if (!nxagentReconnectTrap) { if ((nxagentOption(RootWidth) < w) && !(nxagentUserGeometry.flag & WidthValue)) @@ -1120,7 +1120,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); - if (nxagentReconnectTrap == 0) + if (!nxagentReconnectTrap) { if (nxagentOption(Persistent)) { @@ -1658,7 +1658,7 @@ N/A #endif if (nxagentDoFullGeneration == 1 || - nxagentReconnectTrap == 1) + nxagentReconnectTrap) { unsigned long valuemask = CWBackPixel | CWEventMask | CWColormap; XSetWindowAttributes attributes = { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index be310ec67..54e553338 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -548,7 +548,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) { nxagentPrivWindowPtr pWindowPriv; - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return 1; } @@ -672,7 +672,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) */ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) { - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return True; } @@ -690,7 +690,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) { - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return; } @@ -1250,7 +1250,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"); @@ -1877,7 +1877,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired) -+ */ Bool nxagentRealizeWindow(WindowPtr pWin) { - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return True; } @@ -2573,7 +2573,7 @@ void nxagentMapDefaultWindows(void) * nxagentReconnectAllWindows, after the Root Window is mapped. */ - if (nxagentReconnectTrap == 0) + if (!nxagentReconnectTrap) { XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]); } -- 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 3.6.x in repository nx-libs. commit fbc4a915850d24cd76cac543042541c9ebfeb5bf Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:50:51 2020 +0100 nxagent: make nxagentShadowResize a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index b854bf29b..704bc6995 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -3373,7 +3373,7 @@ int nxagentHandleConfigureNotify(XEvent* X) (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height)) { - nxagentShadowResize = 1; + nxagentShadowResize = True; } if (nxagentOption(Width) != X->xconfigure.width || nxagentOption(Height) != X->xconfigure.height) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 59f368e4f..4085f2b90 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -732,9 +732,9 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas nxagentDispatchEvents(NULL); } - if (nxagentShadowResize == 1) + if (nxagentShadowResize) { - nxagentShadowResize = 0; + nxagentShadowResize = False; nxagentShadowAdaptToRatio(); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index e272b3b02..137f0eb58 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -176,7 +176,7 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix); * These variables are for shadowing feature. */ -int nxagentShadowResize = 0; +Bool nxagentShadowResize = False; WindowPtr nxagentShadowWindowPtr = NULL; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.h b/nx-X11/programs/Xserver/hw/nxagent/Screen.h index 3eb16ea3c..53df72df2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.h @@ -67,7 +67,7 @@ extern RegionRec nxagentShadowUpdateRegion; extern WindowPtr nxagentShadowWindowPtr; -extern int nxagentShadowResize; +extern Bool nxagentShadowResize; extern short nxagentShadowUid; -- 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 3.6.x in repository nx-libs. commit 73bdca0f804a20603e57825f78614c4e9a550903 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:43:07 2020 +0100 nxagent: some more Boolean improvements --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index a5f457796..fa1910eac 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -2146,7 +2146,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo if (nxagentSessionState != SESSION_DOWN) { - if (nxagentExposeArrayIsInitialized == 0) + if (!nxagentExposeArrayIsInitialized) { #ifdef TEST fprintf(stderr, "nxagentWindowExposures: Initializing expose queue.\n"); @@ -2171,7 +2171,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo nxagentInitRemoteExposeRegion(); - nxagentExposeArrayIsInitialized = 1; + nxagentExposeArrayIsInitialized = True; } RegionRec temp; -- 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 3.6.x in repository nx-libs. commit a72f77fc9face4e9854959c5c2ad4915db8c39e8 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:34:03 2020 +0100 nxagent: treat nxagentLastWindowDestroyed as Boolean --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index b8c6ff18a..59f368e4f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -222,7 +222,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) #ifdef TEST - if (nxagentLastWindowDestroyed == 1) + if (nxagentLastWindowDestroyed) { fprintf(stderr, "nxagentBlockHandler: Elapsed time [%lu].\n", now - nxagentLastWindowDestroyedTime); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 54e553338..a5f457796 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -643,7 +643,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) } if (nxagentOption(Rootless) && nxagentRootlessDialogPid == 0 && - nxagentLastWindowDestroyed == False && nxagentSomeWindowsAreMapped() == False) + !nxagentLastWindowDestroyed && nxagentSomeWindowsAreMapped() == False) { #ifdef TEST fprintf(stderr, "nxagentDestroyWindow: Last mapped window as been destroyed.\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 3.6.x in repository nx-libs. commit f4adcbc596e3563b3fcad75e862b7be3a969f969 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:54:48 2020 +0100 nxagent: make nxagentUserDefinedFontPath a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Args.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index a18b4f0f9..ee76fc795 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -116,7 +116,7 @@ is" without express or implied warranty. #undef DISABLE_SMART_SCHEDULE -int nxagentUserDefinedFontPath = 0; +Bool nxagentUserDefinedFontPath = False; /* * From X11/ImUtil.c. @@ -558,7 +558,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) fprintf(stderr, "ddxProcessArgument: User defined font path [%s].\n", argv[i]); #endif - nxagentUserDefinedFontPath = 1; + nxagentUserDefinedFontPath = True; defaultFontPath = argv[i]; } else diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.h b/nx-X11/programs/Xserver/hw/nxagent/Args.h index c8f8907c3..aebb521a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h @@ -97,7 +97,7 @@ void nxagentSetCoalescence(void); void nxagentShowVersionInfo(void); -extern int nxagentUserDefinedFontPath; +extern Bool nxagentUserDefinedFontPath; extern int nxagentRemoteMajor; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index b6901cb38..d760b0c6a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -251,7 +251,7 @@ void InitOutput(ScreenInfo *scrInfo, int argc, char *argv[]) AddCallback(&ServerGrabCallback, nxagentGrabServerCallback, NULL); } - if (nxagentUserDefinedFontPath == 0) + if (!nxagentUserDefinedFontPath) { #ifdef TEST fprintf(stderr, "InitOutput: Calling nxagentVerifyDefaultFontPath.\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 3.6.x in repository nx-libs. commit 41f7a8b4a825aa43e0e4b4888471cf43d9b1f217 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:48:33 2020 +0100 nxagent: make nxagentDoFullgeneration a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index e3857043b..c8a2d852a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -1796,7 +1796,7 @@ void nxagentCloseDisplay(void) nxagentDoFullGeneration, (void *) nxagentDisplay); #endif - if (nxagentDoFullGeneration == 0 || + if (!nxagentDoFullGeneration || nxagentDisplay == NULL) { return; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index a7574ab14..b6901cb38 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -171,7 +171,7 @@ int nxagentSaveUnder; * nxagentOpenScreen * InitInput */ -int nxagentDoFullGeneration = 1; +Bool nxagentDoFullGeneration = True; /* * True if agent is running as X2goAgent diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index e27ed2ec6..e272b3b02 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1657,7 +1657,7 @@ N/A nxagentPrintAgentGeometry(NULL, "nxagentOpenScreen:"); #endif - if (nxagentDoFullGeneration == 1 || + if (nxagentDoFullGeneration || nxagentReconnectTrap) { unsigned long valuemask = CWBackPixel | CWEventMask | CWColormap; -- 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 3.6.x in repository nx-libs. commit 84bad7324f148f323ac6eaff39c38eaccb6539a5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:07:23 2020 +0100 nxagent: rework some Boolean checks nxagentWindowTopLevel() and nxagentNeedConnectionChange() return Boolean nxagentPixmapIsVirtual() and nxagentIsShmPixmap(), too. --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 1cd0a692f..5317d0509 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -2658,7 +2658,7 @@ void nxagentAllocateCorruptedResource(DrawablePtr pDrawable, RESTYPE type) */ if (nxagentPixmapUsageCounter((PixmapPtr) pDrawable) >= MINIMUM_PIXMAP_USAGE_COUNTER && - nxagentIsShmPixmap((PixmapPtr) pDrawable) == 0) + !nxagentIsShmPixmap((PixmapPtr) pDrawable)) { pRealPixmap = nxagentRealPixmap((PixmapPtr) pDrawable); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 704bc6995..f371363a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2009,7 +2009,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if ((pWin = nxagentRootlessTopLevelWindow(X.xunmap.window)) != NULL || ((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL && - nxagentWindowTopLevel(pWin) == 1)) + nxagentWindowTopLevel(pWin))) { nxagentScreenTrap = True; @@ -2040,7 +2040,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if ((pWin = nxagentRootlessTopLevelWindow(X.xmap.window)) != NULL || ((pWin = nxagentWindowPtr(X.xmap.window)) != NULL && - nxagentWindowTopLevel(pWin) == 1)) + nxagentWindowTopLevel(pWin))) { nxagentScreenTrap = True; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 4085f2b90..01c1e0638 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -199,7 +199,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) #endif - if (nxagentNeedConnectionChange() == 1) + if (nxagentNeedConnectionChange()) { #ifdef TEST fprintf(stderr, "nxagentBlockHandler: Calling nxagentHandleConnectionChanges " @@ -703,7 +703,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas fprintf(stderr, "[Begin block]\n"); #endif - if (nxagentNeedConnectionChange() == 1) + if (nxagentNeedConnectionChange()) { nxagentHandleConnectionChanges(); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index bcb64edcd..5851eb05c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -551,8 +551,8 @@ int nxagentCompositePredicate(PicturePtr pSrc, PicturePtr pDst) fprintf(stderr, "nxagentCompositePredicate: Case 1.\n"); #endif - if (nxagentPixmapIsVirtual(pPixmap1) == 1 && - nxagentPixmapIsVirtual(pPixmap2) == 1) + if (nxagentPixmapIsVirtual(pPixmap1) && + nxagentPixmapIsVirtual(pPixmap2)) { #ifdef TEST fprintf(stderr, "nxagentCompositePredicate: Case 2.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index c04fe6f8b..30e5d1e3f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -1064,7 +1064,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, int wPict, int hPict) { if (pDrawable -> type == DRAWABLE_PIXMAP && - nxagentIsShmPixmap((PixmapPtr) pDrawable) == 1) + nxagentIsShmPixmap((PixmapPtr) pDrawable)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeShmPixmap: WARNING! Synchronizing shared pixmap at [%p].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index ed1e673a8..03ac9effd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -220,7 +220,7 @@ int nxagentHandleConnectionStates(void) } } - if (nxagentNeedConnectionChange() == 1) + if (nxagentNeedConnectionChange()) { #ifdef TEST fprintf(stderr, "nxagentHandleConnectionStates: Calling nxagentHandleConnectionChanges " diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index fa1910eac..2a872c812 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -1260,7 +1260,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) } if (nxagentOption(Rootless) && - nxagentWindowTopLevel(pWin) == 1) + nxagentWindowTopLevel(pWin)) { mask &= ~(CWSibling | CWStackMode); } -- 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 3.6.x in repository nx-libs. commit 06833b9646f6286effac00a058b231f7ddbb960f Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:21:43 2020 +0100 Split.c, Image.c: make some internal variables Booleans --- nx-X11/programs/Xserver/hw/nxagent/Image.c | 52 +++++++++++++++--------------- nx-X11/programs/Xserver/hw/nxagent/Split.c | 6 ++-- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index e1f424a16..2e0c901ef 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -473,8 +473,8 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, RegionPtr pRegion = NullRegion; int resource = 0; - int split = 0; - int cache = 1; + Bool split = False; + Bool cache = True; #ifdef TEST fprintf(stderr, "nxagentPutImage: Image data at [%p] drawable [%s][%p] geometry [%d,%d,%d,%d].\n", @@ -692,7 +692,7 @@ FIXME: Temporarily stream the GLX data. * Never split images whose depth is less than 15. */ - if (split == 1 && (nxagentSplitTrap || depth < 15)) + if (split && (nxagentSplitTrap || depth < 15)) { #ifdef TEST if (nxagentSplitTrap || @@ -703,10 +703,10 @@ FIXME: Temporarily stream the GLX data. } #endif - split = 0; + split = False; } #ifdef TEST - else if (split == 1) + else if (split) { fprintf(stderr, "nxagentPutImage: Splitting with reconnection [%d] trap [%d] " "depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth); @@ -714,7 +714,7 @@ FIXME: Temporarily stream the GLX data. #endif #ifdef TEST - if (split == 1) + if (split) { fprintf(stderr, "nxagentPutImage: Splitting the image with size [%d] " "link [%d] GLX [%d] Xv [%d].\n", length, nxagentOption(LinkType), @@ -742,7 +742,7 @@ FIXME: Temporarily stream the GLX data. NXSetCacheParameters(nxagentDisplay, 0, 1, 0, 0); - cache = 0; + cache = False; } /* @@ -750,7 +750,7 @@ FIXME: Temporarily stream the GLX data. * tell us if the split took place. */ - if (split == 1) + if (split) { /* * If the drawable is already being split, expand the @@ -793,7 +793,7 @@ FIXME: Should probably intersect the region with the region being nxagentRealizeImage(pDrawable, pGC, depth, dstX, dstY, dstWidth, dstHeight, leftPad, format, data); - if (split == 1) + if (split) { NXEndSplit(nxagentDisplay, resource); @@ -807,7 +807,7 @@ FIXME: Should probably intersect the region with the region being split = nxagentWaitSplitEvent(resource); - if (split == 1) + if (split) { #ifdef TEST fprintf(stderr, "nxagentPutImage: Marking corrupted region [%d,%d,%d,%d] for drawable at [%p].\n", @@ -838,7 +838,7 @@ FIXME: Should probably intersect the region with the region being * above, so here we have to check the value again. */ - if (split == 0) + if (!split) { if (nxagentDrawableStatus(pDrawable) == NotSynchronized) { @@ -863,7 +863,7 @@ nxagentPutImageEnd: * Check if we disabled caching. */ - if (cache == 0) + if (!cache) { #ifdef TEST fprintf(stderr, "nxagentPutImage: Reenabling the use of the cache.\n"); @@ -1041,9 +1041,9 @@ void nxagentPutSubImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ClientPtr client; - int lossless = 0; - int clean = 0; - int pack = 0; + Bool lossless = False; + Bool clean = False; + Bool pack = False; /* * XCreateImage is the place where the leftPad should be passed. @@ -1136,7 +1136,7 @@ FIXME: Should use an unpack resource here. lossless = (packMethod == nxagentPackLossless); - if (pack == 1 && lossless == 0) + if (pack && !lossless) { /* * Force the image to be sent as a plain bitmap if we don't have @@ -1155,7 +1155,7 @@ FIXME: Should use an unpack resource here. nxagentImageLength(w, h, format, leftPad, depth)); #endif - pack = 0; + pack = False; } else { @@ -1167,7 +1167,7 @@ FIXME: Should use an unpack resource here. packMethod = nxagentPackLossless; - lossless = 1; + lossless = True; } } } @@ -1176,7 +1176,7 @@ FIXME: Should use an unpack resource here. * Do we still want to pack the image? */ - if (pack == 1) + if (pack) { /* * Set the geometry and alpha channel to be used for the unpacked @@ -1234,7 +1234,7 @@ FIXME: There should be a callback registered by the agent that etc. This statistics report would be included by the proxy in its stat output. */ - clean = 1; + clean = True; NXCleanImage(plainImage); @@ -1284,7 +1284,7 @@ FIXME: There should be a callback registered by the agent that * lossless encoder will compress better. */ - if (lossless == 0 && nxagentOption(Adaptive)) + if (!lossless && nxagentOption(Adaptive)) { int ratio = nxagentUniquePixels(plainImage); @@ -1297,7 +1297,7 @@ FIXME: There should be a callback registered by the agent that packMethod = nxagentPackLossless; - lossless = 1; + lossless = True; } #ifdef TEST else @@ -1324,11 +1324,11 @@ FIXME: There should be a callback registered by the agent that * bitwise the same regardless the padding bits. */ - if (clean == 0) + if (!clean) { if (nxagentNeedClean(plainImage, packMethod) == 1) { - clean = 1; + clean = True; NXCleanImage(plainImage); } @@ -1448,12 +1448,12 @@ FIXME: If we failed to encode the image by any of the available was sent in the unpack alpha message. This can be done here, if the clean flag is true and we are going to send a plain image. */ - if (clean == 0) + if (!clean) { clean = (nxagentOption(LinkType) != LINK_TYPE_NONE && nxagentOption(LinkType) != LINK_TYPE_LAN && depth != 32); - if (clean == 1) + if (clean) { #ifdef DEBUG fprintf(stderr, "nxagentPutSubImage: Cleaning the image with link type [%d] and depth [%d].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c index 850056c21..60af4a0d6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -829,11 +829,11 @@ static Bool nxagentWaitSplitPredicate(Display *disp, XEvent *event, XPointer ptr event -> xclient.format == 32); } -int nxagentWaitSplitEvent(int resource) +Bool nxagentWaitSplitEvent(int resource) { XEvent event; - int split = 0; + Bool split = 0; /* * Don't flush the link. We only want to query the NX transport to @@ -890,7 +890,7 @@ int nxagentWaitSplitEvent(int resource) { nxagentHandleStartSplitEvent(resource); - split = 1; + split = True; break; } -- 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 3.6.x in repository nx-libs. commit 1239dffeccc4f4c1fccfee8802562837c50bd193 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:57:00 2020 +0100 GCOps.c: handle some internal variables as Booleans --- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index d29558cb2..277daa699 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -509,7 +509,7 @@ FIXME: The popup could be synchronized with one single put image, nxagentChangeClip(targetGC, CT_NONE, NullRegion, 0); - if (pClipRegionFree == True) + if (pClipRegionFree) { nxagentFreeRegion(pClipRegion); } @@ -1540,7 +1540,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, * will be cleared. */ - int inheritCorruptedRegion = 0; + Bool inheritCorruptedRegion = False; if (pGC -> fillStyle == FillTiled && pGC -> tileIsPixel == 0 && pGC -> tile.pixmap != NULL) @@ -1556,11 +1556,11 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, #endif - inheritCorruptedRegion = 1; + inheritCorruptedRegion = True; } } - if (inheritCorruptedRegion == 1 || nxagentDrawableStatus(pDrawable) == NotSynchronized) + if (inheritCorruptedRegion || nxagentDrawableStatus(pDrawable) == NotSynchronized) { RegionPtr rectRegion = RegionFromRects(nRectangles, pRectangles, CT_REGION); @@ -1582,7 +1582,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, RegionUninit(&tmpRegion); } - if (inheritCorruptedRegion == 1) + if (inheritCorruptedRegion) { /* * The fill style should affect the corrupted region -- 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 3.6.x in repository nx-libs. commit 714a212fd357a9ed855e2fd50b4f8e85336fcad6 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:58:40 2020 +0100 GCOps.c: make internal function Boolean --- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 277daa699..eda87ff20 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -211,18 +211,18 @@ RegionPtr nxagentBitBlitHelper(GC *pGC) * redirect property. */ -int nxagentWindowIsPopup(DrawablePtr pDrawable) +Bool nxagentWindowIsPopup(DrawablePtr pDrawable) { if (pDrawable -> type != DRAWABLE_WINDOW) { return 0; } - int windowIsPopup = 0; + Bool windowIsPopup = False; if (((WindowPtr) pDrawable) -> overrideRedirect == 1) { - windowIsPopup = 1; + windowIsPopup = True; } else { @@ -244,7 +244,7 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable) if (parent -> overrideRedirect == 1) { - windowIsPopup = 1; + windowIsPopup = True; break; } @@ -254,7 +254,7 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable) #ifdef TEST fprintf(stderr, "nxagentWindowIsPopup: Window [%p] %s to be a popup.\n", (void *) pDrawable, - windowIsPopup == 1 ? "seems" : "does not seem"); + windowIsPopup ? "seems" : "does not seem"); #endif return windowIsPopup; @@ -285,7 +285,7 @@ FIXME: The popup could be synchronized with one single put image, if (nxagentOption(DeferLevel) >= 2 && pSrcDrawable -> type == DRAWABLE_PIXMAP && nxagentPixmapContainTrapezoids((PixmapPtr) pSrcDrawable) == 1 && - nxagentWindowIsPopup(pDstDrawable) == 1) + nxagentWindowIsPopup(pDstDrawable)) { RegionPtr pSrcRegion = nxagentCreateRegion(pSrcDrawable, NULL, srcx, srcy, width, height); -- 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 3.6.x in repository nx-libs. commit f98114c95b1486af4bf113051cdc9d938e81c22a Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:54:50 2020 +0100 Drawable.c: make some variables Booleans --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index c335e7ed9..8b657beb7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -357,9 +357,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * full drawable. */ - int useStoredBitmap = (nxagentDrawableBitmap(pDrawable) != NullPixmap && pRegion == NullRegion); + Bool useStoredBitmap = (nxagentDrawableBitmap(pDrawable) != NullPixmap && pRegion == NullRegion); - if (useStoredBitmap != 0) + if (useStoredBitmap) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap at [%p] " @@ -1023,7 +1023,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) DrawablePtr pDrawable = (DrawablePtr) p0; unsigned int *breakMask = (unsigned int *) p2; - int shouldClearHiddenRegion = 1; + Bool shouldClearHiddenRegion = True; /* * The nxagentSynchronization.abort propagates a break condition @@ -1104,7 +1104,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) (void *) pDrawable); #endif - if (shouldClearHiddenRegion == 1) + if (shouldClearHiddenRegion) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeDrawablePredicate: Clearing out the not visible window " @@ -1180,7 +1180,7 @@ FIXME: This condition sounds only as a complication, as the break */ if (nxagentSynchronization.abort == 0 && - shouldClearHiddenRegion == 1) + shouldClearHiddenRegion) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeDrawablePredicate: Clearing out the remaining corrupted " -- 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 3.6.x in repository nx-libs. commit 3cb0a134d697bc0a6537cc0c532128031a9db261 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:03:44 2020 +0100 nxagent: make XDMCP variables Booleans --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 14 +++++++------- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 01c1e0638..a3624dbfc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -114,8 +114,8 @@ extern void nxagentDumpInputDevicesState(void); * Used in the handling of the X desktop manager protocol. */ -int nxagentXdmcpUp = 0; -int nxagentXdmcpAlertUp = 0; +Bool nxagentXdmcpUp = False; +Bool nxagentXdmcpAlertUp = False; /* * Also used in the block, wakeup and sync handlers. @@ -648,7 +648,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) * the session. */ - if (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0) + if (nxagentOption(Xdmcp) && !nxagentXdmcpUp) { #ifdef DEBUG fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState); @@ -656,10 +656,10 @@ void nxagentWakeupHandler(void * data, int count, void * mask) if (XdmcpState == XDM_RUN_SESSION) { - nxagentXdmcpUp = 1; + nxagentXdmcpUp = True; } - if (nxagentXdmcpUp == 0) + if (!nxagentXdmcpUp) { #ifdef DEBUG fprintf(stderr, "nxagentWakeupHandler: XdmcpTime [%lu].\n", @@ -671,7 +671,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) XdmcpTimeOutRtx); #endif - if (nxagentXdmcpAlertUp == 0 && + if (!nxagentXdmcpAlertUp && GetTimeInMillis() - XdmcpStartTime >= XDM_TIMEOUT) { #ifdef WARNING @@ -681,7 +681,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) NXTransAlert(FAILED_XDMCP_CONNECTION_ALERT, NX_ALERT_REMOTE); - nxagentXdmcpAlertUp = 1; + nxagentXdmcpAlertUp = True; } } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 6573ac0b9..12a44dbe0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -330,7 +330,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio clientReady[0] = 0; - if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0)) + if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) && !nxagentXdmcpUp)) { #ifdef TEST fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n", @@ -343,7 +343,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio if (serverGeneration > nxagentMaxAllowedResets && nxagentSessionState == SESSION_STARTING && - (!nxagentOption(Xdmcp) || nxagentXdmcpUp == 1)) + (!nxagentOption(Xdmcp) || nxagentXdmcpUp)) { #ifdef NX_DEBUG_INPUT fprintf(stderr, "Session: Session started at '%s' timestamp [%u].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h b/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h index 086ea9082..946b856bc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h @@ -36,6 +36,6 @@ extern xdmcp_states XdmcpState; extern int XdmcpTimeOutRtx; extern int XdmcpStartTime; -extern int nxagentXdmcpUp; +extern Bool nxagentXdmcpUp; #endif /* __Xdmcp_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 3.6.x in repository nx-libs. commit b8017065de448d461d75f6c2891a961f4bb85b7a Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:52:32 2020 +0100 nxagent: handle RegionNil macro as Boolean just as the rest of the Xserver is alsow doing --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 38 +++++++++++++-------------- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 12 ++++----- nx-X11/programs/Xserver/hw/nxagent/Image.c | 4 +-- nx-X11/programs/Xserver/hw/nxagent/Render.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Split.c | 4 +-- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 5317d0509..c335e7ed9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -396,7 +396,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * The bitmap to synchronize is clipped. */ - if (RegionNil(clipRegion) == 1) + if (RegionNil(clipRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: The bitmap region [%d,%d,%d,%d] is not viewable. " @@ -418,7 +418,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned } else { - if (pRegion != NullRegion && RegionNil(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Region [%d,%d,%d,%d] is nil. Skipping synchronization.\n", @@ -451,7 +451,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned RegionIntersect(clipRegion, clipRegion, nxagentCorruptedRegion(pDrawable)); - if (RegionNil(clipRegion) == 1) + if (RegionNil(clipRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: The corrupted region [%d,%d,%d,%d] is not viewable " @@ -473,7 +473,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned { RegionIntersect(clipRegion, clipRegion, pRegion); - if (RegionNil(clipRegion) == 1) + if (RegionNil(clipRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Region requested [%d,%d,%d,%d] already " @@ -888,7 +888,7 @@ nxagentSynchronizeRegionStop: if (pDrawable -> type == DRAWABLE_PIXMAP && nxagentIsCorruptedBackground((PixmapPtr) pDrawable) == 1 && - RegionNil(&exposeRegion) == 0) + !RegionNil(&exposeRegion)) { struct nxagentExposeBackground eb = { .pBackground = (PixmapPtr) pDrawable, @@ -994,7 +994,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea pBox -> x2 - pBox -> x1, pBox -> y2 - pBox -> y1); - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeBox: Resulting region [%d,%d,%d,%d] is nil. Skipping synchronization.\n", @@ -1441,7 +1441,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, * clipmask. */ - if (RegionNil(pRegion) == 0 && + if (!RegionNil(pRegion) && pGC != NULL && pGC -> clientClip != NULL && pGC -> clientClipType == CT_REGION) { @@ -1478,7 +1478,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) { - if (pRegion != NullRegion && RegionNil(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentMarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n", @@ -1552,7 +1552,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) { - if (pRegion != NullRegion && RegionNil(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentUnmarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n", @@ -2001,7 +2001,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel) unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion) { - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { return nxagentGetDrawableColor(pDrawable); } @@ -2055,7 +2055,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion) return; } - if (pRegion == NullRegion || RegionNil(pRegion) == 1) + if (pRegion == NullRegion || RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentClearRegion: The region is empty. Exiting.\n"); @@ -2145,7 +2145,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion) void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion) { - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { return; } @@ -2328,7 +2328,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) nxagentFreeRegion(clipRegion); - if (RegionNil(&visRegion) == 1) + if (RegionNil(&visRegion)) { #ifdef TEST fprintf(stderr, "nxagentCorruptedRegionOnWindow: The corrupted region of window at [%p] is hidden.\n", @@ -2455,7 +2455,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) RegionIntersect(pClipRegion, pClipRegion, nxagentCorruptedRegion(pDrawable)); - if (RegionNil(pClipRegion) == 1) + if (RegionNil(pClipRegion)) { #ifdef TEST fprintf(stderr, "nxagentCreateDrawableBitmap: The corrupted region is not visible. Skipping bitmap creation.\n"); @@ -2780,14 +2780,14 @@ void nxagentUnmarkExposedRegion(WindowPtr pWin, RegionPtr pRegion, RegionPtr pOt { RegionRec clipRegion; - if (pRegion != NullRegion && RegionNil(pRegion) == 0 && + if (pRegion != NullRegion && !RegionNil(pRegion) && nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized) { RegionInit(&clipRegion, NullBox, 1); RegionCopy(&clipRegion, pRegion); - if (pOther != NullRegion && RegionNil(pOther) == 0) + if (pOther != NullRegion && !RegionNil(pOther)) { RegionUnion(&clipRegion, &clipRegion, pOther); } @@ -2871,7 +2871,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt RegionSubtract(&expose, &expose, nxagentCorruptedRegion((DrawablePtr) pWin)); - if (RegionNil(&pWin -> clipList) != 0) + if (RegionNil(&pWin -> clipList)) { #ifdef TEST fprintf(stderr, "nxagentSendBackgroundExpose: Exposures deferred because the window " @@ -2897,7 +2897,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt pBackingStore = (miBSWindowPtr)pWin->backStorage; - if ((pBackingStore != NULL) && (RegionNil(&pBackingStore->SavedRegion) == 0)) + if ((pBackingStore != NULL) && !RegionNil(&pBackingStore->SavedRegion)) { RegionTranslate(&expose, -pWin -> drawable.x, -pWin -> drawable.y); @@ -2931,7 +2931,7 @@ void nxagentExposeBackgroundPredicate(void *p0, XID x1, void *p2) struct nxagentExposeBackground *pPair = p2; - if (RegionNil(pPair -> pExpose) != 0) + if (RegionNil(pPair -> pExpose)) { return; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index f371363a6..256c7c241 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -4065,7 +4065,7 @@ void nxagentSynchronizeExpose(void) (nxagentExposeQueueHead.remoteRegion), (nxagentExposeQueueHead.localRegion)); - if (RegionNil(nxagentExposeQueueHead.remoteRegion) == 0 && + if (!RegionNil(nxagentExposeQueueHead.remoteRegion) && ((pWin -> eventMask|wOtherEventMasks(pWin)) & ExposureMask)) { #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 093e16a77..d29558cb2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -301,7 +301,7 @@ FIXME: The popup could be synchronized with one single put image, RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (RegionNil(&corruptedRegion) == 0) + if (!RegionNil(&corruptedRegion)) { #ifdef TEST fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n", @@ -422,17 +422,17 @@ FIXME: The popup could be synchronized with one single put image, * corrupted region. */ - if (RegionNil(pClipRegion) == 0) + if (!RegionNil(pClipRegion)) { nxagentUnmarkCorruptedRegion(pDstDrawable, pClipRegion); } - if (RegionNil(pCorruptedRegion) == 0) + if (!RegionNil(pCorruptedRegion)) { nxagentMarkCorruptedRegion(pDstDrawable, pCorruptedRegion); } - if (RegionNil(pClipRegion) == 0) + if (!RegionNil(pClipRegion)) { Bool pClipRegionFree = True; @@ -550,7 +550,7 @@ FIXME: The popup could be synchronized with one single put image, RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (RegionNil(&corruptedRegion) == 0) + if (!RegionNil(&corruptedRegion)) { #ifdef TEST fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n", @@ -996,7 +996,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (RegionNil(&corruptedRegion) == 0) + if (!RegionNil(&corruptedRegion)) { #ifdef TEST fprintf(stderr, "nxagentCopyPlane: Forcing the synchronization of source drawable at [%p].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index 2e0c901ef..eb4085ef3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -544,7 +544,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, pRegion = nxagentCreateRegion(pDrawable, pGC, dstX, dstY, dstWidth, dstHeight); - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on fully clipped " @@ -987,7 +987,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, clipRegion = nxagentCreateRegion(pDrawable, pGC, x, y, w, h); } - if (clipRegion == NullRegion || RegionNil(clipRegion) == 0) + if (clipRegion == NullRegion || !RegionNil(clipRegion)) { nxagentPutSubImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, data, pVisual); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 44d52f8e0..1ea076bfd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -1314,7 +1314,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, RegionPtr pRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, glyphBox.x1, glyphBox.y1, glyphBox.x2 - glyphBox.x1, glyphBox.y2 - glyphBox.y1); - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentGlyphs: WARNING! Glyphs prevented on hidden window at [%p].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 137f0eb58..077457f0e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2903,7 +2903,7 @@ int nxagentShadowSendUpdates(int *suspended) { *suspended = 0; - if (RegionNil(&nxagentShadowUpdateRegion) == 1) + if (RegionNil(&nxagentShadowUpdateRegion)) { return 0; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c index 60af4a0d6..2e2b130fe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -612,7 +612,7 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion) RegionIntersect(&tmpRegion, pResource -> region, pRegion); - if (RegionNil(&tmpRegion) == 0) + if (!RegionNil(&tmpRegion)) { #ifdef TEST fprintf(stderr, "nxagentValidateSplit: Marking the overlapping commits as invalid " @@ -1074,7 +1074,7 @@ void nxagentHandleEndSplitEvent(int resource) if (pResource -> drawable != NULL && pResource -> region != NullRegion) { - if (RegionNil(pResource -> region) == 0) + if (!RegionNil(pResource -> region)) { RegionSubtract( nxagentCorruptedRegion(pResource -> drawable), diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 2a872c812..fcff4c6d0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -2195,7 +2195,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo RegionUnion(&temp, &temp, other_exposed); } - if (RegionNil(&temp) == 0) + if (!RegionNil(&temp)) { RegionTranslate(&temp, -(pWin -> drawable.x), -(pWin -> drawable.y)); -- 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 3.6.x in repository nx-libs. commit 94fd6d2344df9d391fc977053b648c137cb4abae Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:17:53 2020 +0100 Render.c: improve Boolean handling of nxagentCheckPictureRemoteValue --- nx-X11/programs/Xserver/hw/nxagent/Render.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 1ea076bfd..28e2d77fc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -925,7 +925,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPRepeat) { attributes.repeat = (Bool)pPicture -> repeat; - if (nxagentCheckPictureRemoteValue(pPicture, repeat, attributes.repeat) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, repeat, attributes.repeat)) { valuemask |= CPRepeat; nxagentSetPictureRemoteValue(pPicture, repeat, attributes.repeat); @@ -935,7 +935,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPAlphaMap) { attributes.alpha_map = nxagentPicturePriv(pPicture -> alphaMap) -> picture; - if (nxagentCheckPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map)) { valuemask |= CPAlphaMap; nxagentSetPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map); @@ -945,7 +945,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPAlphaXOrigin) { attributes.alpha_x_origin = pPicture -> alphaOrigin.x; - if (nxagentCheckPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin)) { valuemask |= CPAlphaXOrigin; nxagentSetPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin); @@ -955,7 +955,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPAlphaYOrigin) { attributes.alpha_y_origin = pPicture -> alphaOrigin.y; - if (nxagentCheckPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin)) { valuemask |= CPAlphaYOrigin; nxagentSetPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin); @@ -965,7 +965,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPClipXOrigin) { attributes.clip_x_origin = pPicture -> clipOrigin.x; - if (nxagentCheckPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin)) { valuemask |= CPClipXOrigin; nxagentSetPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin); @@ -975,7 +975,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPClipYOrigin) { attributes.clip_y_origin = pPicture -> clipOrigin.y; - if (nxagentCheckPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin)) { valuemask |= CPClipYOrigin; nxagentSetPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin); @@ -985,7 +985,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPGraphicsExposure) { attributes.graphics_exposures = (Bool)pPicture -> graphicsExposures; - if (nxagentCheckPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures)) { valuemask |= CPGraphicsExposure; nxagentSetPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures); @@ -995,7 +995,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPSubwindowMode) { attributes.subwindow_mode = pPicture -> subWindowMode; - if (nxagentCheckPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode)) { valuemask |= CPSubwindowMode; nxagentSetPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode); @@ -1021,7 +1021,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPPolyEdge) { attributes.poly_edge = pPicture -> polyEdge; - if (nxagentCheckPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge)) { valuemask |= CPPolyEdge; nxagentSetPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge); @@ -1031,7 +1031,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPPolyMode) { attributes.poly_mode = pPicture -> polyMode; - if (nxagentCheckPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode)) { valuemask |= CPPolyMode; nxagentSetPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode); @@ -1041,7 +1041,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPDither) { attributes.dither = pPicture -> dither; - if (nxagentCheckPictureRemoteValue(pPicture, dither, attributes.dither) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, dither, attributes.dither)) { valuemask |= CPDither; nxagentSetPictureRemoteValue(pPicture, dither, attributes.dither); @@ -1051,7 +1051,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPComponentAlpha) { attributes.component_alpha = pPicture -> componentAlpha; - if (nxagentCheckPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha)) { valuemask |= CPComponentAlpha; nxagentSetPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha); -- 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 3.6.x in repository nx-libs. commit 54dd29cc6d65789971cf878dd2bb8c29eec242ee Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:38:07 2020 +0100 Client.c: cleanup Boolean handling for nxagentNeedWakeup*() macros --- nx-X11/programs/Xserver/hw/nxagent/Client.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.c b/nx-X11/programs/Xserver/hw/nxagent/Client.c index e0adef3bc..08b2d8feb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.c @@ -457,7 +457,7 @@ void nxagentWaitWakeupBySplit(ClientPtr client) { #ifdef TEST - if (nxagentNeedWakeupBySplit(client) == 0) + if (!nxagentNeedWakeupBySplit(client)) { fprintf(stderr, "++++++nxagentWaitWakeupBySplit: WARNING! The client [%d] is already awake.\n", client -> index); @@ -497,12 +497,12 @@ void nxagentWaitWakeupBySplit(ClientPtr client) #endif - if (nxagentNeedWakeupBySplit(client) == 0 || + if (!nxagentNeedWakeupBySplit(client) || NXDisplayError(nxagentDisplay) == 1) { #ifdef TEST - if (nxagentNeedWakeupBySplit(client) == 0) + if (!nxagentNeedWakeupBySplit(client)) { fprintf(stderr, "++++++nxagentWaitWakeupBySplit: Client [%d] can now run.\n", client -> index); @@ -535,7 +535,7 @@ FIXME: Should record a serial number for the client, so that the */ if (client -> index < MAX_CONNECTIONS) { - if (nxagentNeedWakeup(client) == 0) + if (!nxagentNeedWakeup(client)) { #ifdef TEST fprintf(stderr, "++++++nxagentSuspendBySplit: Suspending client [%d] with agent sequence [%ld].\n", @@ -583,7 +583,7 @@ FIXME: Should record a serial number for the client, so that the { nxagentClientPriv(client) -> clientState &= ~SleepingBySplit; - if (nxagentNeedWakeup(client) == 0) + if (!nxagentNeedWakeup(client)) { #ifdef TEST fprintf(stderr, "++++++nxagentWakeupBySplit: Resuming client [%d] with agent sequence [%ld].\n", @@ -629,7 +629,7 @@ void nxagentCheckRestartedClients(struct timeval **timeout) for (int i = 1; i < currentMaxClients; i++) { if (clients[i] != NULL && clients[i] -> osPrivate != NULL && - nxagentNeedWakeup(clients[i]) == 0) + !nxagentNeedWakeup(clients[i])) { int fd = ((OsCommPtr) clients[i] -> osPrivate) -> fd; -- 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 3.6.x in repository nx-libs. commit e2ff39e04a7e3db9e57323342bd6cc337e448db9 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:24:41 2020 +0100 nxagent: make nxagentBlocking an Boolean --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 14 +++++++------- nx-X11/programs/Xserver/hw/nxagent/Handlers.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 90f4cc1b0..15112312f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -660,7 +660,7 @@ static void nxagentDisplayBlockHandler(Display *disp, int reason) fprintf(stderr, "nxagentDisplayBlockHandler: BLOCK! Display is blocking for [write].\n"); #endif - nxagentBlocking = 1; + nxagentBlocking = True; if (!SmartScheduleSignalEnable) { @@ -908,7 +908,7 @@ void nxagentResetDisplayHandlers(void) */ nxagentBuffer = 0; - nxagentBlocking = 0; + nxagentBlocking = False; nxagentCongestion = 0; /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 8b657beb7..dc4d15c80 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -2815,7 +2815,7 @@ int nxagentSynchronizationPredicate(void) return NotNeeded; } - if (nxagentBlocking == 0 && + if (!nxagentBlocking && nxagentCongestion <= 4 && nxagentReady == 0 && nxagentUserInput(NULL) == 0) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index a3624dbfc..cdba83264 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -122,7 +122,7 @@ Bool nxagentXdmcpAlertUp = False; */ int nxagentBuffer; -int nxagentBlocking; +Bool nxagentBlocking; int nxagentCongestion; double nxagentBytesIn; @@ -322,7 +322,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) nxagentForceSynchronization = 0; } else if (nxagentUserInput(NULL) == 0 && - nxagentBlocking == 0 && + !nxagentBlocking && nxagentCongestion <= 4) { #ifdef TEST @@ -391,7 +391,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) #ifdef DYNAMIC_DISPLAY_BUFFER - if (nxagentBlocking == 1 && + if (nxagentBlocking && nxagentBuffer > MINIMUM_DISPLAY_BUFFER) { nxagentBuffer >>= 1; @@ -587,7 +587,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) * Can become true during the dispatch loop. */ - nxagentBlocking = 0; + nxagentBlocking = False; /* * Check if we got new events. @@ -759,7 +759,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas nxagentShadowSendUpdates(&suspended); - if (nxagentBlocking == 0) + if (!nxagentBlocking) { nxagentSynchronizeDrawable((DrawablePtr) nxagentShadowPixmapPtr, DONT_WAIT, ALWAYS_BREAK, nxagentShadowWindowPtr); @@ -830,7 +830,7 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask) * Can become true during the dispatch loop. */ - nxagentBlocking = 0; + nxagentBlocking = False; /* * Check if we got new events. @@ -1200,7 +1200,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) nxagentDispatchEvents(NULL); - nxagentBlocking = 1; + nxagentBlocking = True; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h index ddae097da..0d019cc22 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h @@ -37,7 +37,7 @@ extern int nxagentBuffer; * the display to become writable. */ -extern int nxagentBlocking; +extern Bool nxagentBlocking; /* * Current congestion level based on diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 181537009..7426acab2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -77,7 +77,7 @@ while (0) #define breakOnBlocking(mask) \ (((mask) != NEVER_BREAK) && ((mask) & BLOCKING_BREAK) && \ - nxagentBlocking == 1) + nxagentBlocking) #define breakOnCongestion(mask) \ (((mask) != NEVER_BREAK) && ((mask) & CONGESTION_BREAK) && \ @@ -164,7 +164,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE #define NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask) \ ((nxagentCorruptedWindows == 0 && nxagentCorruptedPixmaps > 0 && \ - nxagentCongestion == 0 && nxagentBlocking == 0) || \ + nxagentCongestion == 0 && !nxagentBlocking) || \ mask == NEVER_BREAK) /* -- 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 3.6.x in repository nx-libs. commit 3151736d326a5ff5e54b2e08ca16c210f504207c Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:32:35 2020 +0100 GCOps.c: make internal variable an function Booleans --- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index eda87ff20..ee56e9abf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -261,10 +261,10 @@ Bool nxagentWindowIsPopup(DrawablePtr pDrawable) } /* - * This function returns 1 if the XCopyArea request must be skipped. + * This function returns True if the XCopyArea request must be skipped. */ -int nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, +Bool nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { @@ -317,7 +317,7 @@ FIXME: The popup could be synchronized with one single put image, if (nxagentDrawableStatus(pSrcDrawable) == Synchronized) { - return 0; + return False; } } @@ -532,7 +532,7 @@ FIXME: The popup could be synchronized with one single put image, nxagentFreeRegion(pCorruptedRegion); - return 1; + return True; } else { @@ -565,14 +565,14 @@ FIXME: The popup could be synchronized with one single put image, nxagentFreeRegion(pSrcRegion); } - return 0; + return False; } RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { - int skip = 0; + Bool skip = False; #ifdef TEST fprintf(stderr, "nxagentCopyArea: Image src [%s:%p], dst [%s:%p] (%d,%d) -> (%d,%d) size (%d,%d)\n", @@ -761,7 +761,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * can skip the copy area operation. */ - skip = 1; + skip = True; } #ifdef TEST @@ -771,7 +771,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); #endif - if (skip == 0 && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) + if (!skip && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) { skip = nxagentDeferCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty); @@ -784,7 +784,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } #endif - if (skip == 0) + if (!skip) { XCopyArea(nxagentDisplay, nxagentDrawable(pSrcDrawable), nxagentDrawable(pDstDrawable), nxagentGC(pGC), srcx, srcy, width, height, dstx, dsty); @@ -881,7 +881,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long plane) { - int skip = 0; + Bool skip = False; #ifdef TEST fprintf(stderr, "nxagentCopyPlane: Image src [%s:%p], dst [%s:%p] (%d,%d) -> (%d,%d) size (%d,%d)\n", @@ -969,10 +969,10 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * can skip the copy plane operation. */ - skip = 1; + skip = True; } - if (skip == 0 && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) + if (!skip && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) { if (pDstDrawable -> type == DRAWABLE_PIXMAP && nxagentOption(DeferLevel) > 0) @@ -983,7 +983,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, nxagentFreeRegion(pDstRegion); - skip = 1; + skip = True; } else { @@ -1025,7 +1025,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } #endif - if (skip == 0) + if (!skip) { XCopyPlane(nxagentDisplay, nxagentDrawable(pSrcDrawable), nxagentDrawable(pDstDrawable), -- 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 3.6.x in repository nx-libs. commit 5d7b6db0c734dfe61895f46bfccbfae4719acb69 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:43:49 2020 +0100 Drawable.c: make abort flag a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 32 +++++++++++++-------------- nx-X11/programs/Xserver/hw/nxagent/Drawable.h | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index dc4d15c80..ad896dd55 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -63,7 +63,7 @@ /* * The rectangles composing a region are de- fragmented to reduce the - * number of synch- ronizing PutImage's. + * number of synchronizing PutImage()s. */ #define ADVANCED_BOXES_DEFRAG @@ -588,7 +588,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned unsigned long now = GetTimeInMillis(); - nxagentSynchronization.abort = 0; + nxagentSynchronization.abort = False; /* * Going to split the updated region into small blocks. @@ -652,7 +652,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned "[%lu] ms elapsed.\n", elapsedTime); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -670,7 +670,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentBlocking); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -687,7 +687,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentCongestion); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -834,7 +834,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned "new input events.\n"); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -854,7 +854,7 @@ nxagentSynchronizeRegionStop: if (!nxagentOption(Shadow)) { - if (nxagentSynchronization.abort == 1) + if (nxagentSynchronization.abort) { /* * Storing the pointer to the drawable we were synchronizing @@ -1031,7 +1031,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) * synchronizations. */ - if (nxagentSynchronization.abort == 1 || + if (nxagentSynchronization.abort || nxagentDrawableStatus(pDrawable) == Synchronized) { return; @@ -1138,7 +1138,7 @@ FIXME: This condition sounds only as a complication, as the break nxagentCongestion, nxagentBlocking); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; return; } @@ -1179,7 +1179,7 @@ FIXME: This condition sounds only as a complication, as the break * clear it. */ - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && shouldClearHiddenRegion) { #ifdef TEST @@ -1243,7 +1243,7 @@ FIXME: All drawables should be set as synchronized and never marked as int doRoundRobin = (nxagentSynchronization.pDrawable != NULL); - nxagentSynchronization.abort = 0; + nxagentSynchronization.abort = False; /* * Synchronize the windows. @@ -1260,7 +1260,7 @@ FIXME: All drawables should be set as synchronized and never marked as #ifdef TEST - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && nxagentSynchronization.windowBitmaps == 0 && doRoundRobin == 0) { @@ -1280,7 +1280,7 @@ FIXME: All drawables should be set as synchronized and never marked as * Synchronize the backgrounds. */ - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_BACKGROUNDS(mask)) { #ifdef TEST @@ -1292,7 +1292,7 @@ FIXME: All drawables should be set as synchronized and never marked as #ifdef TEST - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && nxagentSynchronization.backgroundBitmaps == 0 && doRoundRobin == 0) { @@ -1315,7 +1315,7 @@ FIXME: All drawables should be set as synchronized and never marked as * the pixmap in a copy or in a composite operation. */ - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask)) { #ifdef TEST @@ -1326,7 +1326,7 @@ FIXME: All drawables should be set as synchronized and never marked as nxagentSynchronizeDrawablePredicate, &breakMask); - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && nxagentSynchronization.pixmapBitmaps == 0 && doRoundRobin == 0) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h index 1101f989f..22ffabf7a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h @@ -38,7 +38,7 @@ typedef struct { DrawablePtr pDrawable; int drawableType; - int abort; + Bool abort; int windowBitmaps; int pixmapBitmaps; int backgroundBitmaps; -- 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 3.6.x in repository nx-libs. commit 2ce0fa8f07bf297dd063c5665a6ebaf6bb37ab13 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:36:20 2020 +0100 GC.c: make internal variable and function Boolean --- nx-X11/programs/Xserver/hw/nxagent/GC.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index d39f743e6..2aa404910 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -86,7 +86,7 @@ GCPtr nxagentCreateGraphicContext(int depth); static void nxagentReconnectGC(void*, XID, void*); static void nxagentReconnectClip(GCPtr, int, void *, int); -static int nxagentCompareRegions(RegionPtr, RegionPtr); +static Bool nxagentCompareRegions(RegionPtr, RegionPtr); struct nxagentGCRec { @@ -497,7 +497,7 @@ void nxagentDestroyGC(GCPtr pGC) void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) { - int clipsMatch = 0; + Bool clipsMatch = False; #ifdef TEST fprintf(stderr, "nxagentChangeClip: Going to change clip on GC [%p]\n", @@ -528,7 +528,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } default: { - clipsMatch = 0; + clipsMatch = False; break; } } @@ -544,7 +544,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) { case CT_NONE: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); } @@ -552,7 +552,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_REGION: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XRectangle *pRects; nRects = RegionNumRects((RegionPtr)pValue); @@ -594,7 +594,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_UNSORTED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -604,7 +604,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YSORTED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -614,7 +614,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YXSORTED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -624,7 +624,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YXBANDED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -1209,29 +1209,29 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) nxagentGCPriv(pGC)->nClipRects = nRects; } -static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2) +static Bool nxagentCompareRegions(RegionPtr r1, RegionPtr r2) { /* - * It returns 1 if regions are equal, 0 otherwise + * It returns True if regions are equal, False otherwise */ if (r1 == NULL && r2 == NULL) { - return 1; + return True; } if ((r1 == NULL) || (r2 == NULL)) { - return 0; + return False; } if (RegionNumRects(r1) != RegionNumRects(r2)) { - return 0; + return False; } else if (RegionNumRects(r1) == 0) { - return 1; + return True; } else if ((*RegionExtents(r1)).x1 != (*RegionExtents(r2)).x1) return 0; else if ((*RegionExtents(r1)).x2 != (*RegionExtents(r2)).x2) return 0; @@ -1247,7 +1247,7 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2) else if (RegionRects(r1)[i].y2 != RegionRects(r2)[i].y2) return 0; } } - return 1; + return True; } /* -- 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 3.6.x in repository nx-libs. commit 41d75f6b273bd45200cddab6b8b1be31f93dc0ce Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:14:35 2020 +0100 nxagent: improve Boolean handling for Reconnect functions --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 14 +++++++------- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index c8a2d852a..90f4cc1b0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -2517,7 +2517,7 @@ Bool nxagentReconnectDisplay(void *p0) nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT, "Couldn't open the display."); - return FALSE; + return False; } nxagentAddXConnection(); @@ -2535,12 +2535,12 @@ Bool nxagentReconnectDisplay(void *p0) #endif - if (nxagentCheckForDefaultDepthCompatibility() == 0) + if (!nxagentCheckForDefaultDepthCompatibility()) { nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT, "Default display depth doesn't match."); - return FALSE; + return False; } nxagentUseNXTrans = nxagentPostProcessArgs(nxagentDisplayName, nxagentDisplay, @@ -2557,12 +2557,12 @@ Bool nxagentReconnectDisplay(void *p0) * Init and compare the visuals. */ - if (nxagentInitAndCheckVisuals(flexibility) == FALSE) + if (!nxagentInitAndCheckVisuals(flexibility)) { nxagentSetReconnectError(FAILED_RESUME_VISUALS_ALERT, "Couldn't restore the required visuals."); - return FALSE; + return False; } reconnectDisplayState = GOT_VISUAL_INFO; @@ -2612,7 +2612,7 @@ Bool nxagentReconnectDisplay(void *p0) reconnectDisplayState = GOT_DEPTH_LIST; - if (nxagentCheckForDepthsCompatibility() == 0) + if (!nxagentCheckForDepthsCompatibility()) { nxagentSetReconnectError(FAILED_RESUME_DEPTHS_ALERT, "Couldn't restore all the required depths."); @@ -2634,7 +2634,7 @@ Bool nxagentReconnectDisplay(void *p0) nxagentInitPixmapFormats(); - if (nxagentCheckForPixmapFormatsCompatibility() == 0) + if (!nxagentCheckForPixmapFormatsCompatibility()) { nxagentSetReconnectError(FAILED_RESUME_PIXMAPS_ALERT, "Couldn't restore all the required pixmap formats."); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 03ac9effd..101796748 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -458,7 +458,7 @@ Bool nxagentReconnectSession(void) nxagentProcessOptions(nxagentOptionsFilenameOrString); - if (nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP]) == 0) + if (!nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP])) { #ifdef TEST fprintf(stderr, "nxagentReconnectSession: WARNING! Failed display reconnection.\n"); @@ -468,7 +468,7 @@ Bool nxagentReconnectSession(void) goto nxagentReconnectError; } - if (nxagentReconnectScreen(reconnectLossyLevel[SCREEN_STEP]) == 0) + if (!nxagentReconnectScreen(reconnectLossyLevel[SCREEN_STEP])) { failedStep = SCREEN_STEP; goto nxagentReconnectError; @@ -478,9 +478,9 @@ Bool nxagentReconnectSession(void) nxagentListRemoteFonts("*", nxagentMaxFontNames); - if (nxagentReconnectAllFonts(reconnectLossyLevel[FONT_STEP]) == 0) + if (!nxagentReconnectAllFonts(reconnectLossyLevel[FONT_STEP])) { - if (nxagentReconnectFailedFonts(reconnectLossyLevel[FONT_STEP]) == 0) + if (!nxagentReconnectFailedFonts(reconnectLossyLevel[FONT_STEP])) { failedStep = FONT_STEP; goto nxagentReconnectError; @@ -515,26 +515,26 @@ Bool nxagentReconnectSession(void) nxagentEmptyBSPixmapList(); /* FIXME: nxagentReconnectAllPixmaps will always return 1 */ - if (nxagentReconnectAllPixmaps(reconnectLossyLevel[PIXMAP_STEP]) == 0) + if (!nxagentReconnectAllPixmaps(reconnectLossyLevel[PIXMAP_STEP])) { failedStep = PIXMAP_STEP; goto nxagentReconnectError; } - if (nxagentReconnectAllGCs(reconnectLossyLevel[GC_STEP]) == 0) + if (!nxagentReconnectAllGCs(reconnectLossyLevel[GC_STEP])) { failedStep = GC_STEP; goto nxagentReconnectError; } - if (nxagentReconnectAllColormap(reconnectLossyLevel[COLORMAP_STEP]) == 0) + if (!nxagentReconnectAllColormap(reconnectLossyLevel[COLORMAP_STEP])) { failedStep = COLORMAP_STEP; goto nxagentReconnectError; } - if (nxagentReconnectAllWindows(reconnectLossyLevel[WINDOW_STEP]) == 0) + if (!nxagentReconnectAllWindows(reconnectLossyLevel[WINDOW_STEP])) { failedStep = WINDOW_STEP; goto nxagentReconnectError; @@ -542,32 +542,32 @@ Bool nxagentReconnectSession(void) if (nxagentRenderEnable) { - if (nxagentReconnectAllGlyphSet(reconnectLossyLevel[GLYPHSET_STEP]) == 0) + if (!nxagentReconnectAllGlyphSet(reconnectLossyLevel[GLYPHSET_STEP])) { failedStep = GLYPHSET_STEP; goto nxagentReconnectError; } - if (nxagentReconnectAllPictFormat(reconnectLossyLevel[PICTFORMAT_STEP]) == 0) + if (!nxagentReconnectAllPictFormat(reconnectLossyLevel[PICTFORMAT_STEP])) { failedStep = PICTFORMAT_STEP; goto nxagentReconnectError; } - if (nxagentReconnectAllPicture(reconnectLossyLevel[PICTURE_STEP]) == 0) + if (!nxagentReconnectAllPicture(reconnectLossyLevel[PICTURE_STEP])) { failedStep = PICTURE_STEP; goto nxagentReconnectError; } } - if (nxagentReconnectAllCursor(reconnectLossyLevel[CURSOR_STEP]) == 0) + if (!nxagentReconnectAllCursor(reconnectLossyLevel[CURSOR_STEP])) { failedStep = CURSOR_STEP; goto nxagentReconnectError; } - if (nxagentSetWindowCursors(reconnectLossyLevel[WINDOW_STEP]) == 0) + if (!nxagentSetWindowCursors(reconnectLossyLevel[WINDOW_STEP])) { failedStep = WINDOW_STEP; goto nxagentReconnectError; -- 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 3.6.x in repository nx-libs. commit c035ddeadee15fff5cd697beafce4b0c5707ef95 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:46:18 2020 +0100 nxagent: make nxagentForceSynchronization a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index ad896dd55..b1df83d3b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -99,7 +99,7 @@ int nxagentCorruptedPixmaps = 0; int nxagentCorruptedWindows = 0; int nxagentCorruptedBackgrounds = 0; -int nxagentForceSynchronization = 0; +Bool nxagentForceSynchronization = False; _nxagentSynchronizationRec nxagentSynchronization = { (DrawablePtr) NULL, 0, 0, 0, 0, 0 }; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h index 22ffabf7a..e4d3ec96e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h @@ -157,7 +157,7 @@ extern int nxagentCorruptedPixmaps; extern int nxagentCorruptedWindows; extern int nxagentCorruptedBackgrounds; -extern int nxagentForceSynchronization; +extern Bool nxagentForceSynchronization; extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 256c7c241..c5bdee63b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -660,7 +660,7 @@ static void nxagentSwitchDeferMode(void) { nxagentLaunchDialog(DIALOG_DISABLE_DEFER_MODE); - nxagentForceSynchronization = 1; + nxagentForceSynchronization = True; } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index cdba83264..e6a368b9a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -310,7 +310,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) * operation. */ - if (nxagentForceSynchronization == 1) + if (nxagentForceSynchronization) { #ifdef TEST fprintf(stderr, "nxagentBlockHandler: Going to force a synchronization at %s.\n", @@ -319,7 +319,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) nxagentSynchronizationLoop(NEVER_BREAK); - nxagentForceSynchronization = 0; + nxagentForceSynchronization = False; } else if (nxagentUserInput(NULL) == 0 && !nxagentBlocking && diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index d6c659fec..9a7c1cd65 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -624,7 +624,7 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) return True; break; case KEYSTROKE_FORCE_SYNCHRONIZATION: - nxagentForceSynchronization = 1; + nxagentForceSynchronization = True; break; #ifdef DUMP case KEYSTROKE_REGIONS_ON_SCREEN: -- 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 3.6.x in repository nx-libs. commit a9d3050c508820267ac595a16fd4ebffe5c38a85 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:49:38 2020 +0100 nxagent: make nxagentSkipImage a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index b1df83d3b..f28eb1945 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -123,7 +123,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel); unsigned long nxagentGetDrawableColor(DrawablePtr pDrawable); unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion); -int nxagentSkipImage = 0; +Bool nxagentSkipImage = False; static int nxagentTooManyImageData(void) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index e6a368b9a..cbe66cd90 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -153,7 +153,7 @@ struct _DispatchRec nxagentDispatch = { UNDEFINED, 0, 0, 0 }; * server. */ -extern int nxagentSkipImage; +extern Bool nxagentSkipImage; void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) { @@ -350,7 +350,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) nxagentCorruptedBackgrounds > 0 || nxagentCorruptedPixmaps > 0)); - if (nxagentSkipImage == 0 && synchronize == 1) + if (!nxagentSkipImage && synchronize == 1) { #ifdef TEST fprintf(stderr, "nxagentBlockHandler: Setting a zero timeout with [%d][%d][%d] and " -- 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 3.6.x in repository nx-libs. commit 9e9568028d60f10de394e3758763a5f75b8e91be Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:01:48 2020 +0100 Events.h: fix wrong prototype --- nx-X11/programs/Xserver/hw/nxagent/Events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.h b/nx-X11/programs/Xserver/hw/nxagent/Events.h index fc00ba1d0..42784a8f3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.h @@ -209,7 +209,7 @@ extern int nxagentInputEvent; * Event-handling utilities. */ -Bool nxagentPendingEvents(Display *dpy); +int nxagentPendingEvents(Display *dpy); #define nxagentQueuedEvents(display) \ XQLength((display)) -- 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 3.6.x in repository nx-libs. commit b814aef39a16ba21e1b2046f902763bc9efd9638 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:49:57 2020 +0100 Handlers.c: make synchronize a Boolean variable --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index cbe66cd90..d00b13d77 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -179,7 +179,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) * Set if we need to synchronize any drawable. */ - static int synchronize; + static Bool synchronize; #ifdef BLOCKS fprintf(stderr, "[Begin block]\n"); @@ -302,7 +302,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) * are synchronized. */ - if (synchronize == 1) + if (synchronize) { /* * We should not enter the synchronization loop if there is any @@ -350,7 +350,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) nxagentCorruptedBackgrounds > 0 || nxagentCorruptedPixmaps > 0)); - if (!nxagentSkipImage && synchronize == 1) + if (!nxagentSkipImage && synchronize) { #ifdef TEST fprintf(stderr, "nxagentBlockHandler: Setting a zero timeout with [%d][%d][%d] and " -- 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 3.6.x in repository nx-libs. commit feb7b977331c62122b2314bd09ad57d2accf18a8 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:58:04 2020 +0100 nxagent: make nxagentXFixesInfo.Initialized a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 2e14c08e7..8ac2241a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -225,7 +225,7 @@ const char * getXErrorString(int code) * Save the values queried from X server. */ -XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, 0 }; +XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, False }; extern Display *nxagentDisplay; @@ -2234,7 +2234,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) XFixesSelectionClientCloseNotifyMask); } - nxagentXFixesInfo.Initialized = 1; + nxagentXFixesInfo.Initialized = True; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h index 4817a03e2..d401dae51 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h @@ -35,7 +35,7 @@ typedef struct _XFixesAgentInfo int Opcode; int EventBase; int ErrorBase; - int Initialized; + Bool Initialized; } XFixesAgentInfoRec; extern XFixesAgentInfoRec nxagentXFixesInfo; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index c5bdee63b..1758f649c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2831,7 +2831,7 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) { XFixesSelectionEvent *xfixesEvent = (XFixesSelectionEvent *) X; - if (nxagentXFixesInfo.Initialized == 0) + if (!nxagentXFixesInfo.Initialized) { #ifdef DEBUG fprintf(stderr, "%s: XFixes not initialized - doing nothing.\n", __func__); -- 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 3.6.x in repository nx-libs. commit b76dddcdc3ecebd234f9bc77adc54ff650c1810e Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:53:11 2020 +0100 Drawable.c: make doRoundRobin a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index f28eb1945..2b81a55f5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -1241,7 +1241,7 @@ FIXME: All drawables should be set as synchronized and never marked as * round-robin and if the bitmaps are all synchronized. */ - int doRoundRobin = (nxagentSynchronization.pDrawable != NULL); + Bool doRoundRobin = (nxagentSynchronization.pDrawable != NULL); nxagentSynchronization.abort = False; @@ -1262,7 +1262,7 @@ FIXME: All drawables should be set as synchronized and never marked as if (!nxagentSynchronization.abort && nxagentSynchronization.windowBitmaps == 0 && - doRoundRobin == 0) + !doRoundRobin) { if (nxagentCorruptedWindows > 0) { @@ -1294,7 +1294,7 @@ FIXME: All drawables should be set as synchronized and never marked as if (!nxagentSynchronization.abort && nxagentSynchronization.backgroundBitmaps == 0 && - doRoundRobin == 0) + !doRoundRobin) { if (nxagentCorruptedBackgrounds > 0) { @@ -1328,7 +1328,7 @@ FIXME: All drawables should be set as synchronized and never marked as if (!nxagentSynchronization.abort && nxagentSynchronization.pixmapBitmaps == 0 && - doRoundRobin == 0) + !doRoundRobin) { #ifdef TEST -- 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 3.6.x in repository nx-libs. commit 0bca321fb1bc76188a86f1d719cb510f5350c175 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:10:33 2020 +0100 nxagent: make nxagentXkbState.Initialized a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.h | 3 +-- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 1758f649c..a9a79cebd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1143,7 +1143,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already nxagentKeyDown = 0; } - if (nxagentXkbState.Initialized == 0) + if (!nxagentXkbState.Initialized) { if (X.xkey.keycode == nxagentCapsLockKeycode) { @@ -2263,7 +2263,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) { - if (nxagentXkbState.Initialized == 0) + if (!nxagentXkbState.Initialized) { if (X -> xkey.keycode == nxagentCapsLockKeycode) { @@ -2741,7 +2741,7 @@ int nxagentHandleXkbKeyboardStateEvent(XEvent *X) nxagentXkbState.Locked); #endif - nxagentXkbState.Initialized = 1; + nxagentXkbState.Initialized = True; if (nxagentXkbState.Caps == 0 && (nxagentXkbState.Locked & CAPSFLAG_IN_EVENT)) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index c9c9bb33b..38955f669 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -161,7 +161,7 @@ XkbAgentInfoRec nxagentXkbInfo = { -1, -1, -1, -1, -1 }; * Keyboard status, updated through XKB events. */ -XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, 0 }; +XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, False }; /* * Info for disabling/enabling Xkb extension. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h index dbfb47733..504c99869 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h @@ -68,8 +68,7 @@ typedef struct _XkbAgentState int Caps; int Num; int Focus; - int Initialized; - + Bool Initialized; } XkbAgentStateRec; extern XkbAgentStateRec nxagentXkbState; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 101796748..d0f83e7bd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -616,7 +616,7 @@ Bool nxagentReconnectSession(void) } } - nxagentXkbState.Initialized = 0; + nxagentXkbState.Initialized = False; SAFE_free(nxagentOldKeyboard); -- 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 3.6.x in repository nx-libs. commit 4eba4f53ad8c62c27c12835e58184d66121ff636 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Dec 10 10:24:29 2020 +0100 CVE-2020-14360: Check SetMap request length carefully. Backported from X.org: From 446ff2d3177087b8173fa779fa5b77a2a128988b Mon Sep 17 00:00:00 2001 From: Matthieu Herrb <matthieu@herrb.eu> Date: Thu, 12 Nov 2020 19:15:07 +0100 Subject: [PATCH] Check SetMap request length carefully. Avoid out of bounds memory accesses on too short request. ZDI-CAN 11572 / CVE-2020-14360 This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Fixes ArcticaProject/nx-libs#972. --- nx-X11/programs/Xserver/xkb/xkb.c | 91 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 7b392fa09..654b33fe7 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -2202,6 +2202,92 @@ XkbServerMapPtr srv = xkbi->desc->server; return (char *)wire; } +#define _add_check_len(new) \ + if (len > UINT32_MAX - (new) || len > req_len - (new)) goto bad; \ + else len += new + +/** + * Check the length of the SetMap request + */ +static int +_XkbSetMapCheckLength(xkbSetMapReq *req) +{ + size_t len = sz_xkbSetMapReq, req_len = req->length << 2; + xkbKeyTypeWireDesc *keytype; + xkbSymMapWireDesc *symmap; + BOOL preserve; + int i, map_count, nSyms; + + if (req_len < len) + goto bad; + /* types */ + if (req->present & XkbKeyTypesMask) { + keytype = (xkbKeyTypeWireDesc *)(req + 1); + for (i = 0; i < req->nTypes; i++) { + _add_check_len(XkbPaddedSize(sz_xkbKeyTypeWireDesc)); + if (req->flags & XkbSetMapResizeTypes) { + _add_check_len(keytype->nMapEntries + * sz_xkbKTSetMapEntryWireDesc); + preserve = keytype->preserve; + map_count = keytype->nMapEntries; + if (preserve) { + _add_check_len(map_count * sz_xkbModsWireDesc); + } + keytype += 1; + keytype = (xkbKeyTypeWireDesc *) + ((xkbKTSetMapEntryWireDesc *)keytype + map_count); + if (preserve) + keytype = (xkbKeyTypeWireDesc *) + ((xkbModsWireDesc *)keytype + map_count); + } + } + } + /* syms */ + if (req->present & XkbKeySymsMask) { + symmap = (xkbSymMapWireDesc *)((char *)req + len); + for (i = 0; i < req->nKeySyms; i++) { + _add_check_len(sz_xkbSymMapWireDesc); + nSyms = symmap->nSyms; + _add_check_len(nSyms*sizeof(CARD32)); + symmap += 1; + symmap = (xkbSymMapWireDesc *)((CARD32 *)symmap + nSyms); + } + } + /* actions */ + if (req->present & XkbKeyActionsMask) { + _add_check_len(req->totalActs * sz_xkbActionWireDesc + + XkbPaddedSize(req->nKeyActs)); + } + /* behaviours */ + if (req->present & XkbKeyBehaviorsMask) { + _add_check_len(req->totalKeyBehaviors * sz_xkbBehaviorWireDesc); + } + /* vmods */ + if (req->present & XkbVirtualModsMask) { + _add_check_len(XkbPaddedSize(Ones(req->virtualMods))); + } + /* explicit */ + if (req->present & XkbExplicitComponentsMask) { + /* two bytes per non-zero explicit componen */ + _add_check_len(XkbPaddedSize(req->totalKeyExplicit * sizeof(CARD16))); + } + /* modmap */ + if (req->present & XkbModifierMapMask) { + /* two bytes per non-zero modmap component */ + _add_check_len(XkbPaddedSize(req->totalModMapKeys * sizeof(CARD16))); + } + /* vmodmap */ + if (req->present & XkbVirtualModMapMask) { + _add_check_len(req->totalVModMapKeys * sz_xkbVModMapWireDesc); + } + if (len == req_len) + return Success; +bad: + ErrorF("[xkb] BOGUS LENGTH in SetMap: expected %ld got %ld\n", + len, req_len); + return BadLength; +} + int ProcXkbSetMap(ClientPtr client) { @@ -2225,6 +2311,11 @@ ProcXkbSetMap(ClientPtr client) CHK_KBD_DEVICE(dev,stuff->deviceSpec); CHK_MASK_LEGAL(0x01,stuff->present,XkbAllMapComponentsMask); + /* first verify the request length carefully */ + rc = _XkbSetMapCheckLength(stuff); + if (rc != Success) + return rc; + XkbSetCauseXkbReq(&cause,X_kbSetMap,client); xkbi= dev->key->xkbInfo; xkb = xkbi->desc; -- 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 3.6.x in repository nx-libs. commit 91cef61a016c2a3118fa6c39d2713a47e7914b60 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:20:00 2020 +0100 Font.c: Use Booleans where appropriate --- nx-X11/programs/Xserver/hw/nxagent/Font.c | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 0ce5b87ad..c5dcdf4af 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -102,7 +102,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName , FontPtr pFont); int nxagentFreeFont(XFontStruct *fs); static Bool nxagentGetFontServerPath(char * fontServerPath, int size); -static char * nxagentMakeScalableFontName(const char *fontName, int scalableResolution); +static char * nxagentMakeScalableFontName(const char *fontName, Bool scalableResolution); RESTYPE RT_NX_FONT; @@ -414,10 +414,10 @@ Bool nxagentFontLookUp(const char *name) if (name && strlen(name) == 0) { - return 0; + return False; } - int result = nxagentFontFind(name, &i); + Bool result = nxagentFontFind(name, &i); char *scalable = NULL; @@ -425,9 +425,9 @@ Bool nxagentFontLookUp(const char *name) * Let's try with the scalable font description. */ - if (result == 0) + if (!result) { - if ((scalable = nxagentMakeScalableFontName(name, 0)) != NULL) + if ((scalable = nxagentMakeScalableFontName(name, False)) != NULL) { result = nxagentFontFind(scalable, &i); @@ -439,9 +439,9 @@ Bool nxagentFontLookUp(const char *name) * Let's try again after replacing zero to xdpi and ydpi in the pattern. */ - if (result == 0) + if (!result) { - if ((scalable = nxagentMakeScalableFontName(name, 1)) != NULL) + if ((scalable = nxagentMakeScalableFontName(name, True)) != NULL) { result = nxagentFontFind(scalable, &i); @@ -449,9 +449,9 @@ Bool nxagentFontLookUp(const char *name) } } - if (result == 0) + if (!result) { - return 0; + return False; } else { @@ -612,7 +612,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) if (nxagentFontPriv(pFont)->font_struct == NULL) { - if (nxagentFontLookUp(name) == False) + if (!nxagentFontLookUp(name)) { fprintf(stderr, "Font: nxagentRealizeFont failed with font Font=%s, not in our remote list\n", validateString(name)); @@ -1532,7 +1532,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo fprintf(stderr, "nxagentLoadQueryFont: Looking for font '%s'.\n", name); #endif - if (nxagentFontLookUp(name) == 0) + if (!nxagentFontLookUp(name)) { #ifdef DEBUG fprintf(stderr, "nxagentLoadQueryFont: WARNING! Font not found '%s'.\n", name); @@ -1630,7 +1630,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) char *current = string; int i = 0; - int last = 0; + Bool last = False; for (;;) { @@ -1644,7 +1644,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) if (next == NULL) { next = string + len; - last = 1; + last = True; } int fieldlen = next - current; @@ -1662,7 +1662,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) i++; - if (last == 1) + if (last) { break; } @@ -1671,7 +1671,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) return i; } -char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution) +char *nxagentMakeScalableFontName(const char *fontName, Bool scalableResolution) { char *scalableFontName; @@ -1710,7 +1710,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution) strcat(scalableFontName, "-0"); } - else if (scalableResolution == 1 && (field == 8 || field == 9)) + else if (scalableResolution && (field == 8 || field == 9)) { /* * RESOLUTION_X || RESOLUTION_Y -- 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 3.6.x in repository nx-libs. commit 262fe771cceda4a984be603ccb3d8f6563706741 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 14:36:23 2020 +0100 Handlers.c: ensure regular yields if suspended Fixes ArcticaProject/nx-libs#903 --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 9f0a3c9d9..62974b9c1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -1070,7 +1070,28 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) * into the inner dispatch loop forever. */ - if (!SmartScheduleSignalEnable) + /* + * The behaviour described in the comment above also happens with the + * smart scheduler if all of the following conditions are met: + * - the agent is suspended + * - SleepTimeMillis is set (the default is sufficient to trigger this) + * - a client is doing a lot of image operations + * - nxagentShadowCounter is 0 + * In that case the agent will slow down the image operations by calling + * an intermediate sleep resulting in the client's request queue never + * being empty. Which in turn leads to the drain loop described above. + * isItTimeToYield will then never be set. The (dramatic) result of this + * is that nxagent will not process any signals and therefore cannot be + * resumed anymore! + * For this reason we do not limit below code to the dumb scheduler but also + * run it if above conditions are met - ensuring regular yields. + * See issue #903 + */ + + if (!SmartScheduleSignalEnable || + (nxagentShadowCounter == 0 && + NXDisplayError(nxagentDisplay) == 1 && + nxagentOption(SleepTimeMillis) > 0)) { if (client -> index != nxagentDispatch.client) { -- 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 3.6.x in repository nx-libs. commit faae65fb3693fd1020e740e00f9038607bc4a430 Merge: d545afdf3 b44ecc0f8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Jan 15 16:27:32 2021 +0100 Merge branch 'uli42-pr/rework_booleans_v2' into 3.6.x Attributes GH PR #980: https://github.com/ArcticaProject/nx-libs/pull/980 nx-X11/programs/Xserver/hw/nxagent/Args.c | 133 +++++++++--------------- nx-X11/programs/Xserver/hw/nxagent/Args.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Client.c | 16 +-- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 2 +- 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 | 22 ++-- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 112 ++++++++++---------- nx-X11/programs/Xserver/hw/nxagent/Drawable.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Error.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Error.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 88 ++++++++-------- nx-X11/programs/Xserver/hw/nxagent/Events.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 20 ++-- nx-X11/programs/Xserver/hw/nxagent/Font.c | 36 +++---- nx-X11/programs/Xserver/hw/nxagent/GC.c | 44 ++++---- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 96 ++++++++--------- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 50 ++++----- nx-X11/programs/Xserver/hw/nxagent/Handlers.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 96 ++++++++--------- nx-X11/programs/Xserver/hw/nxagent/Init.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.h | 3 +- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 50 ++++----- nx-X11/programs/Xserver/hw/nxagent/Options.h | 58 ++++++----- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 12 +-- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 40 +++---- nx-X11/programs/Xserver/hw/nxagent/Render.c | 28 ++--- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 51 ++++----- nx-X11/programs/Xserver/hw/nxagent/Screen.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Split.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 50 ++++----- nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h | 2 +- 44 files changed, 535 insertions(+), 558 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 3.6.x in repository nx-libs. commit b44ecc0f897a5d03445aafc120e54b6475699254 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:28:49 2020 +0100 nxagent: nxagent(Default)WindowIsVisible() are Booleans --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Image.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 2b81a55f5..ca1b09dd3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -2309,7 +2309,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) * The window is not visible. */ - if (nxagentWindowIsVisible(pWin) == 0) + if (!nxagentWindowIsVisible(pWin)) { return; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index ee56e9abf..57b7c2b57 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -699,8 +699,8 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, */ if (!nxagentOption(IgnoreVisibility) && pDstDrawable -> type == DRAWABLE_WINDOW && - (nxagentWindowIsVisible((WindowPtr) pDstDrawable) == 0 || - (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) + (!nxagentWindowIsVisible((WindowPtr) pDstDrawable) || + (!nxagentDefaultWindowIsVisible() && nxagentCompositeEnable == 0))) { #ifdef TEST fprintf(stderr, "nxagentCopyArea: Prevented operation on fully obscured window at [%p].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index eb4085ef3..8c828df20 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -525,8 +525,8 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, */ if (!nxagentOption(IgnoreVisibility) && pDrawable -> type == DRAWABLE_WINDOW && - (nxagentWindowIsVisible((WindowPtr) pDrawable) == 0 || - (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) + (!nxagentWindowIsVisible((WindowPtr) pDrawable) || + (!nxagentDefaultWindowIsVisible() && nxagentCompositeEnable == 0))) { #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 7426acab2..cf5e50c04 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -173,8 +173,8 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE */ #define NXAGENT_SHOULD_SYNCHRONIZE_WINDOW(pDrawable) \ - (nxagentWindowIsVisible((WindowPtr) pDrawable) == 1 && \ - (nxagentDefaultWindowIsVisible() == 1 || nxagentCompositeEnable == 1)) + (nxagentWindowIsVisible((WindowPtr) pDrawable) && \ + (nxagentDefaultWindowIsVisible() || nxagentCompositeEnable == 1)) #define MINIMUM_PIXMAP_USAGE_COUNTER 2 -- 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 3.6.x in repository nx-libs. commit d78837ec3547da1275b635dc0fe6d38de4f8a1cb Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:22:11 2020 +0100 Keyboard.c: noXkbExtension is a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 38955f669..00db6ce2a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -974,7 +974,7 @@ int nxagentResetKeyboard(void) if (dev->key) { #ifdef XKB - if (noXkbExtension == 0 && dev->key->xkbInfo) + if (!noXkbExtension && dev->key->xkbInfo) { oldMinKeycode = dev->key->xkbInfo -> desc -> min_key_code; oldMaxKeycode = dev->key->xkbInfo -> desc -> max_key_code; @@ -1132,7 +1132,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev) if (dev->key) { #ifdef XKB - if (noXkbExtension == 0 && dev->key->xkbInfo) + if (!noXkbExtension && dev->key->xkbInfo) { XkbFreeInfo(dev->key->xkbInfo); dev->key->xkbInfo = NULL; -- 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 3.6.x in repository nx-libs. commit 1e4d8e32b22cb0442ed8cd2dbd5c1e864a9c3585 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 21:22:40 2020 +0100 Options.h: mark Booleans Many variables are used as Booleans. By adding the Bool define to Options.h we can now make that visible. --- nx-X11/programs/Xserver/hw/nxagent/Options.h | 58 +++++++++++++++------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h index e56860f04..a99f4aee2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -26,6 +26,12 @@ #ifndef __Options_H__ #define __Options_H__ +/* Bool is defined in Xlib.h but we do not want to include that here, so let's + clone the definition */ +#ifndef Bool +#define Bool int +#endif + #ifndef True #define True 1 #endif @@ -122,33 +128,33 @@ typedef struct _AgentOptions /* * Is agent running in desktop mode? This is presently the default. */ - int Desktop; + Bool Desktop; /* * True if user activated rootless mode. */ - int Rootless; + Bool Rootless; /* * True for shadow mode. */ - int Shadow; + Bool Shadow; /* * True if user activated persistent mode. */ - int Persistent; + Bool Persistent; /* * True if user activated fullscreen mode. */ - int Fullscreen; + Bool Fullscreen; /* * True if the fullscreen NX session will extend on all available * screens. */ - int AllScreens; + Bool AllScreens; /* * Set to the auto-disconnect timeout, if the user activated this @@ -176,7 +182,7 @@ typedef struct _AgentOptions /* * Set if agent is running nested in another agent X server. */ - int Nested; + Bool Nested; /* * Selected backing-store mode. @@ -192,12 +198,12 @@ typedef struct _AgentOptions * Enable agent to use the MITSHM extension in path from remote * proxy to the real X server. */ - int SharedMemory; + Bool SharedMemory; /* * Enable agent to use shared Pixmaps */ - int SharedPixmaps; + Bool SharedPixmaps; /* * Enable agent to propagate keyboard and pointer device @@ -214,12 +220,12 @@ typedef struct _AgentOptions * Resuming keyboard device corrects keymap if session migrates * across platforms with different keycode layout. */ - int ResetKeyboardAtResume; + Bool ResetKeyboardAtResume; /* * Reset server when the last client disconnects. */ - int Reset; + Bool Reset; /* * Geometry of the agent root window, relative to the agent default @@ -236,7 +242,7 @@ typedef struct _AgentOptions * True if the user can resize the desktop by dragging the window * border. */ - int DesktopResize; + Bool DesktopResize; /* * The scaling ratio of the shadow agent. @@ -248,19 +254,19 @@ typedef struct _AgentOptions /* * The shadow agent uses the Damage extension. */ - int UseDamage; + Bool UseDamage; /* * Was the agent run with the -B option? */ - int Binder; + Bool Binder; char *BinderOptions; /* * Set if the agent has to connect to a desktop manager to start the * session. */ - int Xdmcp; + Bool Xdmcp; /* * Size of the Xlib display buffer. The default is set according to @@ -276,31 +282,31 @@ typedef struct _AgentOptions /* * Use the composite extension when available on the remote display. */ - int Composite; + Bool Composite; /* * If set, don't skip internal operations when the agent window is * not fully visible. */ - int IgnoreVisibility; + Bool IgnoreVisibility; /* * If set, prevent the shadow session to interact with master * display. */ - int ViewOnly; + Bool ViewOnly; /* * If true select a lossy or lossless compression method based on * the characteristics of the image. */ - int Adaptive; + Bool Adaptive; /* * Stream the images and update the display when the image has been * completely transerred. */ - int Streaming; + Bool Streaming; /* * Use a lazy approach in updating the remote display. This means @@ -323,12 +329,12 @@ typedef struct _AgentOptions /* * Enabling/disabling the pulldown menu. */ - int Menu; + Bool Menu; /* * Enabling/disabling the magic pixel. */ - int MagicPixel; + Bool MagicPixel; /* * Specify the Operative System of the client. @@ -338,7 +344,7 @@ typedef struct _AgentOptions /* * Inhibit some XKEYBOARD requests. */ - int InhibitXkb; + Bool InhibitXkb; /* * Maximum number of bytes that can be pasted from an NX session @@ -355,7 +361,7 @@ typedef struct _AgentOptions * True if agent should not exit if there are no clients in rootless * mode */ - int NoRootlessExit; + Bool NoRootlessExit; /* * Store if the user wants Xinerama. There are variables called @@ -365,7 +371,7 @@ typedef struct _AgentOptions * the user preference provided by the -/+(rr)xinerama parameter(s) * before initializing those extensions. */ - int Xinerama; + Bool Xinerama; /* * Sleep delay in milliseconds. @@ -386,7 +392,7 @@ typedef struct _AgentOptions * True if agent should grab the input in windowed mode whenever the * agent window gets the focus */ - int AutoGrab; /* Should be Bool but I do not want to include Xlib.h here */ + Bool AutoGrab; } AgentOptionsRec; -- 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 3.6.x in repository nx-libs. commit ca5a14743168055638a1e8b1fcd5833eeeec515d Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 19:27:15 2020 +0100 nxagent: treat DesktopResize and nxagentResizeDesktopAtStartup as Booleans The already where Booleans but where not using True/False values everywhere --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Events.c | 10 +++++----- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 8 ++++---- nx-X11/programs/Xserver/hw/nxagent/Options.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Window.c | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 554f7ae38..6d63f768a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1220,13 +1220,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 { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 471e3f6a1..f2f9c5119 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -569,7 +569,7 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentChangeOption(DesktopResize, !desktopResize); - if (nxagentOption(DesktopResize) == 0) + if (!nxagentOption(DesktopResize)) { fprintf(stderr,"Info: Disabled desktop resize mode in agent.\n"); @@ -607,7 +607,7 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen) nxagentChangeOption(DesktopResize, !desktopResize); - if (nxagentOption(DesktopResize) == 0) + if (!nxagentOption(DesktopResize)) { nxagentShadowSetRatio(1.0, 1.0); @@ -1229,7 +1229,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentOption(DesktopResize) == False && + if (!nxagentOption(DesktopResize) && (X.xbutton.state & (ControlMask | Mod1Mask)) == (ControlMask | Mod1Mask)) { /* @@ -3303,7 +3303,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 || @@ -3369,7 +3369,7 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentChangeOption(Y, newY); } - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 && + if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) && (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height)) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 835d05d19..77f2d6b38 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -429,7 +429,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, { UpdateCurrentTime(); - if (nxagentOption(DesktopResize) == 1 && + if (nxagentOption(DesktopResize) && (nxagentOption(Fullscreen) || width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) || height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)))) @@ -437,11 +437,11 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, if (nxagentOption(ClientOs) != ClientOsWinnt /*&& nxagentOption(ClientOs) != ClientNXPlayer*/) { - nxagentChangeOption(DesktopResize, 0); + nxagentChangeOption(DesktopResize, False); } } - if (nxagentOption(DesktopResize) == 1 && !nxagentOption(Fullscreen) && + if (nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) { nxagentChangeOption(Width, width); @@ -450,7 +450,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True); - if (result == 1 && nxagentOption(DesktopResize) == 1 && + if (result == 1 && nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) { nxagentRandRSetWindowsSize(width, height); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index 660aa9a4d..d4a7479e3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -108,7 +108,7 @@ void nxagentInitOptions(void) nxagentOptions.ViewportXSpan = 0; nxagentOptions.ViewportYSpan = 0; - nxagentOptions.DesktopResize = 1; + nxagentOptions.DesktopResize = True; nxagentOptions.Ratio = DONT_SCALE; nxagentOptions.XRatio = DONT_SCALE; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index f5aa11e5f..d8f79f015 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -966,7 +966,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) if (nxagentOption(Fullscreen) && nxagentWMIsRunning && nxagentReconnectTrap && - nxagentResizeDesktopAtStartup == False && + !nxagentResizeDesktopAtStartup && nxagentXServerGeometryChanged()) { #ifdef TEST @@ -1836,7 +1836,7 @@ N/A sizeHints->width = nxagentOption(RootWidth); sizeHints->height = nxagentOption(RootHeight); - if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen)) + if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen)) { sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -4399,7 +4399,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/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index ab61c101b..f1c21e12c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -901,7 +901,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e); nxagentFullscreenWindow = w; - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize)) { if (nxagentOption(Shadow) == 0) { @@ -952,7 +952,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentIconWindow = nxagentFullscreenWindow = None; - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize)) { nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); @@ -998,7 +998,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) == 1 && nxagentOption(DesktopResize)) { nxagentShadowAdaptToRatio(); } -- 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 3.6.x in repository nx-libs. commit 6e9b3a7f8872e79c81b1f9096a7cde9fd46d24f6 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 19:20:56 2020 +0100 nxagent: make Fullscreen and AllScreens Booleans There's no need/sense in having a tri-state with the third state being UNDEFINED. --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 14 ++------------ nx-X11/programs/Xserver/hw/nxagent/Events.c | 18 +++++++++--------- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 12 ++++++------ nx-X11/programs/Xserver/hw/nxagent/Options.c | 3 ++- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 13 ++++++++----- nx-X11/programs/Xserver/hw/nxagent/Window.c | 4 ++-- 6 files changed, 29 insertions(+), 35 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 1ae1b570b..554f7ae38 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -589,7 +589,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) } } - if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen) == 1)) + if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen))) { return 2; } @@ -1749,7 +1749,7 @@ N/A #endif - if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen) == 1) + if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen)) { #ifdef TEST fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); @@ -1974,16 +1974,6 @@ N/A * Set the other defaults. */ - if (nxagentOption(Fullscreen) == UNDEFINED) - { - nxagentChangeOption(Fullscreen, False); - } - - if (nxagentOption(AllScreens) == UNDEFINED) - { - nxagentChangeOption(AllScreens, False); - } - if (nxagentOption(Binder) == UNDEFINED) { nxagentChangeOption(Binder, False); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 332cb2f32..471e3f6a1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -575,7 +575,7 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE); - if (nxagentOption(Fullscreen) == 0) + if (!nxagentOption(Fullscreen)) { nxagentSetWMNormalHintsMaxsize(pScreen, nxagentOption(RootWidth), @@ -1724,7 +1724,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already nxagentScreenTrap = False; } - if (nxagentOption(Fullscreen) == 1 && + if (nxagentOption(Fullscreen) && X.xcrossing.window == nxagentFullscreenWindow && X.xcrossing.detail != NotifyInferior) { @@ -2057,7 +2057,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentOption(AllScreens) == 1) + if (nxagentOption(AllScreens)) { if (X.xmap.window == nxagentIconWindow) { @@ -2066,7 +2066,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { nxagentVisibility = VisibilityUnobscured; nxagentVisibilityStop = False; @@ -2185,7 +2185,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (switchFullscreen) { - if (nxagentOption(AllScreens) == 1 && nxagentOption(Fullscreen) == 1) + if (nxagentOption(AllScreens) && nxagentOption(Fullscreen)) { nxagentSwitchAllScreens(pScreen, 0); } @@ -2197,7 +2197,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (switchAllScreens) { - if (nxagentOption(AllScreens) == 0 && nxagentOption(Fullscreen) == 1) + if (!nxagentOption(AllScreens) && nxagentOption(Fullscreen)) { nxagentSwitchFullscreen(pScreen, False); } @@ -3291,7 +3291,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 @@ -3409,7 +3409,7 @@ int nxagentHandleConfigureNotify(XEvent* X) XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, X -> xconfigure.width, X -> xconfigure.height); - if (nxagentOption(Fullscreen) == 0) + if (!nxagentOption(Fullscreen)) { /* FIXME: has already been done some lines above */ nxagentMoveViewport(pScreen, 0, 0); @@ -3592,7 +3592,7 @@ int nxagentHandleReparentNotify(XEvent* X) return 1; } - else if (nxagentWMIsRunning && nxagentOption(Fullscreen) == 0 && + else if (nxagentWMIsRunning && !nxagentOption(Fullscreen) && nxagentOption(WMBorderWidth) == -1) { /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 52c3b0375..835d05d19 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -393,7 +393,7 @@ void nxagentRandRSetWindowsSize(int width, int height) { if (width == 0) { - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } @@ -405,7 +405,7 @@ void nxagentRandRSetWindowsSize(int width, int height) if (height == 0) { - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } @@ -430,7 +430,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, UpdateCurrentTime(); if (nxagentOption(DesktopResize) == 1 && - (nxagentOption(Fullscreen) == 1 || + (nxagentOption(Fullscreen) || width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) || height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)))) { @@ -441,8 +441,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, } } - if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 && - nxagentOption(AllScreens) == 0) + if (nxagentOption(DesktopResize) == 1 && !nxagentOption(Fullscreen) && + !nxagentOption(AllScreens)) { nxagentChangeOption(Width, width); nxagentChangeOption(Height, height); @@ -451,7 +451,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True); if (result == 1 && nxagentOption(DesktopResize) == 1 && - nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0) + !nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) { nxagentRandRSetWindowsSize(width, height); nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index 0da504f06..660aa9a4d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -62,7 +62,8 @@ void nxagentInitOptions(void) nxagentOptions.Desktop = UNDEFINED; nxagentOptions.Persistent = 1; nxagentOptions.Rootless = UNDEFINED; - nxagentOptions.Fullscreen = UNDEFINED; + nxagentOptions.Fullscreen = False; + nxagentOptions.AllScreens = False; nxagentOptions.NoRootlessExit = False; nxagentOptions.X = 0; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 148f9e1dd..f5aa11e5f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -800,6 +800,9 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix) fprintf(stderr, "%s | Fullscreen is %s.\n", prefix, nxagentOption(Fullscreen) ? "ON" : "OFF"); + fprintf(stderr, "%s | AllScreens is %s.\n", prefix, + nxagentOption(AllScreens) ? "ON" : "OFF"); + fprintf(stderr, "%s | Desktop resize mode is %s.\n", prefix, nxagentOption(DesktopResize) ? "ON" : "OFF"); @@ -1664,13 +1667,13 @@ N/A .colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)) }; - if (nxagentOption(AllScreens) == 1) + if (nxagentOption(AllScreens)) { valuemask |= CWOverrideRedirect; attributes.override_redirect = True; } - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { if (nxagentReconnectTrap) { @@ -1833,7 +1836,7 @@ N/A sizeHints->width = nxagentOption(RootWidth); sizeHints->height = nxagentOption(RootHeight); - if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) + if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen)) { sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -2362,7 +2365,7 @@ 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); @@ -2566,7 +2569,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) return -1; } - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 2dea31af0..ab61c101b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -2500,7 +2500,7 @@ void nxagentRefreshWindows(WindowPtr pWin) void nxagentUnmapWindows(void) { - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { for (int i = 0; i < screenInfo.numScreens; i++) { @@ -2556,7 +2556,7 @@ void nxagentMapDefaultWindows(void) XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); - if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning) + if (nxagentOption(Fullscreen) && nxagentWMIsRunning) { nxagentMaximizeToFullScreen(pScreen); } -- 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 3.6.x in repository nx-libs. commit acb861df40951de59db0ff7ca8c5a3acc9f5292d Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 21:21:19 2020 +0100 nxagent: make nxagentOption Shadow a Boolean and add the missing init code. --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 14 +++++++------- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Events.c | 14 +++++++------- nx-X11/programs/Xserver/hw/nxagent/Image.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 1 + nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 8 ++++---- 9 files changed, 26 insertions(+), 25 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 3505c9319..76669e39e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -507,7 +507,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); @@ -830,7 +830,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-S")) { - nxagentChangeOption(Shadow, 1); + nxagentChangeOption(Shadow, True); nxagentChangeOption(DeferLevel, 0); nxagentChangeOption(Persistent, False); return 1; @@ -1749,7 +1749,7 @@ N/A #endif - if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen)) + if ((nxagentOption(Rootless) == True) && nxagentOption(Fullscreen)) { #ifdef TEST fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); @@ -2029,7 +2029,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. nxagentAlphaEnabled = False; } - if ((nxagentOption(Rootless) == 1) && nxagentOption(Xdmcp)) + if ((nxagentOption(Rootless) == True) && nxagentOption(Xdmcp)) { FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n"); } @@ -2353,7 +2353,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"); @@ -2368,7 +2368,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"); @@ -2472,7 +2472,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/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index bdbf4fcf8..4d643a97e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -799,7 +799,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)) { @@ -852,7 +852,7 @@ nxagentSynchronizeRegionStop: success = 1; - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { if (nxagentSynchronization.abort == 1) { @@ -921,7 +921,7 @@ nxagentSynchronizeRegionStop: int w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1; int h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1; - if (nxagentOption(Shadow) == 1 && + if (nxagentOption(Shadow) && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE)) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 88375cbe1..9d58e814b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1043,7 +1043,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } case doSwitchResizeMode: { - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { if (nxagentNoDialogIsRunning) { @@ -1097,7 +1097,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentRemoveDuplicatedKeys(&X); } - if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) == 1 && result == doNothing) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && result == doNothing) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1492,7 +1492,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already NXShadowEvent(nxagentDisplay, X); } - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentInputEvent = 1; } @@ -3369,7 +3369,7 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentChangeOption(Y, newY); } - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) && + if (nxagentOption(Shadow) && nxagentOption(DesktopResize) && (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height)) { @@ -3397,7 +3397,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) && @@ -4323,7 +4323,7 @@ int nxagentUserInput(void *p) * eventually change the nxagentInputEvent status. */ - if (nxagentOption(Shadow) == 1 && + if (nxagentOption(Shadow) && nxagentPendingEvents(nxagentDisplay) > 0) { nxagentDispatchEvents(NULL); @@ -4342,7 +4342,7 @@ int nxagentUserInput(void *p) * browser's page), in order to update the screen smoothly. */ - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow)) { return result; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index 946cb7bf8..79d8c365f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -925,7 +925,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int 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) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 14d811877..c9c9bb33b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -776,7 +776,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 bbc30ee01..6573ac0b9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -575,7 +575,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/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index dd474e3dd..c9b07db97 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -62,6 +62,7 @@ void nxagentInitOptions(void) nxagentOptions.Desktop = UNDEFINED; nxagentOptions.Persistent = True; nxagentOptions.Rootless = UNDEFINED; + nxagentOptions.Shadow = False; nxagentOptions.Fullscreen = False; nxagentOptions.AllScreens = False; nxagentOptions.NoRootlessExit = False; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 316d147ac..07f57621e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -97,7 +97,7 @@ while (0) nxagentUserInput(NULL) == 1) #define canBreakOnTimeout(mask) \ - (((mask) != NEVER_BREAK) && nxagentOption(Shadow) == 0) + (((mask) != NEVER_BREAK) && !nxagentOption(Shadow)) /* * Macros defining the conditions to diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index f1c21e12c..592d76dfd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -903,7 +903,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) if (nxagentOption(DesktopResize)) { - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), True); @@ -957,7 +957,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentOption(RootHeight), True); @@ -998,7 +998,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) nxagentChangeOption(Width, nxagentOption(SavedWidth)); nxagentChangeOption(Height, nxagentOption(SavedHeight)); - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize)) + if (nxagentOption(Shadow) && nxagentOption(DesktopResize)) { nxagentShadowAdaptToRatio(); } @@ -2547,7 +2547,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", -- 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 3.6.x in repository nx-libs. commit 2565484f5d6dc7dc794e729a1fdd15bfba3b48b0 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 20:07:57 2020 +0100 nxagent: treat several nxagentOptions as real Booleans Adaptive, Composite, DeviceControl, DeviceControlUserDefined, IgnoreVisibility, InhibitXkb, Nested, Menu, MagicPixel, Persistent, Reset, ResetzKeyboardAtResume, SharedMemory, SharedPixmaps, Streaming, UseDamage, ViewOnly, Xdmcp, Xinerama --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 56 ++++++++++++------------- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Client.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 18 ++++---- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 8 ++-- nx-X11/programs/Xserver/hw/nxagent/Init.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXshm.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 38 ++++++++--------- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 6 +-- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 4 +- 16 files changed, 77 insertions(+), 77 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 6d63f768a..3505c9319 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -488,11 +488,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) { if (!strcmp(argv[i], "0")) { - nxagentChangeOption(Streaming, 0); + nxagentChangeOption(Streaming, False); } else { - nxagentChangeOption(Streaming, 1); + nxagentChangeOption(Streaming, True); } return 2; } @@ -670,7 +670,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-nomagicpixel")) { - nxagentChangeOption(MagicPixel, 0); + nxagentChangeOption(MagicPixel, False); return 1; } @@ -725,13 +725,13 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-nocomposite")) { - nxagentChangeOption(Composite, 0); + nxagentChangeOption(Composite, False); return 1; } if (!strcmp(argv[i], "-nodamage")) { - nxagentChangeOption(UseDamage, 0); + nxagentChangeOption(UseDamage, False); return 1; } @@ -779,7 +779,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-noignore")) { nxagentChangeOption(DeviceControl, True); - nxagentChangeOption(DeviceControlUserDefined , True); + nxagentChangeOption(DeviceControlUserDefined, True); return 1; } @@ -791,7 +791,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-noxkblock")) { - nxagentChangeOption(InhibitXkb, 0); + nxagentChangeOption(InhibitXkb, False); return 1; } @@ -832,7 +832,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) { nxagentChangeOption(Shadow, 1); nxagentChangeOption(DeferLevel, 0); - nxagentChangeOption(Persistent, 0); + nxagentChangeOption(Persistent, False); return 1; } @@ -858,11 +858,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) { if (!strcmp(argv[i], "0")) { - nxagentChangeOption(ViewOnly, 1); + nxagentChangeOption(ViewOnly, True); } else { - nxagentChangeOption(ViewOnly, 0); + nxagentChangeOption(ViewOnly, False); } return 2; } @@ -998,7 +998,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) * has been disabled on the cmdline. */ if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); return 0; } @@ -1174,11 +1174,11 @@ static void nxagentParseSingleOption(char *name, char *value) { if (!strcmp(value, "1")) { - nxagentChangeOption(Composite, 1); + nxagentChangeOption(Composite, True); } else if (!strcmp(value, "0")) { - nxagentChangeOption(Composite, 0); + nxagentChangeOption(Composite, False); } else { @@ -1190,25 +1190,25 @@ static void nxagentParseSingleOption(char *name, char *value) else if (!strcmp(name, "xinerama")) { #if !defined(PANORAMIX) && !defined(RANDR) - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); fprintf(stderr, "Warning: No Xinerama support compiled into %s.\n", nxagentProgName); return; #else if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) { - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", nxagentProgName); return; } if (!strcmp(value, "1")) { - nxagentChangeOption(Xinerama, 1); + nxagentChangeOption(Xinerama, True); return; } else if (!strcmp(value, "0")) { - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); } else { @@ -1251,11 +1251,11 @@ static void nxagentParseSingleOption(char *name, char *value) { if (!strcmp(value, "0")) { - nxagentChangeOption(Menu, 0); + nxagentChangeOption(Menu, False); } else { - nxagentChangeOption(Menu, 1); + nxagentChangeOption(Menu, True); } return; } @@ -1263,11 +1263,11 @@ static void nxagentParseSingleOption(char *name, char *value) { if (!strcmp(value, "0")) { - nxagentChangeOption(MagicPixel, 0); + nxagentChangeOption(MagicPixel, False); } else { - nxagentChangeOption(MagicPixel, 1); + nxagentChangeOption(MagicPixel, True); } return; } @@ -2038,7 +2038,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. * We enable server reset only for indirect XDMCP sessions. */ - if (nxagentOption(Reset) == True && nxagentMaxAllowedResets == 0) + if (nxagentOption(Reset) && nxagentMaxAllowedResets == 0) { #ifdef WARNING fprintf(stderr, "nxagentPostProcessArgs: Disabling the server reset.\n"); @@ -2054,7 +2054,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. * passing the -noreset option 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"); @@ -2166,7 +2166,7 @@ void nxagentSetPackMethod(void) if (nxagentOption(LinkType) == LINK_TYPE_NONE) { - nxagentChangeOption(Streaming, 0); + nxagentChangeOption(Streaming, False); nxagentPackMethod = PACK_NONE; nxagentPackLossless = PACK_NONE; @@ -2189,7 +2189,7 @@ void nxagentSetPackMethod(void) fprintf(stderr, "nxagentSetPackMethod: Using adaptive mode for image compression.\n"); #endif - nxagentChangeOption(Adaptive, 1); + nxagentChangeOption(Adaptive, True); } else { @@ -2197,7 +2197,7 @@ void nxagentSetPackMethod(void) fprintf(stderr, "nxagentSetPackMethod: Not using adaptive mode for image compression.\n"); #endif - nxagentChangeOption(Adaptive, 0); + nxagentChangeOption(Adaptive, False); } if (method == PACK_LOSSY || method == PACK_ADAPTIVE) @@ -2326,11 +2326,11 @@ void nxagentSetDeferLevel(void) * version of the agent. */ - if (nxagentOption(Streaming) == 1) + if (nxagentOption(Streaming)) { fprintf(stderr, "Warning: Streaming of images not available in this agent.\n"); - nxagentChangeOption(Streaming, 0); + nxagentChangeOption(Streaming, False); } switch (nxagentOption(LinkType)) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index 52c75e805..c15674f5e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -336,7 +336,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen) * server. */ - nxagentChangeOption(Nested, 1); + nxagentChangeOption(Nested, True); /* * Avoid the image degradation caused by diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.c b/nx-X11/programs/Xserver/hw/nxagent/Client.c index 83554e573..e0adef3bc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.c @@ -332,7 +332,7 @@ void nxagentGuessShadowHint(ClientPtr client, Atom property) * the windows updated. */ - nxagentChangeOption(IgnoreVisibility, 1); + nxagentChangeOption(IgnoreVisibility, True); } } } @@ -373,7 +373,7 @@ static void checkIfShadowAgent(ClientPtr client) fprintf(stderr, "nxagentCheckIfShadowAgent: The last shadow nxagent has been detached.\n"); #endif - nxagentChangeOption(IgnoreVisibility, 0); + nxagentChangeOption(IgnoreVisibility, False); } } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index af29f8ebc..45799051c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -57,7 +57,7 @@ void nxagentCompositeExtensionInit(void) nxagentCompositeEnable = 0; - if (nxagentOption(Composite) == 1) + if (nxagentOption(Composite)) { int eventBase, errorBase; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 9adc67a21..e3857043b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -312,7 +312,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/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index f2f9c5119..88375cbe1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1097,7 +1097,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentRemoveDuplicatedKeys(&X); } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) == 1 && result == doNothing) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1190,7 +1190,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already CriticalOutputPending = 1; - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1219,7 +1219,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already 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); @@ -1285,7 +1285,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already CriticalOutputPending = 1; } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xbutton.x -= nxagentOption(RootX); X.xbutton.y -= nxagentOption(RootY); @@ -1359,7 +1359,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already CriticalOutputPending = 1; } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xbutton.x -= nxagentOption(RootX); X.xbutton.y -= nxagentOption(RootY); @@ -1420,7 +1420,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already (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); } @@ -1474,7 +1474,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already 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); @@ -1609,7 +1609,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already x.u.u.detail = i * 8 + k; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { XEvent xM = {0}; xM.type = KeyRelease; @@ -2020,7 +2020,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && - nxagentOption(Nested) == 0 && + !nxagentOption(Nested) && X.xmap.window != nxagentIconWindow) { nxagentVisibility = VisibilityFullyObscured; diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 5cc29234a..b36550b9a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -698,7 +698,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * 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))) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 62974b9c1..b8c6ff18a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -648,7 +648,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 db174a9de..946cb7bf8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -524,7 +524,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, * window. */ - if (nxagentOption(IgnoreVisibility) == 0 && pDrawable -> type == DRAWABLE_WINDOW && + if (!nxagentOption(IgnoreVisibility) && pDrawable -> type == DRAWABLE_WINDOW && (nxagentWindowIsVisible((WindowPtr) pDrawable) == 0 || (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) { @@ -667,11 +667,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, we @@ -1284,7 +1284,7 @@ FIXME: There should be a callback registered by the agent that * lossless encoder will 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/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index 4e2b28a59..b621f62e8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -518,7 +518,7 @@ FIXME: Do we need to check the key grab if the fprintf(stderr, "Info: Auto-terminating session with no client running.\n"); raise(SIGTERM); } - else if (nxagentOption(Persistent) == 0) + else if (!nxagentOption(Persistent)) { fprintf(stderr, "Info: Auto-terminating session with persistence not allowed.\n"); raise(SIGTERM); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index f91dc248d..bbc30ee01 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -330,7 +330,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio clientReady[0] = 0; - if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)) + if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0)) { #ifdef TEST fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n", @@ -343,7 +343,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 [%u].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index e72a37494..90d0e5f10 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; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index d4a7479e3..dd474e3dd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -60,7 +60,7 @@ void nxagentInitOptions(void) nxagentOptions.LinkType = UNDEFINED; nxagentOptions.Desktop = UNDEFINED; - nxagentOptions.Persistent = 1; + nxagentOptions.Persistent = True; nxagentOptions.Rootless = UNDEFINED; nxagentOptions.Fullscreen = False; nxagentOptions.AllScreens = False; @@ -82,23 +82,23 @@ void nxagentInitOptions(void) nxagentOptions.Timeout = 0; - nxagentOptions.Nested = 0; + nxagentOptions.Nested = False; nxagentOptions.BackingStore = BackingStoreUndefined; nxagentOptions.Clipboard = ClipboardBoth; - nxagentOptions.SharedMemory = 1; + nxagentOptions.SharedMemory = True; - nxagentOptions.SharedPixmaps = 1; + nxagentOptions.SharedPixmaps = True; - nxagentOptions.DeviceControl = 0; + nxagentOptions.DeviceControl = False; - nxagentOptions.DeviceControlUserDefined = 0; + nxagentOptions.DeviceControlUserDefined = False; - nxagentOptions.ResetKeyboardAtResume = 1; + nxagentOptions.ResetKeyboardAtResume = True; - nxagentOptions.Reset = 0; + nxagentOptions.Reset = False; nxagentOptions.RootX = 0; nxagentOptions.RootY = 0; @@ -118,25 +118,25 @@ void nxagentInitOptions(void) nxagentOptions.FloatXRatio = 1.0; nxagentOptions.FloatYRatio = 1.0; - nxagentOptions.UseDamage = 1; + nxagentOptions.UseDamage = True; nxagentOptions.Binder = UNDEFINED; nxagentOptions.BinderOptions = NULL; - nxagentOptions.Xdmcp = 0; + nxagentOptions.Xdmcp = False; nxagentOptions.DisplayBuffer = UNDEFINED; nxagentOptions.DisplayCoalescence = 0; - nxagentOptions.Composite = 1; + nxagentOptions.Composite = True; - nxagentOptions.IgnoreVisibility = 0; + nxagentOptions.IgnoreVisibility = False; - nxagentOptions.ViewOnly = 0; + nxagentOptions.ViewOnly = False; - nxagentOptions.Adaptive = 0; + nxagentOptions.Adaptive = False; - nxagentOptions.Streaming = 0; + nxagentOptions.Streaming = False; nxagentOptions.DeferLevel = UNDEFINED; nxagentOptions.DeferTimeout = 200; @@ -144,19 +144,19 @@ void nxagentInitOptions(void) nxagentOptions.TileWidth = UNDEFINED; nxagentOptions.TileHeight = UNDEFINED; - nxagentOptions.Menu = 1; + nxagentOptions.Menu = True; - nxagentOptions.MagicPixel = 1; + nxagentOptions.MagicPixel = True; nxagentOptions.ClientOs = UNDEFINED; - nxagentOptions.InhibitXkb = 1; + nxagentOptions.InhibitXkb = True; nxagentOptions.CopyBufferSize = COPY_UNLIMITED; nxagentOptions.ImageRateLimit = 0; - nxagentOptions.Xinerama = 1; + nxagentOptions.Xinerama = True; nxagentOptions.SleepTimeMillis = DEFAULT_SLEEP_TIME_MILLIS; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index b5d47623a..1191049ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -84,7 +84,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) * leaves the agent's window. */ - if (nxagentOption(DeviceControl) == True) + if (nxagentOption(DeviceControl)) { #ifdef TEST fprintf(stderr, "%s: WARNING! Propagating changes to pointer settings.\n", __func__); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 602351d10..ffdab066a 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 the state became SESSION_DOWN. */ nxagentException.ioError = 0; - if (nxagentOption(Persistent) == 1 && nxagentSessionState != SESSION_STARTING) + if (nxagentOption(Persistent) && nxagentSessionState != SESSION_STARTING) { if (nxagentSessionState == SESSION_UP) { @@ -588,7 +588,7 @@ Bool nxagentReconnectSession(void) } /* Reset the keyboard only if we detect any changes. */ - if (nxagentOption(ResetKeyboardAtResume) == 1) + if (nxagentOption(ResetKeyboardAtResume)) { if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || @@ -630,7 +630,7 @@ Bool nxagentReconnectSession(void) nxagentRedirectDefaultWindows(); - if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama) == True) + if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama)) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentOption(RootHeight), True); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index d8f79f015..e0e86b2ce 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2001,7 +2001,7 @@ N/A * change the real X server's keyboard and pointer settings. */ - if (nxagentOption(DeviceControl) == False) + if (!nxagentOption(DeviceControl)) { fprintf(stderr, "Info: Not using local device configuration changes.\n"); } @@ -2532,7 +2532,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) NXShadowSetDisplayUid(nxagentShadowUid); } - if (nxagentOption(UseDamage) == 0) + if (nxagentOption(UseDamage)) { NXShadowDisableDamage(); } -- 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 3.6.x in repository nx-libs. commit 8bb7d2cd1aa8a0108c5ef66758bc337de239aa11 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:19:50 2020 +0100 nxagent: make Desktop, Rootless and Binder options Booleans (again) They have been changed to tri-state variables (1, 0 and UNDEFINED) between nxagent 1.5.0-90 and -93, for no obvious reason. --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 35 +++++-------------------- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 4 +-- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 12 ++++----- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 4 +-- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 6 ++--- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 8 +++--- nx-X11/programs/Xserver/hw/nxagent/Window.c | 12 ++++----- 11 files changed, 33 insertions(+), 56 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 76669e39e..52aa055fc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -801,14 +801,9 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-R")) { - if (nxagentOption(Binder) == UNDEFINED || - nxagentOption(Desktop) == UNDEFINED || - nxagentOption(Rootless) == UNDEFINED) - { - nxagentChangeOption(Binder, False); - nxagentChangeOption(Desktop, False); - nxagentChangeOption(Rootless, True); - } + nxagentChangeOption(Binder, False); + nxagentChangeOption(Desktop, False); + nxagentChangeOption(Rootless, True); return 1; } @@ -1749,13 +1744,14 @@ N/A #endif - if ((nxagentOption(Rootless) == True) && nxagentOption(Fullscreen)) + if (nxagentOption(Rootless) && nxagentOption(Fullscreen)) { #ifdef TEST fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); #endif nxagentChangeOption(Fullscreen, False); + nxagentChangeOption(AllScreens, False); } /* @@ -1970,25 +1966,6 @@ N/A nxagentSetCoalescence(); - /* - * Set the other defaults. - */ - - if (nxagentOption(Binder) == UNDEFINED) - { - nxagentChangeOption(Binder, False); - } - - if (nxagentOption(Rootless) == UNDEFINED) - { - nxagentChangeOption(Rootless, False); - } - - if (nxagentOption(Desktop) == UNDEFINED) - { - nxagentChangeOption(Desktop, True); - } - /* * The enableBackingStore flag is defined * in window.c in the dix. @@ -2029,7 +2006,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. nxagentAlphaEnabled = False; } - if ((nxagentOption(Rootless) == True) && nxagentOption(Xdmcp)) + if (nxagentOption(Rootless) && nxagentOption(Xdmcp)) { FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n"); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index 45799051c..745696219 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -115,7 +115,7 @@ void nxagentCompositeExtensionInit(void) void nxagentRedirectDefaultWindows(void) { - if (nxagentOption(Rootless) == 1 || + if (nxagentOption(Rootless) || nxagentCompositeEnable == 0) { #ifdef TEST @@ -154,7 +154,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 05c78e0ad..dcee721a2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -127,7 +127,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor) Cursor 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/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 9d58e814b..5eef6c0a4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1851,7 +1851,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already { int value = X.xvisibility.state; - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { TraverseTree(pWin, nxagentChangeVisibilityPrivate, &value); } @@ -2003,7 +2003,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already fprintf(stderr, "%s: Going to handle new UnmapNotify event.\n", __func__); #endif - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { WindowPtr pWin; @@ -2019,7 +2019,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && + if (nxagentUseNXTrans == 1 && !nxagentOption(Rootless) && !nxagentOption(Nested) && X.xmap.window != nxagentIconWindow) { @@ -2034,7 +2034,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already fprintf(stderr, "%s: Going to handle new MapNotify event.\n", __func__); #endif - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { WindowPtr pWin; @@ -3152,7 +3152,7 @@ int nxagentHandleConfigureNotify(XEvent* X) fprintf(stderr, "%s: DefaultRootWindow(DISPLAY) [0x%lx]\n", __func__, DefaultRootWindow(nxagentDisplay)); #endif - if (nxagentOption(Rootless) == True) + if (nxagentOption(Rootless)) { int sendEventAnyway = 0; @@ -3272,7 +3272,7 @@ int nxagentHandleConfigureNotify(XEvent* X) return 1; } } - else /* (nxagentOption(Rootless) == True) */ + else /* (nxagentOption(Rootless)) */ { /* * Save the position of the agent default window. Don't save the diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 77f2d6b38..9ca7711b2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -417,7 +417,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); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index ff50c9965..84414c11f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -189,7 +189,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, * } */ - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { /* * from nxagent-1.5.0-20 changelog: @@ -238,7 +238,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse) * by the agent (for example if the focus had left the window), so * that agent could be unable to update the mouse button state. */ - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { XUngrabPointer(nxagentDisplay, CurrentTime); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 11e66720f..97665d22e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -193,7 +193,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/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index c9b07db97..afc6899e3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -59,9 +59,9 @@ void nxagentInitOptions(void) { nxagentOptions.LinkType = UNDEFINED; - nxagentOptions.Desktop = UNDEFINED; + nxagentOptions.Desktop = True; nxagentOptions.Persistent = True; - nxagentOptions.Rootless = UNDEFINED; + nxagentOptions.Rootless = False; nxagentOptions.Shadow = False; nxagentOptions.Fullscreen = False; nxagentOptions.AllScreens = False; @@ -121,7 +121,7 @@ void nxagentInitOptions(void) nxagentOptions.UseDamage = True; - nxagentOptions.Binder = UNDEFINED; + nxagentOptions.Binder = False; nxagentOptions.BinderOptions = NULL; nxagentOptions.Xdmcp = False; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index ffdab066a..9807a8e3b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -630,7 +630,7 @@ Bool nxagentReconnectSession(void) nxagentRedirectDefaultWindows(); - if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama)) + if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) || nxagentOption(Xinerama)) { nxagentChangeScreenConfig(0, nxagentOption(RootWidth), nxagentOption(RootHeight), True); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index e0e86b2ce..85114c95a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -948,7 +948,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) * 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"); @@ -1732,7 +1732,7 @@ N/A pScreen->myNum, nxagentDefaultWindows[pScreen->myNum]); #endif - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { XSetWindowAttributes inpattributes = {.event_mask = PointerMotionMask}; @@ -1953,7 +1953,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 @@ -2377,7 +2377,7 @@ FIXME: We should try to restore the previously XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); } - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { #ifdef DEBUG fprintf(stderr, "%s: resizing InputWindow to [%d]x[%d]\n", __func__, width, height); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 592d76dfd..be310ec67 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -378,7 +378,7 @@ Bool nxagentCreateWindow(WindowPtr pWin) nxagentWindowPriv(pWin) -> corruptedTimestamp = 0; nxagentWindowPriv(pWin) -> splitResource = NULL; - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { nxagentWindowPriv(pWin) -> isMapped = 0; @@ -700,7 +700,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) { - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { return; } @@ -1259,7 +1259,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) return; } - if (nxagentOption(Rootless) == 1 && + if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) == 1) { mask &= ~(CWSibling | CWStackMode); @@ -2527,7 +2527,7 @@ void nxagentMapDefaultWindows(void) */ MapWindow(pWin, serverClient); - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { /* * Show the NX splash screen. @@ -2760,7 +2760,7 @@ Bool nxagentReconnectAllWindows(void *p0) * raised. */ - if (nxagentOption(Rootless) == 0) + if (!nxagentOption(Rootless)) { for (int i = 0; i < screenInfo.numScreens; i++) { @@ -3274,7 +3274,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 3.6.x in repository nx-libs. commit 616d8619f9420eca1eb7adb628de2675d6b359a2 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:31:01 2020 +0100 nxagent: treat all Traps as Booleans everywhere --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 8 +++---- nx-X11/programs/Xserver/hw/nxagent/GC.c | 24 ++++++++++----------- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 28 ++++++++++++------------ nx-X11/programs/Xserver/hw/nxagent/Image.c | 30 +++++++++++++------------- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 16 +++++++------- nx-X11/programs/Xserver/hw/nxagent/Window.c | 12 +++++------ 12 files changed, 67 insertions(+), 67 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 7902e441d..a18b4f0f9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1075,7 +1075,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"); @@ -1106,7 +1106,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"); @@ -1268,7 +1268,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"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index ceb47b669..2e14c08e7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1571,7 +1571,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, * way to identify that situation during callback processing we * could get rid of the Trap... */ - if (nxagentExternalClipboardEventTrap != 0) + if (nxagentExternalClipboardEventTrap) { #ifdef DEBUG fprintf(stderr, "%s: Trap is set, doing nothing\n", __func__); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 4d643a97e..1cd0a692f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -144,7 +144,7 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre { pDrawable = nxagentSplitDrawable(pDrawable); - if (nxagentLosslessTrap == 0) + if (!nxagentLosslessTrap) { if (nxagentDrawableStatus(pDrawable) == Synchronized) { @@ -257,7 +257,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask * copy with lossless compression turned off. */ - if (nxagentLosslessTrap == 1) + if (nxagentLosslessTrap) { #ifdef TEST fprintf(stderr, "%s: Forcing synchronization of pixmap at [%p] with lossless compression.\n", @@ -266,7 +266,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask return reallySynchronizeDrawableData(pDrawable); } - else if (nxagentReconnectTrap == 1) + else if (nxagentReconnectTrap) { /* * The pixmap data is not synchronized unless we need it. We @@ -277,7 +277,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask if (pDrawable -> depth == 1) { #ifdef TEST - if (nxagentReconnectTrap == 1) + if (nxagentReconnectTrap) { static int totalLength; static int totalReconnectedPixmaps; diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 21e888b8a..d39f743e6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -317,7 +317,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 large, it can be @@ -367,7 +367,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", @@ -425,7 +425,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); @@ -434,7 +434,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask) CHECKGCVAL(GCArcMode, arc_mode, pGC->arcMode); - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { #ifdef TEST fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n", @@ -544,7 +544,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); } @@ -552,7 +552,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_REGION: { - if (clipsMatch == 0 && nxagentGCTrap == 0) + if (clipsMatch == 0 && !nxagentGCTrap) { XRectangle *pRects; nRects = RegionNumRects((RegionPtr)pValue); @@ -576,7 +576,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)); @@ -594,7 +594,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, @@ -604,7 +604,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, @@ -614,7 +614,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, @@ -624,7 +624,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, @@ -679,7 +679,7 @@ void nxagentDestroyClip(GCPtr pGC) nxagentDestroyClipHelper(pGC); - if (nxagentGCTrap == 0) + if (!nxagentGCTrap) { XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index b36550b9a..093e16a77 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -664,7 +664,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } - if (nxagentGCTrap == 1 || nxagentShmTrap == 1) + if (nxagentGCTrap || nxagentShmTrap) { if (pSrcDrawable -> type == DRAWABLE_PIXMAP && pDstDrawable -> type == DRAWABLE_PIXMAP) @@ -890,7 +890,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) @@ -1073,7 +1073,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) { @@ -1130,7 +1130,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) { @@ -1203,7 +1203,7 @@ void nxagentPolySegment(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1280,7 +1280,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1345,7 +1345,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) { @@ -1404,7 +1404,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, { xPoint *newPoints = NULL; - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1518,7 +1518,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1663,7 +1663,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) { @@ -1739,7 +1739,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int width = XTextWidth(nxagentFontStruct(pGC->font), string, count); - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1809,7 +1809,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int width = XTextWidth16(nxagentFontStruct(pGC->font), (XChar2b *)string, count); - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1868,7 +1868,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) { @@ -1925,7 +1925,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/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index 79d8c365f..e1f424a16 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -403,7 +403,7 @@ FIXME: Here the split trap is always set and so the caching of the 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) { @@ -562,8 +562,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) { @@ -579,11 +579,11 @@ 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); @@ -683,8 +683,8 @@ FIXME: Do we stream the images from GLX or Xv? If we do that, we /* FIXME: Temporarily stream the GLX data. - && nxagentGlxTrap == 0 - && nxagentXvTrap == 0 + && !nxagentGlxTrap + && !nxagentXvTrap */ ); @@ -692,11 +692,11 @@ FIXME: Temporarily stream the GLX data. * Never split images whose depth 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); @@ -734,7 +734,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"); @@ -1145,7 +1145,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) { @@ -1219,8 +1219,8 @@ FIXME: Should try to locate the image anyway, if the lossless trap is 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 cleaned before calculating diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index a8d1849ae..d339a12d5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -392,7 +392,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/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 07f57621e..181537009 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 13ac47d00..c04fe6f8b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -200,7 +200,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, * checksum. */ - if (width != 0 && height != 0 && nxagentGCTrap == 0) + if (width != 0 && height != 0 && !nxagentGCTrap) { pPixmapPriv -> id = XCreatePixmap(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum], diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index f38319858..44d52f8e0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -2252,7 +2252,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2) { GlyphSetPtr pGly = (GlyphSetPtr) p0; - if (nxagentReconnectTrap == 0) + if (!nxagentReconnectTrap) { int i; XRenderPictFormat *pForm = NULL; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 85114c95a..e27ed2ec6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -849,7 +849,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) pScreen->myNum); #endif - if (nxagentRenderEnable && nxagentReconnectTrap == False) + if (nxagentRenderEnable && !nxagentReconnectTrap) { PictureScreenPrivateIndex = -1; } @@ -904,7 +904,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) * user geometry then. */ - if (nxagentReconnectTrap == False && !nxagentOption(Rootless)) + if (!nxagentReconnectTrap && !nxagentOption(Rootless)) { if (nxagentUserGeometry.flag & XValue) { @@ -957,7 +957,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) nxagentChangeOption(Fullscreen, True); if (nxagentOption(ClientOs) == ClientOsWinnt && - (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)) + (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup)) { NXSetExposeParameters(nxagentDisplay, 0, 0, 0); } @@ -996,7 +996,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) nxagentChangeOption(Height, h); /* first time screen initialization or resize during reconnect */ - if (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup) + if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup) { if (nxagentOption(RootWidth) >= w) { @@ -1049,7 +1049,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) * screen is initialized for the first time. */ - if (nxagentReconnectTrap == False) + if (!nxagentReconnectTrap) { nxagentChangeOption(RootX, 0); nxagentChangeOption(RootY, 0); @@ -1088,7 +1088,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) * the root window isn't bigger than the X server root window.. */ - if (nxagentReconnectTrap == False) + if (!nxagentReconnectTrap) { if ((nxagentOption(RootWidth) < w) && !(nxagentUserGeometry.flag & WidthValue)) @@ -1120,7 +1120,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); - if (nxagentReconnectTrap == 0) + if (!nxagentReconnectTrap) { if (nxagentOption(Persistent)) { @@ -1658,7 +1658,7 @@ N/A #endif if (nxagentDoFullGeneration == 1 || - nxagentReconnectTrap == 1) + nxagentReconnectTrap) { unsigned long valuemask = CWBackPixel | CWEventMask | CWColormap; XSetWindowAttributes attributes = { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index be310ec67..54e553338 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -548,7 +548,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) { nxagentPrivWindowPtr pWindowPriv; - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return 1; } @@ -672,7 +672,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) */ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) { - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return True; } @@ -690,7 +690,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) { - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return; } @@ -1250,7 +1250,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"); @@ -1877,7 +1877,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired) -+ */ Bool nxagentRealizeWindow(WindowPtr pWin) { - if (nxagentScreenTrap == 1) + if (nxagentScreenTrap) { return True; } @@ -2573,7 +2573,7 @@ void nxagentMapDefaultWindows(void) * nxagentReconnectAllWindows, after the Root Window is mapped. */ - if (nxagentReconnectTrap == 0) + if (!nxagentReconnectTrap) { XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]); } -- 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 3.6.x in repository nx-libs. commit 1b7f37a80c88167c733d700abb232c33d06dc9e0 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:50:51 2020 +0100 nxagent: make nxagentShadowResize a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index b854bf29b..704bc6995 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -3373,7 +3373,7 @@ int nxagentHandleConfigureNotify(XEvent* X) (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height)) { - nxagentShadowResize = 1; + nxagentShadowResize = True; } if (nxagentOption(Width) != X->xconfigure.width || nxagentOption(Height) != X->xconfigure.height) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 59f368e4f..4085f2b90 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -732,9 +732,9 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas nxagentDispatchEvents(NULL); } - if (nxagentShadowResize == 1) + if (nxagentShadowResize) { - nxagentShadowResize = 0; + nxagentShadowResize = False; nxagentShadowAdaptToRatio(); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index e272b3b02..137f0eb58 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -176,7 +176,7 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix); * These variables are for shadowing feature. */ -int nxagentShadowResize = 0; +Bool nxagentShadowResize = False; WindowPtr nxagentShadowWindowPtr = NULL; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.h b/nx-X11/programs/Xserver/hw/nxagent/Screen.h index 3eb16ea3c..53df72df2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.h @@ -67,7 +67,7 @@ extern RegionRec nxagentShadowUpdateRegion; extern WindowPtr nxagentShadowWindowPtr; -extern int nxagentShadowResize; +extern Bool nxagentShadowResize; extern short nxagentShadowUid; -- 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 3.6.x in repository nx-libs. commit 92c8325f36944058ac4972eb4139128122ecad7c Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:34:03 2020 +0100 nxagent: treat nxagentLastWindowDestroyed as Boolean --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index b8c6ff18a..59f368e4f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -222,7 +222,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) #ifdef TEST - if (nxagentLastWindowDestroyed == 1) + if (nxagentLastWindowDestroyed) { fprintf(stderr, "nxagentBlockHandler: Elapsed time [%lu].\n", now - nxagentLastWindowDestroyedTime); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 54e553338..a5f457796 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -643,7 +643,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin) } if (nxagentOption(Rootless) && nxagentRootlessDialogPid == 0 && - nxagentLastWindowDestroyed == False && nxagentSomeWindowsAreMapped() == False) + !nxagentLastWindowDestroyed && nxagentSomeWindowsAreMapped() == False) { #ifdef TEST fprintf(stderr, "nxagentDestroyWindow: Last mapped window as been destroyed.\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 3.6.x in repository nx-libs. commit c3b6dfe2e2c407ecdbcf0154495d246b10f6a7e7 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:25:22 2020 +0100 nxagent: make nxagentVerbose a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Error.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Error.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Font.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 52aa055fc..7902e441d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -178,7 +178,7 @@ static void nxagentParseOptionString(char*); static int nxagentGetDialogName(void); -char nxagentVerbose = 0; +Bool nxagentVerbose = False; char *nxagentKeystrokeFile = NULL; @@ -964,7 +964,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-verbose")) { - nxagentVerbose = 1; + nxagentVerbose = True; return 1; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.c b/nx-X11/programs/Xserver/hw/nxagent/Error.c index add5fae85..8c9a52d2e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c @@ -106,7 +106,7 @@ static int nxagentPrintError(Display *dpy, XErrorEvent *event, FILE *fp); int nxagentErrorHandler(Display *dpy, XErrorEvent *event) { - if (nxagentVerbose == 1) + if (nxagentVerbose) { nxagentPrintError(dpy, event, stderr); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.h b/nx-X11/programs/Xserver/hw/nxagent/Error.h index 9f5cfef74..76f120ff3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.h @@ -32,7 +32,7 @@ extern char *nxagentClientsLogName; -extern char nxagentVerbose; +extern Bool nxagentVerbose; int nxagentErrorHandler(Display *dpy, XErrorEvent *event); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 5eef6c0a4..b854bf29b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1959,7 +1959,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (nxagentExposeQueue.exposures[nxagentExposeQueue.start].serial != X.xconfigure.x) { #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "%s: Requested ConfigureNotify changes didn't take place.\n", __func__); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index dcbd6949a..0ce5b87ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -750,7 +750,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP if (numFontFields <= FIELDS) { #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Font name in non standard format.\n"); } @@ -817,7 +817,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP } #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Failed to load font '%s'. Replacing with '%s'.\n", fontName, substFontBuf); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 9807a8e3b..ed1e673a8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -598,7 +598,7 @@ Bool nxagentReconnectSession(void) if (nxagentResetKeyboard() == 0) { #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "%s: Failed to reset keyboard device.\n", __func__); } @@ -699,7 +699,7 @@ nxagentReconnectError: if (*nxagentGetReconnectError() == '\0') { #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "nxagentReconnectSession: WARNING! The reconnect error message is not set. Failed step is [%d].\n", failedStep); -- 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 3.6.x in repository nx-libs. commit 090742b3b8362667b1570a47c9a7ce516c6f0d67 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:43:07 2020 +0100 nxagent: some more Boolean improvements --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index a5f457796..fa1910eac 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -2146,7 +2146,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo if (nxagentSessionState != SESSION_DOWN) { - if (nxagentExposeArrayIsInitialized == 0) + if (!nxagentExposeArrayIsInitialized) { #ifdef TEST fprintf(stderr, "nxagentWindowExposures: Initializing expose queue.\n"); @@ -2171,7 +2171,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo nxagentInitRemoteExposeRegion(); - nxagentExposeArrayIsInitialized = 1; + nxagentExposeArrayIsInitialized = True; } RegionRec temp; -- 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 3.6.x in repository nx-libs. commit 3e093f9eba4b84f79fc19168ef2cad25738628a4 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:48:33 2020 +0100 nxagent: make nxagentDoFullgeneration a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index e3857043b..c8a2d852a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -1796,7 +1796,7 @@ void nxagentCloseDisplay(void) nxagentDoFullGeneration, (void *) nxagentDisplay); #endif - if (nxagentDoFullGeneration == 0 || + if (!nxagentDoFullGeneration || nxagentDisplay == NULL) { return; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index b621f62e8..7f5360636 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -171,7 +171,7 @@ int nxagentSaveUnder; * nxagentOpenScreen * InitInput */ -int nxagentDoFullGeneration = 1; +Bool nxagentDoFullGeneration = True; /* * True if agent is running as X2goAgent diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index e27ed2ec6..e272b3b02 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1657,7 +1657,7 @@ N/A nxagentPrintAgentGeometry(NULL, "nxagentOpenScreen:"); #endif - if (nxagentDoFullGeneration == 1 || + if (nxagentDoFullGeneration || nxagentReconnectTrap) { unsigned long valuemask = CWBackPixel | CWEventMask | CWColormap; -- 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 3.6.x in repository nx-libs. commit acf3e21f1898883d0692c6ad147c8c1b4e309af0 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:54:50 2020 +0100 Drawable.c: make some variables Booleans --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index c335e7ed9..8b657beb7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -357,9 +357,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * full drawable. */ - int useStoredBitmap = (nxagentDrawableBitmap(pDrawable) != NullPixmap && pRegion == NullRegion); + Bool useStoredBitmap = (nxagentDrawableBitmap(pDrawable) != NullPixmap && pRegion == NullRegion); - if (useStoredBitmap != 0) + if (useStoredBitmap) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap at [%p] " @@ -1023,7 +1023,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) DrawablePtr pDrawable = (DrawablePtr) p0; unsigned int *breakMask = (unsigned int *) p2; - int shouldClearHiddenRegion = 1; + Bool shouldClearHiddenRegion = True; /* * The nxagentSynchronization.abort propagates a break condition @@ -1104,7 +1104,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) (void *) pDrawable); #endif - if (shouldClearHiddenRegion == 1) + if (shouldClearHiddenRegion) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeDrawablePredicate: Clearing out the not visible window " @@ -1180,7 +1180,7 @@ FIXME: This condition sounds only as a complication, as the break */ if (nxagentSynchronization.abort == 0 && - shouldClearHiddenRegion == 1) + shouldClearHiddenRegion) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeDrawablePredicate: Clearing out the remaining corrupted " -- 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 3.6.x in repository nx-libs. commit 5920e36e1a36a39deeed55f3efeffb3c84e2846f Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:07:23 2020 +0100 nxagent: rework some Boolean checks nxagentWindowTopLevel() and nxagentNeedConnectionChange() return Boolean nxagentPixmapIsVirtual() and nxagentIsShmPixmap(), too. --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 1cd0a692f..5317d0509 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -2658,7 +2658,7 @@ void nxagentAllocateCorruptedResource(DrawablePtr pDrawable, RESTYPE type) */ if (nxagentPixmapUsageCounter((PixmapPtr) pDrawable) >= MINIMUM_PIXMAP_USAGE_COUNTER && - nxagentIsShmPixmap((PixmapPtr) pDrawable) == 0) + !nxagentIsShmPixmap((PixmapPtr) pDrawable)) { pRealPixmap = nxagentRealPixmap((PixmapPtr) pDrawable); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 704bc6995..f371363a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2009,7 +2009,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if ((pWin = nxagentRootlessTopLevelWindow(X.xunmap.window)) != NULL || ((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL && - nxagentWindowTopLevel(pWin) == 1)) + nxagentWindowTopLevel(pWin))) { nxagentScreenTrap = True; @@ -2040,7 +2040,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if ((pWin = nxagentRootlessTopLevelWindow(X.xmap.window)) != NULL || ((pWin = nxagentWindowPtr(X.xmap.window)) != NULL && - nxagentWindowTopLevel(pWin) == 1)) + nxagentWindowTopLevel(pWin))) { nxagentScreenTrap = True; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 4085f2b90..01c1e0638 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -199,7 +199,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) #endif - if (nxagentNeedConnectionChange() == 1) + if (nxagentNeedConnectionChange()) { #ifdef TEST fprintf(stderr, "nxagentBlockHandler: Calling nxagentHandleConnectionChanges " @@ -703,7 +703,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas fprintf(stderr, "[Begin block]\n"); #endif - if (nxagentNeedConnectionChange() == 1) + if (nxagentNeedConnectionChange()) { nxagentHandleConnectionChanges(); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index bcb64edcd..5851eb05c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -551,8 +551,8 @@ int nxagentCompositePredicate(PicturePtr pSrc, PicturePtr pDst) fprintf(stderr, "nxagentCompositePredicate: Case 1.\n"); #endif - if (nxagentPixmapIsVirtual(pPixmap1) == 1 && - nxagentPixmapIsVirtual(pPixmap2) == 1) + if (nxagentPixmapIsVirtual(pPixmap1) && + nxagentPixmapIsVirtual(pPixmap2)) { #ifdef TEST fprintf(stderr, "nxagentCompositePredicate: Case 2.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index c04fe6f8b..30e5d1e3f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -1064,7 +1064,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict, int wPict, int hPict) { if (pDrawable -> type == DRAWABLE_PIXMAP && - nxagentIsShmPixmap((PixmapPtr) pDrawable) == 1) + nxagentIsShmPixmap((PixmapPtr) pDrawable)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeShmPixmap: WARNING! Synchronizing shared pixmap at [%p].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index ed1e673a8..03ac9effd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -220,7 +220,7 @@ int nxagentHandleConnectionStates(void) } } - if (nxagentNeedConnectionChange() == 1) + if (nxagentNeedConnectionChange()) { #ifdef TEST fprintf(stderr, "nxagentHandleConnectionStates: Calling nxagentHandleConnectionChanges " diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index fa1910eac..2a872c812 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -1260,7 +1260,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) } if (nxagentOption(Rootless) && - nxagentWindowTopLevel(pWin) == 1) + nxagentWindowTopLevel(pWin)) { mask &= ~(CWSibling | CWStackMode); } -- 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 3.6.x in repository nx-libs. commit 059a3720514d27f9243b4b0521ef710ded2907e2 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:21:43 2020 +0100 Split.c, Image.c: make some internal variables Booleans --- nx-X11/programs/Xserver/hw/nxagent/Image.c | 52 +++++++++++++++--------------- nx-X11/programs/Xserver/hw/nxagent/Split.c | 6 ++-- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index e1f424a16..2e0c901ef 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -473,8 +473,8 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, RegionPtr pRegion = NullRegion; int resource = 0; - int split = 0; - int cache = 1; + Bool split = False; + Bool cache = True; #ifdef TEST fprintf(stderr, "nxagentPutImage: Image data at [%p] drawable [%s][%p] geometry [%d,%d,%d,%d].\n", @@ -692,7 +692,7 @@ FIXME: Temporarily stream the GLX data. * Never split images whose depth is less than 15. */ - if (split == 1 && (nxagentSplitTrap || depth < 15)) + if (split && (nxagentSplitTrap || depth < 15)) { #ifdef TEST if (nxagentSplitTrap || @@ -703,10 +703,10 @@ FIXME: Temporarily stream the GLX data. } #endif - split = 0; + split = False; } #ifdef TEST - else if (split == 1) + else if (split) { fprintf(stderr, "nxagentPutImage: Splitting with reconnection [%d] trap [%d] " "depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth); @@ -714,7 +714,7 @@ FIXME: Temporarily stream the GLX data. #endif #ifdef TEST - if (split == 1) + if (split) { fprintf(stderr, "nxagentPutImage: Splitting the image with size [%d] " "link [%d] GLX [%d] Xv [%d].\n", length, nxagentOption(LinkType), @@ -742,7 +742,7 @@ FIXME: Temporarily stream the GLX data. NXSetCacheParameters(nxagentDisplay, 0, 1, 0, 0); - cache = 0; + cache = False; } /* @@ -750,7 +750,7 @@ FIXME: Temporarily stream the GLX data. * tell us if the split took place. */ - if (split == 1) + if (split) { /* * If the drawable is already being split, expand the @@ -793,7 +793,7 @@ FIXME: Should probably intersect the region with the region being nxagentRealizeImage(pDrawable, pGC, depth, dstX, dstY, dstWidth, dstHeight, leftPad, format, data); - if (split == 1) + if (split) { NXEndSplit(nxagentDisplay, resource); @@ -807,7 +807,7 @@ FIXME: Should probably intersect the region with the region being split = nxagentWaitSplitEvent(resource); - if (split == 1) + if (split) { #ifdef TEST fprintf(stderr, "nxagentPutImage: Marking corrupted region [%d,%d,%d,%d] for drawable at [%p].\n", @@ -838,7 +838,7 @@ FIXME: Should probably intersect the region with the region being * above, so here we have to check the value again. */ - if (split == 0) + if (!split) { if (nxagentDrawableStatus(pDrawable) == NotSynchronized) { @@ -863,7 +863,7 @@ nxagentPutImageEnd: * Check if we disabled caching. */ - if (cache == 0) + if (!cache) { #ifdef TEST fprintf(stderr, "nxagentPutImage: Reenabling the use of the cache.\n"); @@ -1041,9 +1041,9 @@ void nxagentPutSubImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ClientPtr client; - int lossless = 0; - int clean = 0; - int pack = 0; + Bool lossless = False; + Bool clean = False; + Bool pack = False; /* * XCreateImage is the place where the leftPad should be passed. @@ -1136,7 +1136,7 @@ FIXME: Should use an unpack resource here. lossless = (packMethod == nxagentPackLossless); - if (pack == 1 && lossless == 0) + if (pack && !lossless) { /* * Force the image to be sent as a plain bitmap if we don't have @@ -1155,7 +1155,7 @@ FIXME: Should use an unpack resource here. nxagentImageLength(w, h, format, leftPad, depth)); #endif - pack = 0; + pack = False; } else { @@ -1167,7 +1167,7 @@ FIXME: Should use an unpack resource here. packMethod = nxagentPackLossless; - lossless = 1; + lossless = True; } } } @@ -1176,7 +1176,7 @@ FIXME: Should use an unpack resource here. * Do we still want to pack the image? */ - if (pack == 1) + if (pack) { /* * Set the geometry and alpha channel to be used for the unpacked @@ -1234,7 +1234,7 @@ FIXME: There should be a callback registered by the agent that etc. This statistics report would be included by the proxy in its stat output. */ - clean = 1; + clean = True; NXCleanImage(plainImage); @@ -1284,7 +1284,7 @@ FIXME: There should be a callback registered by the agent that * lossless encoder will compress better. */ - if (lossless == 0 && nxagentOption(Adaptive)) + if (!lossless && nxagentOption(Adaptive)) { int ratio = nxagentUniquePixels(plainImage); @@ -1297,7 +1297,7 @@ FIXME: There should be a callback registered by the agent that packMethod = nxagentPackLossless; - lossless = 1; + lossless = True; } #ifdef TEST else @@ -1324,11 +1324,11 @@ FIXME: There should be a callback registered by the agent that * bitwise the same regardless the padding bits. */ - if (clean == 0) + if (!clean) { if (nxagentNeedClean(plainImage, packMethod) == 1) { - clean = 1; + clean = True; NXCleanImage(plainImage); } @@ -1448,12 +1448,12 @@ FIXME: If we failed to encode the image by any of the available was sent in the unpack alpha message. This can be done here, if the clean flag is true and we are going to send a plain image. */ - if (clean == 0) + if (!clean) { clean = (nxagentOption(LinkType) != LINK_TYPE_NONE && nxagentOption(LinkType) != LINK_TYPE_LAN && depth != 32); - if (clean == 1) + if (clean) { #ifdef DEBUG fprintf(stderr, "nxagentPutSubImage: Cleaning the image with link type [%d] and depth [%d].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c index 850056c21..60af4a0d6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -829,11 +829,11 @@ static Bool nxagentWaitSplitPredicate(Display *disp, XEvent *event, XPointer ptr event -> xclient.format == 32); } -int nxagentWaitSplitEvent(int resource) +Bool nxagentWaitSplitEvent(int resource) { XEvent event; - int split = 0; + Bool split = 0; /* * Don't flush the link. We only want to query the NX transport to @@ -890,7 +890,7 @@ int nxagentWaitSplitEvent(int resource) { nxagentHandleStartSplitEvent(resource); - split = 1; + split = True; break; } -- 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 3.6.x in repository nx-libs. commit 6f4dbefbf120f8e82171120da3fa347cc1421a26 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 22:54:48 2020 +0100 nxagent: make nxagentUserDefinedFontPath a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Args.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index a18b4f0f9..ee76fc795 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -116,7 +116,7 @@ is" without express or implied warranty. #undef DISABLE_SMART_SCHEDULE -int nxagentUserDefinedFontPath = 0; +Bool nxagentUserDefinedFontPath = False; /* * From X11/ImUtil.c. @@ -558,7 +558,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) fprintf(stderr, "ddxProcessArgument: User defined font path [%s].\n", argv[i]); #endif - nxagentUserDefinedFontPath = 1; + nxagentUserDefinedFontPath = True; defaultFontPath = argv[i]; } else diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.h b/nx-X11/programs/Xserver/hw/nxagent/Args.h index c8f8907c3..aebb521a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h @@ -97,7 +97,7 @@ void nxagentSetCoalescence(void); void nxagentShowVersionInfo(void); -extern int nxagentUserDefinedFontPath; +extern Bool nxagentUserDefinedFontPath; extern int nxagentRemoteMajor; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index 7f5360636..e8e230956 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -251,7 +251,7 @@ void InitOutput(ScreenInfo *scrInfo, int argc, char *argv[]) AddCallback(&ServerGrabCallback, nxagentGrabServerCallback, NULL); } - if (nxagentUserDefinedFontPath == 0) + if (!nxagentUserDefinedFontPath) { #ifdef TEST fprintf(stderr, "InitOutput: Calling nxagentVerifyDefaultFontPath.\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 3.6.x in repository nx-libs. commit 1b91c8ac18bd43d592cb63ac995c7695d3da192e Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:58:40 2020 +0100 GCOps.c: make internal function Boolean --- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 277daa699..eda87ff20 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -211,18 +211,18 @@ RegionPtr nxagentBitBlitHelper(GC *pGC) * redirect property. */ -int nxagentWindowIsPopup(DrawablePtr pDrawable) +Bool nxagentWindowIsPopup(DrawablePtr pDrawable) { if (pDrawable -> type != DRAWABLE_WINDOW) { return 0; } - int windowIsPopup = 0; + Bool windowIsPopup = False; if (((WindowPtr) pDrawable) -> overrideRedirect == 1) { - windowIsPopup = 1; + windowIsPopup = True; } else { @@ -244,7 +244,7 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable) if (parent -> overrideRedirect == 1) { - windowIsPopup = 1; + windowIsPopup = True; break; } @@ -254,7 +254,7 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable) #ifdef TEST fprintf(stderr, "nxagentWindowIsPopup: Window [%p] %s to be a popup.\n", (void *) pDrawable, - windowIsPopup == 1 ? "seems" : "does not seem"); + windowIsPopup ? "seems" : "does not seem"); #endif return windowIsPopup; @@ -285,7 +285,7 @@ FIXME: The popup could be synchronized with one single put image, if (nxagentOption(DeferLevel) >= 2 && pSrcDrawable -> type == DRAWABLE_PIXMAP && nxagentPixmapContainTrapezoids((PixmapPtr) pSrcDrawable) == 1 && - nxagentWindowIsPopup(pDstDrawable) == 1) + nxagentWindowIsPopup(pDstDrawable)) { RegionPtr pSrcRegion = nxagentCreateRegion(pSrcDrawable, NULL, srcx, srcy, width, height); -- 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 3.6.x in repository nx-libs. commit 4303b1131ba2aa1931e1aade36dce8a69c492d4a Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:57:00 2020 +0100 GCOps.c: handle some internal variables as Booleans --- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index d29558cb2..277daa699 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -509,7 +509,7 @@ FIXME: The popup could be synchronized with one single put image, nxagentChangeClip(targetGC, CT_NONE, NullRegion, 0); - if (pClipRegionFree == True) + if (pClipRegionFree) { nxagentFreeRegion(pClipRegion); } @@ -1540,7 +1540,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, * will be cleared. */ - int inheritCorruptedRegion = 0; + Bool inheritCorruptedRegion = False; if (pGC -> fillStyle == FillTiled && pGC -> tileIsPixel == 0 && pGC -> tile.pixmap != NULL) @@ -1556,11 +1556,11 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, #endif - inheritCorruptedRegion = 1; + inheritCorruptedRegion = True; } } - if (inheritCorruptedRegion == 1 || nxagentDrawableStatus(pDrawable) == NotSynchronized) + if (inheritCorruptedRegion || nxagentDrawableStatus(pDrawable) == NotSynchronized) { RegionPtr rectRegion = RegionFromRects(nRectangles, pRectangles, CT_REGION); @@ -1582,7 +1582,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, RegionUninit(&tmpRegion); } - if (inheritCorruptedRegion == 1) + if (inheritCorruptedRegion) { /* * The fill style should affect the corrupted region -- 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 3.6.x in repository nx-libs. commit f6b386e652ad70ad29b6413d7050234b1d42829f Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 23:52:32 2020 +0100 nxagent: handle RegionNil macro as Boolean just as the rest of the Xserver is alsow doing --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 38 +++++++++++++-------------- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 12 ++++----- nx-X11/programs/Xserver/hw/nxagent/Image.c | 4 +-- nx-X11/programs/Xserver/hw/nxagent/Render.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Split.c | 4 +-- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 5317d0509..c335e7ed9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -396,7 +396,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * The bitmap to synchronize is clipped. */ - if (RegionNil(clipRegion) == 1) + if (RegionNil(clipRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: The bitmap region [%d,%d,%d,%d] is not viewable. " @@ -418,7 +418,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned } else { - if (pRegion != NullRegion && RegionNil(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Region [%d,%d,%d,%d] is nil. Skipping synchronization.\n", @@ -451,7 +451,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned RegionIntersect(clipRegion, clipRegion, nxagentCorruptedRegion(pDrawable)); - if (RegionNil(clipRegion) == 1) + if (RegionNil(clipRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: The corrupted region [%d,%d,%d,%d] is not viewable " @@ -473,7 +473,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned { RegionIntersect(clipRegion, clipRegion, pRegion); - if (RegionNil(clipRegion) == 1) + if (RegionNil(clipRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Region requested [%d,%d,%d,%d] already " @@ -888,7 +888,7 @@ nxagentSynchronizeRegionStop: if (pDrawable -> type == DRAWABLE_PIXMAP && nxagentIsCorruptedBackground((PixmapPtr) pDrawable) == 1 && - RegionNil(&exposeRegion) == 0) + !RegionNil(&exposeRegion)) { struct nxagentExposeBackground eb = { .pBackground = (PixmapPtr) pDrawable, @@ -994,7 +994,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea pBox -> x2 - pBox -> x1, pBox -> y2 - pBox -> y1); - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeBox: Resulting region [%d,%d,%d,%d] is nil. Skipping synchronization.\n", @@ -1441,7 +1441,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, * clipmask. */ - if (RegionNil(pRegion) == 0 && + if (!RegionNil(pRegion) && pGC != NULL && pGC -> clientClip != NULL && pGC -> clientClipType == CT_REGION) { @@ -1478,7 +1478,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) { - if (pRegion != NullRegion && RegionNil(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentMarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n", @@ -1552,7 +1552,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) { - if (pRegion != NullRegion && RegionNil(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentUnmarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n", @@ -2001,7 +2001,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel) unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion) { - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { return nxagentGetDrawableColor(pDrawable); } @@ -2055,7 +2055,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion) return; } - if (pRegion == NullRegion || RegionNil(pRegion) == 1) + if (pRegion == NullRegion || RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentClearRegion: The region is empty. Exiting.\n"); @@ -2145,7 +2145,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion) void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion) { - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { return; } @@ -2328,7 +2328,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) nxagentFreeRegion(clipRegion); - if (RegionNil(&visRegion) == 1) + if (RegionNil(&visRegion)) { #ifdef TEST fprintf(stderr, "nxagentCorruptedRegionOnWindow: The corrupted region of window at [%p] is hidden.\n", @@ -2455,7 +2455,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) RegionIntersect(pClipRegion, pClipRegion, nxagentCorruptedRegion(pDrawable)); - if (RegionNil(pClipRegion) == 1) + if (RegionNil(pClipRegion)) { #ifdef TEST fprintf(stderr, "nxagentCreateDrawableBitmap: The corrupted region is not visible. Skipping bitmap creation.\n"); @@ -2780,14 +2780,14 @@ void nxagentUnmarkExposedRegion(WindowPtr pWin, RegionPtr pRegion, RegionPtr pOt { RegionRec clipRegion; - if (pRegion != NullRegion && RegionNil(pRegion) == 0 && + if (pRegion != NullRegion && !RegionNil(pRegion) && nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized) { RegionInit(&clipRegion, NullBox, 1); RegionCopy(&clipRegion, pRegion); - if (pOther != NullRegion && RegionNil(pOther) == 0) + if (pOther != NullRegion && !RegionNil(pOther)) { RegionUnion(&clipRegion, &clipRegion, pOther); } @@ -2871,7 +2871,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt RegionSubtract(&expose, &expose, nxagentCorruptedRegion((DrawablePtr) pWin)); - if (RegionNil(&pWin -> clipList) != 0) + if (RegionNil(&pWin -> clipList)) { #ifdef TEST fprintf(stderr, "nxagentSendBackgroundExpose: Exposures deferred because the window " @@ -2897,7 +2897,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt pBackingStore = (miBSWindowPtr)pWin->backStorage; - if ((pBackingStore != NULL) && (RegionNil(&pBackingStore->SavedRegion) == 0)) + if ((pBackingStore != NULL) && !RegionNil(&pBackingStore->SavedRegion)) { RegionTranslate(&expose, -pWin -> drawable.x, -pWin -> drawable.y); @@ -2931,7 +2931,7 @@ void nxagentExposeBackgroundPredicate(void *p0, XID x1, void *p2) struct nxagentExposeBackground *pPair = p2; - if (RegionNil(pPair -> pExpose) != 0) + if (RegionNil(pPair -> pExpose)) { return; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index f371363a6..256c7c241 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -4065,7 +4065,7 @@ void nxagentSynchronizeExpose(void) (nxagentExposeQueueHead.remoteRegion), (nxagentExposeQueueHead.localRegion)); - if (RegionNil(nxagentExposeQueueHead.remoteRegion) == 0 && + if (!RegionNil(nxagentExposeQueueHead.remoteRegion) && ((pWin -> eventMask|wOtherEventMasks(pWin)) & ExposureMask)) { #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 093e16a77..d29558cb2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -301,7 +301,7 @@ FIXME: The popup could be synchronized with one single put image, RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (RegionNil(&corruptedRegion) == 0) + if (!RegionNil(&corruptedRegion)) { #ifdef TEST fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n", @@ -422,17 +422,17 @@ FIXME: The popup could be synchronized with one single put image, * corrupted region. */ - if (RegionNil(pClipRegion) == 0) + if (!RegionNil(pClipRegion)) { nxagentUnmarkCorruptedRegion(pDstDrawable, pClipRegion); } - if (RegionNil(pCorruptedRegion) == 0) + if (!RegionNil(pCorruptedRegion)) { nxagentMarkCorruptedRegion(pDstDrawable, pCorruptedRegion); } - if (RegionNil(pClipRegion) == 0) + if (!RegionNil(pClipRegion)) { Bool pClipRegionFree = True; @@ -550,7 +550,7 @@ FIXME: The popup could be synchronized with one single put image, RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (RegionNil(&corruptedRegion) == 0) + if (!RegionNil(&corruptedRegion)) { #ifdef TEST fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n", @@ -996,7 +996,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (RegionNil(&corruptedRegion) == 0) + if (!RegionNil(&corruptedRegion)) { #ifdef TEST fprintf(stderr, "nxagentCopyPlane: Forcing the synchronization of source drawable at [%p].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index 2e0c901ef..eb4085ef3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -544,7 +544,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, pRegion = nxagentCreateRegion(pDrawable, pGC, dstX, dstY, dstWidth, dstHeight); - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on fully clipped " @@ -987,7 +987,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, clipRegion = nxagentCreateRegion(pDrawable, pGC, x, y, w, h); } - if (clipRegion == NullRegion || RegionNil(clipRegion) == 0) + if (clipRegion == NullRegion || !RegionNil(clipRegion)) { nxagentPutSubImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, data, pVisual); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 44d52f8e0..1ea076bfd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -1314,7 +1314,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, RegionPtr pRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, glyphBox.x1, glyphBox.y1, glyphBox.x2 - glyphBox.x1, glyphBox.y2 - glyphBox.y1); - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentGlyphs: WARNING! Glyphs prevented on hidden window at [%p].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 137f0eb58..077457f0e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2903,7 +2903,7 @@ int nxagentShadowSendUpdates(int *suspended) { *suspended = 0; - if (RegionNil(&nxagentShadowUpdateRegion) == 1) + if (RegionNil(&nxagentShadowUpdateRegion)) { return 0; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c index 60af4a0d6..2e2b130fe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -612,7 +612,7 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion) RegionIntersect(&tmpRegion, pResource -> region, pRegion); - if (RegionNil(&tmpRegion) == 0) + if (!RegionNil(&tmpRegion)) { #ifdef TEST fprintf(stderr, "nxagentValidateSplit: Marking the overlapping commits as invalid " @@ -1074,7 +1074,7 @@ void nxagentHandleEndSplitEvent(int resource) if (pResource -> drawable != NULL && pResource -> region != NullRegion) { - if (RegionNil(pResource -> region) == 0) + if (!RegionNil(pResource -> region)) { RegionSubtract( nxagentCorruptedRegion(pResource -> drawable), diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 2a872c812..fcff4c6d0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -2195,7 +2195,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo RegionUnion(&temp, &temp, other_exposed); } - if (RegionNil(&temp) == 0) + if (!RegionNil(&temp)) { RegionTranslate(&temp, -(pWin -> drawable.x), -(pWin -> drawable.y)); -- 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 3.6.x in repository nx-libs. commit 6c09c0b7ecadd1f512a9f795d8f34961b1cc9baf Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:03:44 2020 +0100 nxagent: make XDMCP variables Booleans --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 14 +++++++------- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 01c1e0638..a3624dbfc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -114,8 +114,8 @@ extern void nxagentDumpInputDevicesState(void); * Used in the handling of the X desktop manager protocol. */ -int nxagentXdmcpUp = 0; -int nxagentXdmcpAlertUp = 0; +Bool nxagentXdmcpUp = False; +Bool nxagentXdmcpAlertUp = False; /* * Also used in the block, wakeup and sync handlers. @@ -648,7 +648,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) * the session. */ - if (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0) + if (nxagentOption(Xdmcp) && !nxagentXdmcpUp) { #ifdef DEBUG fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState); @@ -656,10 +656,10 @@ void nxagentWakeupHandler(void * data, int count, void * mask) if (XdmcpState == XDM_RUN_SESSION) { - nxagentXdmcpUp = 1; + nxagentXdmcpUp = True; } - if (nxagentXdmcpUp == 0) + if (!nxagentXdmcpUp) { #ifdef DEBUG fprintf(stderr, "nxagentWakeupHandler: XdmcpTime [%lu].\n", @@ -671,7 +671,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) XdmcpTimeOutRtx); #endif - if (nxagentXdmcpAlertUp == 0 && + if (!nxagentXdmcpAlertUp && GetTimeInMillis() - XdmcpStartTime >= XDM_TIMEOUT) { #ifdef WARNING @@ -681,7 +681,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) NXTransAlert(FAILED_XDMCP_CONNECTION_ALERT, NX_ALERT_REMOTE); - nxagentXdmcpAlertUp = 1; + nxagentXdmcpAlertUp = True; } } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 6573ac0b9..12a44dbe0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -330,7 +330,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio clientReady[0] = 0; - if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) && nxagentXdmcpUp == 0)) + if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) && !nxagentXdmcpUp)) { #ifdef TEST fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n", @@ -343,7 +343,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio if (serverGeneration > nxagentMaxAllowedResets && nxagentSessionState == SESSION_STARTING && - (!nxagentOption(Xdmcp) || nxagentXdmcpUp == 1)) + (!nxagentOption(Xdmcp) || nxagentXdmcpUp)) { #ifdef NX_DEBUG_INPUT fprintf(stderr, "Session: Session started at '%s' timestamp [%u].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h b/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h index 086ea9082..946b856bc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h @@ -36,6 +36,6 @@ extern xdmcp_states XdmcpState; extern int XdmcpTimeOutRtx; extern int XdmcpStartTime; -extern int nxagentXdmcpUp; +extern Bool nxagentXdmcpUp; #endif /* __Xdmcp_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 3.6.x in repository nx-libs. commit db3efd45c061594fcc90017586064ce833556d1e Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:24:41 2020 +0100 nxagent: make nxagentBlocking an Boolean --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 14 +++++++------- nx-X11/programs/Xserver/hw/nxagent/Handlers.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 90f4cc1b0..15112312f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -660,7 +660,7 @@ static void nxagentDisplayBlockHandler(Display *disp, int reason) fprintf(stderr, "nxagentDisplayBlockHandler: BLOCK! Display is blocking for [write].\n"); #endif - nxagentBlocking = 1; + nxagentBlocking = True; if (!SmartScheduleSignalEnable) { @@ -908,7 +908,7 @@ void nxagentResetDisplayHandlers(void) */ nxagentBuffer = 0; - nxagentBlocking = 0; + nxagentBlocking = False; nxagentCongestion = 0; /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 8b657beb7..dc4d15c80 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -2815,7 +2815,7 @@ int nxagentSynchronizationPredicate(void) return NotNeeded; } - if (nxagentBlocking == 0 && + if (!nxagentBlocking && nxagentCongestion <= 4 && nxagentReady == 0 && nxagentUserInput(NULL) == 0) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index a3624dbfc..cdba83264 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -122,7 +122,7 @@ Bool nxagentXdmcpAlertUp = False; */ int nxagentBuffer; -int nxagentBlocking; +Bool nxagentBlocking; int nxagentCongestion; double nxagentBytesIn; @@ -322,7 +322,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) nxagentForceSynchronization = 0; } else if (nxagentUserInput(NULL) == 0 && - nxagentBlocking == 0 && + !nxagentBlocking && nxagentCongestion <= 4) { #ifdef TEST @@ -391,7 +391,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) #ifdef DYNAMIC_DISPLAY_BUFFER - if (nxagentBlocking == 1 && + if (nxagentBlocking && nxagentBuffer > MINIMUM_DISPLAY_BUFFER) { nxagentBuffer >>= 1; @@ -587,7 +587,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask) * Can become true during the dispatch loop. */ - nxagentBlocking = 0; + nxagentBlocking = False; /* * Check if we got new events. @@ -759,7 +759,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas nxagentShadowSendUpdates(&suspended); - if (nxagentBlocking == 0) + if (!nxagentBlocking) { nxagentSynchronizeDrawable((DrawablePtr) nxagentShadowPixmapPtr, DONT_WAIT, ALWAYS_BREAK, nxagentShadowWindowPtr); @@ -830,7 +830,7 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask) * Can become true during the dispatch loop. */ - nxagentBlocking = 0; + nxagentBlocking = False; /* * Check if we got new events. @@ -1200,7 +1200,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) nxagentDispatchEvents(NULL); - nxagentBlocking = 1; + nxagentBlocking = True; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h index ddae097da..0d019cc22 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h @@ -37,7 +37,7 @@ extern int nxagentBuffer; * the display to become writable. */ -extern int nxagentBlocking; +extern Bool nxagentBlocking; /* * Current congestion level based on diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 181537009..7426acab2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -77,7 +77,7 @@ while (0) #define breakOnBlocking(mask) \ (((mask) != NEVER_BREAK) && ((mask) & BLOCKING_BREAK) && \ - nxagentBlocking == 1) + nxagentBlocking) #define breakOnCongestion(mask) \ (((mask) != NEVER_BREAK) && ((mask) & CONGESTION_BREAK) && \ @@ -164,7 +164,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE #define NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask) \ ((nxagentCorruptedWindows == 0 && nxagentCorruptedPixmaps > 0 && \ - nxagentCongestion == 0 && nxagentBlocking == 0) || \ + nxagentCongestion == 0 && !nxagentBlocking) || \ mask == NEVER_BREAK) /* -- 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 3.6.x in repository nx-libs. commit e8a5e328714d118e440df1c0fe3478122f04bbaf Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:32:35 2020 +0100 GCOps.c: make internal variable an function Booleans --- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index eda87ff20..ee56e9abf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -261,10 +261,10 @@ Bool nxagentWindowIsPopup(DrawablePtr pDrawable) } /* - * This function returns 1 if the XCopyArea request must be skipped. + * This function returns True if the XCopyArea request must be skipped. */ -int nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, +Bool nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { @@ -317,7 +317,7 @@ FIXME: The popup could be synchronized with one single put image, if (nxagentDrawableStatus(pSrcDrawable) == Synchronized) { - return 0; + return False; } } @@ -532,7 +532,7 @@ FIXME: The popup could be synchronized with one single put image, nxagentFreeRegion(pCorruptedRegion); - return 1; + return True; } else { @@ -565,14 +565,14 @@ FIXME: The popup could be synchronized with one single put image, nxagentFreeRegion(pSrcRegion); } - return 0; + return False; } RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { - int skip = 0; + Bool skip = False; #ifdef TEST fprintf(stderr, "nxagentCopyArea: Image src [%s:%p], dst [%s:%p] (%d,%d) -> (%d,%d) size (%d,%d)\n", @@ -761,7 +761,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * can skip the copy area operation. */ - skip = 1; + skip = True; } #ifdef TEST @@ -771,7 +771,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); #endif - if (skip == 0 && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) + if (!skip && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) { skip = nxagentDeferCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty); @@ -784,7 +784,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } #endif - if (skip == 0) + if (!skip) { XCopyArea(nxagentDisplay, nxagentDrawable(pSrcDrawable), nxagentDrawable(pDstDrawable), nxagentGC(pGC), srcx, srcy, width, height, dstx, dsty); @@ -881,7 +881,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long plane) { - int skip = 0; + Bool skip = False; #ifdef TEST fprintf(stderr, "nxagentCopyPlane: Image src [%s:%p], dst [%s:%p] (%d,%d) -> (%d,%d) size (%d,%d)\n", @@ -969,10 +969,10 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * can skip the copy plane operation. */ - skip = 1; + skip = True; } - if (skip == 0 && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) + if (!skip && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) { if (pDstDrawable -> type == DRAWABLE_PIXMAP && nxagentOption(DeferLevel) > 0) @@ -983,7 +983,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, nxagentFreeRegion(pDstRegion); - skip = 1; + skip = True; } else { @@ -1025,7 +1025,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } #endif - if (skip == 0) + if (!skip) { XCopyPlane(nxagentDisplay, nxagentDrawable(pSrcDrawable), nxagentDrawable(pDstDrawable), -- 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 3.6.x in repository nx-libs. commit af2964c7ea294ab8dc910e31aa432453123fe537 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:17:53 2020 +0100 Render.c: improve Boolean handling of nxagentCheckPictureRemoteValue --- nx-X11/programs/Xserver/hw/nxagent/Render.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 1ea076bfd..28e2d77fc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -925,7 +925,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPRepeat) { attributes.repeat = (Bool)pPicture -> repeat; - if (nxagentCheckPictureRemoteValue(pPicture, repeat, attributes.repeat) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, repeat, attributes.repeat)) { valuemask |= CPRepeat; nxagentSetPictureRemoteValue(pPicture, repeat, attributes.repeat); @@ -935,7 +935,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPAlphaMap) { attributes.alpha_map = nxagentPicturePriv(pPicture -> alphaMap) -> picture; - if (nxagentCheckPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map)) { valuemask |= CPAlphaMap; nxagentSetPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map); @@ -945,7 +945,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPAlphaXOrigin) { attributes.alpha_x_origin = pPicture -> alphaOrigin.x; - if (nxagentCheckPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin)) { valuemask |= CPAlphaXOrigin; nxagentSetPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin); @@ -955,7 +955,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPAlphaYOrigin) { attributes.alpha_y_origin = pPicture -> alphaOrigin.y; - if (nxagentCheckPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin)) { valuemask |= CPAlphaYOrigin; nxagentSetPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin); @@ -965,7 +965,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPClipXOrigin) { attributes.clip_x_origin = pPicture -> clipOrigin.x; - if (nxagentCheckPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin)) { valuemask |= CPClipXOrigin; nxagentSetPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin); @@ -975,7 +975,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPClipYOrigin) { attributes.clip_y_origin = pPicture -> clipOrigin.y; - if (nxagentCheckPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin)) { valuemask |= CPClipYOrigin; nxagentSetPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin); @@ -985,7 +985,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPGraphicsExposure) { attributes.graphics_exposures = (Bool)pPicture -> graphicsExposures; - if (nxagentCheckPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures)) { valuemask |= CPGraphicsExposure; nxagentSetPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures); @@ -995,7 +995,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPSubwindowMode) { attributes.subwindow_mode = pPicture -> subWindowMode; - if (nxagentCheckPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode)) { valuemask |= CPSubwindowMode; nxagentSetPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode); @@ -1021,7 +1021,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPPolyEdge) { attributes.poly_edge = pPicture -> polyEdge; - if (nxagentCheckPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge)) { valuemask |= CPPolyEdge; nxagentSetPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge); @@ -1031,7 +1031,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPPolyMode) { attributes.poly_mode = pPicture -> polyMode; - if (nxagentCheckPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode)) { valuemask |= CPPolyMode; nxagentSetPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode); @@ -1041,7 +1041,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPDither) { attributes.dither = pPicture -> dither; - if (nxagentCheckPictureRemoteValue(pPicture, dither, attributes.dither) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, dither, attributes.dither)) { valuemask |= CPDither; nxagentSetPictureRemoteValue(pPicture, dither, attributes.dither); @@ -1051,7 +1051,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) if (mask & CPComponentAlpha) { attributes.component_alpha = pPicture -> componentAlpha; - if (nxagentCheckPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha) == 0) + if (!nxagentCheckPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha)) { valuemask |= CPComponentAlpha; nxagentSetPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha); -- 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 3.6.x in repository nx-libs. commit 15cf1eee09d56f416547480cf98217addd52d879 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:36:20 2020 +0100 GC.c: make internal variable and function Boolean --- nx-X11/programs/Xserver/hw/nxagent/GC.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index d39f743e6..2aa404910 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -86,7 +86,7 @@ GCPtr nxagentCreateGraphicContext(int depth); static void nxagentReconnectGC(void*, XID, void*); static void nxagentReconnectClip(GCPtr, int, void *, int); -static int nxagentCompareRegions(RegionPtr, RegionPtr); +static Bool nxagentCompareRegions(RegionPtr, RegionPtr); struct nxagentGCRec { @@ -497,7 +497,7 @@ void nxagentDestroyGC(GCPtr pGC) void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) { - int clipsMatch = 0; + Bool clipsMatch = False; #ifdef TEST fprintf(stderr, "nxagentChangeClip: Going to change clip on GC [%p]\n", @@ -528,7 +528,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } default: { - clipsMatch = 0; + clipsMatch = False; break; } } @@ -544,7 +544,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) { case CT_NONE: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XSetClipMask(nxagentDisplay, nxagentGC(pGC), None); } @@ -552,7 +552,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_REGION: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XRectangle *pRects; nRects = RegionNumRects((RegionPtr)pValue); @@ -594,7 +594,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_UNSORTED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -604,7 +604,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YSORTED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -614,7 +614,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YXSORTED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -624,7 +624,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) } case CT_YXBANDED: { - if (clipsMatch == 0 && !nxagentGCTrap) + if (!clipsMatch && !nxagentGCTrap) { XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC->clipOrg.x, pGC->clipOrg.y, @@ -1209,29 +1209,29 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) nxagentGCPriv(pGC)->nClipRects = nRects; } -static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2) +static Bool nxagentCompareRegions(RegionPtr r1, RegionPtr r2) { /* - * It returns 1 if regions are equal, 0 otherwise + * It returns True if regions are equal, False otherwise */ if (r1 == NULL && r2 == NULL) { - return 1; + return True; } if ((r1 == NULL) || (r2 == NULL)) { - return 0; + return False; } if (RegionNumRects(r1) != RegionNumRects(r2)) { - return 0; + return False; } else if (RegionNumRects(r1) == 0) { - return 1; + return True; } else if ((*RegionExtents(r1)).x1 != (*RegionExtents(r2)).x1) return 0; else if ((*RegionExtents(r1)).x2 != (*RegionExtents(r2)).x2) return 0; @@ -1247,7 +1247,7 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2) else if (RegionRects(r1)[i].y2 != RegionRects(r2)[i].y2) return 0; } } - return 1; + return True; } /* -- 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 3.6.x in repository nx-libs. commit 99ca67c2ff080354c569dbb6f8e8ca611ffe7506 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:14:35 2020 +0100 nxagent: improve Boolean handling for Reconnect functions --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 14 +++++++------- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index c8a2d852a..90f4cc1b0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -2517,7 +2517,7 @@ Bool nxagentReconnectDisplay(void *p0) nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT, "Couldn't open the display."); - return FALSE; + return False; } nxagentAddXConnection(); @@ -2535,12 +2535,12 @@ Bool nxagentReconnectDisplay(void *p0) #endif - if (nxagentCheckForDefaultDepthCompatibility() == 0) + if (!nxagentCheckForDefaultDepthCompatibility()) { nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT, "Default display depth doesn't match."); - return FALSE; + return False; } nxagentUseNXTrans = nxagentPostProcessArgs(nxagentDisplayName, nxagentDisplay, @@ -2557,12 +2557,12 @@ Bool nxagentReconnectDisplay(void *p0) * Init and compare the visuals. */ - if (nxagentInitAndCheckVisuals(flexibility) == FALSE) + if (!nxagentInitAndCheckVisuals(flexibility)) { nxagentSetReconnectError(FAILED_RESUME_VISUALS_ALERT, "Couldn't restore the required visuals."); - return FALSE; + return False; } reconnectDisplayState = GOT_VISUAL_INFO; @@ -2612,7 +2612,7 @@ Bool nxagentReconnectDisplay(void *p0) reconnectDisplayState = GOT_DEPTH_LIST; - if (nxagentCheckForDepthsCompatibility() == 0) + if (!nxagentCheckForDepthsCompatibility()) { nxagentSetReconnectError(FAILED_RESUME_DEPTHS_ALERT, "Couldn't restore all the required depths."); @@ -2634,7 +2634,7 @@ Bool nxagentReconnectDisplay(void *p0) nxagentInitPixmapFormats(); - if (nxagentCheckForPixmapFormatsCompatibility() == 0) + if (!nxagentCheckForPixmapFormatsCompatibility()) { nxagentSetReconnectError(FAILED_RESUME_PIXMAPS_ALERT, "Couldn't restore all the required pixmap formats."); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 03ac9effd..101796748 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -458,7 +458,7 @@ Bool nxagentReconnectSession(void) nxagentProcessOptions(nxagentOptionsFilenameOrString); - if (nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP]) == 0) + if (!nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP])) { #ifdef TEST fprintf(stderr, "nxagentReconnectSession: WARNING! Failed display reconnection.\n"); @@ -468,7 +468,7 @@ Bool nxagentReconnectSession(void) goto nxagentReconnectError; } - if (nxagentReconnectScreen(reconnectLossyLevel[SCREEN_STEP]) == 0) + if (!nxagentReconnectScreen(reconnectLossyLevel[SCREEN_STEP])) { failedStep = SCREEN_STEP; goto nxagentReconnectError; @@ -478,9 +478,9 @@ Bool nxagentReconnectSession(void) nxagentListRemoteFonts("*", nxagentMaxFontNames); - if (nxagentReconnectAllFonts(reconnectLossyLevel[FONT_STEP]) == 0) + if (!nxagentReconnectAllFonts(reconnectLossyLevel[FONT_STEP])) { - if (nxagentReconnectFailedFonts(reconnectLossyLevel[FONT_STEP]) == 0) + if (!nxagentReconnectFailedFonts(reconnectLossyLevel[FONT_STEP])) { failedStep = FONT_STEP; goto nxagentReconnectError; @@ -515,26 +515,26 @@ Bool nxagentReconnectSession(void) nxagentEmptyBSPixmapList(); /* FIXME: nxagentReconnectAllPixmaps will always return 1 */ - if (nxagentReconnectAllPixmaps(reconnectLossyLevel[PIXMAP_STEP]) == 0) + if (!nxagentReconnectAllPixmaps(reconnectLossyLevel[PIXMAP_STEP])) { failedStep = PIXMAP_STEP; goto nxagentReconnectError; } - if (nxagentReconnectAllGCs(reconnectLossyLevel[GC_STEP]) == 0) + if (!nxagentReconnectAllGCs(reconnectLossyLevel[GC_STEP])) { failedStep = GC_STEP; goto nxagentReconnectError; } - if (nxagentReconnectAllColormap(reconnectLossyLevel[COLORMAP_STEP]) == 0) + if (!nxagentReconnectAllColormap(reconnectLossyLevel[COLORMAP_STEP])) { failedStep = COLORMAP_STEP; goto nxagentReconnectError; } - if (nxagentReconnectAllWindows(reconnectLossyLevel[WINDOW_STEP]) == 0) + if (!nxagentReconnectAllWindows(reconnectLossyLevel[WINDOW_STEP])) { failedStep = WINDOW_STEP; goto nxagentReconnectError; @@ -542,32 +542,32 @@ Bool nxagentReconnectSession(void) if (nxagentRenderEnable) { - if (nxagentReconnectAllGlyphSet(reconnectLossyLevel[GLYPHSET_STEP]) == 0) + if (!nxagentReconnectAllGlyphSet(reconnectLossyLevel[GLYPHSET_STEP])) { failedStep = GLYPHSET_STEP; goto nxagentReconnectError; } - if (nxagentReconnectAllPictFormat(reconnectLossyLevel[PICTFORMAT_STEP]) == 0) + if (!nxagentReconnectAllPictFormat(reconnectLossyLevel[PICTFORMAT_STEP])) { failedStep = PICTFORMAT_STEP; goto nxagentReconnectError; } - if (nxagentReconnectAllPicture(reconnectLossyLevel[PICTURE_STEP]) == 0) + if (!nxagentReconnectAllPicture(reconnectLossyLevel[PICTURE_STEP])) { failedStep = PICTURE_STEP; goto nxagentReconnectError; } } - if (nxagentReconnectAllCursor(reconnectLossyLevel[CURSOR_STEP]) == 0) + if (!nxagentReconnectAllCursor(reconnectLossyLevel[CURSOR_STEP])) { failedStep = CURSOR_STEP; goto nxagentReconnectError; } - if (nxagentSetWindowCursors(reconnectLossyLevel[WINDOW_STEP]) == 0) + if (!nxagentSetWindowCursors(reconnectLossyLevel[WINDOW_STEP])) { failedStep = WINDOW_STEP; goto nxagentReconnectError; -- 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 3.6.x in repository nx-libs. commit 48279ae79476e3fb3a9e3f7b215ea59c68288a8e Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:46:18 2020 +0100 nxagent: make nxagentForceSynchronization a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index ad896dd55..b1df83d3b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -99,7 +99,7 @@ int nxagentCorruptedPixmaps = 0; int nxagentCorruptedWindows = 0; int nxagentCorruptedBackgrounds = 0; -int nxagentForceSynchronization = 0; +Bool nxagentForceSynchronization = False; _nxagentSynchronizationRec nxagentSynchronization = { (DrawablePtr) NULL, 0, 0, 0, 0, 0 }; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h index 22ffabf7a..e4d3ec96e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h @@ -157,7 +157,7 @@ extern int nxagentCorruptedPixmaps; extern int nxagentCorruptedWindows; extern int nxagentCorruptedBackgrounds; -extern int nxagentForceSynchronization; +extern Bool nxagentForceSynchronization; extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 256c7c241..c5bdee63b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -660,7 +660,7 @@ static void nxagentSwitchDeferMode(void) { nxagentLaunchDialog(DIALOG_DISABLE_DEFER_MODE); - nxagentForceSynchronization = 1; + nxagentForceSynchronization = True; } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index cdba83264..e6a368b9a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -310,7 +310,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) * operation. */ - if (nxagentForceSynchronization == 1) + if (nxagentForceSynchronization) { #ifdef TEST fprintf(stderr, "nxagentBlockHandler: Going to force a synchronization at %s.\n", @@ -319,7 +319,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) nxagentSynchronizationLoop(NEVER_BREAK); - nxagentForceSynchronization = 0; + nxagentForceSynchronization = False; } else if (nxagentUserInput(NULL) == 0 && !nxagentBlocking && diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index d6c659fec..9a7c1cd65 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -624,7 +624,7 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) return True; break; case KEYSTROKE_FORCE_SYNCHRONIZATION: - nxagentForceSynchronization = 1; + nxagentForceSynchronization = True; break; #ifdef DUMP case KEYSTROKE_REGIONS_ON_SCREEN: -- 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 3.6.x in repository nx-libs. commit b9c2db67b481bc1d512aed84e2fd3c269487210f Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:53:11 2020 +0100 Drawable.c: make doRoundRobin a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index f28eb1945..2b81a55f5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -1241,7 +1241,7 @@ FIXME: All drawables should be set as synchronized and never marked as * round-robin and if the bitmaps are all synchronized. */ - int doRoundRobin = (nxagentSynchronization.pDrawable != NULL); + Bool doRoundRobin = (nxagentSynchronization.pDrawable != NULL); nxagentSynchronization.abort = False; @@ -1262,7 +1262,7 @@ FIXME: All drawables should be set as synchronized and never marked as if (!nxagentSynchronization.abort && nxagentSynchronization.windowBitmaps == 0 && - doRoundRobin == 0) + !doRoundRobin) { if (nxagentCorruptedWindows > 0) { @@ -1294,7 +1294,7 @@ FIXME: All drawables should be set as synchronized and never marked as if (!nxagentSynchronization.abort && nxagentSynchronization.backgroundBitmaps == 0 && - doRoundRobin == 0) + !doRoundRobin) { if (nxagentCorruptedBackgrounds > 0) { @@ -1328,7 +1328,7 @@ FIXME: All drawables should be set as synchronized and never marked as if (!nxagentSynchronization.abort && nxagentSynchronization.pixmapBitmaps == 0 && - doRoundRobin == 0) + !doRoundRobin) { #ifdef TEST -- 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 3.6.x in repository nx-libs. commit af7d8e3fa09c59ce752052e362630a7cf0eafd6a Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:58:04 2020 +0100 nxagent: make nxagentXFixesInfo.Initialized a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 2e14c08e7..8ac2241a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -225,7 +225,7 @@ const char * getXErrorString(int code) * Save the values queried from X server. */ -XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, 0 }; +XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, False }; extern Display *nxagentDisplay; @@ -2234,7 +2234,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) XFixesSelectionClientCloseNotifyMask); } - nxagentXFixesInfo.Initialized = 1; + nxagentXFixesInfo.Initialized = True; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h index 4817a03e2..d401dae51 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h @@ -35,7 +35,7 @@ typedef struct _XFixesAgentInfo int Opcode; int EventBase; int ErrorBase; - int Initialized; + Bool Initialized; } XFixesAgentInfoRec; extern XFixesAgentInfoRec nxagentXFixesInfo; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index c5bdee63b..1758f649c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2831,7 +2831,7 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) { XFixesSelectionEvent *xfixesEvent = (XFixesSelectionEvent *) X; - if (nxagentXFixesInfo.Initialized == 0) + if (!nxagentXFixesInfo.Initialized) { #ifdef DEBUG fprintf(stderr, "%s: XFixes not initialized - doing nothing.\n", __func__); -- 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 3.6.x in repository nx-libs. commit ab83e4688b5787cad652f7d47092813e687161d7 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:38:07 2020 +0100 Client.c: cleanup Boolean handling for nxagentNeedWakeup*() macros --- nx-X11/programs/Xserver/hw/nxagent/Client.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.c b/nx-X11/programs/Xserver/hw/nxagent/Client.c index e0adef3bc..08b2d8feb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.c @@ -457,7 +457,7 @@ void nxagentWaitWakeupBySplit(ClientPtr client) { #ifdef TEST - if (nxagentNeedWakeupBySplit(client) == 0) + if (!nxagentNeedWakeupBySplit(client)) { fprintf(stderr, "++++++nxagentWaitWakeupBySplit: WARNING! The client [%d] is already awake.\n", client -> index); @@ -497,12 +497,12 @@ void nxagentWaitWakeupBySplit(ClientPtr client) #endif - if (nxagentNeedWakeupBySplit(client) == 0 || + if (!nxagentNeedWakeupBySplit(client) || NXDisplayError(nxagentDisplay) == 1) { #ifdef TEST - if (nxagentNeedWakeupBySplit(client) == 0) + if (!nxagentNeedWakeupBySplit(client)) { fprintf(stderr, "++++++nxagentWaitWakeupBySplit: Client [%d] can now run.\n", client -> index); @@ -535,7 +535,7 @@ FIXME: Should record a serial number for the client, so that the */ if (client -> index < MAX_CONNECTIONS) { - if (nxagentNeedWakeup(client) == 0) + if (!nxagentNeedWakeup(client)) { #ifdef TEST fprintf(stderr, "++++++nxagentSuspendBySplit: Suspending client [%d] with agent sequence [%ld].\n", @@ -583,7 +583,7 @@ FIXME: Should record a serial number for the client, so that the { nxagentClientPriv(client) -> clientState &= ~SleepingBySplit; - if (nxagentNeedWakeup(client) == 0) + if (!nxagentNeedWakeup(client)) { #ifdef TEST fprintf(stderr, "++++++nxagentWakeupBySplit: Resuming client [%d] with agent sequence [%ld].\n", @@ -629,7 +629,7 @@ void nxagentCheckRestartedClients(struct timeval **timeout) for (int i = 1; i < currentMaxClients; i++) { if (clients[i] != NULL && clients[i] -> osPrivate != NULL && - nxagentNeedWakeup(clients[i]) == 0) + !nxagentNeedWakeup(clients[i])) { int fd = ((OsCommPtr) clients[i] -> osPrivate) -> fd; -- 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 3.6.x in repository nx-libs. commit 90178b54883fc687b12574f19cd714e822a7d22c Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:49:38 2020 +0100 nxagent: make nxagentSkipImage a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index b1df83d3b..f28eb1945 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -123,7 +123,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel); unsigned long nxagentGetDrawableColor(DrawablePtr pDrawable); unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion); -int nxagentSkipImage = 0; +Bool nxagentSkipImage = False; static int nxagentTooManyImageData(void) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index e6a368b9a..cbe66cd90 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -153,7 +153,7 @@ struct _DispatchRec nxagentDispatch = { UNDEFINED, 0, 0, 0 }; * server. */ -extern int nxagentSkipImage; +extern Bool nxagentSkipImage; void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) { @@ -350,7 +350,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) nxagentCorruptedBackgrounds > 0 || nxagentCorruptedPixmaps > 0)); - if (nxagentSkipImage == 0 && synchronize == 1) + if (!nxagentSkipImage && synchronize == 1) { #ifdef TEST fprintf(stderr, "nxagentBlockHandler: Setting a zero timeout with [%d][%d][%d] and " -- 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 3.6.x in repository nx-libs. commit 9aa33917623085260f85d766bf5761ef2dddb333 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:49:57 2020 +0100 Handlers.c: make synchronize a Boolean variable --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index cbe66cd90..d00b13d77 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -179,7 +179,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) * Set if we need to synchronize any drawable. */ - static int synchronize; + static Bool synchronize; #ifdef BLOCKS fprintf(stderr, "[Begin block]\n"); @@ -302,7 +302,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) * are synchronized. */ - if (synchronize == 1) + if (synchronize) { /* * We should not enter the synchronization loop if there is any @@ -350,7 +350,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask) nxagentCorruptedBackgrounds > 0 || nxagentCorruptedPixmaps > 0)); - if (!nxagentSkipImage && synchronize == 1) + if (!nxagentSkipImage && synchronize) { #ifdef TEST fprintf(stderr, "nxagentBlockHandler: Setting a zero timeout with [%d][%d][%d] and " -- 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 3.6.x in repository nx-libs. commit 1ed28c85be774d2283aa0c6815831d1a402cea89 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:43:49 2020 +0100 Drawable.c: make abort flag a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 32 +++++++++++++-------------- nx-X11/programs/Xserver/hw/nxagent/Drawable.h | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index dc4d15c80..ad896dd55 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -63,7 +63,7 @@ /* * The rectangles composing a region are de- fragmented to reduce the - * number of synch- ronizing PutImage's. + * number of synchronizing PutImage()s. */ #define ADVANCED_BOXES_DEFRAG @@ -588,7 +588,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned unsigned long now = GetTimeInMillis(); - nxagentSynchronization.abort = 0; + nxagentSynchronization.abort = False; /* * Going to split the updated region into small blocks. @@ -652,7 +652,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned "[%lu] ms elapsed.\n", elapsedTime); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -670,7 +670,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentBlocking); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -687,7 +687,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentCongestion); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -834,7 +834,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned "new input events.\n"); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -854,7 +854,7 @@ nxagentSynchronizeRegionStop: if (!nxagentOption(Shadow)) { - if (nxagentSynchronization.abort == 1) + if (nxagentSynchronization.abort) { /* * Storing the pointer to the drawable we were synchronizing @@ -1031,7 +1031,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) * synchronizations. */ - if (nxagentSynchronization.abort == 1 || + if (nxagentSynchronization.abort || nxagentDrawableStatus(pDrawable) == Synchronized) { return; @@ -1138,7 +1138,7 @@ FIXME: This condition sounds only as a complication, as the break nxagentCongestion, nxagentBlocking); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; return; } @@ -1179,7 +1179,7 @@ FIXME: This condition sounds only as a complication, as the break * clear it. */ - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && shouldClearHiddenRegion) { #ifdef TEST @@ -1243,7 +1243,7 @@ FIXME: All drawables should be set as synchronized and never marked as int doRoundRobin = (nxagentSynchronization.pDrawable != NULL); - nxagentSynchronization.abort = 0; + nxagentSynchronization.abort = False; /* * Synchronize the windows. @@ -1260,7 +1260,7 @@ FIXME: All drawables should be set as synchronized and never marked as #ifdef TEST - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && nxagentSynchronization.windowBitmaps == 0 && doRoundRobin == 0) { @@ -1280,7 +1280,7 @@ FIXME: All drawables should be set as synchronized and never marked as * Synchronize the backgrounds. */ - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_BACKGROUNDS(mask)) { #ifdef TEST @@ -1292,7 +1292,7 @@ FIXME: All drawables should be set as synchronized and never marked as #ifdef TEST - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && nxagentSynchronization.backgroundBitmaps == 0 && doRoundRobin == 0) { @@ -1315,7 +1315,7 @@ FIXME: All drawables should be set as synchronized and never marked as * the pixmap in a copy or in a composite operation. */ - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask)) { #ifdef TEST @@ -1326,7 +1326,7 @@ FIXME: All drawables should be set as synchronized and never marked as nxagentSynchronizeDrawablePredicate, &breakMask); - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && nxagentSynchronization.pixmapBitmaps == 0 && doRoundRobin == 0) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h index 1101f989f..22ffabf7a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h @@ -38,7 +38,7 @@ typedef struct { DrawablePtr pDrawable; int drawableType; - int abort; + Bool abort; int windowBitmaps; int pixmapBitmaps; int backgroundBitmaps; -- 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 3.6.x in repository nx-libs. commit 013a6ba3c500ead26e4210699d177f4b485ceb7d Merge: faae65fb3 f8b759263 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Jan 15 16:38:23 2021 +0100 Merge branch 'uli42-pr/fix_unusable_mouse_in_fullscreen' into 3.6.x Attributes GH PR #984: https://github.com/ArcticaProject/nx-libs/pull/984 nx-X11/programs/Xserver/hw/nxagent/Init.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 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 3.6.x in repository nx-libs. commit f4dd9d76aa58cdfbb7e0e2a160d0cfdee85a9f40 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:20:00 2020 +0100 Font.c: Use Booleans where appropriate --- nx-X11/programs/Xserver/hw/nxagent/Font.c | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 0ce5b87ad..c5dcdf4af 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -102,7 +102,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName , FontPtr pFont); int nxagentFreeFont(XFontStruct *fs); static Bool nxagentGetFontServerPath(char * fontServerPath, int size); -static char * nxagentMakeScalableFontName(const char *fontName, int scalableResolution); +static char * nxagentMakeScalableFontName(const char *fontName, Bool scalableResolution); RESTYPE RT_NX_FONT; @@ -414,10 +414,10 @@ Bool nxagentFontLookUp(const char *name) if (name && strlen(name) == 0) { - return 0; + return False; } - int result = nxagentFontFind(name, &i); + Bool result = nxagentFontFind(name, &i); char *scalable = NULL; @@ -425,9 +425,9 @@ Bool nxagentFontLookUp(const char *name) * Let's try with the scalable font description. */ - if (result == 0) + if (!result) { - if ((scalable = nxagentMakeScalableFontName(name, 0)) != NULL) + if ((scalable = nxagentMakeScalableFontName(name, False)) != NULL) { result = nxagentFontFind(scalable, &i); @@ -439,9 +439,9 @@ Bool nxagentFontLookUp(const char *name) * Let's try again after replacing zero to xdpi and ydpi in the pattern. */ - if (result == 0) + if (!result) { - if ((scalable = nxagentMakeScalableFontName(name, 1)) != NULL) + if ((scalable = nxagentMakeScalableFontName(name, True)) != NULL) { result = nxagentFontFind(scalable, &i); @@ -449,9 +449,9 @@ Bool nxagentFontLookUp(const char *name) } } - if (result == 0) + if (!result) { - return 0; + return False; } else { @@ -612,7 +612,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) if (nxagentFontPriv(pFont)->font_struct == NULL) { - if (nxagentFontLookUp(name) == False) + if (!nxagentFontLookUp(name)) { fprintf(stderr, "Font: nxagentRealizeFont failed with font Font=%s, not in our remote list\n", validateString(name)); @@ -1532,7 +1532,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo fprintf(stderr, "nxagentLoadQueryFont: Looking for font '%s'.\n", name); #endif - if (nxagentFontLookUp(name) == 0) + if (!nxagentFontLookUp(name)) { #ifdef DEBUG fprintf(stderr, "nxagentLoadQueryFont: WARNING! Font not found '%s'.\n", name); @@ -1630,7 +1630,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) char *current = string; int i = 0; - int last = 0; + Bool last = False; for (;;) { @@ -1644,7 +1644,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) if (next == NULL) { next = string + len; - last = 1; + last = True; } int fieldlen = next - current; @@ -1662,7 +1662,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) i++; - if (last == 1) + if (last) { break; } @@ -1671,7 +1671,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) return i; } -char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution) +char *nxagentMakeScalableFontName(const char *fontName, Bool scalableResolution) { char *scalableFontName; @@ -1710,7 +1710,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution) strcat(scalableFontName, "-0"); } - else if (scalableResolution == 1 && (field == 8 || field == 9)) + else if (scalableResolution && (field == 8 || field == 9)) { /* * RESOLUTION_X || RESOLUTION_Y -- 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 3.6.x in repository nx-libs. commit f8b75926363cd9f337e2b95fe6e5301b21f76ed5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:28:49 2020 +0100 nxagent: nxagent(Default)WindowIsVisible() are Booleans --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Image.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 2b81a55f5..ca1b09dd3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -2309,7 +2309,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) * The window is not visible. */ - if (nxagentWindowIsVisible(pWin) == 0) + if (!nxagentWindowIsVisible(pWin)) { return; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index ee56e9abf..57b7c2b57 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -699,8 +699,8 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, */ if (!nxagentOption(IgnoreVisibility) && pDstDrawable -> type == DRAWABLE_WINDOW && - (nxagentWindowIsVisible((WindowPtr) pDstDrawable) == 0 || - (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) + (!nxagentWindowIsVisible((WindowPtr) pDstDrawable) || + (!nxagentDefaultWindowIsVisible() && nxagentCompositeEnable == 0))) { #ifdef TEST fprintf(stderr, "nxagentCopyArea: Prevented operation on fully obscured window at [%p].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index eb4085ef3..8c828df20 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -525,8 +525,8 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, */ if (!nxagentOption(IgnoreVisibility) && pDrawable -> type == DRAWABLE_WINDOW && - (nxagentWindowIsVisible((WindowPtr) pDrawable) == 0 || - (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) + (!nxagentWindowIsVisible((WindowPtr) pDrawable) || + (!nxagentDefaultWindowIsVisible() && nxagentCompositeEnable == 0))) { #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 7426acab2..cf5e50c04 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -173,8 +173,8 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE */ #define NXAGENT_SHOULD_SYNCHRONIZE_WINDOW(pDrawable) \ - (nxagentWindowIsVisible((WindowPtr) pDrawable) == 1 && \ - (nxagentDefaultWindowIsVisible() == 1 || nxagentCompositeEnable == 1)) + (nxagentWindowIsVisible((WindowPtr) pDrawable) && \ + (nxagentDefaultWindowIsVisible() || nxagentCompositeEnable == 1)) #define MINIMUM_PIXMAP_USAGE_COUNTER 2 -- 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 3.6.x in repository nx-libs. commit d2ba4ddb8693f997eab2812995ff7474d8dd999e Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:10:33 2020 +0100 nxagent: make nxagentXkbState.Initialized a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.h | 3 +-- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 1758f649c..a9a79cebd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1143,7 +1143,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already nxagentKeyDown = 0; } - if (nxagentXkbState.Initialized == 0) + if (!nxagentXkbState.Initialized) { if (X.xkey.keycode == nxagentCapsLockKeycode) { @@ -2263,7 +2263,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) { - if (nxagentXkbState.Initialized == 0) + if (!nxagentXkbState.Initialized) { if (X -> xkey.keycode == nxagentCapsLockKeycode) { @@ -2741,7 +2741,7 @@ int nxagentHandleXkbKeyboardStateEvent(XEvent *X) nxagentXkbState.Locked); #endif - nxagentXkbState.Initialized = 1; + nxagentXkbState.Initialized = True; if (nxagentXkbState.Caps == 0 && (nxagentXkbState.Locked & CAPSFLAG_IN_EVENT)) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index c9c9bb33b..38955f669 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -161,7 +161,7 @@ XkbAgentInfoRec nxagentXkbInfo = { -1, -1, -1, -1, -1 }; * Keyboard status, updated through XKB events. */ -XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, 0 }; +XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, False }; /* * Info for disabling/enabling Xkb extension. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h index dbfb47733..504c99869 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h @@ -68,8 +68,7 @@ typedef struct _XkbAgentState int Caps; int Num; int Focus; - int Initialized; - + Bool Initialized; } XkbAgentStateRec; extern XkbAgentStateRec nxagentXkbState; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 101796748..d0f83e7bd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -616,7 +616,7 @@ Bool nxagentReconnectSession(void) } } - nxagentXkbState.Initialized = 0; + nxagentXkbState.Initialized = False; SAFE_free(nxagentOldKeyboard); -- 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 3.6.x in repository nx-libs. commit f10e9d9ac1e689222c03ce823fdce99d78ae6b3e Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:01:48 2020 +0100 Events.h: fix wrong prototype --- nx-X11/programs/Xserver/hw/nxagent/Events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.h b/nx-X11/programs/Xserver/hw/nxagent/Events.h index fc00ba1d0..42784a8f3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.h @@ -209,7 +209,7 @@ extern int nxagentInputEvent; * Event-handling utilities. */ -Bool nxagentPendingEvents(Display *dpy); +int nxagentPendingEvents(Display *dpy); #define nxagentQueuedEvents(display) \ XQLength((display)) -- 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 3.6.x in repository nx-libs. commit 108ed9d928bae39c6398a3b11770f40749f07bc1 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:22:11 2020 +0100 Keyboard.c: noXkbExtension is a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 38955f669..00db6ce2a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -974,7 +974,7 @@ int nxagentResetKeyboard(void) if (dev->key) { #ifdef XKB - if (noXkbExtension == 0 && dev->key->xkbInfo) + if (!noXkbExtension && dev->key->xkbInfo) { oldMinKeycode = dev->key->xkbInfo -> desc -> min_key_code; oldMaxKeycode = dev->key->xkbInfo -> desc -> max_key_code; @@ -1132,7 +1132,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev) if (dev->key) { #ifdef XKB - if (noXkbExtension == 0 && dev->key->xkbInfo) + if (!noXkbExtension && dev->key->xkbInfo) { XkbFreeInfo(dev->key->xkbInfo); dev->key->xkbInfo = NULL; -- 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 3.6.x in repository nx-libs. commit dd5d8bc89ca0968a70bba667e8fd1a48817ca41a Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 13:22:05 2020 +0100 Client.h: conditionally add unused field --- nx-X11/programs/Xserver/hw/nxagent/Client.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.h b/nx-X11/programs/Xserver/hw/nxagent/Client.h index ac2f34e8b..574466602 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.h @@ -44,10 +44,15 @@ enum ClientHint JAVA_WINDOW }; +/* client byte counting is currently unused */ +#undef COUNT_CLIENT_BYTES + typedef struct _PrivClientRec { int clientState; +#ifdef COUNT_CLIENT_BYTES long clientBytes; +#endif enum ClientHint clientHint; char *clientInfoString; } PrivClientRec; @@ -59,8 +64,6 @@ extern int nxagentClientPrivateIndex; extern void nxagentClientStateCallback(CallbackListPtr *callbacks, void *data, void *args); -#undef COUNT_CLIENT_BYTES - #ifdef COUNT_CLIENT_BYTES #define nxagentClientAddBytes(pClient, size) \ (nxagentClientPriv(pClient) -> clientBytes += (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 3.6.x in repository nx-libs. commit 7c22dbfda3286bb794e527739e6db31963983917 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Nov 8 17:01:57 2020 +0100 NXDispatch.c: remove double nxagentFreeAtomMap() --- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 12a44dbe0..a8739fa3f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -581,7 +581,6 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio } saveAgentState("TERMINATED"); - nxagentFreeAtomMap(); nxagentFreeFontData(); #endif /* NXAGENT_SERVER */ -- 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 3.6.x in repository nx-libs. commit 3523d15e2a9f84e2136e3370129a9bea0e16e072 Merge: 125756157 e7b4440f2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Jan 15 17:09:21 2021 +0100 Merge branch 'uli42-pr/fullscreen_select' into 3.6.x Attributes GH PR #978: https://github.com/ArcticaProject/nx-libs/pull/978 nx-X11/programs/Xserver/hw/nxagent/Args.c | 13 +++++++++++-- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 8 +++++++- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 19 ++++++++++++++----- 4 files changed, 33 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 3.6.x in repository nx-libs. commit e7b4440f2a525524fdaf8f132afe2dd824ed7714 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 19:00:48 2020 +0100 nxagent: make full screen mode selectable at startup fullscreen= now accepts the new value "2" for a fullscreen covering only one screen. -geometry and geometry= now know additional keywords "allscreens" and "onescreen". Fixes ArcticaProject/nx-libs#923 --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 13 +++++++++++-- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 8 +++++++- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 19 ++++++++++++++----- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index ee76fc795..d5d13ea56 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -571,12 +571,16 @@ int ddxProcessArgument(int argc, char *argv[], int i) { if (++i < argc) { - if (!strcmp(argv[i],"fullscreen")) + if (!strcmp(argv[i],"fullscreen") || !strcmp(argv[i],"allscreens")) { nxagentChangeOption(Fullscreen, True); - nxagentChangeOption(AllScreens, True); } + else if (!strcmp(argv[i],"onescreen")) + { + nxagentChangeOption(Fullscreen, True); + nxagentChangeOption(AllScreens, False); + } else { if (nxagentUserGeometry.flag == 0) @@ -1112,6 +1116,11 @@ static void nxagentParseSingleOption(char *name, char *value) fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'fullscreen' at reconnection.\n"); #endif } + else if (!strcmp(value, "2")) + { + nxagentChangeOption(Fullscreen, True); + nxagentChangeOption(AllScreens, False); + } else if (!strcmp(value, "1")) { nxagentChangeOption(Fullscreen, True); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 077457f0e..86f88bb7b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -337,6 +337,12 @@ void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) */ void nxagentMaximizeToFullScreen(ScreenPtr pScreen) { + if (nxagentOption(AllScreens)) + nxagentSwitchAllScreens(pScreen, True); + else + nxagentSwitchFullscreen(pScreen, True); + return; + /* XUnmapWindow(nxagentDisplay, nxagentIconWindow); */ @@ -363,7 +369,7 @@ FIXME: We'll check for ReparentNotify and LeaveNotify events after XEvent e; #ifdef TEST - fprintf(stderr, "nxagentMaximizeToFullscreen: WARNING! Going to wait for the ReparentNotify event [%d].\n", i); + fprintf(stderr, "%d: WARNING! Going to wait for the ReparentNotify event [%d].\n", __func__, i); #endif if (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, ReparentNotify, &e)) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index fcff4c6d0..a30eac589 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -729,7 +729,7 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) } #ifdef TEST - fprintf(stderr, "nxagentSwitchFullscreen: Switching to %s mode.\n", + fprintf(stderr, "%s: Switching to %s mode.\n", __func__, switchOn ? "fullscreen" : "windowed"); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 index e6fad9ba5..111224264 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 +++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 @@ -281,7 +281,9 @@ not specified, \fBnxagent\fR will choose .I W and .I H -to be 3/4ths the dimensions of the root window of the real server. +to be 3/4ths the dimensions of the root window of the real server. For +further values accepted see the documentation of +\fBgeometry=<string>\fR below. .TP 8 .B \-dpi \fIresolution\fP sets the resolution for all screens, in dots per inch. If this option @@ -626,14 +628,21 @@ line, no-op when resuming (default: \fI0\fR, disabled) .TP 8 .B geometry=<string> desktop geometry when starting or resuming a session, no-op in -rootless mode (default 66% of the underlying X server geometry) +rootless mode (default 66% of the underlying X server geometry). You +can either specify a standard X geometry string +(WxH+X+Y) or \fIallscreens\fR for a window covering +all available screens or \fRonescreen\fR for a window covering only +one screen. For historical reasons \fIfullscreen\fR (as a synonym to +\fIallscreens\fR) is also accepted. +.TP 8 +.B fullscreen=<int> +start or resume a session in fullscreen mode (default: \fI0\fR, off). Specify \fI1\fR for +a fullscreen window covering all available screens or \fI2\fR for a fullscreen window +covering only the first screen. .TP 8 .B resize=<bool> set resizing support (default: \fI1\fR, enabled) .TP 8 -.B fullscreen=<bool> -start or resume a session in fullscreen mode (default: \fI0\fR, off) -.TP 8 .B keyboard=<string> or kbtype=<string> .BR query | clone | <model>/<layout> | rmlvo/<rules>#<model>#<layout>#<variant>#<options> -- 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 3.6.x in repository nx-libs. commit 1257561577cd8227f3534fc44b72a1239aba363c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Jan 15 17:00:42 2021 +0100 Revert "CVE-2020-14360: Check SetMap request length carefully." This reverts commit 4eba4f53ad8c62c27c12835e58184d66121ff636. --- nx-X11/programs/Xserver/xkb/xkb.c | 91 --------------------------------------- 1 file changed, 91 deletions(-) diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 654b33fe7..7b392fa09 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -2202,92 +2202,6 @@ XkbServerMapPtr srv = xkbi->desc->server; return (char *)wire; } -#define _add_check_len(new) \ - if (len > UINT32_MAX - (new) || len > req_len - (new)) goto bad; \ - else len += new - -/** - * Check the length of the SetMap request - */ -static int -_XkbSetMapCheckLength(xkbSetMapReq *req) -{ - size_t len = sz_xkbSetMapReq, req_len = req->length << 2; - xkbKeyTypeWireDesc *keytype; - xkbSymMapWireDesc *symmap; - BOOL preserve; - int i, map_count, nSyms; - - if (req_len < len) - goto bad; - /* types */ - if (req->present & XkbKeyTypesMask) { - keytype = (xkbKeyTypeWireDesc *)(req + 1); - for (i = 0; i < req->nTypes; i++) { - _add_check_len(XkbPaddedSize(sz_xkbKeyTypeWireDesc)); - if (req->flags & XkbSetMapResizeTypes) { - _add_check_len(keytype->nMapEntries - * sz_xkbKTSetMapEntryWireDesc); - preserve = keytype->preserve; - map_count = keytype->nMapEntries; - if (preserve) { - _add_check_len(map_count * sz_xkbModsWireDesc); - } - keytype += 1; - keytype = (xkbKeyTypeWireDesc *) - ((xkbKTSetMapEntryWireDesc *)keytype + map_count); - if (preserve) - keytype = (xkbKeyTypeWireDesc *) - ((xkbModsWireDesc *)keytype + map_count); - } - } - } - /* syms */ - if (req->present & XkbKeySymsMask) { - symmap = (xkbSymMapWireDesc *)((char *)req + len); - for (i = 0; i < req->nKeySyms; i++) { - _add_check_len(sz_xkbSymMapWireDesc); - nSyms = symmap->nSyms; - _add_check_len(nSyms*sizeof(CARD32)); - symmap += 1; - symmap = (xkbSymMapWireDesc *)((CARD32 *)symmap + nSyms); - } - } - /* actions */ - if (req->present & XkbKeyActionsMask) { - _add_check_len(req->totalActs * sz_xkbActionWireDesc - + XkbPaddedSize(req->nKeyActs)); - } - /* behaviours */ - if (req->present & XkbKeyBehaviorsMask) { - _add_check_len(req->totalKeyBehaviors * sz_xkbBehaviorWireDesc); - } - /* vmods */ - if (req->present & XkbVirtualModsMask) { - _add_check_len(XkbPaddedSize(Ones(req->virtualMods))); - } - /* explicit */ - if (req->present & XkbExplicitComponentsMask) { - /* two bytes per non-zero explicit componen */ - _add_check_len(XkbPaddedSize(req->totalKeyExplicit * sizeof(CARD16))); - } - /* modmap */ - if (req->present & XkbModifierMapMask) { - /* two bytes per non-zero modmap component */ - _add_check_len(XkbPaddedSize(req->totalModMapKeys * sizeof(CARD16))); - } - /* vmodmap */ - if (req->present & XkbVirtualModMapMask) { - _add_check_len(req->totalVModMapKeys * sz_xkbVModMapWireDesc); - } - if (len == req_len) - return Success; -bad: - ErrorF("[xkb] BOGUS LENGTH in SetMap: expected %ld got %ld\n", - len, req_len); - return BadLength; -} - int ProcXkbSetMap(ClientPtr client) { @@ -2311,11 +2225,6 @@ ProcXkbSetMap(ClientPtr client) CHK_KBD_DEVICE(dev,stuff->deviceSpec); CHK_MASK_LEGAL(0x01,stuff->present,XkbAllMapComponentsMask); - /* first verify the request length carefully */ - rc = _XkbSetMapCheckLength(stuff); - if (rc != Success) - return rc; - XkbSetCauseXkbReq(&cause,X_kbSetMap,client); xkbi= dev->key->xkbInfo; xkb = xkbi->desc; -- 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 3.6.x in repository nx-libs. commit c1843ef88265427e0d61986725ecfc8df7b9290b Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Nov 9 21:17:45 2020 +0100 Handlers.c: use the same boolean values as in NXdispatch.c although there is no functional difference... --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index d00b13d77..b573d0a66 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -1017,7 +1017,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) nxagentDispatch.in = nxagentBytesIn; nxagentDispatch.out = nxagentBytesOut; - isItTimeToYield = 1; + isItTimeToYield = TRUE; } #ifdef DEBUG else @@ -1126,7 +1126,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) nxagentDispatch.in = nxagentBytesIn; nxagentDispatch.out = nxagentBytesOut; - isItTimeToYield = 1; + isItTimeToYield = TRUE; } #ifdef DEBUG else -- 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 3.6.x in repository nx-libs. commit 432cc0ca416dec1fe955cf3537482f7a521f0506 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Nov 9 22:54:49 2020 +0100 manpage: document defaults for options -defer and -tile --- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 index 111224264..72a885638 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 +++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 @@ -539,7 +539,9 @@ allowed to change the keyboard settings through XKEYBOARD. .TP 8 .B \-tile WxH maximum size of the tile used when sending an image to the remote -display (minimum allowed: 32x32; no default) +display (minimum allowed: 32x32). The default depends on the link +type: 64x64 for \fImodem\fR and \fIisdn\fR, 4096x4096 for all other +link types) .TP 8 .B \-irlimit maximum image data rate to the encoder input in kB/s. The default is no limit. @@ -755,21 +757,29 @@ The default value can be set via the command line (\-defer). The value provided as nx/nx option is set when resuming a session, thus it overrides the command line default. +The default depends on the link type (see man nxproxy). + Each defer level adds the following rules to the previous ones: .RS 8 .TP 8 .I 0 Eager encoding. + +Default for link speed \fIlan\fR and \fIlocal\fR. .TP 8 .I 1 No data is put or copied on pixmaps, marking them always as corrupted and synchronizing them on demand, i.e. when a copy area to a window is requested, the source is synchronized before copying it. + +Default for link speed \fIwan\fR. .TP 8 .I 2 The put images over the windows are skipped marking the destination as corrupted. The same happens for copy area and composite operations, spreading the corrupted regions of involved drawables. + +Default for link speed \fIadsl\fR, \fIisdn\fR and \fImodem\fR. .RE .TP 8 -- 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 3.6.x in repository nx-libs. commit 63a39619cb95a51cbc648dd25656b6543c1a3ceb Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:45:36 2020 +0100 Handlers.c: add FIXME --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index b573d0a66..639e3429e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -123,6 +123,9 @@ Bool nxagentXdmcpAlertUp = False; int nxagentBuffer; Bool nxagentBlocking; + +/* FIXME: nxagentCongestion is checked as a Boolean and as an Integer + (>= 4) at the same time which is weird at least */ int nxagentCongestion; double nxagentBytesIn; -- 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 3.6.x in repository nx-libs. commit 6aff5bfdf5ff33746060471f4e8db29c4c9f4f59 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 14:12:05 2021 +0100 fix formatting and spelling in various files --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/GC.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 13 ++++++------- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Split.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- nxcomp/include/NX.h | 2 +- nxcomp/src/Control.h | 2 +- nxcomp/src/Message.h | 2 +- nxproxy/man/nxproxy.1 | 2 +- 12 files changed, 17 insertions(+), 18 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index d5d13ea56..f24d15c55 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -2319,7 +2319,7 @@ void nxagentSetDeferLevel(void) nxagentChangeOption(Streaming, False); } - switch (nxagentOption(LinkType)) + switch (nxagentOption(LinkType)) { case LINK_TYPE_MODEM: case LINK_TYPE_ISDN: { deferLevel = 2; tileWidth = 64; tileHeight = 64; break; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h index a39c53c07..9006b2253 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h @@ -58,7 +58,7 @@ void nxagentWMDetect(void); #ifdef XlibAtom /* - * only provide these protoypes if the including file knows about Xlib + * only provide these prototypes if the including file knows about Xlib * types. This allows us including Atoms.h without having to use the * Xlib type magic of Agent.h */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 15112312f..a87efb117 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -767,7 +767,7 @@ static void nxagentDisplayFlushHandler(Display *disp, int length) * Error flag after the _NXDisplayErrorPredicate returns true. The * function can be used to activate additional checks, besides the * normal failures detected by Xlib on the display socket. For exam- - * ple, the application can set the funciton to verify if an inter- + * ple, the application can set the function to verify if an inter- * rupt was received or if any other event occurred mandating the + end of the session." */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 2aa404910..b956bb8df 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -1127,7 +1127,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) /* * Originally, the clip origin area were 0,0 but it didn't * work with kedit and family, because it got the clip mask of - * the pixmap all traslated. + * the pixmap all translated. */ XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC -> clipOrg.x, pGC -> clipOrg.y, diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index 159a7b55d..2a307b0f7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -531,13 +531,12 @@ void nxagentReconnectPictFormat(void *p0, XID x1, void *p2) } /* - * The set of picture formats may change considerably - * between different X servers. This poses a problem - * while migrating NX sessions, because a requisite to - * successfully reconnect the session is that all pic- - * ture formats have to be available on the new X server. - * To reduce such problems, we use a limited set of - * pictures available on the most X servers. + * The set of picture formats may change considerably between + * different X servers. This poses a problem while migrating NX + * sessions, because a requisite to successfully reconnect the session + * is that all picture formats have to be available on the new X + * server. To reduce such problems, we use a limited set of pictures + * available on the most X servers. */ void nxagentPictureCreateDefaultFormats(ScreenPtr pScreen, FormatInitRec *formats, int *nformats) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 3bd0b7c25..65d0f4218 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -1244,7 +1244,7 @@ void nxagentFreePropertyList(void) /* * We are trying to distinguish notifications generated by an external - * client from those genarated by our own requests. + * client from those generated by our own requests. */ Bool nxagentNotifyMatchChangeProperty(void *p) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c index 2e2b130fe..99cc3a280 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -112,7 +112,7 @@ SplitResourcePtr nxagentAllocSplitResource(void) fprintf(stderr, "nxagentAllocSplitResource: PANIC! No more resources for the next split.\n"); #endif /* -FIXME: Must deal with the case all resources are exausted. +FIXME: Must deal with the case all resources are exhausted. */ FatalError("nxagentAllocSplitResource: PANIC! No more resources for the next split.\n"); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 31f205ac2..6ef52f7aa 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -1530,7 +1530,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) * position in the window tree, and pPriorParent is its previous * parent. This function can be NULL. * - * We simply pass this pver to the real X server. + * We simply pass this over to the real X server. */ void nxagentReparentWindow(WindowPtr pWin, WindowPtr pOldParent) { diff --git a/nxcomp/include/NX.h b/nxcomp/include/NX.h index cc1cfb280..088e265e0 100644 --- a/nxcomp/include/NX.h +++ b/nxcomp/include/NX.h @@ -342,7 +342,7 @@ extern int NXTransFlush(int fd); * connection. * * NX_CHANNEL_SLAVE: The channel will forward data to a remote slave - * command (see NX_SLAVE_CMD envrionment variable) + * command (see NX_SLAVE_CMD environment variable) * * Only a proxy running at the NX server/X client side will be able * to create a X, CUPS, SMB, MEDIA and HTTP channel. A proxy running diff --git a/nxcomp/src/Control.h b/nxcomp/src/Control.h index 764fca2c1..21edae77c 100644 --- a/nxcomp/src/Control.h +++ b/nxcomp/src/Control.h @@ -144,7 +144,7 @@ class Control T_session_mode SessionMode; // - // Either immediate or defferred flushes. + // Either immediate or deferred flushes. // T_flush_policy FlushPolicy; diff --git a/nxcomp/src/Message.h b/nxcomp/src/Message.h index 30883f101..f3a588104 100644 --- a/nxcomp/src/Message.h +++ b/nxcomp/src/Message.h @@ -566,7 +566,7 @@ class MessageStore // it can contain valid data that must be // explicitly deallocated if not needed. // Note also that you cannot count on the - // initialization made in costructor. + // initialization made in constructor. // temporary_ = message; diff --git a/nxproxy/man/nxproxy.1 b/nxproxy/man/nxproxy.1 index 9a145d2c0..c22f15a48 100644 --- a/nxproxy/man/nxproxy.1 +++ b/nxproxy/man/nxproxy.1 @@ -109,7 +109,7 @@ Remote port used for the connection. .TP 8 .B retry=<int> -Number of connection atempts. +Number of connection attempts. .TP 8 .B root=<string> -- 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 3.6.x in repository nx-libs. commit 599334aff8b7388c455fce50998bba244a85655e Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:07:15 2020 +0100 Screen.c: clarify that characters are compared --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 86f88bb7b..d09c14692 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2514,9 +2514,9 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) if (nxagentKeyboard != NULL) { int i; - for (i = 0; nxagentKeyboard[i] != '/' && nxagentKeyboard[i] != 0; i++); + for (i = 0; nxagentKeyboard[i] != '/' && nxagentKeyboard[i] != '\0'; i++); - if(nxagentKeyboard[i] == 0 || nxagentKeyboard[i + 1] == 0 || i == 0) + if(nxagentKeyboard[i] == '\0' || nxagentKeyboard[i + 1] == '\0' || i == 0) { #ifdef WARNING fprintf(stderr,"WARNING! Wrong keyboard type: %s.\n", nxagentKeyboard); -- 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 3.6.x in repository nx-libs. commit 97a69b95ac3018f9a8838b09df28a0f33c484a0d Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 15 18:24:26 2021 +0100 Display.c: fix and reformat broken comment --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index a87efb117..659355501 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -758,18 +758,17 @@ static void nxagentDisplayFlushHandler(Display *disp, int length) } /* - * From the changelog for nx-X11-3.0.0-4: - * "Added the _NXDisplayErrorPredicate function in XlibInt.c. It is - * actually a pointer to a function called whenever Xlib is going to - * perform a network operation. If the function returns true, the - * call will be aborted and Xlib will return the control to the ap- - * plication. It is up to the application to set the XlibDisplayIO- - * Error flag after the _NXDisplayErrorPredicate returns true. The - * function can be used to activate additional checks, besides the - * normal failures detected by Xlib on the display socket. For exam- - * ple, the application can set the function to verify if an inter- - * rupt was received or if any other event occurred mandating the - + end of the session." + * From the changelog for nx-X11-3.0.0-4: "Added the + * _NXDisplayErrorPredicate function in XlibInt.c. It is actually a + * pointer to a function called whenever Xlib is going to perform a + * network operation. If the function returns true, the call will be + * aborted and Xlib will return the control to the application. It is + * up to the application to set the XlibDisplayIO- Error flag after + * the _NXDisplayErrorPredicate returns true. The function can be used + * to activate additional checks, besides the normal failures detected + * by Xlib on the display socket. For example, the application can set + * the function to verify if an interrupt was received or if any other + * event occurred mandating the end of the session." */ static int nxagentDisplayErrorPredicate(Display *disp, int error) { -- 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 3.6.x in repository nx-libs. commit 21c631f4d51b89e77b159362350a130cf07e16bc Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 14:57:32 2021 +0100 Window.c: suppress warning This used to be printed only in TEST mode. Some while ago I had changed that to WARNING (because it is a warning...). However, this happens e.g. when running the xscreensaver vfeedback module and it does not look like it is a problem at all. So let's suppress this warning again and leave it to the TEST mode as it used to be. --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 6ef52f7aa..e1a0776ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3905,7 +3905,7 @@ StoringPixmapPtr nxagentFindItemBSPixmapList(unsigned long pixmapId) } } - #ifdef WARNING + #ifdef TEST fprintf(stderr, "%s: WARNING! Item not found.\n", __func__); #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 3.6.x in repository nx-libs. commit c7f9ff0b61bad8231f564c1cb896f20fce44d1a5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 14:11:31 2021 +0100 nxagent: Drop unused nxagentRootTileWindow --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index a9a79cebd..8e2313eac 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -131,8 +131,6 @@ extern Bool nxagentOnce; -extern WindowPtr nxagentRootTileWindow; - extern int nxagentLastClipboardClient; #ifdef NX_DEBUG_INPUT diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index a30eac589..31f205ac2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -110,8 +110,6 @@ extern WindowPtr nxagentViewportFrameRight; extern WindowPtr nxagentViewportFrameAbove; extern WindowPtr nxagentViewportFrameBelow; -extern WindowPtr nxagentRootTileWindow; - extern Bool nxagentReportPrivateWindowIds; #define RECTLIMIT 25 -- 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 3.6.x in repository nx-libs. commit 36d7e152f1bb977517d0c6f764781d287cf01c26 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Aug 3 16:27:41 2020 +0200 Atoms.c: silence PVS Studio warning "V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'privAtomMap' is lost. Consider assigning realloc() to a temporary pointer." --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index 2daad061e..61953e2a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -385,12 +385,16 @@ static void nxagentExpandCache(void) { privAtomMapSize += NXAGENT_ATOM_MAP_SIZE_INCREMENT; - privAtomMap = realloc(privAtomMap, privAtomMapSize * sizeof(AtomMap)); + AtomMap * newmap = realloc(privAtomMap, privAtomMapSize * sizeof(AtomMap)); - if (privAtomMap == NULL) + if (newmap == NULL) { FatalError("nxagentExpandCache: realloc failed\n"); } + else + { + privAtomMap = newmap; + } } /* -- 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 3.6.x in repository nx-libs. commit e991dbae988766707e9506ec08d5682416f6eb4a Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Aug 3 16:26:12 2020 +0200 Atoms.c: cosmetics in nxagentWriteAtom() --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index af8b31dfd..2daad061e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -405,12 +405,13 @@ static void nxagentWriteAtom(Atom local, XlibAtom remote, const char *string) #ifdef WARNING if (s == NULL) { - fprintf(stderr, "nxagentWriteAtom: Malloc failed.\n"); + fprintf(stderr, "%s: Malloc failed.\n", __func__); } #endif if (privLastAtom == privAtomMapSize) { + /* will issue a fatal error, therefore no further check here */ nxagentExpandCache(); } -- 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 3.6.x in repository nx-libs. commit 41bf839792be7c20447251fd679b6132775749db Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Aug 3 17:02:29 2020 +0200 Keyboard.c: simplify code Based on PVS Studio finding: "V547 Expression 'data' is always true." --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 00db6ce2a..8f29d66b8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -1425,11 +1425,9 @@ static void nxagentXkbGetRemoteNames(void) if ((after > 0) || (type != XA_STRING) || (format != 8)) { - if (data) - { - SAFE_XFree(data); - return; - } + /* data non-null - has been checked above */ + SAFE_XFree(data); + return; } char *name = data; -- 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 3.6.x in repository nx-libs. commit 5735e164e9625137c7d3209428eafab33300df94 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Aug 3 16:40:49 2020 +0200 Colormap.c: remove unneccessary check success would always be true at the beginning of the loop as it is part of the loop condition. Finding from PVS Studio: "V560 A part of conditional expression is always true: success." --- nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c index 099c76af4..c173f322c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c @@ -573,7 +573,7 @@ Bool nxagentReconnectAllColormap(void *p0) for (int cid = 0; (cid < MAXCLIENTS) && success; cid++) { - if (clients[cid] && success) + if (clients[cid]) { FindClientResourcesByType(clients[cid], RT_COLORMAP, nxagentReconnectColormap, &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 3.6.x in repository nx-libs. commit 1529b32174867acaffc952b77cb404180fad17f1 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Aug 3 16:25:00 2020 +0200 Atoms.c: fix strlen(NULL) FIX PVS Studio finding "V575 The potential null pointer is passed into 'strlen' function. Inspect the first argument" --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index c15674f5e..af8b31dfd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -417,7 +417,7 @@ static void nxagentWriteAtom(Atom local, XlibAtom remote, const char *string) privAtomMap[privLastAtom].local = local; privAtomMap[privLastAtom].remote = remote; privAtomMap[privLastAtom].string = s; - privAtomMap[privLastAtom].length = strlen(s); + privAtomMap[privLastAtom].length = s ? strlen(s) : 0; privLastAtom++; } -- 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 3.6.x in repository nx-libs. commit 28fef3bc06e9325202920fc21f42d2506e8f2b2e Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Aug 3 16:38:19 2020 +0200 Colormap.c: fix parentheses PVS Studio: "V592 The expression was enclosed by parentheses twice: '((* pRed * (limg + 1)))'. One pair of parentheses is unnecessary or misprint is present." --- nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c index 9308390fe..099c76af4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c @@ -482,7 +482,7 @@ void nxagentResolveColor(unsigned short *pRed, unsigned short *pGreen, unsigned int limg = pVisual->ColormapEntries - 1; /* rescale to gray then [0..limg] then [0..65535] then rgb bits */ *pRed = (30L * *pRed + 59L * *pGreen + 11L * *pBlue) / 100; - *pRed = ((((*pRed * (limg + 1))) >> 16) * 65535) / limg; + *pRed = (((*pRed * (limg + 1)) >> 16) * 65535) / limg; *pBlue = *pGreen = *pRed = ((*pRed >> shift) * 65535) / lim; } else -- 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 3.6.x in repository nx-libs. commit 5871100dd5db7f05e3f67cd90fda25dc9a68a29d Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Aug 3 17:08:30 2020 +0200 NXpicture.c: remove unneccessary check Code can only be reached if pPicture is non-NULL. Besides, pPicture will be accessed later anyway, regardless of this check. Finding of PVS Studio: "V547 Expression 'pPicture != NULL' is always true." --- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 27 ++++++++++++-------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index 159a7b55d..ae9de652a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -320,27 +320,24 @@ static PicturePtr createSourcePicture(void) if (!pPicture) return 0; - if (pPicture != NULL) - { - DevUnion *ppriv = (DevUnion *) (pPicture + 1); + DevUnion *ppriv = (DevUnion *) (pPicture + 1); - for (int i = 0; i < picturePrivateCount; ++i) - { - /* - * Other privates are inaccessible. - */ + for (int i = 0; i < picturePrivateCount; ++i) + { + /* + * Other privates are inaccessible. + */ - ppriv[i].ptr = NULL; - } + ppriv[i].ptr = NULL; + } - char *privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; + char *privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; - ppriv[nxagentPicturePrivateIndex].ptr = (void *) privPictureRecAddr; + ppriv[nxagentPicturePrivateIndex].ptr = (void *) privPictureRecAddr; - pPicture -> devPrivates = ppriv; + pPicture -> devPrivates = ppriv; - nxagentPicturePriv(pPicture) -> picture = 0; - } + nxagentPicturePriv(pPicture) -> picture = 0; pPicture->pDrawable = 0; pPicture->pFormat = 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 3.6.x in repository nx-libs. commit db134de3b9cefa6e0d76fe57f2feabe79ba9216c Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 16:17:36 2021 +0100 Atoms.c: add explanation for PVS Studio warning "V575 The potential null pointer is passed into 'strlen' function. Inspect the first argument. Check lines: 420, 403." --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index 61953e2a6..ea7ad7599 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -409,6 +409,9 @@ static void nxagentWriteAtom(Atom local, XlibAtom remote, const char *string) #ifdef WARNING if (s == NULL) { + /* we only warn here, because s being NULL ist not problem, it + will only result in NULL being stored in the privAtomMap, which + is perfectly legal. */ fprintf(stderr, "%s: Malloc failed.\n", __func__); } #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 3.6.x in repository nx-libs. commit e664d82019ef2a876cc325c746b4e7521b9c1910 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 16:35:07 2021 +0100 Drawable.c: Prevent PVS Studio warning "V560 A part of conditional expression is always true: oldStatus == NotSynchronized." --- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index ca1b09dd3..2facf1df3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -1605,9 +1605,11 @@ void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) * If the drawable becomes synchronized, the counter reporting the * number of corrupted drawables must be decreased. Moreover the * corrupted timestamp must be reset. + * Note: oldstatus has been checked above and is always + * "NotSynchronized" here. */ - if (oldStatus == NotSynchronized && + if (/*oldStatus == NotSynchronized &&*/ nxagentDrawableStatus(pDrawable) == Synchronized) { if (pDrawable -> type == DRAWABLE_PIXMAP) -- 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 3.6.x in repository nx-libs. commit 948bbe50a96c5563a2783f2d9c86a83ded707143 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 17:28:53 2021 +0100 NXglyph.c: check for malloc error "V575 The potential null pointer is passed into 'memcpy' function. Inspect the first argument." --- nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c index 022ef09f4..8c35af4c4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c @@ -296,6 +296,13 @@ miGlyphs (CARD8 op, else { nxagentGlyphsExtents = (BoxPtr) malloc(sizeof(BoxRec)); + if (!nxagentGlyphsExtents) + { + #ifdef WARNING + fprintf(stderr, "WARNING! Cannot allocate GlyphExtents\n"); + #endif + return; + } GlyphExtents (nlist, list, glyphs, &extents); -- 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 3.6.x in repository nx-libs. commit 67c7513bfc18c5bcb94ea152823601970a18d7f3 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 16:28:27 2021 +0100 Display.c: prevent PVS Studio realloc warning "V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'nxagentDefaultColormaps' is lost. Consider assigning realloc() to a temporary pointer." --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 15112312f..9931bdd77 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -2577,12 +2577,18 @@ Bool nxagentReconnectDisplay(void *p0) nxagentNumDefaultColormaps = nxagentNumVisuals; - nxagentDefaultColormaps = (Colormap *) realloc(nxagentDefaultColormaps, - nxagentNumDefaultColormaps * sizeof(Colormap)); - - if (nxagentDefaultColormaps == NULL) { - FatalError("Can't allocate memory for the default colormaps\n"); + Colormap * tmp = (Colormap *) realloc(nxagentDefaultColormaps, + nxagentNumDefaultColormaps * sizeof(Colormap)); + if (tmp == NULL) + { + SAFE_free(nxagentDefaultColormaps); + FatalError("Can't allocate memory for the default colormaps\n"); + } + else + { + nxagentDefaultColormaps = tmp; + } } reconnectDisplayState = ALLOC_DEF_COLORMAP; -- 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 3.6.x in repository nx-libs. commit 7443fea69f89fda3c36e99dc5ff07731020e8891 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 17:18:43 2021 +0100 Keyboard.c: fix possible NULL pointer dereference found by PVS Studio: "V522 There might be dereferencing of a potential null pointer 'keymap'." --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 8f29d66b8..731844874 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -435,6 +435,11 @@ N/A int len = (max_keycode - min_keycode + 1) * mapWidth; keymap = (KeySym *)malloc(len * sizeof(KeySym)); + if (keymap == NULL) + { + XFreeModifiermap(modifier_keymap); + return -1; + } for(int i = 0; i < len; ++i) { keymap[i] = keymap64[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 3.6.x in repository nx-libs. commit c1cae3c66a7ac5b351605111c936342e21578aa4 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 18:13:49 2021 +0100 Render.c: Init BoxRec PVS Studio: "V614 Potentially uninitialized variable 'glyphBox.*' used." --- nx-X11/programs/Xserver/hw/nxagent/Render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 28e2d77fc..98d7aef67 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -1248,7 +1248,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlists, XGlyphElt8 *elts, int sizeID, GlyphPtr *glyphsBase) { - BoxRec glyphBox; + BoxRec glyphBox = {0}; XGlyphElt8 *elements; -- 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 3.6.x in repository nx-libs. commit 1251e8347e60edf54a64d64e2059c35e28bd234a Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 18:58:55 2021 +0100 Rootless.c: prevent PVS error "V547 Expression 'wmHints.input == 1' is always true." --- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 3bd0b7c25..9bcd90130 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -502,7 +502,8 @@ int nxagentExportProperty(WindowPtr pWin, nxagentPropWMHints propHints = { .flags = wmHints.flags, - .input = (wmHints.input == True ? 1 : 0), + /*.input = (wmHints.input == True ? 1 : 0), is always True*/ + .input = 1, .initialState = wmHints.initial_state, .iconPixmap = wmHints.icon_pixmap, .iconWindow = wmHints.icon_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 3.6.x in repository nx-libs. commit a57097ad005244043262fce395de0e3914fec2d1 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 19:01:55 2021 +0100 Splash.c: remove unneccessary check PVs finding: "V547 Expression '!nxagentWMPassed' is always true." --- nx-X11/programs/Xserver/hw/nxagent/Splash.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.c b/nx-X11/programs/Xserver/hw/nxagent/Splash.c index ea82513e6..37f965f04 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c @@ -332,15 +332,10 @@ void nxagentRemoveSplashWindow(void) fprintf(stderr, "%s: Destroying the splash window.\n", __func__); #endif - if (!nxagentWMPassed) - { - #ifdef NXAGENT_ONSTART - XSetSelectionOwner(nxagentDisplay, nxagentReadyAtom, - nxagentDefaultWindows[0], CurrentTime); - #endif - - nxagentWMPassed = True; - } + #ifdef NXAGENT_ONSTART + XSetSelectionOwner(nxagentDisplay, nxagentReadyAtom, + nxagentDefaultWindows[0], CurrentTime); + #endif if (nxagentSplashWindow != None) { -- 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 3.6.x in repository nx-libs. commit 5ad0b4dde3b686d369d222976e947dcd83058757 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 19:44:37 2021 +0100 Window.c: check for malloc failure PVS finding: "V522 There might be dereferencing of a potential null pointer 'nxagentConfiguredWindowList'." --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index a30eac589..367c15841 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3659,6 +3659,14 @@ void nxagentAddStaticResizedWindow(WindowPtr pWin, unsigned long sequence, int o StaticResizedWindowStruct *tmp = nxagentStaticResizedWindowList; nxagentStaticResizedWindowList = malloc(sizeof(StaticResizedWindowStruct)); + if (!nxagentStaticResizedWindowList) + { + #ifdef WARNING + fprintf(stderr, "WARNING: could not allocate memory for nxagentStaticResizedWindowList\n"); + #endif + nxagentStaticResizedWindowList = tmp; + return; + } nxagentStaticResizedWindowList -> next = tmp; nxagentStaticResizedWindowList -> prev = NULL; -- 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 3.6.x in repository nx-libs. commit 8bb77997f8e7828846d68a02e8e1f00571f3a4f5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 18:04:29 2021 +0100 Reconnect.c: fix possible realloc() memory loss "V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'nxagentReconnectErrorMessage' is lost. Consider assigning realloc() to a temporary pointer." --- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index d0f83e7bd..e6d3ce6ec 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -788,12 +788,16 @@ void nxagentSetReconnectError(int id, char *format, ...) size = (size ? size * 2 : NXAGENT_RECONNECT_DEFAULT_MESSAGE_SIZE); } - nxagentReconnectErrorMessage = realloc(nxagentReconnectErrorMessage, size); + char *tmp = realloc(nxagentReconnectErrorMessage, size); - if (nxagentReconnectErrorMessage == NULL) + if (tmp == NULL) { FatalError("realloc failed"); } + else + { + nxagentReconnectErrorMessage = tmp; + } } return; -- 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 3.6.x in repository nx-libs. commit 6214c71b32aa3562aeff08ffa63e67323a2cc05b Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 19:07:06 2021 +0100 Screen.c: check for malloc failures PVS finding: "V522 There might be dereferencing of a potential null pointer" --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 86f88bb7b..cff0eb76a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1156,6 +1156,14 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) */ DepthPtr depths = (DepthPtr) malloc(nxagentNumDepths * sizeof(DepthRec)); + if (!depths) + { + #ifdef WARNING + fprintf(stderr, "WARNING: Could not allocate depths array\n"); + #endif + /* FIXME: free data allocated above */ + return False; + } for (int i = 0; i < nxagentNumDepths; i++) { @@ -1177,6 +1185,14 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) int numDepths = nxagentNumDepths; VisualPtr visuals = (VisualPtr) malloc(nxagentNumVisuals * sizeof(VisualRec)); + if (!visuals) + { + #ifdef WARNING + fprintf(stderr, "WARNING: Could not allocate visual array\n"); + #endif + /* FIXME: free data allocated above */ + return False; + } int defaultVisualIndex = 0; @@ -3058,6 +3074,14 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height, unsigned char *cBuffer = malloc(length); unsigned char *icBuffer = cBuffer; + if (!cBuffer) + { + #ifdef WARNING + fprintf(stderr, "WARNING: could not allocate cBuffer\n"); + #endif + return; + } + Visual *pVisual = nxagentImageVisual((DrawablePtr) nxagentShadowPixmapPtr, nxagentShadowDepth); if (pVisual == NULL) @@ -4203,6 +4227,13 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, int nRects = RegionNumRects(&cleanRegion); int size = nRects * sizeof(XRectangle); XRectangle *pRects = (XRectangle *) malloc(size); + if (!pRects) + { + #ifdef WARNING + fprintf(stderr, "Could not allocate pRects\n"); + #endif + return; + } BoxPtr pBox = RegionRects(&cleanRegion); for (int i = nRects; i-- > 0;) @@ -4336,6 +4367,14 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int nRects = RegionNumRects(clipRegion); int size = nRects * sizeof(XRectangle); XRectangle *pRects = (XRectangle *) malloc(size); + if (!pRects) + { + #ifdef WARNING + fprintf(stderr, "Could not allocate pRects\n"); + #endif + return; + } + BoxPtr pBox = RegionRects(clipRegion); for (int i = nRects; i-- > 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 3.6.x in repository nx-libs. commit 4d95e29b87217ac12de97bf4031603c36055b6ac Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 19:50:31 2021 +0100 Window.c: check for malloc failure PVS finding: "V522 There might be dereferencing of a potential null pointer 'props'" --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 35 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 367c15841..811b5b565 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3090,27 +3090,36 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer (void*)pWin, pWin -> drawable.id, nxagentWindow(pWin)); #endif + /* FIXME: use XAllocSizeHints() */ #ifdef _XSERVER64 data64 = (unsigned char *) malloc(sizeof(XSizeHints) + 4); + if (data64) + { + for (int i = 0; i < 4; i++) + { + *(data64 + i) = *(data + i); + } - for (int i = 0; i < 4; i++) - { - *(data64 + i) = *(data + i); - } - - *(((int *) data64) + 1) = 0; + *(((int *) data64) + 1) = 0; - for (int i = 8; i < sizeof(XSizeHints) + 4; i++) - { - *(data64 + i) = *(data + i - 4); - } + for (int i = 8; i < sizeof(XSizeHints) + 4; i++) + { + *(data64 + i) = *(data + i - 4); + } - XSizeHints *props = (XSizeHints *) data64; + XSizeHints *props = (XSizeHints *) data64; #else - XSizeHints *props = (XSizeHints *) data; + XSizeHints *props = (XSizeHints *) data; #endif /* _XSERVER64 */ - hints = *props; + hints = *props; + } + else + { + #ifdef WARNING + fprintf(stderr, "%s: Failed to alloc memory for XSizeHints\n", __func__); + #endif + } } else { -- 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 3.6.x in repository nx-libs. commit b66699555d2e2503926f01a9c192481e01812399 Merge: 3523d15e2 97a69b95a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Jan 16 00:19:38 2021 +0100 Merge branch 'uli42-pr/various6' into 3.6.x Attributes GH PR #979: https://github.com/ArcticaProject/nx-libs/pull/979 nx-X11/programs/Xserver/hw/nxagent/Args.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Client.h | 7 +++++-- nx-X11/programs/Xserver/hw/nxagent/Display.c | 23 +++++++++++------------ nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/GC.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 7 +++++-- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 1 - nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 13 ++++++------- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Split.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 6 ++---- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 12 +++++++++++- nxcomp/include/NX.h | 2 +- nxcomp/src/Control.h | 2 +- nxcomp/src/Message.h | 2 +- nxproxy/man/nxproxy.1 | 2 +- 18 files changed, 51 insertions(+), 42 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 3.6.x in repository nx-libs. commit 35556cac95b2c637d9b3ee754084aa12edbb3e91 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Nov 8 17:01:57 2020 +0100 NXDispatch.c: remove double nxagentFreeAtomMap() --- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 12a44dbe0..a8739fa3f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -581,7 +581,6 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio } saveAgentState("TERMINATED"); - nxagentFreeAtomMap(); nxagentFreeFontData(); #endif /* NXAGENT_SERVER */ -- 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 3.6.x in repository nx-libs. commit f64fac47e9b2c3a6cdb49911b25b6f22f811f2f0 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Nov 9 21:17:45 2020 +0100 Handlers.c: use the same boolean values as in NXdispatch.c although there is no functional difference... --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index d00b13d77..b573d0a66 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -1017,7 +1017,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) nxagentDispatch.in = nxagentBytesIn; nxagentDispatch.out = nxagentBytesOut; - isItTimeToYield = 1; + isItTimeToYield = TRUE; } #ifdef DEBUG else @@ -1126,7 +1126,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out) nxagentDispatch.in = nxagentBytesIn; nxagentDispatch.out = nxagentBytesOut; - isItTimeToYield = 1; + isItTimeToYield = TRUE; } #ifdef DEBUG else -- 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 3.6.x in repository nx-libs. commit d1136ea2fc57e38c94608ad889f70fc3c517055e Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 30 13:22:05 2020 +0100 Client.h: conditionally add unused field --- nx-X11/programs/Xserver/hw/nxagent/Client.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.h b/nx-X11/programs/Xserver/hw/nxagent/Client.h index ac2f34e8b..574466602 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.h @@ -44,10 +44,15 @@ enum ClientHint JAVA_WINDOW }; +/* client byte counting is currently unused */ +#undef COUNT_CLIENT_BYTES + typedef struct _PrivClientRec { int clientState; +#ifdef COUNT_CLIENT_BYTES long clientBytes; +#endif enum ClientHint clientHint; char *clientInfoString; } PrivClientRec; @@ -59,8 +64,6 @@ extern int nxagentClientPrivateIndex; extern void nxagentClientStateCallback(CallbackListPtr *callbacks, void *data, void *args); -#undef COUNT_CLIENT_BYTES - #ifdef COUNT_CLIENT_BYTES #define nxagentClientAddBytes(pClient, size) \ (nxagentClientPriv(pClient) -> clientBytes += (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 3.6.x in repository nx-libs. commit eef306c2d8b5139bdb065adb8ce61ac1caf06b6c Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Nov 9 22:54:49 2020 +0100 manpage: document defaults for options -defer and -tile --- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 index 111224264..72a885638 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 +++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 @@ -539,7 +539,9 @@ allowed to change the keyboard settings through XKEYBOARD. .TP 8 .B \-tile WxH maximum size of the tile used when sending an image to the remote -display (minimum allowed: 32x32; no default) +display (minimum allowed: 32x32). The default depends on the link +type: 64x64 for \fImodem\fR and \fIisdn\fR, 4096x4096 for all other +link types) .TP 8 .B \-irlimit maximum image data rate to the encoder input in kB/s. The default is no limit. @@ -755,21 +757,29 @@ The default value can be set via the command line (\-defer). The value provided as nx/nx option is set when resuming a session, thus it overrides the command line default. +The default depends on the link type (see man nxproxy). + Each defer level adds the following rules to the previous ones: .RS 8 .TP 8 .I 0 Eager encoding. + +Default for link speed \fIlan\fR and \fIlocal\fR. .TP 8 .I 1 No data is put or copied on pixmaps, marking them always as corrupted and synchronizing them on demand, i.e. when a copy area to a window is requested, the source is synchronized before copying it. + +Default for link speed \fIwan\fR. .TP 8 .I 2 The put images over the windows are skipped marking the destination as corrupted. The same happens for copy area and composite operations, spreading the corrupted regions of involved drawables. + +Default for link speed \fIadsl\fR, \fIisdn\fR and \fImodem\fR. .RE .TP 8 -- 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 3.6.x in repository nx-libs. commit 7aec57a404b4252e47db9b0efe03f01a07c56453 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 01:45:36 2020 +0100 Handlers.c: add FIXME --- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index b573d0a66..639e3429e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -123,6 +123,9 @@ Bool nxagentXdmcpAlertUp = False; int nxagentBuffer; Bool nxagentBlocking; + +/* FIXME: nxagentCongestion is checked as a Boolean and as an Integer + (>= 4) at the same time which is weird at least */ int nxagentCongestion; double nxagentBytesIn; -- 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 3.6.x in repository nx-libs. commit cc781ae2edb414c2c591ab578636debc3515ed1d Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Dec 31 00:07:15 2020 +0100 Screen.c: clarify that characters are compared --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index cff0eb76a..173d2fb82 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2530,9 +2530,9 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) if (nxagentKeyboard != NULL) { int i; - for (i = 0; nxagentKeyboard[i] != '/' && nxagentKeyboard[i] != 0; i++); + for (i = 0; nxagentKeyboard[i] != '/' && nxagentKeyboard[i] != '\0'; i++); - if(nxagentKeyboard[i] == 0 || nxagentKeyboard[i + 1] == 0 || i == 0) + if(nxagentKeyboard[i] == '\0' || nxagentKeyboard[i + 1] == '\0' || i == 0) { #ifdef WARNING fprintf(stderr,"WARNING! Wrong keyboard type: %s.\n", nxagentKeyboard); -- 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 3.6.x in repository nx-libs. commit 0a06ee77a2ffd2b1dc5f1d6ebe93789be12f259f Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 14:11:31 2021 +0100 nxagent: Drop unused nxagentRootTileWindow --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index a9a79cebd..8e2313eac 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -131,8 +131,6 @@ extern Bool nxagentOnce; -extern WindowPtr nxagentRootTileWindow; - extern int nxagentLastClipboardClient; #ifdef NX_DEBUG_INPUT diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 811b5b565..d5b0c1b6a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -110,8 +110,6 @@ extern WindowPtr nxagentViewportFrameRight; extern WindowPtr nxagentViewportFrameAbove; extern WindowPtr nxagentViewportFrameBelow; -extern WindowPtr nxagentRootTileWindow; - extern Bool nxagentReportPrivateWindowIds; #define RECTLIMIT 25 -- 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 3.6.x in repository nx-libs. commit 12b96fd9abb9289039cb71a03703dcfc503f61e1 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 14:12:05 2021 +0100 fix formatting and spelling in various files --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/GC.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 13 ++++++------- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Split.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- nxcomp/include/NX.h | 2 +- nxcomp/src/Control.h | 2 +- nxcomp/src/Message.h | 2 +- nxproxy/man/nxproxy.1 | 2 +- 12 files changed, 17 insertions(+), 18 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index d5d13ea56..f24d15c55 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -2319,7 +2319,7 @@ void nxagentSetDeferLevel(void) nxagentChangeOption(Streaming, False); } - switch (nxagentOption(LinkType)) + switch (nxagentOption(LinkType)) { case LINK_TYPE_MODEM: case LINK_TYPE_ISDN: { deferLevel = 2; tileWidth = 64; tileHeight = 64; break; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h index a39c53c07..9006b2253 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h @@ -58,7 +58,7 @@ void nxagentWMDetect(void); #ifdef XlibAtom /* - * only provide these protoypes if the including file knows about Xlib + * only provide these prototypes if the including file knows about Xlib * types. This allows us including Atoms.h without having to use the * Xlib type magic of Agent.h */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 9931bdd77..cc9d35ac6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -767,7 +767,7 @@ static void nxagentDisplayFlushHandler(Display *disp, int length) * Error flag after the _NXDisplayErrorPredicate returns true. The * function can be used to activate additional checks, besides the * normal failures detected by Xlib on the display socket. For exam- - * ple, the application can set the funciton to verify if an inter- + * ple, the application can set the function to verify if an inter- * rupt was received or if any other event occurred mandating the + end of the session." */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 2aa404910..b956bb8df 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -1127,7 +1127,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) /* * Originally, the clip origin area were 0,0 but it didn't * work with kedit and family, because it got the clip mask of - * the pixmap all traslated. + * the pixmap all translated. */ XSetClipRectangles(nxagentDisplay, nxagentGC(pGC), pGC -> clipOrg.x, pGC -> clipOrg.y, diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index ae9de652a..5bda3c9ef 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -528,13 +528,12 @@ void nxagentReconnectPictFormat(void *p0, XID x1, void *p2) } /* - * The set of picture formats may change considerably - * between different X servers. This poses a problem - * while migrating NX sessions, because a requisite to - * successfully reconnect the session is that all pic- - * ture formats have to be available on the new X server. - * To reduce such problems, we use a limited set of - * pictures available on the most X servers. + * The set of picture formats may change considerably between + * different X servers. This poses a problem while migrating NX + * sessions, because a requisite to successfully reconnect the session + * is that all picture formats have to be available on the new X + * server. To reduce such problems, we use a limited set of pictures + * available on the most X servers. */ void nxagentPictureCreateDefaultFormats(ScreenPtr pScreen, FormatInitRec *formats, int *nformats) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 9bcd90130..72cb13042 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -1245,7 +1245,7 @@ void nxagentFreePropertyList(void) /* * We are trying to distinguish notifications generated by an external - * client from those genarated by our own requests. + * client from those generated by our own requests. */ Bool nxagentNotifyMatchChangeProperty(void *p) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c index 2e2b130fe..99cc3a280 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -112,7 +112,7 @@ SplitResourcePtr nxagentAllocSplitResource(void) fprintf(stderr, "nxagentAllocSplitResource: PANIC! No more resources for the next split.\n"); #endif /* -FIXME: Must deal with the case all resources are exausted. +FIXME: Must deal with the case all resources are exhausted. */ FatalError("nxagentAllocSplitResource: PANIC! No more resources for the next split.\n"); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index d5b0c1b6a..841ee3888 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -1530,7 +1530,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) * position in the window tree, and pPriorParent is its previous * parent. This function can be NULL. * - * We simply pass this pver to the real X server. + * We simply pass this over to the real X server. */ void nxagentReparentWindow(WindowPtr pWin, WindowPtr pOldParent) { diff --git a/nxcomp/include/NX.h b/nxcomp/include/NX.h index cc1cfb280..088e265e0 100644 --- a/nxcomp/include/NX.h +++ b/nxcomp/include/NX.h @@ -342,7 +342,7 @@ extern int NXTransFlush(int fd); * connection. * * NX_CHANNEL_SLAVE: The channel will forward data to a remote slave - * command (see NX_SLAVE_CMD envrionment variable) + * command (see NX_SLAVE_CMD environment variable) * * Only a proxy running at the NX server/X client side will be able * to create a X, CUPS, SMB, MEDIA and HTTP channel. A proxy running diff --git a/nxcomp/src/Control.h b/nxcomp/src/Control.h index 764fca2c1..21edae77c 100644 --- a/nxcomp/src/Control.h +++ b/nxcomp/src/Control.h @@ -144,7 +144,7 @@ class Control T_session_mode SessionMode; // - // Either immediate or defferred flushes. + // Either immediate or deferred flushes. // T_flush_policy FlushPolicy; diff --git a/nxcomp/src/Message.h b/nxcomp/src/Message.h index 30883f101..f3a588104 100644 --- a/nxcomp/src/Message.h +++ b/nxcomp/src/Message.h @@ -566,7 +566,7 @@ class MessageStore // it can contain valid data that must be // explicitly deallocated if not needed. // Note also that you cannot count on the - // initialization made in costructor. + // initialization made in constructor. // temporary_ = message; diff --git a/nxproxy/man/nxproxy.1 b/nxproxy/man/nxproxy.1 index 9a145d2c0..c22f15a48 100644 --- a/nxproxy/man/nxproxy.1 +++ b/nxproxy/man/nxproxy.1 @@ -109,7 +109,7 @@ Remote port used for the connection. .TP 8 .B retry=<int> -Number of connection atempts. +Number of connection attempts. .TP 8 .B root=<string> -- 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 3.6.x in repository nx-libs. commit 8c3bb27150bf058c007af1318cb477e9763b9d9d Merge: b66699555 1b80750f6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Jan 16 00:24:10 2021 +0100 Merge branch 'uli42-pr/pvs_findings' into 3.6.x Attributes GH PR #981: https://github.com/ArcticaProject/nx-libs/pull/981 nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 16 +++++++--- nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 4 +-- nx-X11/programs/Xserver/hw/nxagent/Display.c | 16 +++++++--- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 4 ++- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 13 +++++--- nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 7 +++++ nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 27 +++++++--------- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 8 +++-- nx-X11/programs/Xserver/hw/nxagent/Render.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 3 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 39 +++++++++++++++++++++++ nx-X11/programs/Xserver/hw/nxagent/Splash.c | 13 +++----- nx-X11/programs/Xserver/hw/nxagent/Window.c | 43 ++++++++++++++++++-------- 13 files changed, 137 insertions(+), 58 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 3.6.x in repository nx-libs. commit 669299de3594e46fd67a84066be4b78f83cb6f00 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 14:57:32 2021 +0100 Window.c: suppress warning This used to be printed only in TEST mode. Some while ago I had changed that to WARNING (because it is a warning...). However, this happens e.g. when running the xscreensaver vfeedback module and it does not look like it is a problem at all. So let's suppress this warning again and leave it to the TEST mode as it used to be. --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 841ee3888..d95f8f3ed 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3922,7 +3922,7 @@ StoringPixmapPtr nxagentFindItemBSPixmapList(unsigned long pixmapId) } } - #ifdef WARNING + #ifdef TEST fprintf(stderr, "%s: WARNING! Item not found.\n", __func__); #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 3.6.x in repository nx-libs. commit 46c9c493f083ef180c690533eef218eb82684eaa Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 20:44:24 2021 +0100 Xext: include limits.h Is required for compilations with musl. See ArcticaProjects/nx-libs#975 and ArcticaProjects/nx-libs#976 --- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index 352e40261..a31ffd02c 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -46,6 +46,7 @@ Linux 2.0.x and 2.2.x define SHMLBA as PAGE_SIZE, but forget to define PAGE_SIZE. It is defined in <asm/page.h>. */ #include <asm/page.h> +#include <limits.h> #endif #ifdef SVR4 #include <sys/sysmacros.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 3.6.x in repository nx-libs. commit 8b6d454cf5606540ab23ce7479631f4f09af6d34 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jan 4 20:41:32 2021 +0100 Mesa: make compilation with work with musl Fixes ArcticaProject/nx-lib#975 --- nx-X11/extras/Mesa.patches_6.4.2/1001_support_musl | 12 ++++++++++++ nx-X11/extras/Mesa.patches_6.4.2/series | 1 + 2 files changed, 13 insertions(+) diff --git a/nx-X11/extras/Mesa.patches_6.4.2/1001_support_musl b/nx-X11/extras/Mesa.patches_6.4.2/1001_support_musl new file mode 100644 index 000000000..72b8d90bd --- /dev/null +++ b/nx-X11/extras/Mesa.patches_6.4.2/1001_support_musl @@ -0,0 +1,12 @@ +make compilation work on any non-linux glibc system. See ArcticaProject/nx-libs#975 +--- a/src/mesa/main/glheader.h ++++ b/src/mesa/main/glheader.h +@@ -62,7 +62,7 @@ + #include <stdlib.h> + #include <stdio.h> + #include <string.h> +-#if defined(__linux__) && defined(__i386__) ++#if defined(__GLIBC__) && defined(__i386__) + #include <fpu_control.h> + #endif + #endif diff --git a/nx-X11/extras/Mesa.patches_6.4.2/series b/nx-X11/extras/Mesa.patches_6.4.2/series index 4e6c15934..db40c2b60 100644 --- a/nx-X11/extras/Mesa.patches_6.4.2/series +++ b/nx-X11/extras/Mesa.patches_6.4.2/series @@ -5,3 +5,4 @@ 5001_nasty-typo-fixes.patch 4005_adapt-all-libX11-include-paths-to-libNX_X11.patch 5002_silence-uninitialized.diff +1001_support_musl -- 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 3.6.x in repository nx-libs. commit 1b80750f69a848c1c00c15c537707acca4e68684 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jan 15 18:24:26 2021 +0100 Display.c: fix and reformat broken comment --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index cc9d35ac6..89d49edf1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -758,18 +758,17 @@ static void nxagentDisplayFlushHandler(Display *disp, int length) } /* - * From the changelog for nx-X11-3.0.0-4: - * "Added the _NXDisplayErrorPredicate function in XlibInt.c. It is - * actually a pointer to a function called whenever Xlib is going to - * perform a network operation. If the function returns true, the - * call will be aborted and Xlib will return the control to the ap- - * plication. It is up to the application to set the XlibDisplayIO- - * Error flag after the _NXDisplayErrorPredicate returns true. The - * function can be used to activate additional checks, besides the - * normal failures detected by Xlib on the display socket. For exam- - * ple, the application can set the function to verify if an inter- - * rupt was received or if any other event occurred mandating the - + end of the session." + * From the changelog for nx-X11-3.0.0-4: "Added the + * _NXDisplayErrorPredicate function in XlibInt.c. It is actually a + * pointer to a function called whenever Xlib is going to perform a + * network operation. If the function returns true, the call will be + * aborted and Xlib will return the control to the application. It is + * up to the application to set the XlibDisplayIO- Error flag after + * the _NXDisplayErrorPredicate returns true. The function can be used + * to activate additional checks, besides the normal failures detected + * by Xlib on the display socket. For example, the application can set + * the function to verify if an interrupt was received or if any other + * event occurred mandating the end of the session." */ static int nxagentDisplayErrorPredicate(Display *disp, int error) { -- 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 3.6.x in repository nx-libs. commit f60ac577713c28212cdf2f4203b2cc0726034f5f Merge: 8c3bb2715 46c9c493f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Jan 16 00:28:13 2021 +0100 Merge branch 'uli42-pr/musl_fixes' into 3.6.x Attributes GH PR #982: https://github.com/ArcticaProject/nx-libs/pull/982 nx-X11/extras/Mesa.patches_6.4.2/1001_support_musl | 12 ++++++++++++ nx-X11/extras/Mesa.patches_6.4.2/series | 1 + nx-X11/programs/Xserver/Xext/xf86bigfont.c | 1 + 3 files changed, 14 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 3.6.x in repository nx-libs. commit 689f811ba1bac8caee40e50149127e5c81ec575c Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 16 23:29:04 2021 +0100 Xext: use $USRDATADIR/SecurityPolicy This reflects the path where the file is placed after installation. It also obsoletes the NX_ALTERNATIVEPOLICYFILE. Fixes ArcticaProject/nx-libs#988 --- nx-X11/programs/Xserver/Xext/Imakefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/Xext/Imakefile b/nx-X11/programs/Xserver/Xext/Imakefile index 540ac80fa..c3bb8391f 100644 --- a/nx-X11/programs/Xserver/Xext/Imakefile +++ b/nx-X11/programs/Xserver/Xext/Imakefile @@ -56,8 +56,7 @@ XF86BIGFOBJS = xf86bigfont.o #if BuildXCSecurity SECURITYSRCS = security.c SECURITYOBJS = security.o - SERVERCONFIGDIR = ServerConfigDir - POLICYFILEDEF = -DDEFAULTPOLICYFILE=\"$(SERVERCONFIGDIR)/SecurityPolicy\" + POLICYFILEDEF = -DDEFAULTPOLICYFILE=\"$(USRDATADIR)/SecurityPolicy\" #endif #if BuildXinerama PNRXSRCS = panoramiX.c panoramiXSwap.c panoramiXprocs.c @@ -125,7 +124,7 @@ SpecialCObjectRule(security,$(ICONFIGFILES),$(POLICYFILEDEF)) LinkConfDirectory(xserver,.,xserver,.) #if BuildXCSecurity && InstallSecurityConfig -InstallNonExecFile(SecurityPolicy,$(SERVERCONFIGDIR)) +InstallNonExecFile(SecurityPolicy,$(USRDATADIR)) #endif DependTarget() -- 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 3.6.x in repository nx-libs. commit e156bdc0350e14dbd0429fab899b4eb9ee1a201b Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 16 22:31:44 2021 +0100 Args.c: improve usage string for -geometry --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index f24d15c55..72d6d050c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -2083,7 +2083,7 @@ void ddxUseMsg(void) ErrorF("-full utilize full regeneration\n"); ErrorF("-class string default visual class\n"); ErrorF("-depth int default depth\n"); - ErrorF("-geometry WxH+X+Y window size and position\n"); + ErrorF("-geometry string window size and position (WXH+X+Y) or 'allscreens' / 'onescreen'\n"); ErrorF("-bw int window border width\n"); ErrorF("-name string window name\n"); ErrorF("-scrns int number of screens to generate\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 3.6.x in repository nx-libs. commit a83ec33d5f4d4d60e25d14053282c31dc0e09655 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 16 22:13:05 2021 +0100 Screen.c: remove superflous code that produces a crash Fixes ArcticaProject/nx-libs#987 --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 173d2fb82..a6b312aaa 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -337,12 +337,6 @@ void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) */ void nxagentMaximizeToFullScreen(ScreenPtr pScreen) { - if (nxagentOption(AllScreens)) - nxagentSwitchAllScreens(pScreen, True); - else - nxagentSwitchFullscreen(pScreen, True); - return; - /* XUnmapWindow(nxagentDisplay, nxagentIconWindow); */ -- 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 3.6.x in repository nx-libs. commit f4782bbd2c3e98176cd34ed1bfabba954d9489e4 Merge: f60ac5777 e156bdc03 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jan 18 11:37:25 2021 +0100 Merge branch 'uli42-pr/fix_fullscreen' into 3.6.x Attributes GH PR #990: https://github.com/ArcticaProject/nx-libs/pull/990 nx-X11/programs/Xserver/hw/nxagent/Args.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 6 ------ 2 files changed, 1 insertion(+), 7 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 3.6.x in repository nx-libs. commit 57e662b83d31344b331d5035d02f7ab26a9eeaad Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:08 2021 +0100 nxagent: drop unused nxagentVisibility variables --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/Windows.h | 2 -- 3 files changed, 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 8e2313eac..a342cdee1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2067,8 +2067,6 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (nxagentOption(Fullscreen)) { nxagentVisibility = VisibilityUnobscured; - nxagentVisibilityStop = False; - nxagentVisibilityTimeout = GetTimeInMillis() + 2000; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index d95f8f3ed..adf54b717 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -80,8 +80,6 @@ int nxagentWindowPrivateIndex; */ int nxagentVisibility = VisibilityUnobscured; -unsigned long nxagentVisibilityTimeout = 0; -Bool nxagentVisibilityStop = False; ConfiguredWindowStruct *nxagentConfiguredWindowList; StaticResizedWindowStruct *nxagentStaticResizedWindowList; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Windows.h b/nx-X11/programs/Xserver/hw/nxagent/Windows.h index 8666ebec9..df27d4e53 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Windows.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Windows.h @@ -256,8 +256,6 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask); */ extern int nxagentVisibility; -extern unsigned long nxagentVisibilityTimeout; -extern Bool nxagentVisibilityStop; /* * Return the pointer to the window given the remote id. It tries to -- 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 3.6.x in repository nx-libs. commit a26011503c7c64549a11ff679f504f3ad2dce081 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 16 23:31:12 2021 +0100 Xext: drop NX_ALTERNATIVEPOLICYFILE We can now also drop all remaining NX specific lines from the security.c see ArcticaProject/nx-libs#988 --- nx-X11/programs/Xserver/Xext/security.c | 202 -------------------------------- 1 file changed, 202 deletions(-) diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index 2a7d5628f..2b4fa2cb5 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -69,49 +69,15 @@ in this Software without prior written authorization from The Open Group. #include <stdio.h> /* for file reading operations */ #include <nx-X11/Xatom.h> /* for XA_STRING */ -#ifdef NXAGENT_SERVER - -#include <unistd.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> - -#endif - #ifndef DEFAULTPOLICYFILE # define DEFAULTPOLICYFILE NULL #endif -#ifdef NXAGENT_SERVER - -#define NX_ALTERNATIVEPOLICYFILE "/usr/local/share/nx/SecurityPolicy" - -#endif - #if defined(WIN32) || defined(__CYGWIN__) #include <nx-X11/Xos.h> #undef index #endif -/* - * Set here the required NX log level. - */ - -#ifdef NXAGENT_SERVER - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -#endif - -#ifdef NXAGENT_SERVER - -static char _NXPolicyFilePath[1024]; - -#endif - static int SecurityErrorBase; /* first Security error number */ static int SecurityEventBase; /* first Security event number */ @@ -135,115 +101,6 @@ int (*SwappedUntrustedProcVector[256])( ClientPtr /*client*/ ); -#ifdef NXAGENT_SERVER - -/* - * This function returns the SecurityPolicy - * file full path. This path is referred by - * SecurityPolicyFile variable (generally it - * contains the hardcoded path at compile time). - * If the path does not exist, the function will - * try a set of well known paths. - */ - -char *_NXGetPolicyFilePath(const char *path) -{ - - struct stat SecurityPolicyStat; - - /* - * Check the policy file path only once. - */ - - if (*_NXPolicyFilePath != '\0') - { - return _NXPolicyFilePath; - } - - if (stat(path, &SecurityPolicyStat) == 0) - { - if (strlen(path) + 1 > 1024) - { - #ifdef WARNING - fprintf(stderr, "_NXGetPolicyFilePath: WARNING! Maximum length of SecurityPolicy file path exceeded.\n"); - #endif - - goto _NXGetPolicyFilePathError; - } - - strcpy(_NXPolicyFilePath, path); - - #ifdef TEST - fprintf(stderr, "_NXGetPolicyFilePath: Using SecurityPolicy file path [%s].\n", - _NXPolicyFilePath); - #endif - - return _NXPolicyFilePath; - } - - if (stat(DEFAULTPOLICYFILE, &SecurityPolicyStat) == 0) - { - if (strlen(DEFAULTPOLICYFILE) + 1 > 1024) - { - #ifdef WARNING - fprintf(stderr, "_NXGetPolicyFilePath: WARNING! Maximum length of SecurityPolicy file path exceeded.\n"); - #endif - - goto _NXGetPolicyFilePathError; - } - - strcpy(_NXPolicyFilePath, DEFAULTPOLICYFILE); - - #ifdef TEST - fprintf(stderr, "_NXGetPolicyFilePath: Using SecurityPolicy file path [%s].\n", - _NXPolicyFilePath); - #endif - - return _NXPolicyFilePath; - } - - if (stat(NX_ALTERNATIVEPOLICYFILE, &SecurityPolicyStat) == 0) - { - if (strlen(NX_ALTERNATIVEPOLICYFILE) + 1 > 1024) - { - #ifdef WARNING - fprintf(stderr, "_NXGetPolicyFilePath: WARNING! Maximum length of SecurityPolicy file path exceeded.\n"); - #endif - - goto _NXGetPolicyFilePathError; - } - - strcpy(_NXPolicyFilePath, NX_ALTERNATIVEPOLICYFILE); - - #ifdef TEST - fprintf(stderr, "_NXGetPolicyFilePath: Using SecurityPolicy file path [%s].\n", - _NXPolicyFilePath); - #endif - - return _NXPolicyFilePath; - } - -_NXGetPolicyFilePathError: - - if (strlen(path) + 1 > 1024) - { - #ifdef WARNING - fprintf(stderr, "_NXGetPolicyFilePath: WARNING! Maximum length of SecurityPolicy file exceeded.\n"); - #endif - } - - strcpy(_NXPolicyFilePath, path); - - #ifdef TEST - fprintf(stderr, "_NXGetPolicyFilePath: Using default SecurityPolicy file path [%s].\n", - _NXPolicyFilePath); - #endif - - return _NXPolicyFilePath; -} - -#endif - /* SecurityAudit * * Arguments: @@ -1756,44 +1613,16 @@ SecurityLoadPropertyAccessList(void) SecurityMaxPropertyName = 0; -#ifdef NXAGENT_SERVER - - if (!_NXGetPolicyFilePath(SecurityPolicyFile)) - { - return; - } - -#else - if (!SecurityPolicyFile) return; -#endif - -#ifdef NXAGENT_SERVER - - f = Fopen(_NXGetPolicyFilePath(SecurityPolicyFile), "r"); - -#else - f = Fopen(SecurityPolicyFile, "r"); -#endif - if (!f) { -#ifdef NXAGENT_SERVER - - ErrorF("error opening security policy file %s\n", - _NXGetPolicyFilePath(SecurityPolicyFile)); - -#else ErrorF("error opening security policy file %s\n", SecurityPolicyFile); - -#endif - return; } @@ -1813,19 +1642,8 @@ SecurityLoadPropertyAccessList(void) char *v = SecurityParseString(&p); if (strcmp(v, SECURITY_POLICY_FILE_VERSION) != 0) { - -#ifdef NXAGENT_SERVER - - ErrorF("%s: invalid security policy file version, ignoring file\n", - _NXGetPolicyFilePath(SecurityPolicyFile)); - -#else - ErrorF("%s: invalid security policy file version, ignoring file\n", SecurityPolicyFile); - -#endif - break; } validLine = TRUE; @@ -1852,22 +1670,10 @@ SecurityLoadPropertyAccessList(void) } } -#ifdef NXAGENT_SERVER - - if (!validLine) - { - ErrorF("Line %d of %s invalid, ignoring\n", - lineNumber, _NXGetPolicyFilePath(SecurityPolicyFile)); - } - -#else - if (!validLine) ErrorF("Line %d of %s invalid, ignoring\n", lineNumber, SecurityPolicyFile); -#endif - } /* end while more input */ #ifdef PROPDEBUG @@ -1959,16 +1765,8 @@ SecurityCheckPropertyAccess(client, pWin, propertyName, access_mode) struct stat buf; static time_t lastmod = 0; -#ifdef NXAGENT_SERVER - - int ret = stat(_NXGetPolicyFilePath(SecurityPolicyFile), &buf); - -#else - int ret = stat(SecurityPolicyFile , &buf); -#endif - if ( (ret == 0) && (buf.st_mtime > lastmod) ) { ErrorF("reloading property rules\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 3.6.x in repository nx-libs. commit 24b903be52601b223f9527cd28334cb3d9e3aad0 Merge: f4782bbd2 a26011503 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jan 18 11:41:47 2021 +0100 Merge branch 'uli42-pr/drop_alternative_securitypolicy' into 3.6.x Attributes GH PR #989: https://github.com/ArcticaProject/nx-libs/pull/989 nx-X11/programs/Xserver/Xext/Imakefile | 5 +- nx-X11/programs/Xserver/Xext/security.c | 202 -------------------------------- 2 files changed, 2 insertions(+), 205 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 3.6.x in repository nx-libs. commit ee60cc50cb3c9fb3844fb5b6bd330f636213ee7d Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:14 2021 +0100 Window.c: Fix 32bit code path make it compile again Thanks to Simon Matter for reporting this and the patch. Fixes ArcticaProject/nx-libs#993 --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index adf54b717..ba93c96cb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3089,8 +3089,8 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer /* FIXME: use XAllocSizeHints() */ #ifdef _XSERVER64 data64 = (unsigned char *) malloc(sizeof(XSizeHints) + 4); - if (data64) - { + if (data64) + { for (int i = 0; i < 4; i++) { *(data64 + i) = *(data + i); @@ -3104,18 +3104,18 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer } XSizeHints *props = (XSizeHints *) data64; - #else - XSizeHints *props = (XSizeHints *) data; - #endif /* _XSERVER64 */ - hints = *props; - } - else - { + } + else + { #ifdef WARNING fprintf(stderr, "%s: Failed to alloc memory for XSizeHints\n", __func__); #endif - } + } + #else + XSizeHints *props = (XSizeHints *) data; + hints = *props; + #endif /* _XSERVER64 */ } else { -- 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 3.6.x in repository nx-libs. commit e5746df802eff5c50e46ef5ee96b3f0e34a00003 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jan 18 11:44:24 2021 +0100 debian/patches: Drop 2002_xserver-xext_set-securitypolicy-path.debian.patch. Not required anymore since 689f811b. Regression fix. --- ..._xserver-xext_set-securitypolicy-path.debian.patch | 19 ------------------- debian/patches/series | 1 - 2 files changed, 20 deletions(-) diff --git a/debian/patches/2002_xserver-xext_set-securitypolicy-path.debian.patch b/debian/patches/2002_xserver-xext_set-securitypolicy-path.debian.patch deleted file mode 100644 index b3186a9b4..000000000 --- a/debian/patches/2002_xserver-xext_set-securitypolicy-path.debian.patch +++ /dev/null @@ -1,19 +0,0 @@ -Description: FHS path fix for SecurityPolicy file - This patch is needed on Debian only, not reporting this path - change to upstream. - . - Originally contributed by Marcelo Boveto Shima <marceloshima@gmail.com>. -Forwarded: not-needed -Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> -Last-Update: 2012-01-12 ---- a/nx-X11/programs/Xserver/Xext/security.c -+++ b/nx-X11/programs/Xserver/Xext/security.c -@@ -84,7 +84,7 @@ - - #ifdef NXAGENT_SERVER - --#define NX_ALTERNATIVEPOLICYFILE "/usr/local/share/nx/SecurityPolicy" -+#define NX_ALTERNATIVEPOLICYFILE "/usr/share/nx/SecurityPolicy" - - #endif - diff --git a/debian/patches/series b/debian/patches/series index e1ec9c56d..a2566bd93 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,2 @@ 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 3.6.x in repository nx-libs. commit 8b2b4111384133491a11bb67a7272532b582a814 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:19 2021 +0100 NXproperty.c: simplify and reformat GetWindowProperty() --- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 3ca79cea7..9e14a3cca 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -466,9 +466,6 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, unsigned long *bytesAfter; unsigned char **propData; { - PropertyPtr pProp, prevProp; - unsigned long n, len, ind; - if (!pWin) { #ifdef DEBUG @@ -484,6 +481,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, #endif return BadAtom; } + if ((type != AnyPropertyType) && !ValidAtom(type)) { #ifdef DEBUG @@ -492,8 +490,8 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, return BadAtom; } - pProp = wUserProps (pWin); - prevProp = (PropertyPtr)NULL; + PropertyPtr pProp = wUserProps (pWin); + PropertyPtr prevProp = (PropertyPtr)NULL; while (pProp) { @@ -522,14 +520,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, *format = pProp->format; *nItems = 0; *actualType = pProp->type; - return(Success); + return Success; } /* * Return type, format, value to client */ - n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - ind = longOffset << 2; + unsigned long n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ + unsigned long ind = longOffset << 2; /* If longOffset is invalid such that it causes "len" to be negative, it's a value error. */ @@ -542,7 +540,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, return BadValue; } - len = min(n - ind, 4 * longLength); + unsigned long len = min(n - ind, 4 * longLength); *bytesAfter = n - (ind + len); *format = pProp->format; @@ -566,7 +564,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, } if (delete && (*bytesAfter == 0)) - { /* delete the Property */ + { /* delete the property */ if (prevProp == (PropertyPtr)NULL) /* takes care of head */ { if (!(pWin->optional->userProps = pProp->next)) -- 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 3.6.x in repository nx-libs. commit 5a00da5eca15ce16401dbdfc6595949beb8a3e76 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:17 2021 +0100 NXproperty.c: clean returns remove unneccessary parentheses --- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 97665d22e..3ca79cea7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -482,14 +482,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, #ifdef DEBUG fprintf(stderr, "%s: invalid atom [%d]\n", __func__, property); #endif - return(BadAtom); + return BadAtom; } if ((type != AnyPropertyType) && !ValidAtom(type)) { #ifdef DEBUG fprintf(stderr, "%s: invalid type [%d]\n", __func__, type); #endif - return(BadAtom); + return BadAtom; } pProp = wUserProps (pWin); @@ -508,7 +508,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, #ifdef DEBUG fprintf(stderr, "%s: property not found [%d]\n", __func__, property); #endif - return (BadAtom); + return BadAtom; } /* If the request type and actual type don't match. Return the @@ -577,7 +577,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, free(pProp->data); free(pProp); } - return(Success); + return Success; } #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 3.6.x in repository nx-libs. commit 5b628e2d79bce67b255690e0a54a0a488bbb05e0 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 14:17:39 2021 +0100 shellcheck: Fix SC2006 issue See, $ find . -name "*.sh" | xargs shellcheck -i SC2006 In ./roll-tarballs.sh line 62: echo "HEAD (on branch `git rev-parse --abbrev-ref HEAD`)" ^-- SC2006: Use $(...) notation instead of legacy backticked `...`. Did you mean: echo "HEAD (on branch $(git rev-parse --abbrev-ref HEAD))" In ./nx-X11/x-indent-all.sh line 2: where=`dirname $0` ^----------^ SC2006: Use $(...) notation instead of legacy backticked `...`. Did you mean: where=$(dirname $0) In ./nx-X11/x-indent.sh line 5: INDENT=`which gnuindent || which gindent || which indent` ^-- SC2006: Use $(...) notation instead of legacy backticked `...`. Did you mean: INDENT=$(which gnuindent || which gindent || which indent) For more information: https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- nx-X11/x-indent-all.sh | 2 +- nx-X11/x-indent.sh | 2 +- roll-tarballs.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/x-indent-all.sh b/nx-X11/x-indent-all.sh index 6addaf400..d3c4113de 100755 --- a/nx-X11/x-indent-all.sh +++ b/nx-X11/x-indent-all.sh @@ -1,4 +1,4 @@ #!/bin/sh -where=`dirname $0` +where=$(dirname $0) git ls-files | grep '\.[chm]$' | xargs sh "$where"/x-indent.sh diff --git a/nx-X11/x-indent.sh b/nx-X11/x-indent.sh index e662cce09..327aa6a4f 100755 --- a/nx-X11/x-indent.sh +++ b/nx-X11/x-indent.sh @@ -2,7 +2,7 @@ # We want GNU indent, so first search for gindent to avoid /usr/bin/indent # on the BSDs, which won't work for us -INDENT=`which gnuindent || which gindent || which indent` +INDENT=$(which gnuindent || which gindent || which indent) if [ -z "${INDENT}" ] ; then echo "Could not find indent, sorry..." >&2 diff --git a/roll-tarballs.sh b/roll-tarballs.sh index dc30a8a17..acef42daa 100755 --- a/roll-tarballs.sh +++ b/roll-tarballs.sh @@ -59,7 +59,7 @@ fi if ! git rev-parse --verify -q "$CHECKOUT" >/dev/null; then echo " '${RELEASE}' is not a valid release number because there is no git tag named ${CHECKOUT}." echo " Please specify one of the following releases:" - echo "HEAD (on branch `git rev-parse --abbrev-ref HEAD`)" + echo "HEAD (on branch $(git rev-parse --abbrev-ref HEAD))" git tag -l | grep "^redist" | cut -f2 -d"/" | sort -u exit 1 fi -- 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 3.6.x in repository nx-libs. commit d627e948f558f4210feb54c674e7c112b1d6a2e7 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:23 2021 +0100 NXproperty.c, dix.c: simplify ProcDeleteProperty() by calling the dix version after a check --- nx-X11/programs/Xserver/dix/property.c | 6 ++-- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 48 +++---------------------- 2 files changed, 9 insertions(+), 45 deletions(-) diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index f0bfe1e65..37af8d592 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -661,9 +661,12 @@ ProcListProperties(ClientPtr client) return(client->noClientException); } -#ifndef NXAGENT_SERVER int +#ifdef NXAGENT_SERVER +xorg_ProcDeleteProperty(register ClientPtr client) +#else ProcDeleteProperty(register ClientPtr client) +#endif { WindowPtr pWin; REQUEST(xDeletePropertyReq); @@ -699,4 +702,3 @@ ProcDeleteProperty(register ClientPtr client) else return(result); } -#endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index f4979ceb3..7cf41f241 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -180,11 +180,8 @@ ProcChangeProperty(ClientPtr client) #ifdef NXAGENT_SERVER /* prevent clients from changing the NX_AGENT_VERSION property */ - { - Atom prop = MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True); - if (stuff->property == prop) - return client->noClientException; - } + if (stuff->property == MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True)) + return client->noClientException; #endif err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format, @@ -577,46 +574,11 @@ GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, int ProcDeleteProperty(register ClientPtr client) { - WindowPtr pWin; REQUEST(xDeletePropertyReq); - int result; - REQUEST_SIZE_MATCH(xDeletePropertyReq); - UpdateCurrentTime(); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - DixWriteAccess); - if (!pWin) - return(BadWindow); - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return (BadAtom); - } - -#ifdef XCSECURITY - switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - DixDestroyAccess)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return Success; - } -#endif - -#ifdef NXAGENT_SERVER /* prevent clients from deleting the NX_AGENT_VERSION property */ - { - Atom prop = MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True); - if (stuff->property == prop) - return client->noClientException; - } -#endif + if (stuff->property == MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True)) + return client->noClientException; - result = DeleteProperty(pWin, stuff->property); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); + return xorg_ProcDeleteProperty(client); } -- 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 3.6.x in repository nx-libs. commit b8b1edb2b3507386de9c9fbe6f7b0f0347a22001 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:21 2021 +0100 NXproperty.c: GetWindowProperty(): add more comments, restruct prototype --- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 35 +++++++++++-------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 9e14a3cca..f4979ceb3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -446,25 +446,20 @@ ProcGetProperty(ClientPtr client) return(client->noClientException); } -#ifdef NXAGENT_CLIPBOARD -/* GetWindowProperty clipboard use only */ -/* FIXME: that's wrong, it is also called in Window.c and Events.c */ -/* FIXME: should be moved to a different file, is not derived from - dix */ +/* + * GetWindowProperty is the internal implementation of the + * XGetWindowProperty() Xlib call. It is called from + * Clipboard.c, Window.c and Events.c + * + * FIXME: should be moved to a different file, is not derived from + * dix + */ int -GetWindowProperty(pWin, property, longOffset, longLength, delete, - type, actualType, format, nItems, bytesAfter, propData ) - WindowPtr pWin; - Atom property; - long longOffset; - long longLength; - Bool delete; - Atom type; - Atom *actualType; - int *format; - unsigned long *nItems; - unsigned long *bytesAfter; - unsigned char **propData; +GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, + long longLength, Bool delete, Atom type, + Atom *actualType, int *format, unsigned + long *nItems, unsigned long *bytesAfter, + unsigned char **propData) { if (!pWin) { @@ -527,7 +522,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, * Return type, format, value to client */ unsigned long n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - unsigned long ind = longOffset << 2; + unsigned long ind = longOffset << 2; /* byte offset */ /* If longOffset is invalid such that it causes "len" to be negative, it's a value error. */ @@ -540,6 +535,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, return BadValue; } + /* minimum of prop size and requested size */ unsigned long len = min(n - ind, 4 * longLength); *bytesAfter = n - (ind + len); @@ -577,7 +573,6 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, } return Success; } -#endif int ProcDeleteProperty(register ClientPtr client) -- 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 3.6.x in repository nx-libs. commit daeb82e33bfeb23d09f7782728f088bdc5d39ce5 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 14:23:06 2021 +0100 shellcheck: Fix SC2162 issue See, find . -name "*.sh" | xargs shellcheck -i SC2162 [...] For more information: https://www.shellcheck.net/wiki/SC2162 -- read without -r will mangle backs... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- regenerate-symbol-docs.sh | 10 +++++----- roll-tarballs.sh | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/regenerate-symbol-docs.sh b/regenerate-symbol-docs.sh index 20322247f..289effb25 100755 --- a/regenerate-symbol-docs.sh +++ b/regenerate-symbol-docs.sh @@ -24,7 +24,7 @@ SYMBOLS_FILE="doc/libNX_X11/symbols/libNX_X11::symbols.txt" DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_internally.txt" echo "Scanning for libNX_X11 symbols: in libNX_X11 internally: $DOC_FILE" cd nx-X11/lib/X11/ -cat "../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read symbol; do +cat "../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; do echo echo "#### $symbol ####" @@ -36,7 +36,7 @@ cd - 1>/dev/null DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_nxagent.txt" echo "Scanning for libNX_X11 symbols: in hw/nxagent: $DOC_FILE" cd nx-X11/programs/Xserver/hw/nxagent/ -cat "../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read symbol; do +cat "../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; do echo echo "#### $symbol ####" @@ -48,7 +48,7 @@ cd - 1>/dev/null DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_nxcompext.txt" echo "Scanning for libNX_X11 symbols: in hw/nxagent/compext: $DOC_FILE" cd nx-X11/programs/Xserver/hw/nxagent/compext/ -cat "../../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read symbol; do +cat "../../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; do echo echo "#### $symbol ####" @@ -65,7 +65,7 @@ SYMBOLS_FILE="doc/nxcompext/symbols/nxcompext::symbols.txt" DOC_FILE="doc/nxcompext/symbols/nxcompext::symbol-usage_internally.txt" echo "Scanning for nxcompext symbols: in hw/nxagent/compext internally: $DOC_FILE" cd nx-X11/programs/Xserver/hw/nxagent/compext/ -cat "../../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read symbol; do +cat "../../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; do echo echo "#### $symbol ####" @@ -77,7 +77,7 @@ cd - 1>/dev/null DOC_FILE="doc/nxcompext/symbols/nxcompext::symbol-usage_nxagent.txt" echo "Scanning for nxcompext symbols: in hw/nxagent: $DOC_FILE" cd nx-X11/programs/Xserver/hw/nxagent/ -cat ../../../../../$SYMBOLS_FILE | grep -v -E "^#" | while read symbol; do +cat ../../../../../$SYMBOLS_FILE | grep -v -E "^#" | while read -r symbol; do echo echo "#### $symbol ####" diff --git a/roll-tarballs.sh b/roll-tarballs.sh index acef42daa..85e098960 100755 --- a/roll-tarballs.sh +++ b/roll-tarballs.sh @@ -81,7 +81,7 @@ cd "${TEMP_DIR}/${PROJECT}-${RELEASE}/" # Replace symlinks by copies of the linked target files # Note: We don't have symlinked directories!!! -find . -type "l" | while read link; do +find . -type "l" | while read -r link; do TARGET="$(readlink "${link}")" pushd "$(dirname "${link}")" >/dev/null if [ -f "${TARGET}" ]; then @@ -156,12 +156,12 @@ if [ "x$MODE" = "xfull" ]; then rm -f "nx-X11/extras/Mesa/src/mesa/main/"*.py rm -f "nx-X11/extras/Mesa/src/mesa/main/"{mesa.def,Imakefile,vsnprintf.c} - find nx-X11/extras/Mesa/ -name Makefile | while read file; do rm "$file"; done - find nx-X11/extras/Mesa/ -name Makefile.* | while read file; do rm "$file"; done - find nx-X11/extras/Mesa/ -name descrip.mms | while read file; do rm "$file"; done + find nx-X11/extras/Mesa/ -name Makefile | while read -r file; do rm "$file"; done + find nx-X11/extras/Mesa/ -name Makefile.* | while read -r file; do rm "$file"; done + find nx-X11/extras/Mesa/ -name descrip.mms | while read -r file; do rm "$file"; done # this is for 3.5.0.x only... - cat "debian/patches/series" | sort | grep -v '^#' | egrep "([0-9]+(_|-).*\.(full|full\+lite)\.patch)" | while read file + cat "debian/patches/series" | sort | grep -v '^#' | egrep "([0-9]+(_|-).*\.(full|full\+lite)\.patch)" | while read -r file do cp -v "debian/patches/$file" "doc/applied-patches/" echo "${file##*/}" >> "doc/applied-patches/series" @@ -198,7 +198,7 @@ else mv LICENSE.nxcomp LICENSE # this is for 3.5.0.x only... - cat "debian/patches/series" | sort | grep -v '^#' | egrep "([0-9]+(_|-).*\.full\+lite\.patch)" | while read file + cat "debian/patches/series" | sort | grep -v '^#' | egrep "([0-9]+(_|-).*\.full\+lite\.patch)" | while read -r file do cp -v "debian/patches/$file" "doc/applied-patches/" echo "${file##*/}" >> "doc/applied-patches/series" -- 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 3.6.x in repository nx-libs. commit cb6e3b7d33923b177b0b8ffbe61d6c5b62c09001 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 14:27:45 2021 +0100 shellcheck: Fix SC2148 issues See, $ find . -name "*.sh" | xargs shellcheck -i SC2148 In ./replace.sh line 1: ^-- SC2148: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. For more information: https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- replace.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/replace.sh b/replace.sh index c2b187fda..28ce65aa4 100644 --- a/replace.sh +++ b/replace.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # Copyright (C) 2013 Jan Engelhardt <jengelh@inai.de> # # This program is free software; you can redistribute it and/or modify -- 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 3.6.x in repository nx-libs. commit 747a337444bbbb61e6956554e33c1387f5f40643 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 14:38:08 2021 +0100 shellcheck: Fix some SC2086 issues see, $ find . -name "*.sh" | xargs shellcheck -i SC2086 For more information: https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- regenerate-symbol-docs.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/regenerate-symbol-docs.sh b/regenerate-symbol-docs.sh index 289effb25..96b23c9d8 100755 --- a/regenerate-symbol-docs.sh +++ b/regenerate-symbol-docs.sh @@ -28,7 +28,7 @@ cat "../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; do echo echo "#### $symbol ####" - grep -n $symbol *.{c,h} 2>/dev/null + grep -n "$symbol" *.{c,h} 2>/dev/null done > "../../../$DOC_FILE" cd - 1>/dev/null @@ -40,7 +40,7 @@ cat "../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; do echo echo "#### $symbol ####" - grep -n $symbol *.{c,h} 2>/dev/null + grep -n "$symbol" *.{c,h} 2>/dev/null done > "../../../../../$DOC_FILE" cd - 1>/dev/null @@ -52,7 +52,7 @@ cat "../../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; echo echo "#### $symbol ####" - grep -n $symbol *.{c,h} 2>/dev/null + grep -n "$symbol" *.{c,h} 2>/dev/null done > "../../../../../../$DOC_FILE" cd - 1>/dev/null @@ -69,7 +69,7 @@ cat "../../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; echo echo "#### $symbol ####" - grep -n $symbol *.{c,h} 2>/dev/null + grep -n "$symbol" *.{c,h} 2>/dev/null done > "../../../../../../$DOC_FILE" cd - 1>/dev/null @@ -81,7 +81,7 @@ cat ../../../../../$SYMBOLS_FILE | grep -v -E "^#" | while read -r symbol; do echo echo "#### $symbol ####" - grep -n $symbol *.{c,h} 2>/dev/null + grep -n "$symbol" *.{c,h} 2>/dev/null done > "../../../../../$DOC_FILE" cd - 1>/dev/null -- 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 3.6.x in repository nx-libs. commit 18aca1f69ce0b305c746b84ff90f8bf5a471ca33 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 14:31:41 2021 +0100 shellcheck: Fix SC2059 issue See, $ find . -name "*.sh" | xargs shellcheck -i SC2059 In ./version.sh line 34: printf "${VER}" ^------^ SC2059: Don't use variables in the printf format string. Use printf '..%s..' "$foo". For more information: https://www.shellcheck.net/wiki/SC2059 -- Don't use variables in the printf... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sh b/version.sh index 891536890..f46600c50 100755 --- a/version.sh +++ b/version.sh @@ -31,4 +31,4 @@ VER="$(head -n "1" "${VERSION_FILE}" | cut -d"." -f"${COMPONENT}")" [ "x${VER}" = "x" ] && VER="0" -printf "${VER}" +printf "%s" "${VER}" -- 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 3.6.x in repository nx-libs. commit 2168bc68987c0d47f5898040ead57484d2671fb7 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 14:43:47 2021 +0100 shellcheck: Fix SC2045 issue See, $ find . -name "*.sh" | xargs shellcheck -i SC2045 In ./roll-tarballs.sh line 220: for f in $(ls README* 2>/dev/null); do ^-----------------------^ SC2045: Iterating over ls output is fragile. Use globs. For more information: https://www.shellcheck.net/wiki/SC2045 -- Iterating over ls output is fragi... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- roll-tarballs.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roll-tarballs.sh b/roll-tarballs.sh index 85e098960..5d0b7c215 100755 --- a/roll-tarballs.sh +++ b/roll-tarballs.sh @@ -217,8 +217,9 @@ rm -Rf "debian/" rm -Rf "nx-libs.spec" # very old release did not add any README -for f in $(ls README* 2>/dev/null); do - mv -v "$f" "doc/"; +for f in README*; do + [[ -e "$f" ]] || break # handle the case of no README* files + mv -v "$f" "doc/" done # remove files, that we do not want in the tarballs (build cruft) -- 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 3.6.x in repository nx-libs. commit 930fbe08bf6e17a953bc3c869a1c6b66e498d76a Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 14:57:29 2021 +0100 shellcheck: Fix SC2034 issue See, $ find . -name "*.sh" | xargs shellcheck -i SC2034 In ./roll-tarballs.sh line 34: NULL="" ^--^ SC2034: NULL appears unused. Verify use (or export if used externally). For more information: https://www.shellcheck.net/wiki/SC2034 -- NULL appears unused. Verify use (... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- roll-tarballs.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/roll-tarballs.sh b/roll-tarballs.sh index 2e2a19f7a..1a5fac626 100755 --- a/roll-tarballs.sh +++ b/roll-tarballs.sh @@ -31,7 +31,6 @@ usage() { } PROJECT="nx-libs" -NULL="" test -d ".git" || usage RELEASE="$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 3.6.x in repository nx-libs. commit 22b40e690ac85ba694b999ecdfbbd91ab923b64c Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 14:53:37 2021 +0100 shellcheck: Fix SC2002 issue See, $ find . -name "*.sh" | xargs shellcheck -i SC2002 For more information: https://www.shellcheck.net/wiki/SC2002 -- Useless cat. Consider 'cmd < file... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- nx-X11/lib/src/util/mkks.sh | 4 ++-- regenerate-symbol-docs.sh | 10 +++++----- roll-tarballs.sh | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/nx-X11/lib/src/util/mkks.sh b/nx-X11/lib/src/util/mkks.sh index ab5ca80c9..1831081f9 100644 --- a/nx-X11/lib/src/util/mkks.sh +++ b/nx-X11/lib/src/util/mkks.sh @@ -1,10 +1,10 @@ #!/bin/sh -cat $* | awk 'BEGIN { \ +awk 'BEGIN { \ printf "/*\n * This file is generated from %s. Do not edit.\n */\n", \ "$(INCLUDESRC)/keysymdef.h";\ } \ /^#define/ { \ len = length($2)-3; \ printf("{ \"%s\", %s },\n", substr($2,4,len), $3); \ -}' +}' $* diff --git a/regenerate-symbol-docs.sh b/regenerate-symbol-docs.sh index 96b23c9d8..05548bdb0 100755 --- a/regenerate-symbol-docs.sh +++ b/regenerate-symbol-docs.sh @@ -24,7 +24,7 @@ SYMBOLS_FILE="doc/libNX_X11/symbols/libNX_X11::symbols.txt" DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_internally.txt" echo "Scanning for libNX_X11 symbols: in libNX_X11 internally: $DOC_FILE" cd nx-X11/lib/X11/ -cat "../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; do +grep -v -E "^#" "../../../$SYMBOLS_FILE" | while read -r symbol; do echo echo "#### $symbol ####" @@ -36,7 +36,7 @@ cd - 1>/dev/null DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_nxagent.txt" echo "Scanning for libNX_X11 symbols: in hw/nxagent: $DOC_FILE" cd nx-X11/programs/Xserver/hw/nxagent/ -cat "../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; do +grep -v -E "^#" "../../../../../$SYMBOLS_FILE" | while read -r symbol; do echo echo "#### $symbol ####" @@ -48,7 +48,7 @@ cd - 1>/dev/null DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_nxcompext.txt" echo "Scanning for libNX_X11 symbols: in hw/nxagent/compext: $DOC_FILE" cd nx-X11/programs/Xserver/hw/nxagent/compext/ -cat "../../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; do +grep -v -E "^#" "../../../../../../$SYMBOLS_FILE" | while read -r symbol; do echo echo "#### $symbol ####" @@ -65,7 +65,7 @@ SYMBOLS_FILE="doc/nxcompext/symbols/nxcompext::symbols.txt" DOC_FILE="doc/nxcompext/symbols/nxcompext::symbol-usage_internally.txt" echo "Scanning for nxcompext symbols: in hw/nxagent/compext internally: $DOC_FILE" cd nx-X11/programs/Xserver/hw/nxagent/compext/ -cat "../../../../../../$SYMBOLS_FILE" | grep -v -E "^#" | while read -r symbol; do +grep -v -E "^#" "../../../../../../$SYMBOLS_FILE" | while read -r symbol; do echo echo "#### $symbol ####" @@ -77,7 +77,7 @@ cd - 1>/dev/null DOC_FILE="doc/nxcompext/symbols/nxcompext::symbol-usage_nxagent.txt" echo "Scanning for nxcompext symbols: in hw/nxagent: $DOC_FILE" cd nx-X11/programs/Xserver/hw/nxagent/ -cat ../../../../../$SYMBOLS_FILE | grep -v -E "^#" | while read -r symbol; do +grep -v -E "^#" "../../../../../$SYMBOLS_FILE" | while read -r symbol; do echo echo "#### $symbol ####" diff --git a/roll-tarballs.sh b/roll-tarballs.sh index 5d0b7c215..2e2a19f7a 100755 --- a/roll-tarballs.sh +++ b/roll-tarballs.sh @@ -161,7 +161,7 @@ if [ "x$MODE" = "xfull" ]; then find nx-X11/extras/Mesa/ -name descrip.mms | while read -r file; do rm "$file"; done # this is for 3.5.0.x only... - cat "debian/patches/series" | sort | grep -v '^#' | egrep "([0-9]+(_|-).*\.(full|full\+lite)\.patch)" | while read -r file + sort "debian/patches/series" | grep -v '^#' | egrep "([0-9]+(_|-).*\.(full|full\+lite)\.patch)" | while read -r file do cp -v "debian/patches/$file" "doc/applied-patches/" echo "${file##*/}" >> "doc/applied-patches/series" @@ -198,7 +198,7 @@ else mv LICENSE.nxcomp LICENSE # this is for 3.5.0.x only... - cat "debian/patches/series" | sort | grep -v '^#' | egrep "([0-9]+(_|-).*\.full\+lite\.patch)" | while read -r file + sort "debian/patches/series" | grep -v '^#' | egrep "([0-9]+(_|-).*\.full\+lite\.patch)" | while read -r file do cp -v "debian/patches/$file" "doc/applied-patches/" echo "${file##*/}" >> "doc/applied-patches/series" -- 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 3.6.x in repository nx-libs. commit 770f468cd56cdd4c82bf4973a3505a3e8e4f01b4 Merge: e5746df80 cbd9875e5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Feb 3 14:46:20 2021 +0100 Merge branch 'uli42-pr/windowfixes' into 3.6.x Attributes GH PR #994: https://github.com/ArcticaProject/nx-libs/pull/994 nx-X11/programs/Xserver/dix/property.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 - nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 153 +++++++++--------------- nx-X11/programs/Xserver/hw/nxagent/Window.c | 27 +++-- nx-X11/programs/Xserver/hw/nxagent/Windows.h | 2 - 5 files changed, 74 insertions(+), 116 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 3.6.x in repository nx-libs. commit afe0c1473a09120bcd3aa9c6bd853529df4d896f Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 14:59:40 2021 +0100 shellcheck: Fix SC2196 issues See, $ find . -name "*.sh" | xargs shellcheck -i SC2196 In ./roll-tarballs.sh line 163: sort "debian/patches/series" | grep -v '^#' | egrep "([0-9]+(_|-).*\.(full|full\+lite)\.patch)" | while read -r file ^---^ SC2196: egrep is non-standard and deprecated. Use grep -E instead. In ./roll-tarballs.sh line 200: sort "debian/patches/series" | grep -v '^#' | egrep "([0-9]+(_|-).*\.full\+lite\.patch)" | while read -r file ^---^ SC2196: egrep is non-standard and deprecated. Use grep -E instead. For more information: https://www.shellcheck.net/wiki/SC2196 -- egrep is non-standard and depreca... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- roll-tarballs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roll-tarballs.sh b/roll-tarballs.sh index 1a5fac626..47b503a71 100755 --- a/roll-tarballs.sh +++ b/roll-tarballs.sh @@ -160,7 +160,7 @@ if [ "x$MODE" = "xfull" ]; then find nx-X11/extras/Mesa/ -name descrip.mms | while read -r file; do rm "$file"; done # this is for 3.5.0.x only... - sort "debian/patches/series" | grep -v '^#' | egrep "([0-9]+(_|-).*\.(full|full\+lite)\.patch)" | while read -r file + sort "debian/patches/series" | grep -v '^#' | grep -E "([0-9]+(_|-).*\.(full|full\+lite)\.patch)" | while read -r file do cp -v "debian/patches/$file" "doc/applied-patches/" echo "${file##*/}" >> "doc/applied-patches/series" @@ -197,7 +197,7 @@ else mv LICENSE.nxcomp LICENSE # this is for 3.5.0.x only... - sort "debian/patches/series" | grep -v '^#' | egrep "([0-9]+(_|-).*\.full\+lite\.patch)" | while read -r file + sort "debian/patches/series" | grep -v '^#' | grep -E "([0-9]+(_|-).*\.full\+lite\.patch)" | while read -r file do cp -v "debian/patches/$file" "doc/applied-patches/" echo "${file##*/}" >> "doc/applied-patches/series" -- 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 3.6.x in repository nx-libs. commit 5121188f08680b49deb6a3cc7362222a1797607c Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Jan 31 19:20:25 2021 +0100 NXproperty.c: reorder functions Make it obvious that GetWindowProperty() and ChangeWindowProperty are not derived from dix. --- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 60 +++++++++++++------------ 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 7cf41f241..8461f4a30 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -208,28 +208,6 @@ ProcChangeProperty(ClientPtr client) } } -int -ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, - int mode, unsigned long len, void * value, - Bool sendevent) -{ - int sizeInBytes = format>>3; - int totalSize = len * sizeInBytes; - int copySize = nxagentOption(CopyBufferSize); - - if (copySize != COPY_UNLIMITED && property == clientCutProperty) - { - if (totalSize > copySize) - { - totalSize = copySize; - totalSize = totalSize - (totalSize % sizeInBytes); - len = totalSize / sizeInBytes; - } - } - - return xorg_ChangeWindowProperty(pWin, property, type, format, mode, len, value, sendevent); -} - /***************** * GetProperty * If type Any is specified, returns the property from the specified @@ -443,6 +421,20 @@ ProcGetProperty(ClientPtr client) return(client->noClientException); } +int +ProcDeleteProperty(register ClientPtr client) +{ + REQUEST(xDeletePropertyReq); + REQUEST_SIZE_MATCH(xDeletePropertyReq); + /* prevent clients from deleting the NX_AGENT_VERSION property */ + if (stuff->property == MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True)) + return client->noClientException; + + return xorg_ProcDeleteProperty(client); +} + +/* ---------------------------------------------------------------------- */ + /* * GetWindowProperty is the internal implementation of the * XGetWindowProperty() Xlib call. It is called from @@ -572,13 +564,23 @@ GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, } int -ProcDeleteProperty(register ClientPtr client) +ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, + int mode, unsigned long len, void * value, + Bool sendevent) { - REQUEST(xDeletePropertyReq); - REQUEST_SIZE_MATCH(xDeletePropertyReq); - /* prevent clients from deleting the NX_AGENT_VERSION property */ - if (stuff->property == MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True)) - return client->noClientException; + int sizeInBytes = format>>3; + int totalSize = len * sizeInBytes; + int copySize = nxagentOption(CopyBufferSize); - return xorg_ProcDeleteProperty(client); + if (copySize != COPY_UNLIMITED && property == clientCutProperty) + { + if (totalSize > copySize) + { + totalSize = copySize; + totalSize = totalSize - (totalSize % sizeInBytes); + len = totalSize / sizeInBytes; + } + } + + return xorg_ChangeWindowProperty(pWin, property, type, format, mode, len, value, sendevent); } -- 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 3.6.x in repository nx-libs. commit 8ce12d613a570710b9e1c7fa179b6d0cafd9de0f Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 15:07:18 2021 +0100 shellcheck: Fix SC2061 issue $ find . -name "*.sh" | xargs shellcheck -i SC2061 In ./roll-tarballs.sh line 159: find nx-X11/extras/Mesa/ -name Makefile.* | while read -r file; do rm "$file"; done ^--------^ SC2061: Quote the parameter to -name so the shell won't interpret it. For more information: https://www.shellcheck.net/wiki/SC2061 -- Quote the parameter to -name so t... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- roll-tarballs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roll-tarballs.sh b/roll-tarballs.sh index 47b503a71..c9af13102 100755 --- a/roll-tarballs.sh +++ b/roll-tarballs.sh @@ -156,7 +156,7 @@ if [ "x$MODE" = "xfull" ]; then rm -f "nx-X11/extras/Mesa/src/mesa/main/"{mesa.def,Imakefile,vsnprintf.c} find nx-X11/extras/Mesa/ -name Makefile | while read -r file; do rm "$file"; done - find nx-X11/extras/Mesa/ -name Makefile.* | while read -r file; do rm "$file"; done + find nx-X11/extras/Mesa/ -name 'Makefile.*' | while read -r file; do rm "$file"; done find nx-X11/extras/Mesa/ -name descrip.mms | while read -r file; do rm "$file"; done # this is for 3.5.0.x only... -- 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 3.6.x in repository nx-libs. commit cbd9875e5ca3169d5aaa995e73ec1f67f29ca743 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Feb 3 13:38:59 2021 +0100 Window.c: add another FIXME --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index ba93c96cb..5f12fd48a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3087,6 +3087,11 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer #endif /* FIXME: use XAllocSizeHints() */ + /* FIXME: all this copying is only done because the first + element of the XSizeHints struct is a long which is of + different size on 32bit vs. 64bit platforms. We should + rewrite this to better readable and probably more robust + code */ #ifdef _XSERVER64 data64 = (unsigned char *) malloc(sizeof(XSizeHints) + 4); if (data64) -- 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 3.6.x in repository nx-libs. commit 407651b39e5d6dc1f74716e38a54e315bb251ae3 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 15:03:17 2021 +0100 shellcheck: Fix SC2048 issue See, $ find . -name "*.sh" | xargs shellcheck -i SC2048 In ./nx-X11/lib/src/util/mkks.sh line 10: }' $* ^-- SC2048: Use "$@" (with quotes) to prevent whitespace problems. For more information: https://www.shellcheck.net/wiki/SC2048 -- Use "$@" (with quotes) to prevent... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- nx-X11/lib/src/util/mkks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/lib/src/util/mkks.sh b/nx-X11/lib/src/util/mkks.sh index 1831081f9..7af0e51ab 100644 --- a/nx-X11/lib/src/util/mkks.sh +++ b/nx-X11/lib/src/util/mkks.sh @@ -7,4 +7,4 @@ awk 'BEGIN { \ /^#define/ { \ len = length($2)-3; \ printf("{ \"%s\", %s },\n", substr($2,4,len), $3); \ -}' $* +}' "$@" -- 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 3.6.x in repository nx-libs. commit f92e1a5a298c505e64f32c3da62ca4ddcd3df990 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:19:21 2021 +0100 Screen.c: Fix fullscreen (onescreen) at startup Fixes ArcticaProject/nx-libs#991 --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 33 +++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index a6b312aaa..c51302e6d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -322,6 +322,12 @@ Bool nxagentIsParentOf(Display *d, XlibWindow possible_parent, XlibWindow candid */ void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) { + if (nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) + { + nxagentSwitchFullscreen(pScreen, False); + return; + } + XUnmapWindow(nxagentDisplay, nxagentFullscreenWindow); XIconifyWindow(nxagentDisplay, nxagentIconWindow, DefaultScreen(nxagentDisplay)); @@ -337,6 +343,12 @@ void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) */ void nxagentMaximizeToFullScreen(ScreenPtr pScreen) { + if (nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) + { + nxagentSwitchFullscreen(pScreen, True); + return; + } + /* XUnmapWindow(nxagentDisplay, nxagentIconWindow); */ @@ -992,8 +1004,25 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) nxagentChangeOption(X, 0); nxagentChangeOption(Y, 0); - nxagentChangeOption(Width, w); - nxagentChangeOption(Height, h); + /* + * Fullscreen will use the window manager on the remote X + * server. We need to size the window appropriately because the + * window manager stores the size and restores it when fullscreen + * mode is left. In AllScreens mode the window manager is + * instructed to not draw any window decorations. Here we need the + * full width to cover the whole screen. + */ + + if (nxagentOption(AllScreens)) + { + nxagentChangeOption(Width, w); + nxagentChangeOption(Height, h); + } + else + { + nxagentChangeOption(Width, w * 3 / 4); + nxagentChangeOption(Height, h * 3 / 4); + } /* first time screen initialization or resize during reconnect */ if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup) -- 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 3.6.x in repository nx-libs. commit 06724dfe03bcff422a7d518841757f4fa2e563f6 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 17:23:49 2021 +0100 Screen.c: rephrase comment --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index c51302e6d..b87c1e225 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -483,8 +483,8 @@ Window nxagentCreateIconWindow(void) if (-1 == asprintf(&winname, "%s Icon", nxagentWindowName)) { /* If memory allocation wasn't possible, or some other error - occurs, these functions will return -1, and the contents of - winname are undefined. */ + occurs, asprintf() will return -1, and the content of + winname is undefined. */ winname = NULL; } #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 3.6.x in repository nx-libs. commit f696a57f8f17b87deca8079ac9a71d184bfedb53 Merge: 770f468cd 06724dfe0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Feb 3 14:49:32 2021 +0100 Merge branch 'uli42-pr/fix_onescreen' into 3.6.x Attributes GH PR #995: https://github.com/ArcticaProject/nx-libs/pull/995 nx-X11/programs/Xserver/hw/nxagent/Screen.c | 37 +++++++++++++++++++++++++---- 1 file changed, 33 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 3.6.x in repository nx-libs. commit 150e9bda9f47e004291f169e7493500cc5b0be74 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:08 2021 +0100 nxagent: drop unused nxagentVisibility variables --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 -- nx-X11/programs/Xserver/hw/nxagent/Windows.h | 2 -- 3 files changed, 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 8e2313eac..a342cdee1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2067,8 +2067,6 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (nxagentOption(Fullscreen)) { nxagentVisibility = VisibilityUnobscured; - nxagentVisibilityStop = False; - nxagentVisibilityTimeout = GetTimeInMillis() + 2000; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index d95f8f3ed..adf54b717 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -80,8 +80,6 @@ int nxagentWindowPrivateIndex; */ int nxagentVisibility = VisibilityUnobscured; -unsigned long nxagentVisibilityTimeout = 0; -Bool nxagentVisibilityStop = False; ConfiguredWindowStruct *nxagentConfiguredWindowList; StaticResizedWindowStruct *nxagentStaticResizedWindowList; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Windows.h b/nx-X11/programs/Xserver/hw/nxagent/Windows.h index 8666ebec9..df27d4e53 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Windows.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Windows.h @@ -256,8 +256,6 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask); */ extern int nxagentVisibility; -extern unsigned long nxagentVisibilityTimeout; -extern Bool nxagentVisibilityStop; /* * Return the pointer to the window given the remote id. It tries to -- 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 3.6.x in repository nx-libs. commit 969d9af23c77d90abe9d9607d142d668b1ab432e Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:21 2021 +0100 NXproperty.c: GetWindowProperty(): add more comments, restruct prototype --- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 35 +++++++++++-------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 9e14a3cca..f4979ceb3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -446,25 +446,20 @@ ProcGetProperty(ClientPtr client) return(client->noClientException); } -#ifdef NXAGENT_CLIPBOARD -/* GetWindowProperty clipboard use only */ -/* FIXME: that's wrong, it is also called in Window.c and Events.c */ -/* FIXME: should be moved to a different file, is not derived from - dix */ +/* + * GetWindowProperty is the internal implementation of the + * XGetWindowProperty() Xlib call. It is called from + * Clipboard.c, Window.c and Events.c + * + * FIXME: should be moved to a different file, is not derived from + * dix + */ int -GetWindowProperty(pWin, property, longOffset, longLength, delete, - type, actualType, format, nItems, bytesAfter, propData ) - WindowPtr pWin; - Atom property; - long longOffset; - long longLength; - Bool delete; - Atom type; - Atom *actualType; - int *format; - unsigned long *nItems; - unsigned long *bytesAfter; - unsigned char **propData; +GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, + long longLength, Bool delete, Atom type, + Atom *actualType, int *format, unsigned + long *nItems, unsigned long *bytesAfter, + unsigned char **propData) { if (!pWin) { @@ -527,7 +522,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, * Return type, format, value to client */ unsigned long n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - unsigned long ind = longOffset << 2; + unsigned long ind = longOffset << 2; /* byte offset */ /* If longOffset is invalid such that it causes "len" to be negative, it's a value error. */ @@ -540,6 +535,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, return BadValue; } + /* minimum of prop size and requested size */ unsigned long len = min(n - ind, 4 * longLength); *bytesAfter = n - (ind + len); @@ -577,7 +573,6 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, } return Success; } -#endif int ProcDeleteProperty(register ClientPtr client) -- 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 3.6.x in repository nx-libs. commit da9ac92e9729308bcaabd76cf2a9b37b7acca9ec Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:23 2021 +0100 NXproperty.c, dix.c: simplify ProcDeleteProperty() by calling the dix version after a check --- nx-X11/programs/Xserver/dix/property.c | 6 ++-- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 48 +++---------------------- 2 files changed, 9 insertions(+), 45 deletions(-) diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index f0bfe1e65..37af8d592 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -661,9 +661,12 @@ ProcListProperties(ClientPtr client) return(client->noClientException); } -#ifndef NXAGENT_SERVER int +#ifdef NXAGENT_SERVER +xorg_ProcDeleteProperty(register ClientPtr client) +#else ProcDeleteProperty(register ClientPtr client) +#endif { WindowPtr pWin; REQUEST(xDeletePropertyReq); @@ -699,4 +702,3 @@ ProcDeleteProperty(register ClientPtr client) else return(result); } -#endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index f4979ceb3..7cf41f241 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -180,11 +180,8 @@ ProcChangeProperty(ClientPtr client) #ifdef NXAGENT_SERVER /* prevent clients from changing the NX_AGENT_VERSION property */ - { - Atom prop = MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True); - if (stuff->property == prop) - return client->noClientException; - } + if (stuff->property == MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True)) + return client->noClientException; #endif err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format, @@ -577,46 +574,11 @@ GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, int ProcDeleteProperty(register ClientPtr client) { - WindowPtr pWin; REQUEST(xDeletePropertyReq); - int result; - REQUEST_SIZE_MATCH(xDeletePropertyReq); - UpdateCurrentTime(); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - DixWriteAccess); - if (!pWin) - return(BadWindow); - if (!ValidAtom(stuff->property)) - { - client->errorValue = stuff->property; - return (BadAtom); - } - -#ifdef XCSECURITY - switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - DixDestroyAccess)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return Success; - } -#endif - -#ifdef NXAGENT_SERVER /* prevent clients from deleting the NX_AGENT_VERSION property */ - { - Atom prop = MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True); - if (stuff->property == prop) - return client->noClientException; - } -#endif + if (stuff->property == MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True)) + return client->noClientException; - result = DeleteProperty(pWin, stuff->property); - if (client->noClientException != Success) - return(client->noClientException); - else - return(result); + return xorg_ProcDeleteProperty(client); } -- 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 3.6.x in repository nx-libs. commit 513418ace94fa4e57917d5145381d05050e3e160 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:17 2021 +0100 NXproperty.c: clean returns remove unneccessary parentheses --- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 97665d22e..3ca79cea7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -482,14 +482,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, #ifdef DEBUG fprintf(stderr, "%s: invalid atom [%d]\n", __func__, property); #endif - return(BadAtom); + return BadAtom; } if ((type != AnyPropertyType) && !ValidAtom(type)) { #ifdef DEBUG fprintf(stderr, "%s: invalid type [%d]\n", __func__, type); #endif - return(BadAtom); + return BadAtom; } pProp = wUserProps (pWin); @@ -508,7 +508,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, #ifdef DEBUG fprintf(stderr, "%s: property not found [%d]\n", __func__, property); #endif - return (BadAtom); + return BadAtom; } /* If the request type and actual type don't match. Return the @@ -577,7 +577,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, free(pProp->data); free(pProp); } - return(Success); + return Success; } #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 3.6.x in repository nx-libs. commit 82028465cd5b92ad7c5bffd6333ee57e13ce8045 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Jan 31 19:20:25 2021 +0100 NXproperty.c: reorder functions Make it obvious that GetWindowProperty() and ChangeWindowProperty are not derived from dix. --- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 60 +++++++++++++------------ 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 7cf41f241..8461f4a30 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -208,28 +208,6 @@ ProcChangeProperty(ClientPtr client) } } -int -ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, - int mode, unsigned long len, void * value, - Bool sendevent) -{ - int sizeInBytes = format>>3; - int totalSize = len * sizeInBytes; - int copySize = nxagentOption(CopyBufferSize); - - if (copySize != COPY_UNLIMITED && property == clientCutProperty) - { - if (totalSize > copySize) - { - totalSize = copySize; - totalSize = totalSize - (totalSize % sizeInBytes); - len = totalSize / sizeInBytes; - } - } - - return xorg_ChangeWindowProperty(pWin, property, type, format, mode, len, value, sendevent); -} - /***************** * GetProperty * If type Any is specified, returns the property from the specified @@ -443,6 +421,20 @@ ProcGetProperty(ClientPtr client) return(client->noClientException); } +int +ProcDeleteProperty(register ClientPtr client) +{ + REQUEST(xDeletePropertyReq); + REQUEST_SIZE_MATCH(xDeletePropertyReq); + /* prevent clients from deleting the NX_AGENT_VERSION property */ + if (stuff->property == MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True)) + return client->noClientException; + + return xorg_ProcDeleteProperty(client); +} + +/* ---------------------------------------------------------------------- */ + /* * GetWindowProperty is the internal implementation of the * XGetWindowProperty() Xlib call. It is called from @@ -572,13 +564,23 @@ GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, } int -ProcDeleteProperty(register ClientPtr client) +ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, + int mode, unsigned long len, void * value, + Bool sendevent) { - REQUEST(xDeletePropertyReq); - REQUEST_SIZE_MATCH(xDeletePropertyReq); - /* prevent clients from deleting the NX_AGENT_VERSION property */ - if (stuff->property == MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True)) - return client->noClientException; + int sizeInBytes = format>>3; + int totalSize = len * sizeInBytes; + int copySize = nxagentOption(CopyBufferSize); - return xorg_ProcDeleteProperty(client); + if (copySize != COPY_UNLIMITED && property == clientCutProperty) + { + if (totalSize > copySize) + { + totalSize = copySize; + totalSize = totalSize - (totalSize % sizeInBytes); + len = totalSize / sizeInBytes; + } + } + + return xorg_ChangeWindowProperty(pWin, property, type, format, mode, len, value, sendevent); } -- 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 3.6.x in repository nx-libs. commit 3cabdfa2a0f799d7c9278da1b6f333961e670428 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:19 2021 +0100 NXproperty.c: simplify and reformat GetWindowProperty() --- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 3ca79cea7..9e14a3cca 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -466,9 +466,6 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, unsigned long *bytesAfter; unsigned char **propData; { - PropertyPtr pProp, prevProp; - unsigned long n, len, ind; - if (!pWin) { #ifdef DEBUG @@ -484,6 +481,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, #endif return BadAtom; } + if ((type != AnyPropertyType) && !ValidAtom(type)) { #ifdef DEBUG @@ -492,8 +490,8 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, return BadAtom; } - pProp = wUserProps (pWin); - prevProp = (PropertyPtr)NULL; + PropertyPtr pProp = wUserProps (pWin); + PropertyPtr prevProp = (PropertyPtr)NULL; while (pProp) { @@ -522,14 +520,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, *format = pProp->format; *nItems = 0; *actualType = pProp->type; - return(Success); + return Success; } /* * Return type, format, value to client */ - n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ - ind = longOffset << 2; + unsigned long n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ + unsigned long ind = longOffset << 2; /* If longOffset is invalid such that it causes "len" to be negative, it's a value error. */ @@ -542,7 +540,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, return BadValue; } - len = min(n - ind, 4 * longLength); + unsigned long len = min(n - ind, 4 * longLength); *bytesAfter = n - (ind + len); *format = pProp->format; @@ -566,7 +564,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, } if (delete && (*bytesAfter == 0)) - { /* delete the Property */ + { /* delete the property */ if (prevProp == (PropertyPtr)NULL) /* takes care of head */ { if (!(pWin->optional->userProps = pProp->next)) -- 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 3.6.x in repository nx-libs. commit 19b639b910fadac9ef24ec1ef9bf774ad4e78a71 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:10:14 2021 +0100 Window.c: Fix 32bit code path make it compile again Thanks to Simon Matter for reporting this and the patch. Fixes ArcticaProject/nx-libs#993 --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index adf54b717..ba93c96cb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3089,8 +3089,8 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer /* FIXME: use XAllocSizeHints() */ #ifdef _XSERVER64 data64 = (unsigned char *) malloc(sizeof(XSizeHints) + 4); - if (data64) - { + if (data64) + { for (int i = 0; i < 4; i++) { *(data64 + i) = *(data + i); @@ -3104,18 +3104,18 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer } XSizeHints *props = (XSizeHints *) data64; - #else - XSizeHints *props = (XSizeHints *) data; - #endif /* _XSERVER64 */ - hints = *props; - } - else - { + } + else + { #ifdef WARNING fprintf(stderr, "%s: Failed to alloc memory for XSizeHints\n", __func__); #endif - } + } + #else + XSizeHints *props = (XSizeHints *) data; + hints = *props; + #endif /* _XSERVER64 */ } else { -- 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 3.6.x in repository nx-libs. commit 9d0364198e1e161e540e05757f40935f7018d8d6 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 17:23:49 2021 +0100 Screen.c: rephrase comment --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index c51302e6d..b87c1e225 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -483,8 +483,8 @@ Window nxagentCreateIconWindow(void) if (-1 == asprintf(&winname, "%s Icon", nxagentWindowName)) { /* If memory allocation wasn't possible, or some other error - occurs, these functions will return -1, and the contents of - winname are undefined. */ + occurs, asprintf() will return -1, and the content of + winname is undefined. */ winname = NULL; } #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 3.6.x in repository nx-libs. commit 3e02494cbc29d2a40b377cc803eae3eb50911e11 Merge: f696a57f8 9d0364198 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Feb 3 14:53:40 2021 +0100 Merge branch 'mjtrangoni-fix-shellcheck-issues' into 3.6.x Attributes GH PR #996: https://github.com/ArcticaProject/nx-libs/pull/996 nx-X11/lib/src/util/mkks.sh | 4 ++-- nx-X11/x-indent-all.sh | 2 +- nx-X11/x-indent.sh | 2 +- regenerate-symbol-docs.sh | 20 ++++++++++---------- replace.sh | 2 ++ roll-tarballs.sh | 20 ++++++++++---------- version.sh | 2 +- 7 files changed, 27 insertions(+), 25 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 3.6.x in repository nx-libs. commit 0e2b7971343845248353f6d8503e28506e9536ea Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Feb 4 14:34:56 2021 +0100 release 3.5.99.26 --- AUTHORS | 0 ChangeLog | 706 ++++++++++++++++++++++- VERSION | 2 +- debian/changelog | 7 + nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb | Bin 206452 -> 206452 bytes nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 2 +- nx-libs.spec | 4 +- nxdialog/bin/nxdialog | 4 +- nxdialog/man/nxdialog.1 | 2 +- nxproxy/man/nxproxy.1 | 2 +- 10 files changed, 719 insertions(+), 10 deletions(-) diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 000000000..e69de29bb diff --git a/ChangeLog b/ChangeLog index ff0901620..0e2235885 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,708 @@ -2020-11-04 13:43:58 +0100 Mike Gabriel +2021-02-04 14:34:56 +0100 Mike Gabriel - * release 3.5.99.25 (HEAD -> 3.6.x, tag: 3.5.99.25) + * release 3.5.99.26 (HEAD -> 3.6.x, tag: 3.5.99.26) + +2021-02-03 14:53:40 +0100 Mike Gabriel (3e02494cb) + + * Merge branch 'mjtrangoni-fix-shellcheck-issues' into 3.6.x + +2021-01-30 17:23:49 +0100 Ulrich Sibiller (9d0364198) + + * Screen.c: rephrase comment + +2021-01-30 16:19:21 +0100 Ulrich Sibiller (b09f5e03e) + + * Screen.c: Fix fullscreen (onescreen) at startup + +2021-02-03 13:38:59 +0100 Ulrich Sibiller (6d8ccec75) + + * Window.c: add another FIXME + +2021-01-31 19:20:25 +0100 Ulrich Sibiller (82028465c) + + * NXproperty.c: reorder functions + +2021-01-30 16:10:23 +0100 Ulrich Sibiller (da9ac92e9) + + * NXproperty.c, dix.c: simplify ProcDeleteProperty() + +2021-01-30 16:10:21 +0100 Ulrich Sibiller (969d9af23) + + * NXproperty.c: GetWindowProperty(): add more comments, restruct + prototype + +2021-01-30 16:10:19 +0100 Ulrich Sibiller (3cabdfa2a) + + * NXproperty.c: simplify and reformat GetWindowProperty() + +2021-01-30 16:10:17 +0100 Ulrich Sibiller (513418ace) + + * NXproperty.c: clean returns + +2021-01-30 16:10:14 +0100 Ulrich Sibiller (19b639b91) + + * Window.c: Fix 32bit code path + +2021-01-30 16:10:08 +0100 Ulrich Sibiller (150e9bda9) + + * nxagent: drop unused nxagentVisibility variables + +2021-02-03 14:49:32 +0100 Mike Gabriel (f696a57f8) + + * Merge branch 'uli42-pr/fix_onescreen' into 3.6.x + +2021-01-30 17:23:49 +0100 Ulrich Sibiller (06724dfe0) + + * Screen.c: rephrase comment + +2021-01-30 16:19:21 +0100 Ulrich Sibiller (f92e1a5a2) + + * Screen.c: Fix fullscreen (onescreen) at startup + +2021-02-03 14:46:20 +0100 Mike Gabriel (770f468cd) + + * Merge branch 'uli42-pr/windowfixes' into 3.6.x + +2021-02-03 13:38:59 +0100 Ulrich Sibiller (cbd9875e5) + + * Window.c: add another FIXME + +2021-01-31 19:20:25 +0100 Ulrich Sibiller (5121188f0) + + * NXproperty.c: reorder functions + +2021-01-31 15:07:18 +0100 Mario Trangoni (8ce12d613) + + * shellcheck: Fix SC2061 issue + +2021-01-31 15:03:17 +0100 Mario Trangoni (407651b39) + + * shellcheck: Fix SC2048 issue + +2021-01-31 14:59:40 +0100 Mario Trangoni (afe0c1473) + + * shellcheck: Fix SC2196 issues + +2021-01-31 14:57:29 +0100 Mario Trangoni (930fbe08b) + + * shellcheck: Fix SC2034 issue + +2021-01-31 14:53:37 +0100 Mario Trangoni (22b40e690) + + * shellcheck: Fix SC2002 issue + +2021-01-31 14:43:47 +0100 Mario Trangoni (2168bc689) + + * shellcheck: Fix SC2045 issue + +2021-01-31 14:38:08 +0100 Mario Trangoni (747a33744) + + * shellcheck: Fix some SC2086 issues + +2021-01-31 14:31:41 +0100 Mario Trangoni (18aca1f69) + + * shellcheck: Fix SC2059 issue + +2021-01-31 14:27:45 +0100 Mario Trangoni (cb6e3b7d3) + + * shellcheck: Fix SC2148 issues + +2021-01-31 14:23:06 +0100 Mario Trangoni (daeb82e33) + + * shellcheck: Fix SC2162 issue + +2021-01-31 14:17:39 +0100 Mario Trangoni (5b628e2d7) + + * shellcheck: Fix SC2006 issue + +2021-01-30 16:10:23 +0100 Ulrich Sibiller (d627e948f) + + * NXproperty.c, dix.c: simplify ProcDeleteProperty() + +2021-01-30 16:10:21 +0100 Ulrich Sibiller (b8b1edb2b) + + * NXproperty.c: GetWindowProperty(): add more comments, restruct + prototype + +2021-01-30 16:10:19 +0100 Ulrich Sibiller (8b2b41113) + + * NXproperty.c: simplify and reformat GetWindowProperty() + +2021-01-30 16:10:17 +0100 Ulrich Sibiller (5a00da5ec) + + * NXproperty.c: clean returns + +2021-01-30 16:10:14 +0100 Ulrich Sibiller (ee60cc50c) + + * Window.c: Fix 32bit code path + +2021-01-30 16:10:08 +0100 Ulrich Sibiller (57e662b83) + + * nxagent: drop unused nxagentVisibility variables + +2021-01-18 11:44:24 +0100 Mike Gabriel (e5746df80) + + * debian/patches: Drop + 2002_xserver-xext_set-securitypolicy-path.debian.patch. + Not required anymore since 689f811b. + +2021-01-18 11:41:47 +0100 Mike Gabriel (24b903be5) + + * Merge branch 'uli42-pr/drop_alternative_securitypolicy' into 3.6.x + +2021-01-16 23:31:12 +0100 Ulrich Sibiller (a26011503) + + * Xext: drop NX_ALTERNATIVEPOLICYFILE + +2021-01-16 23:29:04 +0100 Ulrich Sibiller (689f811ba) + + * Xext: use $USRDATADIR/SecurityPolicy + +2021-01-18 11:37:25 +0100 Mike Gabriel (f4782bbd2) + + * Merge branch 'uli42-pr/fix_fullscreen' into 3.6.x + +2021-01-16 22:31:44 +0100 Ulrich Sibiller (e156bdc03) + + * Args.c: improve usage string for -geometry + +2021-01-16 22:13:05 +0100 Ulrich Sibiller (a83ec33d5) + + * Screen.c: remove superflous code that produces a crash + +2021-01-16 00:28:13 +0100 Mike Gabriel (f60ac5777) + + * Merge branch 'uli42-pr/musl_fixes' into 3.6.x + +2021-01-04 20:44:24 +0100 Ulrich Sibiller (46c9c493f) + + * Xext: include limits.h + +2021-01-04 20:41:32 +0100 Ulrich Sibiller (8b6d454cf) + + * Mesa: make compilation with work with musl + +2021-01-16 00:24:10 +0100 Mike Gabriel (8c3bb2715) + + * Merge branch 'uli42-pr/pvs_findings' into 3.6.x + +2021-01-15 18:24:26 +0100 Ulrich Sibiller (1b80750f6) + + * Display.c: fix and reformat broken comment + +2021-01-04 14:57:32 +0100 Ulrich Sibiller (669299de3) + + * Window.c: suppress warning + +2021-01-04 14:12:05 +0100 Ulrich Sibiller (12b96fd9a) + + * fix formatting and spelling in various files + +2021-01-04 14:11:31 +0100 Ulrich Sibiller (0a06ee77a) + + * nxagent: Drop unused nxagentRootTileWindow + +2020-12-31 01:45:36 +0100 Ulrich Sibiller (7aec57a40) + + * Handlers.c: add FIXME + +2020-12-31 00:07:15 +0100 Ulrich Sibiller (cc781ae2e) + + * Screen.c: clarify that characters are compared + +2020-12-30 13:22:05 +0100 Ulrich Sibiller (d1136ea2f) + + * Client.h: conditionally add unused field + +2020-11-09 21:17:45 +0100 Ulrich Sibiller (f64fac47e) + + * Handlers.c: use the same boolean values as in NXdispatch.c + +2020-11-09 22:54:49 +0100 Ulrich Sibiller (eef306c2d) + + * manpage: document defaults for options -defer and -tile + +2020-11-08 17:01:57 +0100 Ulrich Sibiller (35556cac9) + + * NXDispatch.c: remove double nxagentFreeAtomMap() + +2021-01-16 00:19:38 +0100 Mike Gabriel (b66699555) + + * Merge branch 'uli42-pr/various6' into 3.6.x + +2021-01-04 19:50:31 +0100 Ulrich Sibiller (4d95e29b8) + + * Window.c: check for malloc failure + +2021-01-04 19:44:37 +0100 Ulrich Sibiller (5ad0b4dde) + + * Window.c: check for malloc failure + +2021-01-04 19:07:06 +0100 Ulrich Sibiller (6214c71b3) + + * Screen.c: check for malloc failures + +2021-01-04 19:01:55 +0100 Ulrich Sibiller (a57097ad0) + + * Splash.c: remove unneccessary check + +2021-01-04 18:58:55 +0100 Ulrich Sibiller (1251e8347) + + * Rootless.c: prevent PVS error + +2021-01-04 18:13:49 +0100 Ulrich Sibiller (c1cae3c66) + + * Render.c: Init BoxRec + +2021-01-04 18:04:29 +0100 Ulrich Sibiller (8bb77997f) + + * Reconnect.c: fix possible realloc() memory loss + +2021-01-04 17:28:53 +0100 Ulrich Sibiller (948bbe50a) + + * NXglyph.c: check for malloc error + +2021-01-04 17:18:43 +0100 Ulrich Sibiller (7443fea69) + + * Keyboard.c: fix possible NULL pointer dereference + +2021-01-04 16:35:07 +0100 Ulrich Sibiller (e664d8201) + + * Drawable.c: Prevent PVS Studio warning + +2021-01-04 16:28:27 +0100 Ulrich Sibiller (67c7513bf) + + * Display.c: prevent PVS Studio realloc warning + +2021-01-04 16:17:36 +0100 Ulrich Sibiller (db134de3b) + + * Atoms.c: add explanation for PVS Studio warning + +2020-08-03 17:08:30 +0200 Ulrich Sibiller (5871100dd) + + * NXpicture.c: remove unneccessary check + +2020-08-03 17:02:29 +0200 Ulrich Sibiller (41bf83979) + + * Keyboard.c: simplify code + +2020-08-03 16:40:49 +0200 Ulrich Sibiller (5735e164e) + + * Colormap.c: remove unneccessary check + +2020-08-03 16:38:19 +0200 Ulrich Sibiller (28fef3bc0) + + * Colormap.c: fix parentheses + +2020-08-03 16:27:41 +0200 Ulrich Sibiller (36d7e152f) + + * Atoms.c: silence PVS Studio warning + +2020-08-03 16:26:12 +0200 Ulrich Sibiller (e991dbae9) + + * Atoms.c: cosmetics in nxagentWriteAtom() + +2020-08-03 16:25:00 +0200 Ulrich Sibiller (1529b3217) + + * Atoms.c: fix strlen(NULL) + +2021-01-15 18:24:26 +0100 Ulrich Sibiller (97a69b95a) + + * Display.c: fix and reformat broken comment + +2021-01-04 14:57:32 +0100 Ulrich Sibiller (21c631f4d) + + * Window.c: suppress warning + +2021-01-04 14:12:05 +0100 Ulrich Sibiller (6aff5bfdf) + + * fix formatting and spelling in various files + +2021-01-04 14:11:31 +0100 Ulrich Sibiller (c7f9ff0b6) + + * nxagent: Drop unused nxagentRootTileWindow + +2020-12-31 01:45:36 +0100 Ulrich Sibiller (63a39619c) + + * Handlers.c: add FIXME + +2020-12-31 00:07:15 +0100 Ulrich Sibiller (599334aff) + + * Screen.c: clarify that characters are compared + +2020-12-30 13:22:05 +0100 Ulrich Sibiller (dd5d8bc89) + + * Client.h: conditionally add unused field + +2020-11-09 21:17:45 +0100 Ulrich Sibiller (c1843ef88) + + * Handlers.c: use the same boolean values as in NXdispatch.c + +2020-11-09 22:54:49 +0100 Ulrich Sibiller (432cc0ca4) + + * manpage: document defaults for options -defer and -tile + +2020-11-08 17:01:57 +0100 Ulrich Sibiller (7c22dbfda) + + * NXDispatch.c: remove double nxagentFreeAtomMap() + +2021-01-15 17:09:21 +0100 Mike Gabriel (3523d15e2) + + * Merge branch 'uli42-pr/fullscreen_select' into 3.6.x + +2020-12-30 19:00:48 +0100 Ulrich Sibiller (e7b4440f2) + + * nxagent: make full screen mode selectable at startup + +2021-01-15 17:00:42 +0100 Mike Gabriel (125756157) + + * Revert "CVE-2020-14360: Check SetMap request length carefully." + +2021-01-15 16:38:23 +0100 Mike Gabriel (013a6ba3c) + + * Merge branch 'uli42-pr/fix_unusable_mouse_in_fullscreen' into 3.6.x + +2020-12-31 01:28:49 +0100 Ulrich Sibiller (f8b759263) + + * nxagent: nxagent(Default)WindowIsVisible() are Booleans + +2020-12-31 01:22:11 +0100 Ulrich Sibiller (108ed9d92) + + * Keyboard.c: noXkbExtension is a Boolean + +2020-12-31 01:20:00 +0100 Ulrich Sibiller (f4dd9d76a) + + * Font.c: Use Booleans where appropriate + +2020-12-31 01:10:33 +0100 Ulrich Sibiller (d2ba4ddb8) + + * nxagent: make nxagentXkbState.Initialized a Boolean + +2020-12-31 01:01:48 +0100 Ulrich Sibiller (f10e9d9ac) + + * Events.h: fix wrong prototype + +2020-12-31 00:58:04 +0100 Ulrich Sibiller (af7d8e3fa) + + * nxagent: make nxagentXFixesInfo.Initialized a Boolean + +2020-12-31 00:53:11 +0100 Ulrich Sibiller (b9c2db67b) + + * Drawable.c: make doRoundRobin a Boolean + +2020-12-31 00:49:57 +0100 Ulrich Sibiller (9aa339176) + + * Handlers.c: make synchronize a Boolean variable + +2020-12-31 00:49:38 +0100 Ulrich Sibiller (90178b548) + + * nxagent: make nxagentSkipImage a Boolean + +2020-12-31 00:46:18 +0100 Ulrich Sibiller (48279ae79) + + * nxagent: make nxagentForceSynchronization a Boolean + +2020-12-31 00:43:49 +0100 Ulrich Sibiller (1ed28c85b) + + * Drawable.c: make abort flag a Boolean + +2020-12-31 00:38:07 +0100 Ulrich Sibiller (ab83e4688) + + * Client.c: cleanup Boolean handling for nxagentNeedWakeup*() macros + +2020-12-31 00:36:20 +0100 Ulrich Sibiller (15cf1eee0) + + * GC.c: make internal variable and function Boolean + +2020-12-31 00:32:35 +0100 Ulrich Sibiller (e8a5e3287) + + * GCOps.c: make internal variable an function Booleans + +2020-12-31 00:24:41 +0100 Ulrich Sibiller (db3efd45c) + + * nxagent: make nxagentBlocking an Boolean + +2020-12-31 00:17:53 +0100 Ulrich Sibiller (af2964c7e) + + * Render.c: improve Boolean handling of + nxagentCheckPictureRemoteValue + +2020-12-31 00:14:35 +0100 Ulrich Sibiller (99ca67c2f) + + * nxagent: improve Boolean handling for Reconnect functions + +2020-12-31 00:03:44 +0100 Ulrich Sibiller (6c09c0b7e) + + * nxagent: make XDMCP variables Booleans + +2020-12-30 23:58:40 +0100 Ulrich Sibiller (1b91c8ac1) + + * GCOps.c: make internal function Boolean + +2020-12-30 23:57:00 +0100 Ulrich Sibiller (4303b1131) + + * GCOps.c: handle some internal variables as Booleans + +2020-12-30 23:54:50 +0100 Ulrich Sibiller (acf3e21f1) + + * Drawable.c: make some variables Booleans + +2020-12-30 23:52:32 +0100 Ulrich Sibiller (f6b386e65) + + * nxagent: handle RegionNil macro as Boolean + +2020-12-30 23:21:43 +0100 Ulrich Sibiller (059a37205) + + * Split.c, Image.c: make some internal variables Booleans + +2020-12-30 23:07:23 +0100 Ulrich Sibiller (5920e36e1) + + * nxagent: rework some Boolean checks + +2020-12-30 22:54:48 +0100 Ulrich Sibiller (6f4dbefbf) + + * nxagent: make nxagentUserDefinedFontPath a Boolean + +2020-12-30 22:50:51 +0100 Ulrich Sibiller (1b7f37a80) + + * nxagent: make nxagentShadowResize a Boolean + +2020-12-30 22:48:33 +0100 Ulrich Sibiller (3e093f9eb) + + * nxagent: make nxagentDoFullgeneration a Boolean + +2020-12-30 22:43:07 +0100 Ulrich Sibiller (090742b3b) + + * nxagent: some more Boolean improvements + +2020-12-30 22:34:03 +0100 Ulrich Sibiller (92c8325f3) + + * nxagent: treat nxagentLastWindowDestroyed as Boolean + +2020-12-30 22:31:01 +0100 Ulrich Sibiller (616d8619f) + + * nxagent: treat all Traps as Booleans everywhere + +2020-12-30 22:25:22 +0100 Ulrich Sibiller (c3b6dfe2e) + + * nxagent: make nxagentVerbose a Boolean + +2020-12-30 22:19:50 +0100 Ulrich Sibiller (8bb7d2cd1) + + * nxagent: make Desktop, Rootless and Binder options Booleans (again) + +2020-12-30 21:22:40 +0100 Ulrich Sibiller (1e4d8e32b) + + * Options.h: mark Booleans + +2020-12-30 21:21:19 +0100 Ulrich Sibiller (acb861df4) + + * nxagent: make nxagentOption Shadow a Boolean + +2020-12-30 20:07:57 +0100 Ulrich Sibiller (2565484f5) + + * nxagent: treat several nxagentOptions as real Booleans + +2020-12-30 19:27:15 +0100 Ulrich Sibiller (ca5a14743) + + * nxagent: treat DesktopResize and nxagentResizeDesktopAtStartup as + Booleans + +2020-12-30 19:20:56 +0100 Ulrich Sibiller (6e9b3a7f8) + + * nxagent: make Fullscreen and AllScreens Booleans + +2020-12-30 14:36:23 +0100 Ulrich Sibiller (262fe771c) + + * Handlers.c: ensure regular yields if suspended + +2020-12-10 10:24:29 +0100 Mike Gabriel (4eba4f53a) + + * CVE-2020-14360: Check SetMap request length carefully. + +2021-01-15 16:27:32 +0100 Mike Gabriel (faae65fb3) + + * Merge branch 'uli42-pr/rework_booleans_v2' into 3.6.x + +2020-12-31 01:28:49 +0100 Ulrich Sibiller (b44ecc0f8) + + * nxagent: nxagent(Default)WindowIsVisible() are Booleans + +2020-12-31 01:22:11 +0100 Ulrich Sibiller (d78837ec3) + + * Keyboard.c: noXkbExtension is a Boolean + +2020-12-31 01:20:00 +0100 Ulrich Sibiller (91cef61a0) + + * Font.c: Use Booleans where appropriate + +2020-12-31 01:10:33 +0100 Ulrich Sibiller (0bca321fb) + + * nxagent: make nxagentXkbState.Initialized a Boolean + +2020-12-31 01:01:48 +0100 Ulrich Sibiller (9e9568028) + + * Events.h: fix wrong prototype + +2020-12-31 00:58:04 +0100 Ulrich Sibiller (feb7b9773) + + * nxagent: make nxagentXFixesInfo.Initialized a Boolean + +2020-12-31 00:53:11 +0100 Ulrich Sibiller (b76dddcdc) + + * Drawable.c: make doRoundRobin a Boolean + +2020-12-31 00:49:57 +0100 Ulrich Sibiller (b814aef39) + + * Handlers.c: make synchronize a Boolean variable + +2020-12-31 00:49:38 +0100 Ulrich Sibiller (a9d3050c5) + + * nxagent: make nxagentSkipImage a Boolean + +2020-12-31 00:46:18 +0100 Ulrich Sibiller (c035ddead) + + * nxagent: make nxagentForceSynchronization a Boolean + +2020-12-31 00:43:49 +0100 Ulrich Sibiller (5d7b6db0c) + + * Drawable.c: make abort flag a Boolean + +2020-12-31 00:38:07 +0100 Ulrich Sibiller (54dd29cc6) + + * Client.c: cleanup Boolean handling for nxagentNeedWakeup*() macros + +2020-12-31 00:36:20 +0100 Ulrich Sibiller (2ce0fa8f0) + + * GC.c: make internal variable and function Boolean + +2020-12-31 00:32:35 +0100 Ulrich Sibiller (3151736d3) + + * GCOps.c: make internal variable an function Booleans + +2020-12-31 00:24:41 +0100 Ulrich Sibiller (e2ff39e04) + + * nxagent: make nxagentBlocking an Boolean + +2020-12-31 00:17:53 +0100 Ulrich Sibiller (94fd6d234) + + * Render.c: improve Boolean handling of + nxagentCheckPictureRemoteValue + +2020-12-31 00:14:35 +0100 Ulrich Sibiller (41d75f6b2) + + * nxagent: improve Boolean handling for Reconnect functions + +2020-12-31 00:03:44 +0100 Ulrich Sibiller (3cb0a134d) + + * nxagent: make XDMCP variables Booleans + +2020-12-30 23:58:40 +0100 Ulrich Sibiller (714a212fd) + + * GCOps.c: make internal function Boolean + +2020-12-30 23:57:00 +0100 Ulrich Sibiller (1239dffec) + + * GCOps.c: handle some internal variables as Booleans + +2020-12-30 23:54:50 +0100 Ulrich Sibiller (f98114c95) + + * Drawable.c: make some variables Booleans + +2020-12-30 23:52:32 +0100 Ulrich Sibiller (b8017065d) + + * nxagent: handle RegionNil macro as Boolean + +2020-12-30 23:21:43 +0100 Ulrich Sibiller (06833b964) + + * Split.c, Image.c: make some internal variables Booleans + +2020-12-30 23:07:23 +0100 Ulrich Sibiller (84bad7324) + + * nxagent: rework some Boolean checks + +2020-12-30 22:54:48 +0100 Ulrich Sibiller (f4adcbc59) + + * nxagent: make nxagentUserDefinedFontPath a Boolean + +2020-12-30 22:50:51 +0100 Ulrich Sibiller (fbc4a9158) + + * nxagent: make nxagentShadowResize a Boolean + +2020-12-30 22:48:33 +0100 Ulrich Sibiller (41f7a8b4a) + + * nxagent: make nxagentDoFullgeneration a Boolean + +2020-12-30 22:43:07 +0100 Ulrich Sibiller (73bdca0f8) + + * nxagent: some more Boolean improvements + +2020-12-30 22:34:03 +0100 Ulrich Sibiller (a72f77fc9) + + * nxagent: treat nxagentLastWindowDestroyed as Boolean + +2020-12-30 22:31:01 +0100 Ulrich Sibiller (fec462906) + + * nxagent: treat all Traps as Booleans everywhere + +2020-12-30 22:25:22 +0100 Ulrich Sibiller (42f76ddee) + + * nxagent: make nxagentVerbose a Boolean + +2020-12-30 22:19:50 +0100 Ulrich Sibiller (bd336c92b) + + * nxagent: make Desktop, Rootless and Binder options Booleans (again) + +2020-12-30 21:22:40 +0100 Ulrich Sibiller (7b299a4ce) + + * Options.h: mark Booleans + +2020-12-30 21:21:19 +0100 Ulrich Sibiller (f6cebfd85) + + * nxagent: make nxagentOption Shadow a Boolean + +2020-12-30 20:07:57 +0100 Ulrich Sibiller (2b4ccc30a) + + * nxagent: treat several nxagentOptions as real Booleans + +2020-12-30 19:27:15 +0100 Ulrich Sibiller (a85adf5ea) + + * nxagent: treat DesktopResize and nxagentResizeDesktopAtStartup as + Booleans + +2020-12-30 19:20:56 +0100 Ulrich Sibiller (de5eb54c6) + + * nxagent: make Fullscreen and AllScreens Booleans + +2021-01-15 15:48:49 +0100 Mike Gabriel (d545afdf3) + + * Merge branch 'uli42-pr/fix_resume' into 3.6.x + +2021-01-12 22:11:49 +0100 Ulrich Sibiller (89b37de7c) + + * Init.c: Initialize nxagentGrabServerInfo + +2020-12-30 14:36:23 +0100 Ulrich Sibiller (e7d5ba4e5) + + * Handlers.c: ensure regular yields if suspended + +2020-12-10 10:24:29 +0100 Mike Gabriel (d5a3b4401) + + * CVE-2020-14360: Check SetMap request length carefully. + +2020-12-03 01:00:59 +0100 Ulrich Sibiller (ad275d507) + + * Events.c: fix leftover DEBUG and TEST definitions + +2020-11-04 13:51:16 +0100 Mike Gabriel (5ca9a6b1e) + + * NXdixfonts.c: Regression fix for db45683a. Fix typo in libXfont1 + function call (FreeFontName -> FreeFontNames). Fixes FTBFS + on Ubuntu 14.04 and 16.04. + +2020-11-04 13:43:58 +0100 Mike Gabriel (f2973029d) + + * release 3.5.99.25 (tag: 3.5.99.25) 2020-11-04 13:38:30 +0100 Mike Gabriel (48b914810) diff --git a/VERSION b/VERSION index e6e337051..dcb5d428a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.5.99.25 +3.5.99.26 diff --git a/debian/changelog b/debian/changelog index 2d53e2fad..436f1e70d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +nx-libs (2:3.5.99.26-0) unstable; urgency=medium + + * Upstream-provided Debian package for nx-libs. + See upstream ChangeLog for recent changes. + + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Thu, 04 Feb 2021 14:34:17 +0100 + nx-libs (2:3.5.99.25-0) unstable; urgency=medium * Upstream-provided Debian package for nx-libs. diff --git a/nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb b/nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb index 9c08d6237..53636515d 100644 Binary files a/nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb and b/nx-X11/extras/Mesa_6.4.2/progs/images/bw.rgb differ diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 index 72a885638..2a83a5afb 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 "Nov 2020" "Version 3.5.99.25" "NX Agent (Xserver)" +.TH nxagent 1 "Feb 2021" "Version 3.5.99.26" "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 13538c4af..8fe59f810 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -10,7 +10,7 @@ %endif Name: nx-libs -Version: 3.5.99.25 +Version: 3.5.99.26 Release: 0.0build1%{?dist} Summary: NX X11 protocol compression libraries @@ -643,5 +643,5 @@ sed -i '1 s/python/python3/' %{buildroot}%{_bindir}/nxdialog %{_datadir}/man/man1/nxdialog.1* %changelog -* Sun May 31 2020 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> 3.5.99.25 +* Sun May 31 2020 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> 3.5.99.26 - See upstream ChangeLog and debian/changelog for details. diff --git a/nxdialog/bin/nxdialog b/nxdialog/bin/nxdialog index 42dba964a..a455e75b5 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.25 only uses yesno, ok, pulldown and yesnosuspend + # nxagent 3.5.99.26 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.25 + # -class, -local, -allowmultiple are unused in nxlibs 3.5.99.26 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 f8cdda737..68ddab5b2 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 "Nov 2020" "Version 3.5.99.25" "NX Dialog" +.TH nxdialog 1 "Feb 2021" "Version 3.5.99.26" "NX Dialog" .SH NAME nxdialog \- NX Dialog Helper .SH SYNOPSIS diff --git a/nxproxy/man/nxproxy.1 b/nxproxy/man/nxproxy.1 index c22f15a48..67bf345f5 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 "Nov 2020" "Version 3.5.99.25" "NX Proxy" +.TH nxproxy 1 "Feb 2021" "Version 3.5.99.26" "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
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch 3.6.x in repository nx-libs. commit b09f5e03ec08bcbb9a614d5f2c0f86b28a203aef Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 16:19:21 2021 +0100 Screen.c: Fix fullscreen (onescreen) at startup Fixes ArcticaProject/nx-libs#991 --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 33 +++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index a6b312aaa..c51302e6d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -322,6 +322,12 @@ Bool nxagentIsParentOf(Display *d, XlibWindow possible_parent, XlibWindow candid */ void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) { + if (nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) + { + nxagentSwitchFullscreen(pScreen, False); + return; + } + XUnmapWindow(nxagentDisplay, nxagentFullscreenWindow); XIconifyWindow(nxagentDisplay, nxagentIconWindow, DefaultScreen(nxagentDisplay)); @@ -337,6 +343,12 @@ void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) */ void nxagentMaximizeToFullScreen(ScreenPtr pScreen) { + if (nxagentOption(Fullscreen) && !nxagentOption(AllScreens)) + { + nxagentSwitchFullscreen(pScreen, True); + return; + } + /* XUnmapWindow(nxagentDisplay, nxagentIconWindow); */ @@ -992,8 +1004,25 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) nxagentChangeOption(X, 0); nxagentChangeOption(Y, 0); - nxagentChangeOption(Width, w); - nxagentChangeOption(Height, h); + /* + * Fullscreen will use the window manager on the remote X + * server. We need to size the window appropriately because the + * window manager stores the size and restores it when fullscreen + * mode is left. In AllScreens mode the window manager is + * instructed to not draw any window decorations. Here we need the + * full width to cover the whole screen. + */ + + if (nxagentOption(AllScreens)) + { + nxagentChangeOption(Width, w); + nxagentChangeOption(Height, h); + } + else + { + nxagentChangeOption(Width, w * 3 / 4); + nxagentChangeOption(Height, h * 3 / 4); + } /* first time screen initialization or resize during reconnect */ if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup) -- 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 3.6.x in repository nx-libs. commit 6d8ccec751dd7de462936cd2b0920867055f0e2a Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Feb 3 13:38:59 2021 +0100 Window.c: add another FIXME --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index ba93c96cb..5f12fd48a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3087,6 +3087,11 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer #endif /* FIXME: use XAllocSizeHints() */ + /* FIXME: all this copying is only done because the first + element of the XSizeHints struct is a long which is of + different size on 32bit vs. 64bit platforms. We should + rewrite this to better readable and probably more robust + code */ #ifdef _XSERVER64 data64 = (unsigned char *) malloc(sizeof(XSizeHints) + 4); if (data64) -- 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 3.6.x in repository nx-libs. commit 763a9ee0ef774114f06e57edb3869ba5bfed6feb Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sat Jan 30 18:07:40 2021 +0100 Add build jobs on containers Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .github/workflows/nx-libs.yml | 217 +++++++++++++++++++++++++++++++++--------- 1 file changed, 171 insertions(+), 46 deletions(-) diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml index cc4878498..70177f419 100644 --- a/.github/workflows/nx-libs.yml +++ b/.github/workflows/nx-libs.yml @@ -7,50 +7,175 @@ on: branches: [ 3.6.x ] jobs: - build: - name: Build on ${{ matrix.cfg.container }} - ${{ matrix.cfg.cpp-version }} - runs-on: ubuntu-latest - container: ${{ matrix.cfg.container }} - strategy: - fail-fast: false - matrix: - cfg: - - { container: 'ubuntu:16.04', cpp-version: gcc } - - { container: 'ubuntu:16.04', cpp-version: clang } - - { container: 'ubuntu:20.04', cpp-version: gcc } - - { container: 'ubuntu:20.04', cpp-version: clang } - - { container: 'debian:stable', cpp-version: gcc } - - { container: 'debian:stable', cpp-version: clang } - - { container: 'debian:sid', cpp-version: gcc } - - { container: 'debian:sid', cpp-version: clang } - - { container: 'centos:7', cpp-version: gcc } - - { container: 'centos:7', cpp-version: clang } - - { container: 'centos:8', cpp-version: gcc } - - { container: 'centos:8', cpp-version: clang } - - { container: 'fedora:latest', cpp-version: gcc } - - { container: 'fedora:latest', cpp-version: clang } + build: + name: Build on ${{ matrix.cfg.container }} - ${{ matrix.cfg.cc-version }} + runs-on: ubuntu-latest + container: ${{ matrix.cfg.container }} + strategy: + fail-fast: false + matrix: + cfg: + - { container: 'ubuntu:16.04', cc-version: gcc } + - { container: 'ubuntu:16.04', cc-version: clang } + - { container: 'ubuntu:20.04', cc-version: gcc } + - { container: 'ubuntu:20.04', cc-version: clang } + - { container: 'debian:stable', cc-version: gcc } + - { container: 'debian:stable', cc-version: clang } + - { container: 'debian:sid', cc-version: gcc } + - { container: 'debian:sid', cc-version: clang } + - { container: 'centos:7', cc-version: gcc } + - { container: 'centos:7', cc-version: clang } + - { container: 'centos:8', cc-version: gcc } + - { container: 'centos:8', cc-version: clang } + - { container: 'fedora:latest', cc-version: gcc } + - { container: 'fedora:latest', cc-version: clang } - steps: - - name: Install compiler ${{ matrix.cfg.cpp-version }} - shell: sh - run: | - case "${{ matrix.cfg.container }}" in - ubuntu*|debian*) - cat /etc/debian_version - apt-get update -q -y - apt-get install -q -y ${{ matrix.cfg.cpp-version }} - ${{ matrix.cfg.cpp-version }} --version - ;; - fedora*) - cat /etc/fedora-release - dnf -y update - dnf -y install ${{ matrix.cfg.cpp-version }} - ${{ matrix.cfg.cpp-version }} --version - ;; - centos*) - cat /etc/centos-release - yum -y update - yum -y install ${{ matrix.cfg.cpp-version }} - ${{ matrix.cfg.cpp-version }} --version - ;; - esac + steps: + - name: Install compiler ${{ matrix.cfg.cc-version }} + shell: sh + env: + DEBIAN_FRONTEND: noninteractive + run: | + case "${{ matrix.cfg.container }}" in + ubuntu*|debian*) + cat /etc/debian_version + apt-get update -q -y + apt-get install -q -y ${{ matrix.cfg.cc-version }} + ${{ matrix.cfg.cc-version }} --version + case "${{ matrix.cfg.cc-version }}" in + gcc) + apt-get install -q -y g++ + ;; + esac + ;; + fedora*) + cat /etc/fedora-release + dnf -y update + dnf -y install ${{ matrix.cfg.cc-version }} + ${{ matrix.cfg.cc-version }} --version + ;; + centos:8) + cat /etc/centos-release + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial + dnf -y update + dnf -y install ${{ matrix.cfg.cc-version }} + ${{ matrix.cfg.cc-version }} --version + ;; + centos:7) + cat /etc/centos-release + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + yum -y update + yum -y install ${{ matrix.cfg.cc-version }} + ${{ matrix.cfg.cc-version }} --version + ;; + esac + + - name: Install nx-libs dependencies ${{ matrix.cfg.cc-version }} + shell: sh + env: + DEBIAN_FRONTEND: noninteractive + run: | + case "${{ matrix.cfg.container }}" in + ubuntu*|debian*) + # basic packages + apt-get install -q -y \ + autoconf libtool make pkg-config + # imake deps + apt-get install -q -y \ + libxkbfile-dev xfonts-utils xutils-dev + # X11 libraries deps + apt-get install -q -y \ + libpixman-1-dev libjpeg-dev libxcomposite-dev libxdamage-dev \ + libxml2-dev libxfont-dev libxinerama-dev libxpm-dev libxrandr-dev \ + libxtst-dev x11proto-fonts-dev + # soft requirements + apt-get install -q -y \ + quilt x11-xkb-utils + ;; + fedora*) + # basic packages + dnf -y install \ + autoconf automake gcc-c++ libtool make imake pkgconfig which + # imake deps + dnf -y install \ + xorg-x11-proto-devel zlib-devel + # X11 libraries deps + dnf -y install \ + libjpeg-devel expat-devel libpng-devel libxml2-devel pixman-devel \ + libX11-devel libXext-devel libXpm-devel libXfont2-devel \ + libXdmcp-devel libXdamage-devel libXcomposite-devel \ + libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \ + xorg-x11-font-utils libtirpc-devel xkeyboard-config + # soft requirements + dnf -y install \ + quilt xorg-x11-xkb-utils-devel + ;; + centos:8) + # Enable powertools repository for imake + dnf -y install dnf-plugins-core epel-release + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 + dnf config-manager --set-enabled powertools + # basic packages + dnf -y install \ + autoconf automake gcc-c++ libtool make imake pkgconfig which + # imake deps + dnf -y install \ + xorg-x11-proto-devel zlib-devel + # X11 libraries deps + dnf -y install \ + libjpeg-devel expat-devel libpng-devel libxml2-devel pixman-devel \ + libX11-devel libXext-devel libXpm-devel libXfont2-devel \ + libXdmcp-devel libXdamage-devel libXcomposite-devel \ + libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \ + xorg-x11-font-utils libtirpc-devel xkeyboard-config + # soft requirements + dnf --enablerepo="epel" -y install \ + quilt xorg-x11-xkb-utils-devel + ;; + centos:7) + # basic packages + yum -y install \ + autoconf automake gcc-c++ libtool make imake pkgconfig which + # imake deps + yum -y install \ + xorg-x11-proto-devel zlib-devel + # X11 libraries deps + yum -y install \ + libjpeg-devel expat-devel libpng-devel libxml2-devel pixman-devel \ + libX11-devel libXext-devel libXpm-devel libXfont-devel \ + libXdmcp-devel libXdamage-devel libXcomposite-devel \ + libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \ + xorg-x11-font-utils libtirpc-devel xkeyboard-config + # soft requirements + yum -y install \ + quilt xorg-x11-xkb-utils-devel + ;; + esac + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build nx-libs with ${{ matrix.cfg.cc-version }} + shell: sh + env: + DEBIAN_FRONTEND: noninteractive + run: | + case "${{ matrix.cfg.cc-version }}" in + gcc) + export CC=gcc + export CXX=g++ + ;; + clang) + export CC=clang + export CXX=clang++ + ;; + esac + case "${{ matrix.cfg.container }}" in + ubuntu*|debian*) + make + ;; + fedora*|centos*) + export IMAKE_DEFINES="-DUseTIRPC=YES" + make IMAKE_DEFINES="${IMAKE_DEFINES}" + ;; + esac -- 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 3.6.x in repository nx-libs. commit 3dfd7a711567f90878acb1a58ee5fe3228f102b9 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sat Feb 6 18:09:21 2021 +0100 linters: Enable shellcheck This will be green after #1001 get merged. Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .github/workflows/linters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 183924dfd..c6a238fd2 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -20,7 +20,7 @@ jobs: - name: run Shellcheck run: | - find . -name "*.sh" | xargs shellcheck || true + find . -name "*.sh" | xargs shellcheck -e SC1004,SC2010,SC2035,SC2086 cppcheck: runs-on: ubuntu-20.04 -- 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 3.6.x in repository nx-libs. commit 3da6e9c3a348cc3ffe20701e389fd2046d0d4e1d Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 11:07:07 2021 +0100 Move PVS run to GitHub Actions Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .github/workflows/linters.yml | 62 ++++++++++++++++++++++++++++++++++++++++--- .github/workflows/nx-libs.yml | 2 +- .pvs-studio.sh | 37 -------------------------- 3 files changed, 59 insertions(+), 42 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 936db9c8b..183924dfd 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -8,14 +8,14 @@ on: jobs: shellcheck: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout repository uses: actions/checkout@v2 - name: Install linters on ubuntu run: | - sudo apt-get update + sudo apt-get update -q -y sudo apt-get install shellcheck - name: run Shellcheck @@ -23,14 +23,14 @@ jobs: find . -name "*.sh" | xargs shellcheck || true cppcheck: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout repository uses: actions/checkout@v2 - name: Install linters on ubuntu run: | - sudo apt-get update + sudo apt-get update -q -y sudo apt-get install cppcheck - name: run cppcheck @@ -45,3 +45,57 @@ jobs: CPPCHECK_EXCLUDES='-i ./nx-X11/extras/ -i nx-X11/programs/Xserver/GL/mesa* -i ./.pc -i ./nx-X11/.build-exports -i ./nx-X11/exports -i ./doc' echo "$(cppcheck --version):"; cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .; + pvs: + environment: pvs + runs-on: ubuntu-20.04 + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install linters on ubuntu + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update -qq -y + # compiler + sudo apt-get install -qq -y gcc g++ + # basic packages + sudo apt-get install -qq -y \ + autoconf libtool make pkg-config + # imake deps + sudo apt-get install -qq -y \ + libxkbfile-dev xfonts-utils xutils-dev + # X11 libraries deps + sudo apt-get install -qq -y \ + libpixman-1-dev libjpeg-dev libxcomposite-dev libxdamage-dev \ + libxml2-dev libxfont-dev libxinerama-dev libxpm-dev libxrandr-dev \ + libxtst-dev x11proto-fonts-dev + # soft requirements + sudo apt-get install -qq -y \ + quilt x11-xkb-utils + # PVS + sudo wget -q -O - https://files.viva64.com/etc/pubkey.txt | sudo apt-key add - + sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list + sudo apt-get update -qq + sudo apt-get install -qq pvs-studio + + - name: Run PVS-Studio Analyzer + shell: bash + env: + PVS_USERNAME: ${{ secrets.PVS_USERNAME }} + PVS_KEY: ${{ secrets.PVS_KEY }} + run: | + # check environment variables + if [[ -z "${PVS_USERNAME}" ]]; then + echo '"PVS_USERNAME" environment variable not set' + exit 0 + elif [[ -z "${PVS_KEY}" ]]; then + echo '"PVS_KEY" environment variable not set' + exit 0 + else + pvs-studio-analyzer credentials -o "PVS-Studio.lic" "${PVS_USERNAME}" "${PVS_KEY}" + pvs-studio-analyzer trace -- make + pvs-studio-analyzer analyze --quiet --lic-file "PVS-Studio.lic" --output-file "PVS-Studio-${CC}.log" + plog-converter -a "GA:1,2" -t tasklist -o "PVS-Studio-${CC}.tasks" "PVS-Studio-${CC}.log" + cat "PVS-Studio-${CC}.tasks" + fi diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml index 70177f419..5988f05c6 100644 --- a/.github/workflows/nx-libs.yml +++ b/.github/workflows/nx-libs.yml @@ -9,7 +9,7 @@ on: jobs: build: name: Build on ${{ matrix.cfg.container }} - ${{ matrix.cfg.cc-version }} - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 container: ${{ matrix.cfg.container }} strategy: fail-fast: false diff --git a/.pvs-studio.sh b/.pvs-studio.sh deleted file mode 100644 index 9e9f0370c..000000000 --- a/.pvs-studio.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -before_install() { - if [ "$PVS_ANALYZE" = "yes" ]; then - sudo wget -q -O - https://files.viva64.com/etc/pubkey.txt | sudo apt-key add - - sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list - sudo apt-get update -qq - sudo apt-get install -qq pvs-studio - else - echo "not installing PVS-Studio" - fi -} - -build_script() { - if [ "$PVS_ANALYZE" = "yes" ]; then - if [[ -z "${PVS_USERNAME}" ]]; then - echo '"PVS_USERNAME" environment variable not set' - exit 0 - elif [[ -z "${PVS_KEY}" ]]; then - echo '"PVS_KEY" environment variable not set' - exit 0 - else - pvs-studio-analyzer credentials -o "PVS-Studio.lic" "${PVS_USERNAME}" "${PVS_KEY}" - pvs-studio-analyzer trace -- make -j2 - pvs-studio-analyzer analyze --quiet -j2 --lic-file "PVS-Studio.lic" --output-file "PVS-Studio-${CC}.log" - plog-converter -a "GA:1,2" -t tasklist -o "PVS-Studio-${CC}.tasks" "PVS-Studio-${CC}.log" - cat "PVS-Studio-${CC}.tasks" - fi - else - make -j2 - fi -} - -set -e -set -x - -$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 3.6.x in repository nx-libs. commit 1620c93f0a509f82abf636872dcfd0360b88d97c Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 10:40:17 2021 +0100 Replace TravisCI with GitHub Actions Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .travis.yml | 172 ------------------------------------------------- README.md | 2 +- run-static-analysis.sh | 14 ---- 3 files changed, 1 insertion(+), 187 deletions(-) diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 776c1a4bd..000000000 --- a/.travis.yml +++ /dev/null @@ -1,172 +0,0 @@ -# Use new bionic images, should yield newer compilers and packages -language: cpp -os: linux -dist: xenial - -jobs: - include: - - name: "GCC 5.4" - addons: - apt: - update: true - sources: - - ubuntu-toolchain-r-test - packages: - # imake - - libxkbfile-dev - - xfonts-utils - - xutils-dev - # X11 libaries - - libxcomposite-dev - - libxdamage-dev - - libxfont-dev - - libxinerama-dev - - libxpm-dev - - libxrandr-dev - - libxtst-dev - - x11proto-fonts-dev - # soft requirements - - quilt - - x11-xkb-utils - - env: - - MATRIX_EVAL="CC=gcc && CXX=g++" - - STATIC_ANALYSIS="no" - - PVS_ANALYZE="no" - - - name: "cppcheck 1.82 + GCC 10.x" - dist: bionic - addons: - apt: - update: true - sources: - - ubuntu-toolchain-r-test - packages: - - cppcheck - - g++-10 - # imake - - libxkbfile-dev - - xfonts-utils - - xutils-dev - # X11 libaries - - libxcomposite-dev - - libxdamage-dev - - libxfont-dev - - libxinerama-dev - - libxpm-dev - - libxrandr-dev - - libxtst-dev - - x11proto-fonts-dev - # soft requirements - - quilt - - x11-xkb-utils - - env: - - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10" - - STATIC_ANALYSIS="yes" - - PVS_ANALYZE="no" - - - name: "GCC 10.x + PVS-Studio" - dist: bionic - addons: - apt: - update: true - sources: - - ubuntu-toolchain-r-test - packages: - - g++-10 - # imake - - libxkbfile-dev - - xfonts-utils - - xutils-dev - # X11 libaries - - libxcomposite-dev - - libxdamage-dev - - libxfont-dev - - libxinerama-dev - - libxpm-dev - - libxrandr-dev - - libxtst-dev - - x11proto-fonts-dev - # soft requirements - - quilt - - x11-xkb-utils - - env: - - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10" - - STATIC_ANALYSIS="no" - - PVS_ANALYZE="yes" - - - name: "Clang 3.9" - addons: - apt: - update: true - sources: - - llvm-toolchain-xenial-3.9 - packages: - - clang-3.9 - # imake - - libxkbfile-dev - - xfonts-utils - - xutils-dev - # X11 libaries - - libxcomposite-dev - - libxdamage-dev - - libxfont-dev - - libxinerama-dev - - libxpm-dev - - libxrandr-dev - - libxtst-dev - - x11proto-fonts-dev - # soft requirements - - quilt - - x11-xkb-utils - - env: - - MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9" - - STATIC_ANALYSIS="no" - - PVS_ANALYZE="no" - - - name: "Clang 9.x" - dist: bionic - addons: - apt: - update: true - sources: - - llvm-toolchain-bionic-9 - - ubuntu-toolchain-r-test - packages: - - clang-9 - # imake - - libxkbfile-dev - - xfonts-utils - - xutils-dev - # X11 libaries - - libxcomposite-dev - - libxdamage-dev - - libxfont-dev - - libxinerama-dev - - libxpm-dev - - libxrandr-dev - - libxtst-dev - - x11proto-fonts-dev - # soft requirements - - quilt - - x11-xkb-utils - - env: - - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9" - - STATIC_ANALYSIS="no" - - PVS_ANALYZE="no" - -before_install: - - eval "${MATRIX_EVAL}" - - travis_retry bash .pvs-studio.sh before_install - -script: - # run static analysis tools - - ./run-static-analysis.sh - # print compiler version - - ${CC} --version - # build all packages - - travis_retry bash .pvs-studio.sh build_script diff --git a/README.md b/README.md index d781194b4..8470199f9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# NX development by ArticaProject, X2Go and TheQVD [](https://travis-ci.org/ArcticaProject/nx-libs) +# NX development by ArticaProject, X2Go and TheQVD This source tree started as a re-distribution of those NX packages needed to setup FreeNX and/or X2Go on a Linux server. diff --git a/run-static-analysis.sh b/run-static-analysis.sh deleted file mode 100755 index a9368973b..000000000 --- a/run-static-analysis.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -if [[ "${STATIC_ANALYSIS}" == "yes" ]]; then - # cppcheck - if ! [ -x "$(command -v cppcheck)" ]; then - echo 'Error: cppcheck is not installed.' >&2 - exit 1 - fi - CPPCHECK_OPTS='--error-exitcode=0 --force --quiet --suppressions-list=./static-analysis-suppressions' - # we exclude some external projects - CPPCHECK_EXCLUDES='-i ./nx-X11/extras/ -i nx-X11/programs/Xserver/GL/mesa* -i ./.pc -i ./nx-X11/.build-exports -i ./nx-X11/exports -i ./doc' - echo "$(cppcheck --version):"; - cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .; -fi -- 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 3.6.x in repository nx-libs. commit e0e999f4ccfdb633199c35223802f39569586482 Author: Mario Trangoni <mario@mariotrangoni.de> Date: Sat Dec 19 17:01:34 2020 +0100 Implement github actions basics --- .github/workflows/nx-libs.yml | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml new file mode 100644 index 000000000..cc4878498 --- /dev/null +++ b/.github/workflows/nx-libs.yml @@ -0,0 +1,56 @@ +name: nx-libs CI + +on: + push: + branches: [ 3.6.x ] + pull_request: + branches: [ 3.6.x ] + +jobs: + build: + name: Build on ${{ matrix.cfg.container }} - ${{ matrix.cfg.cpp-version }} + runs-on: ubuntu-latest + container: ${{ matrix.cfg.container }} + strategy: + fail-fast: false + matrix: + cfg: + - { container: 'ubuntu:16.04', cpp-version: gcc } + - { container: 'ubuntu:16.04', cpp-version: clang } + - { container: 'ubuntu:20.04', cpp-version: gcc } + - { container: 'ubuntu:20.04', cpp-version: clang } + - { container: 'debian:stable', cpp-version: gcc } + - { container: 'debian:stable', cpp-version: clang } + - { container: 'debian:sid', cpp-version: gcc } + - { container: 'debian:sid', cpp-version: clang } + - { container: 'centos:7', cpp-version: gcc } + - { container: 'centos:7', cpp-version: clang } + - { container: 'centos:8', cpp-version: gcc } + - { container: 'centos:8', cpp-version: clang } + - { container: 'fedora:latest', cpp-version: gcc } + - { container: 'fedora:latest', cpp-version: clang } + + steps: + - name: Install compiler ${{ matrix.cfg.cpp-version }} + shell: sh + run: | + case "${{ matrix.cfg.container }}" in + ubuntu*|debian*) + cat /etc/debian_version + apt-get update -q -y + apt-get install -q -y ${{ matrix.cfg.cpp-version }} + ${{ matrix.cfg.cpp-version }} --version + ;; + fedora*) + cat /etc/fedora-release + dnf -y update + dnf -y install ${{ matrix.cfg.cpp-version }} + ${{ matrix.cfg.cpp-version }} --version + ;; + centos*) + cat /etc/centos-release + yum -y update + yum -y install ${{ matrix.cfg.cpp-version }} + ${{ matrix.cfg.cpp-version }} --version + ;; + esac -- 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 3.6.x in repository nx-libs. commit 637d6d733a96557c3c9aa345c23c9b233bb6710e Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Jan 31 10:29:14 2021 +0100 Add shellcheck and cppcheck linters Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .github/workflows/linters.yml | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 000000000..936db9c8b --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,47 @@ +name: linters + +on: + push: + branches: [ 3.6.x ] + pull_request: + branches: [ 3.6.x ] + +jobs: + shellcheck: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install linters on ubuntu + run: | + sudo apt-get update + sudo apt-get install shellcheck + + - name: run Shellcheck + run: | + find . -name "*.sh" | xargs shellcheck || true + + cppcheck: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install linters on ubuntu + run: | + sudo apt-get update + sudo apt-get install cppcheck + + - name: run cppcheck + run: | + # cppcheck + if ! [ -x "$(command -v cppcheck)" ]; then + echo 'Error: cppcheck is not installed.' >&2 + exit 1 + fi + CPPCHECK_OPTS='--error-exitcode=0 --force --quiet --suppressions-list=./static-analysis-suppressions' + # we exclude some external projects + CPPCHECK_EXCLUDES='-i ./nx-X11/extras/ -i nx-X11/programs/Xserver/GL/mesa* -i ./.pc -i ./nx-X11/.build-exports -i ./nx-X11/exports -i ./doc' + echo "$(cppcheck --version):"; + cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .; -- 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 3.6.x in repository nx-libs. commit ffba3aab3f2cf140403b19e23756008f9c947091 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Fri Feb 5 18:29:43 2021 +0100 shellcheck: Fix SC2164 issues For more information: https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... |... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- regenerate-symbol-docs.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/regenerate-symbol-docs.sh b/regenerate-symbol-docs.sh index 05548bdb0..90bc9da34 100755 --- a/regenerate-symbol-docs.sh +++ b/regenerate-symbol-docs.sh @@ -23,7 +23,7 @@ SYMBOLS_FILE="doc/libNX_X11/symbols/libNX_X11::symbols.txt" DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_internally.txt" echo "Scanning for libNX_X11 symbols: in libNX_X11 internally: $DOC_FILE" -cd nx-X11/lib/X11/ +cd nx-X11/lib/X11/ || exit grep -v -E "^#" "../../../$SYMBOLS_FILE" | while read -r symbol; do echo @@ -31,11 +31,11 @@ grep -v -E "^#" "../../../$SYMBOLS_FILE" | while read -r symbol; do grep -n "$symbol" *.{c,h} 2>/dev/null done > "../../../$DOC_FILE" -cd - 1>/dev/null +cd - 1>/dev/null || exit DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_nxagent.txt" echo "Scanning for libNX_X11 symbols: in hw/nxagent: $DOC_FILE" -cd nx-X11/programs/Xserver/hw/nxagent/ +cd nx-X11/programs/Xserver/hw/nxagent/ || exit grep -v -E "^#" "../../../../../$SYMBOLS_FILE" | while read -r symbol; do echo @@ -43,11 +43,11 @@ grep -v -E "^#" "../../../../../$SYMBOLS_FILE" | while read -r symbol; do grep -n "$symbol" *.{c,h} 2>/dev/null done > "../../../../../$DOC_FILE" -cd - 1>/dev/null +cd - 1>/dev/null || exit DOC_FILE="doc/libNX_X11/symbols/libNX_X11::symbol-usage_nxcompext.txt" echo "Scanning for libNX_X11 symbols: in hw/nxagent/compext: $DOC_FILE" -cd nx-X11/programs/Xserver/hw/nxagent/compext/ +cd nx-X11/programs/Xserver/hw/nxagent/compext/ || exit grep -v -E "^#" "../../../../../../$SYMBOLS_FILE" | while read -r symbol; do echo @@ -55,7 +55,7 @@ grep -v -E "^#" "../../../../../../$SYMBOLS_FILE" | while read -r symbol; do grep -n "$symbol" *.{c,h} 2>/dev/null done > "../../../../../../$DOC_FILE" -cd - 1>/dev/null +cd - 1>/dev/null || exit # nxcompext @@ -64,7 +64,7 @@ SYMBOLS_FILE="doc/nxcompext/symbols/nxcompext::symbols.txt" DOC_FILE="doc/nxcompext/symbols/nxcompext::symbol-usage_internally.txt" echo "Scanning for nxcompext symbols: in hw/nxagent/compext internally: $DOC_FILE" -cd nx-X11/programs/Xserver/hw/nxagent/compext/ +cd nx-X11/programs/Xserver/hw/nxagent/compext/ || exit grep -v -E "^#" "../../../../../../$SYMBOLS_FILE" | while read -r symbol; do echo @@ -72,11 +72,11 @@ grep -v -E "^#" "../../../../../../$SYMBOLS_FILE" | while read -r symbol; do grep -n "$symbol" *.{c,h} 2>/dev/null done > "../../../../../../$DOC_FILE" -cd - 1>/dev/null +cd - 1>/dev/null || exit DOC_FILE="doc/nxcompext/symbols/nxcompext::symbol-usage_nxagent.txt" echo "Scanning for nxcompext symbols: in hw/nxagent: $DOC_FILE" -cd nx-X11/programs/Xserver/hw/nxagent/ +cd nx-X11/programs/Xserver/hw/nxagent/ || exit grep -v -E "^#" "../../../../../$SYMBOLS_FILE" | while read -r symbol; do echo @@ -84,4 +84,4 @@ grep -v -E "^#" "../../../../../$SYMBOLS_FILE" | while read -r symbol; do grep -n "$symbol" *.{c,h} 2>/dev/null done > "../../../../../$DOC_FILE" -cd - 1>/dev/null +cd - 1>/dev/null || exit -- 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 3.6.x in repository nx-libs. commit f4d654e6b5e993c15a3545c8d4e8d8ef3bb12b2b Merge: 0e2b79713 69864ad11 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jun 7 13:31:28 2021 +0200 Merge branch 'test-github-actions' into 3.6.x Attributes GH PR #974: https://github.com/ArcticaProject/nx-libs/pull/974 .github/workflows/linters.yml | 126 ++++++++++++++++++++++++ .github/workflows/nx-libs-archs.yml | 81 ++++++++++++++++ .github/workflows/nx-libs.yml | 186 ++++++++++++++++++++++++++++++++++++ .pvs-studio.sh | 37 ------- .travis.yml | 172 --------------------------------- README.md | 2 +- run-static-analysis.sh | 14 --- 7 files changed, 394 insertions(+), 224 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 3.6.x in repository nx-libs. commit 899c2a6f112610b8cdb2566f85fc533ff5e81885 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sat Feb 6 18:43:49 2021 +0100 Build nx-libs on different architectures Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .github/workflows/nx-libs-archs.yml | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/.github/workflows/nx-libs-archs.yml b/.github/workflows/nx-libs-archs.yml new file mode 100644 index 000000000..b2e343acd --- /dev/null +++ b/.github/workflows/nx-libs-archs.yml @@ -0,0 +1,81 @@ +name: nx-libs CI diff archs + +on: + push: + branches: [ 3.6.x ] + pull_request: + branches: [ 3.6.x ] + +jobs: + build: + runs-on: ubuntu-20.04 + name: Build on ${{ matrix.distro }} ${{ matrix.arch }} with gcc + + # Run steps on a matrix of 4 arch/distro combinations + strategy: + fail-fast: false + matrix: + include: + - arch: aarch64 + distro: ubuntu20.04 + - arch: ppc64le + distro: ubuntu20.04 + - arch: s390x + distro: ubuntu20.04 + - arch: armv7 + distro: ubuntu20.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - uses: uraimo/run-on-arch-action@v2.0.8 + name: Build artifact + id: build + with: + arch: ${{ matrix.arch }} + distro: ${{ matrix.distro }} + + # Not required, but speeds up builds + githubToken: ${{ github.token }} + + # Pass some environment variables to the container + env: | + CC: gcc + CXX: g++ + DEBIAN_FRONTEND: noninteractive + + # The shell to run commands with in the container + shell: /bin/sh + + # Install some dependencies in the container. This speeds up builds if + # you are also using githubToken. Any dependencies installed here will + # be part of the container image that gets cached, so subsequent + # builds don't have to re-install them. The image layer is cached + # publicly in your project's package repository, so it is vital that + # no secrets are present in the container state or logs. + install: | + case "${{ matrix.distro }}" in + ubuntu*) + cat /etc/debian_version + apt-get update -q -y + apt-get install -q -y gcc g++ + gcc --version + # basic packages + apt-get install -q -y \ + autoconf libtool make pkg-config + # imake deps + apt-get install -q -y \ + libxkbfile-dev xfonts-utils xutils-dev + # X11 libraries deps + apt-get install -q -y \ + libpixman-1-dev libjpeg-dev libxcomposite-dev libxdamage-dev \ + libxml2-dev libxfont-dev libxinerama-dev libxpm-dev libxrandr-dev \ + libxtst-dev x11proto-fonts-dev + # soft requirements + apt-get install -q -y \ + quilt x11-xkb-utils + ;; + esac + + run: | + make -- 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 3.6.x in repository nx-libs. commit 69864ad11cf05198a673e4507d6006b21a243a31 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Feb 7 14:19:52 2021 +0100 Add pylint to GitHub Actions Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .github/workflows/linters.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 6bad1fd15..f8a670610 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -21,8 +21,29 @@ jobs: - name: run Shellcheck run: | + shellcheck --version find . -name "*.sh" | xargs shellcheck -e SC1004,SC2010,SC2035,SC2086 + # see https://pylint.org/ + pylint: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install linters on ubuntu + run: | + sudo apt-get update -q -y + sudo apt-get install pylint + # dependencies + sudo apt-get install --reinstall python-gi + sudo apt-get install python-dbus python-gobject + + - name: run Pylint + run: | + pylint --version + cd nxdialog/; find . -name "nxdialog" -type f | xargs pylint --exit-zero + # see https://github.com/danmar/cppcheck cppcheck: runs-on: ubuntu-20.04 -- 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 3.6.x in repository nx-libs. commit d570730e6d6bbc52382cc2f1029996d4a3f8041d Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Feb 7 11:19:52 2021 +0100 Fix missing quilt on CentOS7 Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .github/workflows/nx-libs.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml index 5988f05c6..28a7bd237 100644 --- a/.github/workflows/nx-libs.yml +++ b/.github/workflows/nx-libs.yml @@ -133,7 +133,9 @@ jobs: quilt xorg-x11-xkb-utils-devel ;; centos:7) - # basic packages + # enable epel repository for quilt + yum -y install epel-release + # basic packages yum -y install \ autoconf automake gcc-c++ libtool make imake pkgconfig which # imake deps @@ -147,7 +149,7 @@ jobs: libXrandr-devel libXfixes-devel libXtst-devel libXinerama-devel \ xorg-x11-font-utils libtirpc-devel xkeyboard-config # soft requirements - yum -y install \ + yum -y --enablerepo=epel install \ quilt xorg-x11-xkb-utils-devel ;; esac -- 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 3.6.x in repository nx-libs. commit 077089c4e4f7fcdff55d316811482c920cb62c7f Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Feb 7 11:20:20 2021 +0100 Add linter references Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .github/workflows/linters.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index c6a238fd2..6bad1fd15 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -7,6 +7,7 @@ on: branches: [ 3.6.x ] jobs: + # see https://github.com/koalaman/shellcheck shellcheck: runs-on: ubuntu-20.04 steps: @@ -22,6 +23,7 @@ jobs: run: | find . -name "*.sh" | xargs shellcheck -e SC1004,SC2010,SC2035,SC2086 + # see https://github.com/danmar/cppcheck cppcheck: runs-on: ubuntu-20.04 steps: @@ -45,6 +47,8 @@ jobs: CPPCHECK_EXCLUDES='-i ./nx-X11/extras/ -i nx-X11/programs/Xserver/GL/mesa* -i ./.pc -i ./nx-X11/.build-exports -i ./nx-X11/exports -i ./doc' echo "$(cppcheck --version):"; cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .; + + # see https://www.viva64.com/en/pvs-studio/ pvs: environment: pvs runs-on: ubuntu-20.04 -- 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 3.6.x in repository nx-libs. commit dfee5a9886112b29f14f762016c8fe892846bfef Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sat Feb 6 17:56:53 2021 +0100 shellcheck: Fix SC2064 issues For more information: https://www.shellcheck.net/wiki/SC2064 -- Use single quotes, otherwise this... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- roll-tarballs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roll-tarballs.sh b/roll-tarballs.sh index c9af13102..95b820c5a 100755 --- a/roll-tarballs.sh +++ b/roll-tarballs.sh @@ -68,7 +68,7 @@ TARGETDIR="../.." MANIFEST="$(mktemp)" TEMP_DIR="$(mktemp -d)" -trap "rm -f \"${MANIFEST}\"; rm -rf \"${TEMP_DIR}\"" 0 +trap 'rm -f "${MANIFEST}"; rm -rf "${TEMP_DIR}"' 0 # create local copy of Git project at temp location git archive --format=tar "${CHECKOUT}" --prefix="${PROJECT}-${RELEASE}/" | ( cd "$TEMP_DIR"; tar xf - ) -- 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 3.6.x in repository nx-libs. commit b42544cf4c8e14d3a070a12695fcc3bb5d867def Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sun Feb 7 13:38:15 2021 +0100 Install build-essentials on clang Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- .github/workflows/nx-libs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml index 28a7bd237..fe5523166 100644 --- a/.github/workflows/nx-libs.yml +++ b/.github/workflows/nx-libs.yml @@ -46,6 +46,8 @@ jobs: gcc) apt-get install -q -y g++ ;; + clang) + apt-get install -q -y build-essential esac ;; fedora*) @@ -135,6 +137,7 @@ jobs: centos:7) # enable epel repository for quilt yum -y install epel-release + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 # basic packages yum -y install \ autoconf automake gcc-c++ libtool make imake pkgconfig which -- 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 3.6.x in repository nx-libs. commit 6bada8f63d98128b269fb379194aead1eacbd711 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jun 7 14:32:08 2021 +0200 shellcheck: Fix SC2230 issue ./nx-X11/x-indent.sh line 5: INDENT=$(which gnuindent || which gindent || which indent) ^---^ SC2230: which is non-standard. Use builtin 'command -v' instead. ^---^ SC2230: which is non-standard. Use builtin 'command -v' instead. ^---^ SC2230: which is non-standard. Use builtin 'command -v' instead. For more information: https://www.shellcheck.net/wiki/SC2230 -- which is non-standard. Use builti... Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> --- nx-X11/x-indent.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/x-indent.sh b/nx-X11/x-indent.sh index 327aa6a4f..4690372e6 100755 --- a/nx-X11/x-indent.sh +++ b/nx-X11/x-indent.sh @@ -2,7 +2,7 @@ # We want GNU indent, so first search for gindent to avoid /usr/bin/indent # on the BSDs, which won't work for us -INDENT=$(which gnuindent || which gindent || which indent) +INDENT=$(command -v gnuindent || command -v gindent || command -v indent) if [ -z "${INDENT}" ] ; then echo "Could not find indent, sorry..." >&2 -- 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 3.6.x in repository nx-libs. commit 940b7843fee91d8f139b56bcd1feb95bd7e9ddb6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jun 7 16:46:57 2021 +0200 .github/workflows/nx-libs.yml: In Fedora 34 and beyond, files from xorg-x11-xkb-utils-devel have been moved into bin:pkg xkbcomp-devel. --- .github/workflows/nx-libs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nx-libs.yml b/.github/workflows/nx-libs.yml index fe5523166..14625feb1 100644 --- a/.github/workflows/nx-libs.yml +++ b/.github/workflows/nx-libs.yml @@ -110,7 +110,7 @@ jobs: xorg-x11-font-utils libtirpc-devel xkeyboard-config # soft requirements dnf -y install \ - quilt xorg-x11-xkb-utils-devel + quilt xkbcomp-devel ;; centos:8) # Enable powertools repository for imake -- 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 3.6.x in repository nx-libs. commit 420754489ea3275002736ca1986da13ca959bd11 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Feb 7 15:21:12 2021 +0100 nxdialog: fix/suppress some pylint findings Increase pylint scrore from 9.5 to 10.0 I: 61, 0: Locally disabling wrong-import-position (C0413) (locally-disabled) W:119, 0: TODO: Show title item in bold font (fixme) W:390, 0: TODO: Implement all dialog types (fixme) C: 41, 0: Trailing whitespace (trailing-whitespace) C: 50, 0: Line too long (108/100) (line-too-long) W:158,30: Unused argument '_ypos' (unused-argument) W:158,23: Unused argument '_xpos' (unused-argument) W:291,15: Catching too general exception Exception (broad-except) R:333, 4: Too many branches (15/12) (too-many-branches) --- nxdialog/bin/nxdialog | 61 +++++++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/nxdialog/bin/nxdialog b/nxdialog/bin/nxdialog index a455e75b5..ab0dbf17f 100755 --- a/nxdialog/bin/nxdialog +++ b/nxdialog/bin/nxdialog @@ -38,7 +38,7 @@ # - 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. +# - make code compatible to python2 and python3. """nxdialog program for handling dialog display.""" @@ -47,7 +47,10 @@ # # Examples: # nxdialog --dialog yesno --message "message text" --caption "message title" --parent 0 -# nxdialog --dialog pulldown --message "message text" --caption "message title" --window 0x123456 --parent 0 +# nxdialog --dialog pulldown --message "message text" --caption "message title" \ +# --window 0x123456 --parent 0 +# +# pylint: disable=fixme, broad-except from __future__ import print_function @@ -155,6 +158,7 @@ class PullDownMenu(object): Gtk.main_quit() @staticmethod + # pylint: disable=unused-argument def pos_menu(menu, _xpos, _ypos, *data): """ Positions menu at the top center of the parent window. """ parent = data[0] @@ -330,6 +334,34 @@ class NxDialogProgram(object): return parser.parse_args() + def show_dialog(self, message_caption, message_text): + """ Show the dialog or exit with failure if not implemented. """ + dlgtype = self.options.dialog_type + if dlgtype == DLG_TYPE_OK: + show_simple_message_box( + Gtk.MessageType.INFO, message_caption, message_text) + + elif dlgtype in (DLG_TYPE_ERROR, DLG_TYPE_PANIC): + show_simple_message_box( + Gtk.MessageType.ERROR, message_caption, message_text) + + elif dlgtype == DLG_TYPE_PULLDOWN: + handle_session_action(self.options.agentpid, + PullDownMenu(self.options.window).show()) + + 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: + 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) + def run(self): """ Disconnect/terminate NX session upon user's request. """ @@ -366,30 +398,7 @@ class NxDialogProgram(object): if self.options.display: os.environ["DISPLAY"] = self.options.display - if dlgtype == DLG_TYPE_OK: - show_simple_message_box( - Gtk.MessageType.INFO, message_caption, message_text) - - elif dlgtype in (DLG_TYPE_ERROR, DLG_TYPE_PANIC): - show_simple_message_box( - Gtk.MessageType.ERROR, message_caption, message_text) - - elif dlgtype == DLG_TYPE_PULLDOWN: - handle_session_action(self.options.agentpid, - PullDownMenu(self.options.window).show()) - - 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: - 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) + self.show_dialog(message_caption, message_text) 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 3.6.x in repository nx-libs. commit 5c09159aed997498d2f59f8d4025811f363586c0 Merge: 1fc5c689e 420754489 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jun 7 16:36:15 2021 +0200 Merge branch 'uli42-pr/pylint_fixes' into 3.6.x Attributes GH PR #1002: https://github.com/ArcticaProject/nx-libs/pull/1002 nxdialog/bin/nxdialog | 61 +++++++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 26 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 3.6.x in repository nx-libs. commit 1fc5c689ed63b2c053ed223453d22c5559c706d6 Merge: f4d654e6b 6bada8f63 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jun 7 15:06:58 2021 +0200 Merge branch 'mjtrangoni-fix-shellcheck-issues' into 3.6.x Attributes GH PR #1001: https://github.com/ArcticaProject/nx-libs/pull/1001 nx-X11/x-indent.sh | 2 +- regenerate-symbol-docs.sh | 20 ++++++++++---------- roll-tarballs.sh | 4 ++-- 3 files changed, 13 insertions(+), 13 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 3.6.x in repository nx-libs. commit 71ae04011c353b0341b5ab0c16dad12ebefe6a67 Author: Mario Trangoni <mjtrangoni@gmail.com> Date: Sat Feb 6 17:58:47 2021 +0100 shellcheck: Fix SC2022 issue $ find . -name "*.sh" | xargs shellcheck -i SC2022 In ./roll-tarballs.sh line 120: ls -d nx-X11/extras/* | grep -v "nx-X11/extras/tmpMesa*" | xargs rm -r ^----------------------^ SC2022: Note that unlike globs, a* here matches 'aaa' but not 'alpha'. For more information: https://www.shellcheck.net/wiki/SC2022 -- Note that unlike globs, a* here m... Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com> --- roll-tarballs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roll-tarballs.sh b/roll-tarballs.sh index 95b820c5a..a263c7218 100755 --- a/roll-tarballs.sh +++ b/roll-tarballs.sh @@ -117,7 +117,7 @@ if [ "x$MODE" = "xfull" ]; then # nx-X11/extras/Mesa. Deal with the Mesa.patches symlink/folder accordingly cp -Lr "nx-X11/extras/Mesa" "nx-X11/extras/tmpMesa" cp -Lr "nx-X11/extras/Mesa.patches" "nx-X11/extras/tmpMesa.patches" - ls -d nx-X11/extras/* | grep -v "nx-X11/extras/tmpMesa*" | xargs rm -r + ls -d nx-X11/extras/* | grep -v "^nx-X11/extras/tmpMesa*" | xargs rm -r mv "nx-X11/extras/tmpMesa" "nx-X11/extras/Mesa" mv "nx-X11/extras/tmpMesa.patches" "nx-X11/extras/Mesa.patches" -- 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 3.6.x in repository nx-libs. commit 36f804e549121fb56aa71979b7da5d75f2cc7cbe Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun May 2 18:42:44 2021 +0200 Forward ClientMessages to nxproxy side This should help with clients requesting window manager actions like maximizing or minimizing. This is a first version as it only handles messages of type WM_STATE_CHANGE and _NET_WM_STATE. But ICCCM and EWMH know some more. The other direction, setting of properties by the WM, is already implemented in Rootless.c. Fixes ArcticaProject/nx-libs#1015 --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 64 +++++++++++++++++++++++++++ nx-X11/programs/Xserver/hw/nxagent/Events.h | 2 + nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 6 +++ 3 files changed, 72 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index a342cdee1..2a3654731 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -4505,6 +4505,70 @@ int nxagentWaitEvents(Display *dpy, useconds_t msec) return 1; } +void ForwardClientMessage(ClientPtr client, xSendEventReq *stuff) +{ + Atom netwmstate = MakeAtom("_NET_WM_STATE", strlen("_NET_WM_STATE"), False); + Atom wmchangestate = MakeAtom("WM_CHANGE_STATE", strlen("WM_CHANGE_STATE"), False); + WindowPtr pWin = (WindowPtr)SecurityLookupWindow(stuff->destination, client, + DixReadAccess); + + if (stuff->event.u.clientMessage.u.l.type == netwmstate || stuff->event.u.clientMessage.u.l.type == wmchangestate) + { + if (pWin->drawable.id == pWin->drawable.pScreen->root->drawable.id) + { + #ifdef DEBUG + fprintf(stderr, "%s: dest [0x%x] window [0x%x] clmsg.type [%d]->[%d]\n", __func__, stuff->destination, stuff->event.u.clientMessage.window, stuff->event.u.clientMessage.u.l.type, nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.type)); + #endif + + XEvent X = {0}; + X.xany.type = ClientMessage; + + WindowPtr pWin2 = (WindowPtr)SecurityLookupWindow(stuff->event.u.clientMessage.window, client, + DixReadAccess); + X.xclient.window = nxagentWindowPriv(pWin2)->window; + X.xclient.format = stuff->event.u.u.detail; + X.xclient.send_event = True; + X.xclient.serial = 0; + + if (X.xclient.format == 32) + { + X.xclient.message_type = nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.type); + X.xclient.data.l[0] = stuff->event.u.clientMessage.u.l.longs0; + X.xclient.data.l[1] = nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.longs1); + X.xclient.data.l[2] = nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.longs2); + X.xclient.data.l[3] = nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.longs3); + X.xclient.data.l[4] = nxagentLocalToRemoteAtom(stuff->event.u.clientMessage.u.l.longs4); + //X.xclient.data.l[3] = stuff->event.u.clientMessage.u.l.longs3; + //X.xclient.data.l[4] = stuff->event.u.clientMessage.u.l.longs4; + #ifdef DEBUG + for (int i = 0; i < 5; i++) + { + fprintf(stderr, "%s: data[%d] [%ld]\n", __func__, i, X.xclient.data.l[i]); + } + #endif + } + else + return; // ERROR! + + #ifdef DEBUG + fprintf(stderr, "%s: window [0x%lx]\n", __func__, X.xclient.window); + fprintf(stderr, "%s: message_type [%ld]\n", __func__, X.xclient.message_type); + fprintf(stderr, "%s: format [%d]\n", __func__, X.xclient.format); + #endif + + XlibWindow dest; + dest = DefaultRootWindow(nxagentDisplay); + + Status stat = XSendEvent(nxagentDisplay, dest, stuff->propagate, stuff->eventMask, &X); + XFlush(nxagentDisplay); + #ifdef DEBUG + fprintf(stderr, "%s: send to window [0x%lx]\n", __func__, dest); + fprintf(stderr, "%s: return Status [%d]\n", __func__, stat); + #endif + } + } +} + #ifdef NX_DEBUG_INPUT void nxagentGuessDumpInputInfo(ClientPtr client, Atom property, char *data) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.h b/nx-X11/programs/Xserver/hw/nxagent/Events.h index 42784a8f3..a334897ec 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.h @@ -222,4 +222,6 @@ int nxagentPendingEvents(Display *dpy); int nxagentWaitEvents(Display *, useconds_t msec); +void ForwardClientMessage(ClientPtr client, xSendEventReq *stuff); + #endif /* __Events_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index 84414c11f..fccc718b0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -425,6 +425,12 @@ ProcSendEvent(ClientPtr client) REQUEST_SIZE_MATCH(xSendEventReq); + if (nxagentOption(Rootless) && stuff->event.u.u.type == ClientMessage) + { + ForwardClientMessage(client, stuff); + return Success; + } + if (stuff -> event.u.u.type == SelectionNotify) { if (nxagentSendNotify(&stuff->event) == 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 3.6.x in repository nx-libs. commit d7a49834ea4b3fbe9703cdd408b1a4b4a36a1636 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Feb 28 21:38:25 2021 +0100 nxcomp/Children.cpp: display dialog text in output This ensures the dialog text is visible in the log which is useful when the dialog display tool (nxclient, nxdialog, ...) fails or cannot be found. Fixes ArcticaProject/nx-libs#915 --- nxcomp/src/Children.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nxcomp/src/Children.cpp b/nxcomp/src/Children.cpp index 036cffa95..40eccd9da 100644 --- a/nxcomp/src/Children.cpp +++ b/nxcomp/src/Children.cpp @@ -216,7 +216,15 @@ int NXTransDialog(const char *caption, const char *message, UnsetEnv("LD_LIBRARY_PATH"); - for (int i = 0; i < 2; i++) + if (!pulldown) + { + cerr << "Info: Upcoming dialog:\n" + << "/-----------------------------------------------------------\n" + << caption << ":\n" + << message << "\n" + << "\\-----------------------------------------------------------\n"; + } + { if (local != 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 3.6.x in repository nx-libs. commit 90ff3d0256327bd4097568740a0ece24ca722989 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Feb 28 21:44:33 2021 +0100 nxcomp/Children.cpp: add macro checks around some log/stderr prints This helps no flooding the output with (double) messages. --- nxcomp/src/Children.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nxcomp/src/Children.cpp b/nxcomp/src/Children.cpp index 40eccd9da..842db7fe5 100644 --- a/nxcomp/src/Children.cpp +++ b/nxcomp/src/Children.cpp @@ -257,15 +257,17 @@ int NXTransDialog(const char *caption, const char *message, } } - #ifdef WARNING + #ifdef TEST *logofs << "NXTransDialog: WARNING! Couldn't start '" << command << "'. " << "Error is " << EGET() << " '" << ESTR() << "'.\n" << logofs_flush; #endif + #ifdef WARNING cerr << "Warning" << ": Couldn't start '" << command << "'. Error is " << EGET() << " '" << ESTR() << "'.\n"; + #endif // // Retry by looking for the default name @@ -302,13 +304,15 @@ int NXTransDialog(const char *caption, const char *message, // FIXME: check if strncat would be better here snprintf(newPath + newLength, DEFAULT_STRING_LIMIT - newLength, "%s", oldPath); - #ifdef WARNING + #ifdef TEST *logofs << "NXTransDialog: WARNING! Trying with path '" << newPath << "'.\n" << logofs_flush; #endif + #ifdef WARNING cerr << "Warning" << ": Trying with path '" << newPath << "'.\n"; + #endif // // Solaris doesn't seem to have -- 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 3.6.x in repository nx-libs. commit 90728fadcd845a4017722ffa51f43ce7939e6121 Merge: 5c09159ae bbc59f214 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jun 7 20:09:22 2021 +0200 Merge branch 'sunweaver-pr/fix-ci-builds-against-fedora-greater-than-33' into 3.6.x Attributes GH PR #1017: https://github.com/ArcticaProject/nx-libs/pull/1017 .github/workflows/nx-libs.yml | 2 +- nx-libs.spec | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) -- 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 3.6.x in repository nx-libs. commit bbc59f214285d413f1ede891c62e03d898667b3f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jun 7 16:49:21 2021 +0200 nx-libs.spec: In Fedora 34 and beyond, files from xorg-x11-xkb-utils-devel have been moved into bin:pkg xkbcomp-devel. --- nx-libs.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nx-libs.spec b/nx-libs.spec index 8fe59f810..84140f381 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -41,8 +41,12 @@ BuildRequires: imake BuildRequires: xkbcomp-devel %endif %else +%if 0%{?fedora} >= 34 +BuildRequires: xkbcomp-devel +%else BuildRequires: xorg-x11-xkb-utils-devel %endif +%endif # ideally we build with quilt (for mesa-quilt patch appliance script), # it seems Fedora has it... -- 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 3.6.x in repository nx-libs. commit c3476b6a801ae6355664d5af24ab5a87022c58f6 Merge: 90728fadc 36f804e54 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 8 08:01:54 2021 +0200 Merge branch 'uli42-pr/forward_clientmessages' into 3.6.x Attributes GH PR #1016: https://github.com/ArcticaProject/nx-libs/pulls nx-X11/programs/Xserver/hw/nxagent/Events.c | 64 +++++++++++++++++++++++++++ nx-X11/programs/Xserver/hw/nxagent/Events.h | 2 + nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 6 +++ 3 files changed, 72 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 3.6.x in repository nx-libs. commit 2e3fe61d11b606ab5be561e30649984240e90954 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Feb 28 21:48:55 2021 +0100 nxcomp/Children.cpp: reformat code drop some superflous empty lines to make code more compact. --- nxcomp/src/Children.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/nxcomp/src/Children.cpp b/nxcomp/src/Children.cpp index abfcbf2f9..829c6fbad 100644 --- a/nxcomp/src/Children.cpp +++ b/nxcomp/src/Children.cpp @@ -291,21 +291,16 @@ int NXTransDialog(const char *caption, const char *message, strcpy(newPath, "/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:"); #ifdef __APPLE__ - // FIXME: missing length limitation! strcat(newPath, "/Applications/NX Client for OSX.app/Contents/MacOS:"); - #endif #ifdef __CYGWIN32__ - // FIXME: missing length limitation! strcat(newPath, ".:"); - #endif int newLength = strlen(newPath); - char *oldPath = getenv("PATH"); // FIXME: check if strncat would be better here @@ -327,17 +322,11 @@ int NXTransDialog(const char *caption, const char *message, // #ifdef __sun - char newEnv[DEFAULT_STRING_LIMIT + 5]; - sprintf(newEnv,"PATH=%s", newPath); - putenv(newEnv); - #else - setenv("PATH", newPath, 1); - #endif } else -- 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 3.6.x in repository nx-libs. commit 1338cffc940eb3c3291ee8bea098f79545e969da Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Feb 28 21:49:21 2021 +0100 nxcomp/Children.cpp: print a message if the dialog could not be displayed --- nxcomp/src/Children.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nxcomp/src/Children.cpp b/nxcomp/src/Children.cpp index 829c6fbad..2e89f2e68 100644 --- a/nxcomp/src/Children.cpp +++ b/nxcomp/src/Children.cpp @@ -343,6 +343,15 @@ int NXTransDialog(const char *caption, const char *message, } } + #ifdef TEST + *logofs << "NXTransDialog: WARNING! Could not display dialog.\n" + << logofs_flush; + #endif + + #ifdef WARNING + cerr << "Warning" << ": Could not display dialog.\n"; + #endif + // // Hopefully useless. // -- 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 3.6.x in repository nx-libs. commit 31beb51df199d1fec9cec2afe2c7c3684728bc2a Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Feb 28 21:48:28 2021 +0100 nxcomp/Children.cpp: also try searching nxdialog, not only nxclient --- nxcomp/src/Children.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/nxcomp/src/Children.cpp b/nxcomp/src/Children.cpp index 842db7fe5..abfcbf2f9 100644 --- a/nxcomp/src/Children.cpp +++ b/nxcomp/src/Children.cpp @@ -225,6 +225,7 @@ int NXTransDialog(const char *caption, const char *message, << "\\-----------------------------------------------------------\n"; } + for (int i = 0; i < 4; i++) { if (local != 0) { @@ -274,11 +275,17 @@ int NXTransDialog(const char *caption, const char *message, // in the default NX path. // - if (i == 0) + if (i == 0 || i == 2) { - strcpy(command, "nxclient"); + } + else if (i == 1 || i == 3) + { + strcpy(command, "nxdialog"); + } + if (i == 2) + { char newPath[DEFAULT_STRING_LIMIT]; strcpy(newPath, "/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:"); @@ -332,7 +339,18 @@ int NXTransDialog(const char *caption, const char *message, setenv("PATH", newPath, 1); #endif + } + else + { + #ifdef TEST + *logofs << "NXTransDialog: WARNING! Trying with command '" + << command << "'.\n" << logofs_flush; + #endif + #ifdef WARNING + cerr << "Warning" << ": Trying with command '" << command + << "'.\n"; + #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 3.6.x in repository nx-libs. commit 46258974d0527e299c82d36e31f9f160ee3e586f Author: Vadim Troshchinskiy <vtroshchinskiy@qindel.com> Date: Wed Mar 10 00:25:20 2021 +0100 nxcomp: Support Cygwin64. 64 bit Cygwin defines __CYGWIN__ instead of __CYGWIN32__ --- nxcomp/src/Auth.cpp | 2 +- nxcomp/src/BlockCacheSet.cpp | 4 ++-- nxcomp/src/ChannelEndPoint.cpp | 2 +- nxcomp/src/Children.cpp | 4 ++-- nxcomp/src/Fork.cpp | 2 +- nxcomp/src/Loop.cpp | 16 ++++++++-------- nxcomp/src/MD5.c | 4 ++-- nxcomp/src/Proxy.cpp | 4 ++-- nxcomp/src/ServerChannel.cpp | 4 ++-- nxcomp/src/Socket.cpp | 8 ++++---- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/nxcomp/src/Auth.cpp b/nxcomp/src/Auth.cpp index 87955f6ab..aaca905de 100644 --- a/nxcomp/src/Auth.cpp +++ b/nxcomp/src/Auth.cpp @@ -238,7 +238,7 @@ int Auth::getCookie() char command[DEFAULT_STRING_LIMIT]; - #if defined(__CYGWIN32__) + #if defined(__CYGWIN__) || defined(__CYGWIN32__) snprintf(command, DEFAULT_STRING_LIMIT, "%s/bin/nxauth", control -> SystemPath); diff --git a/nxcomp/src/BlockCacheSet.cpp b/nxcomp/src/BlockCacheSet.cpp index 1dd6361dc..1f79b2dd0 100644 --- a/nxcomp/src/BlockCacheSet.cpp +++ b/nxcomp/src/BlockCacheSet.cpp @@ -51,13 +51,13 @@ BlockCacheSet::~BlockCacheSet() // failure happens in this destructor. // - #ifndef __CYGWIN32__ + #if !(defined(__CYGWIN__) || defined(__CYGWIN32__)) for (unsigned int i = 0; i < size_; i++) delete caches_[i]; delete[]caches_; - #endif /* ifdef __CYGWIN32__ */ + #endif /* if defined(__CYGWIN__) || defined(__CYGWIN32__) */ } diff --git a/nxcomp/src/ChannelEndPoint.cpp b/nxcomp/src/ChannelEndPoint.cpp index 635dd1ac7..7d088bdde 100644 --- a/nxcomp/src/ChannelEndPoint.cpp +++ b/nxcomp/src/ChannelEndPoint.cpp @@ -253,7 +253,7 @@ getComputerName() { const char *hostname = NULL; - #ifdef __CYGWIN32__ + #if defined(__CYGWIN__) || defined(__CYGWIN32__) hostname = getenv("COMPUTERNAME"); diff --git a/nxcomp/src/Children.cpp b/nxcomp/src/Children.cpp index 2e89f2e68..4c74e662b 100644 --- a/nxcomp/src/Children.cpp +++ b/nxcomp/src/Children.cpp @@ -295,7 +295,7 @@ int NXTransDialog(const char *caption, const char *message, strcat(newPath, "/Applications/NX Client for OSX.app/Contents/MacOS:"); #endif - #ifdef __CYGWIN32__ + #if defined(__CYGWIN__) || defined(__CYGWIN32__) // FIXME: missing length limitation! strcat(newPath, ".:"); #endif @@ -505,7 +505,7 @@ int NXTransClient(const char* display) #endif - #ifdef __CYGWIN32__ + #if defined(__CYGWIN__) || defined(__CYGWIN32__) strcat(newPath, ".:"); diff --git a/nxcomp/src/Fork.cpp b/nxcomp/src/Fork.cpp index 657c36134..5c855e0c3 100644 --- a/nxcomp/src/Fork.cpp +++ b/nxcomp/src/Fork.cpp @@ -53,7 +53,7 @@ int Fork() { - #ifdef __CYGWIN32__ + #if defined(__CYGWIN__) || defined(__CYGWIN32__) int limit = RETRY_LIMIT; int timeout = RETRY_TIMEOUT; diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp index 7fecb9123..4bbf42b91 100644 --- a/nxcomp/src/Loop.cpp +++ b/nxcomp/src/Loop.cpp @@ -79,7 +79,7 @@ typedef int socklen_t; #include <sys/select.h> #endif -#ifndef __CYGWIN32__ +#if !(defined(__CYGWIN__) || defined(__CYGWIN32__)) #include <netinet/tcp.h> #endif @@ -4702,7 +4702,7 @@ void CleanupStreams() // at the time the proxy is being shut down. // - #ifndef __CYGWIN32__ + #if !(defined(__CYGWIN__) || defined(__CYGWIN32__)) nxinfo << "Loop: Freeing up streams in process " << "with pid '" << getpid() << "'.\n" @@ -4753,7 +4753,7 @@ void CleanupStreams() errofs = NULL; } - #endif /* #ifndef __CYGWIN32__ */ + #endif /* #if !(defined(__CYGWIN__) || defined(__CYGWIN32__)) */ // // Reset these as they can't be reset @@ -5705,7 +5705,7 @@ void HandleSignal(int signal) break; } - #ifdef __CYGWIN32__ + #if defined(__CYGWIN__) || defined(__CYGWIN32__) case 12: { @@ -6753,7 +6753,7 @@ int ConnectToRemote(ChannelEndPoint &socketAddress) // on Windows. // - #ifdef __CYGWIN32__ + #if defined(__CYGWIN__) || defined(__CYGWIN32__) KillProcess(lastDialog, "dialog", SIGKILL, 1); @@ -9849,7 +9849,7 @@ char *GetClientPath() clientEnv = "/Applications/NX Client for OSX.app/Contents/MacOS/nxclient"; #else - # if defined(__CYGWIN32__) + # if defined(__CYGWIN__) || defined(__CYGWIN32__) clientEnv = "C:\\Program Files\\NX Client for Windows\\nxclient"; @@ -13633,7 +13633,7 @@ int CheckSignal(int signal) } default: { - #ifdef __CYGWIN32__ + #if defined(__CYGWIN__) || defined(__CYGWIN32__) // // This signal can be raised by the Cygwin @@ -14968,7 +14968,7 @@ static void handleAlertInLoop() // on Windows. // - #ifdef __CYGWIN32__ + #if defined(__CYGWIN__) || defined(__CYGWIN32__) KillProcess(lastDialog, "dialog", SIGKILL, 0); diff --git a/nxcomp/src/MD5.c b/nxcomp/src/MD5.c index 43a2793e3..f5bc01761 100644 --- a/nxcomp/src/MD5.c +++ b/nxcomp/src/MD5.c @@ -64,7 +64,7 @@ * at compile time. */ -#if defined(__linux) || defined(__CYGWIN32__) +#if defined(__linux) || defined(__CYGWIN__) || defined(__CYGWIN32__) #include <endian.h> @@ -74,7 +74,7 @@ #define ARCH_IS_BIG_ENDIAN 1 #endif -#endif /* #if defined(__linux) || defined(__CYGWIN32__) */ +#endif /* #if defined(__linux) || defined(__CYGWIN__) || defined(__CYGWIN32__) */ #undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */ #ifdef ARCH_IS_BIG_ENDIAN diff --git a/nxcomp/src/Proxy.cpp b/nxcomp/src/Proxy.cpp index 7f72fae3f..1713e308b 100644 --- a/nxcomp/src/Proxy.cpp +++ b/nxcomp/src/Proxy.cpp @@ -44,7 +44,7 @@ #include "Misc.h" -#if defined(__CYGWIN32__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun) +#if defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun) #include <netinet/in_systm.h> #endif @@ -788,7 +788,7 @@ const char *Proxy::getComputerName() const char *hostname = NULL; - #ifdef __CYGWIN32__ + #if defined(__CYGWIN__) || defined(__CYGWIN32__) hostname = getenv("COMPUTERNAME"); diff --git a/nxcomp/src/ServerChannel.cpp b/nxcomp/src/ServerChannel.cpp index 0c99c9d33..4ee83507d 100644 --- a/nxcomp/src/ServerChannel.cpp +++ b/nxcomp/src/ServerChannel.cpp @@ -6972,7 +6972,7 @@ int ServerChannel::handleShmemRequest(DecodeBuffer &decodeBuffer, unsigned char // 0600 mask doesn't seem to work). // - #if defined(__CYGWIN32__) || defined(__APPLE__) + #if defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__APPLE__) int permissions = 0777; @@ -7047,7 +7047,7 @@ int ServerChannel::handleShmemRequest(DecodeBuffer &decodeBuffer, unsigned char } else { - #ifndef __CYGWIN32__ + #if !(defined(__CYGWIN__) || defined(__CYGWIN32__)) #ifdef WARNING *logofs << "handleShmemRequest: WARNING! Can't create the shared " diff --git a/nxcomp/src/Socket.cpp b/nxcomp/src/Socket.cpp index 8be04d76d..34fdea634 100644 --- a/nxcomp/src/Socket.cpp +++ b/nxcomp/src/Socket.cpp @@ -30,7 +30,7 @@ #include <sys/types.h> #include <sys/utsname.h> -#if defined(__CYGWIN32__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun) +#if defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun) #include <netinet/in_systm.h> #endif @@ -65,7 +65,7 @@ // disabled when running on MacOS/X. // -#ifdef __CYGWIN32__ +#if defined(__CYGWIN__) || defined(__CYGWIN32__) #define TIOCOUTQ ((unsigned int) -1) #endif @@ -101,7 +101,7 @@ int GetKernelStep() // in the relevant OS dependent functions. // - #if defined(__CYGWIN32__) || defined(__APPLE__) + #if defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__APPLE__) _kernelStep = 0; @@ -183,7 +183,7 @@ int GetKernelStep() } } - #endif /* #if defined(__CYGWIN32__) || defined(__APPLE__) */ + #endif /* #if defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__APPLE__) */ } return _kernelStep; -- 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 3.6.x in repository nx-libs. commit 9815f32d5c7c397c5a27a53764565beda2d007c2 Merge: c3476b6a8 5dcb19b3d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 8 08:07:25 2021 +0200 Merge branch 'uli42-pr/dialog_text' into 3.6.x Attributes GH PR #1004: https://github.com/ArcticaProject/nx-libs/pull/1004 nx-X11/programs/Xserver/hw/nxagent/Dialog.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 4 +- nxcomp/src/Children.cpp | 60 +++++++++++++++++++------- 3 files changed, 47 insertions(+), 21 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 3.6.x in repository nx-libs. commit 5dcb19b3d7ae4910f3d3cd1015b0840e7d4bf11d Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Feb 28 21:50:48 2021 +0100 nxagent: fix RESIZE dialog text to not end with a linefeed It was the only dialog that had a linefeed a the end. --- nx-X11/programs/Xserver/hw/nxagent/Dialog.h | 4 +--- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h index b11df5045..d0295f81c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h @@ -192,9 +192,7 @@ by dragging the desktop with the mouse while pressing\n\ Ctrl+Alt or use the keystrokes listed below. Press\n\ %s again to return to the desktop resize mode.\n\ \n\ -Use these keystrokes to navigate:\n\ -%s\ -" +Use these keystrokes to navigate:%s" #define DIALOG_DISABLE_DESKTOP_RESIZE_MODE_TYPE "ok" diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index 9a7c1cd65..aff2e56ab 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -513,13 +513,13 @@ char *nxagentFindMatchingKeystrokes(char *name) { char *tmp; char *tmp1 = nxagentGetSingleKeystrokeString(cur); - if (-1 == asprintf(&tmp, "%s %-*s : %s\n", res, maxlen, + if (-1 == asprintf(&tmp, "%s\n %-*s : %s", res, maxlen, nxagentSpecialKeystrokeNames[cur->stroke], tmp1)) { SAFE_free(tmp1); #ifdef TEST - fprintf(stderr, "%s: returning incomplete result:\n%s", __func__, res); + fprintf(stderr, "%s: returning incomplete result:%s\n", __func__, res); #endif return res; } -- 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 3.6.x in repository nx-libs. commit 1b4ebce2ce8ef29c01bd124ed56c9d6a14c9a82d Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Mar 17 22:17:55 2021 +0100 Compext.c: fix comparisons of 16bit sequence numbers rep->generic.sequenceNumber is of type CARD16 state->sequence is of type unsigned long Converting state->sequence to an int as it has been done since the first version of nxcomp I know of (1.3.0-18 from 2003) is wrong here because for numbers > INT_MAX this will result in a negative number, which, after applying the 16bit modulo, will not match rep->generic.sequenceNumber. Example with numbers: CARD16 c = 24565 unsigned long u = 3179110389 c % 65536 = 24565 u % 65536 = 24565 (int)(u) = -1115856907 (int)(u) % 65536 = -40971 -40971 will not match 24565 To fix this we need to ensure the number stays positive. We use CARD16 for this to match the type in the request which is a 16bit number. On my system CARD16 is unsigned short which is guaranteed to contain _at least_ the 0-65,535 range. As there is no upper limit of the range we cannot drop the modulo because we need this value to be 16bit and not more. Thanks to Norm Green for providing log after log until we could finally identify the reason for him seeing "Xlib: unexpected async reply (sequence 0x94b01439)!" when pasting stopped working. --- nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c index 4a8dacaf4..7a6cb9e30 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c @@ -3435,7 +3435,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectImageState *) data; if ((rep -> generic.sequenceNumber % 65536) != - ((int)(state -> sequence) % 65536)) + ((CARD16)(state -> sequence) % 65536)) { #ifdef TEST fprintf(stderr, "******_NXCollectImageHandler: Unmatched sequence [%d] for opcode [%d] " @@ -3819,7 +3819,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectPropertyState *) data; if ((rep -> generic.sequenceNumber % 65536) != - ((int)(state -> sequence) % 65536)) + ((CARD16)(state -> sequence) % 65536)) { #ifdef TEST fprintf(stderr, "******_NXCollectPropertyHandler: Unmatched sequence [%d] for opcode [%d] " @@ -4173,7 +4173,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectGrabPointerState *) data; if ((rep -> generic.sequenceNumber % 65536) != - ((int)(state -> sequence) % 65536)) + ((CARD16)(state -> sequence) % 65536)) { #ifdef TEST fprintf(stderr, "******_NXCollectGrabPointerHandler: Unmatched sequence [%d] for opcode [%d] " @@ -4447,7 +4447,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectInputFocusState *) data; if ((rep -> generic.sequenceNumber % 65536) != - ((int)(state -> sequence) % 65536)) + ((CARD16)(state -> sequence) % 65536)) { #ifdef TEST fprintf(stderr, "******_NXCollectInputFocusHandler: Unmatched sequence [%d] for opcode [%d] " -- 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 3.6.x in repository nx-libs. commit 1bd98ef7730f8f8807d07b3af0357e31a530e90a Merge: 00711f914 1b4ebce2c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 8 08:19:08 2021 +0200 Merge branch 'uli42-pr/fix_async_replies' into 3.6.x Attributes GH PR #1010: https://github.com/ArcticaProject/nx-libs/pull/1010 nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c | 8 ++++---- 1 file changed, 4 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 3.6.x in repository nx-libs. commit 00711f914d4b0ca76ca66c0225f257d6192807e2 Merge: 9815f32d5 ff0c2b148 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 8 08:17:37 2021 +0200 Merge branch 'vatral-support_cygwin64' into 3.6.x Attributes GH PR #1008: https://github.com/ArcticaProject/nx-libs/pull/1008 nxcomp/src/Auth.cpp | 2 +- nxcomp/src/BlockCacheSet.cpp | 4 ++-- nxcomp/src/ChannelEndPoint.cpp | 2 +- nxcomp/src/Children.cpp | 4 ++-- nxcomp/src/Fork.cpp | 2 +- nxcomp/src/Loop.cpp | 16 ++++++++-------- nxcomp/src/MD5.c | 4 ++-- nxcomp/src/Proxy.cpp | 4 ++-- nxcomp/src/ServerChannel.cpp | 4 ++-- nxcomp/src/Socket.cpp | 8 ++++---- 10 files changed, 25 insertions(+), 25 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 3.6.x in repository nx-libs. commit ff0c2b1484e6e8a9f47d4ba78bbff54bf734c2f1 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 8 08:12:17 2021 +0200 nxcomp/src/BlockCacheSet.cpp: Amend comment behind if-clause closure. --- nxcomp/src/BlockCacheSet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxcomp/src/BlockCacheSet.cpp b/nxcomp/src/BlockCacheSet.cpp index 1f79b2dd0..98546b773 100644 --- a/nxcomp/src/BlockCacheSet.cpp +++ b/nxcomp/src/BlockCacheSet.cpp @@ -57,7 +57,7 @@ BlockCacheSet::~BlockCacheSet() delete caches_[i]; delete[]caches_; - #endif /* if defined(__CYGWIN__) || defined(__CYGWIN32__) */ + #endif /* if !(defined(__CYGWIN__) || defined(__CYGWIN32__)) */ } -- 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 3.6.x in repository nx-libs. commit f0f91ed2608f98c4ddef6eb7bc289e36e8569a93 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Mar 7 14:12:53 2021 +0100 Compext.c: some scope improvements --- .../programs/Xserver/hw/nxagent/compext/Compext.c | 47 +++++----------------- 1 file changed, 10 insertions(+), 37 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c index 7a6cb9e30..bd839f5e7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c @@ -324,13 +324,11 @@ int _NXInternalInitResources(Display *dpy) int _NXInternalResetResources(Display *dpy) { - int i; - #ifdef TEST fprintf(stderr, "******_NXInternalResetResources: Clearing all the internal structures.\n"); #endif - for (i = 0; i < NXNumberOfResources; i++) + for (int i = 0; i < NXNumberOfResources; i++) { _NXSplitResources[i] = 0; _NXUnpackResources[i] = 0; @@ -913,10 +911,6 @@ Status NXGetUnpackParameters(Display *dpy, unsigned int *entries, unsigned char register unsigned n; - #ifdef TEST - register unsigned i; - #endif - if (*entries < NXNumberOfPackMethods) { #ifdef TEST @@ -979,7 +973,7 @@ Status NXGetUnpackParameters(Display *dpy, unsigned int *entries, unsigned char fprintf(stderr, "******NXGetUnpackParameters: Got reply with methods: "); - for (i = 0; i < n; i++) + for (unsigned int i = 0; i < n; i++) { if (supported_methods[i] != 0) { @@ -1812,12 +1806,6 @@ int NXSetUnpackColormapCompat(Display *dpy, unsigned int resource, register int dst_data_length; - #ifdef DUMP - - int i; - - #endif - LockDisplay(dpy); GetReq(NXSetUnpackColormapCompat, req); @@ -1862,7 +1850,7 @@ int NXSetUnpackColormapCompat(Display *dpy, unsigned int resource, fprintf(stderr, "******NXSetUnpackColormapCompat: Dumping colormap entries:\n"); - for (i = 0; i < entries; i++) + for (int i = 0; i < entries; i++) { fprintf(stderr, "******NXSetUnpackColormapCompat: [%d] -> [0x%x].\n", i, *((int *) (dst_data + (i * 4)))); @@ -1907,12 +1895,6 @@ int NXSetUnpackAlphaCompat(Display *dpy, unsigned int resource, register unsigned int dst_data_length; - #ifdef DUMP - - int i; - - #endif - LockDisplay(dpy); GetReq(NXSetUnpackAlphaCompat, req); @@ -1962,7 +1944,7 @@ int NXSetUnpackAlphaCompat(Display *dpy, unsigned int resource, fprintf(stderr, "******NXSetUnpackAlphaCompat: Dumping alpha channel data:\n"); - for (i = 0; i < dst_data_length; i++) + for (int i = 0; i < dst_data_length; i++) { fprintf(stderr, "******NXSetUnpackAlphaCompat: [%d] -> [0x%02x].\n", i, ((unsigned int) *(dst_data + i)) & 0xff); @@ -2573,11 +2555,9 @@ int NXAllocColors(Display *dpy, Colormap colormap, unsigned int entries, Bool alloc_error = False; - register unsigned int i; - LockDisplay(dpy); - for (i = 0; i < entries; i++) + for (unsigned int i = 0; i < entries; i++) { GetReq(AllocColor, req); @@ -2588,7 +2568,7 @@ int NXAllocColors(Display *dpy, Colormap colormap, unsigned int entries, req -> blue = screens_in_out[i].blue; } - for (i = 0; i < entries; i++) + for (unsigned int i = 0; i < entries; i++) { result = _XReply(dpy, (xReply *) &rep, 0, xTrue); @@ -3163,21 +3143,18 @@ void _NXCacheDump(const char *label) { char s[MD5_LENGTH * 2 + 1]; - int i; - int j; - #ifdef DEBUG fprintf(stderr, "%s: Dumping the content of image cache:\n", label); #endif - for (i = 0; i < NXImageCacheSize; i++) + for (int i = 0; i < NXImageCacheSize; i++) { if (NXImageCache[i].image == NULL) { break; } - for (j = 0; j < MD5_LENGTH; j++) + for (int j = 0; j < MD5_LENGTH; j++) { sprintf(s + (j * 2), "%02X", ((unsigned char *) NXImageCache[i].md5)[j]); } @@ -3362,8 +3339,6 @@ int NXCacheAddImage(NXPackedImage *image, unsigned int method, unsigned char *md void NXFreeCache(Display *dpy) { - int i; - if (NXImageCache == NULL) { #ifdef DEBUG @@ -3378,7 +3353,7 @@ void NXFreeCache(Display *dpy) NXImageCacheSize); #endif - for (i = 0; i < NXImageCacheSize; i++) + for (int i = 0; i < NXImageCacheSize; i++) { if (NXImageCache[i].image != NULL) { @@ -3625,9 +3600,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, int NXGetCollectImageResource(Display *dpy) { - int i; - - for (i = 0; i < NXNumberOfResources; i++) + for (int i = 0; i < NXNumberOfResources; i++) { if (_NXCollectedImages[i] == NULL) { -- 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 3.6.x in repository nx-libs. commit 605a266911b50ababbb3f8a8b224efb42743379c Author: ponce <matteo.bernardini@gmail.com> Date: Mon Apr 5 08:44:00 2021 +0200 fix building with binutils >= 2.36. The l option of ar in the newer binutils versions switched from being unused to being used to specify dependencies so here should be safely removed --- nx-X11/config/cf/Imake.tmpl | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/nx-X11/config/cf/Imake.tmpl b/nx-X11/config/cf/Imake.tmpl index 25d985d75..de1fca937 100644 --- a/nx-X11/config/cf/Imake.tmpl +++ b/nx-X11/config/cf/Imake.tmpl @@ -1015,25 +1015,13 @@ TCLIBDIR = TclLibDir #define ArCmdBase ar #endif #ifndef ArCmd -#if HasLargeTmp || SystemV4 #define ArCmd ArCmdBase cq -#else -#define ArCmd ArCmdBase clq -#endif #endif #ifndef ArAddCmd -#if HasLargeTmp || SystemV4 #define ArAddCmd ArCmdBase ru -#else -#define ArAddCmd ArCmdBase rul -#endif #endif #ifndef ArExtCmd -#if HasLargeTmp || SystemV4 #define ArExtCmd ArCmdBase x -#else -#define ArExtCmd ArCmdBase xl -#endif #endif #ifndef BootstrapCFlags #define BootstrapCFlags /**/ -- 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 3.6.x in repository nx-libs. commit 906aa0714de9f2aa2b9d2600d44658864cce0070 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Mar 7 14:13:09 2021 +0100 Compext.c: add specific DEBUG and TEST macros --- .../programs/Xserver/hw/nxagent/compext/Compext.c | 302 +++++++++++---------- 1 file changed, 159 insertions(+), 143 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c index bd839f5e7..a77e4fc79 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c @@ -74,7 +74,23 @@ #define PANIC #define WARNING #undef TEST +#undef TEST_DISPLAY +#undef TEST_IMAGE +#undef TEST_INPUT +#undef TEST_PARAMS +#undef TEST_POINTER +#undef TEST_PROPERTY +#undef TEST_SPLIT +#undef TEST_UNPACK #undef DEBUG +#undef DEBUG_DISPLAY +#undef DEBUG_IMAGE +#undef DEBUG_INPUT +#undef DEBUG_PARAMS +#undef DEBUG_POINTER +#undef DEBUG_PROPERTY +#undef DEBUG_SPLIT +#undef DEBUG_UNPACK #undef DUMP /* @@ -271,7 +287,7 @@ extern int _NXInternalResetEncoders(Display *dpy); int NXInitDisplay(Display *dpy) { - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXInitDisplay: Called for display at [%p].\n", (void *) dpy); #endif @@ -286,7 +302,7 @@ int NXInitDisplay(Display *dpy) return 1; } - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXInitDisplay: WARNING! Internal structures already initialized.\n"); #endif @@ -295,7 +311,7 @@ int NXInitDisplay(Display *dpy) int NXResetDisplay(Display *dpy) { - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXResetDisplay: Called for display at [%p].\n", (void *) dpy); #endif @@ -310,7 +326,7 @@ int NXResetDisplay(Display *dpy) return 1; } - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXResetDisplay: WARNING! Internal structures already reset.\n"); #endif @@ -324,7 +340,7 @@ int _NXInternalInitResources(Display *dpy) int _NXInternalResetResources(Display *dpy) { - #ifdef TEST + #if defined(TEST_IMAGE) || defined(TEST_PROPERTY) || defined(TEST_POINTER) || defined(TEST_INPUT) fprintf(stderr, "******_NXInternalResetResources: Clearing all the internal structures.\n"); #endif @@ -335,7 +351,7 @@ int _NXInternalResetResources(Display *dpy) if (_NXCollectedImages[i] != NULL) { - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******_NXInternalResetResources: WARNING! Clearing collect image data " "for resource [%d].\n", i); #endif @@ -357,7 +373,7 @@ int _NXInternalResetResources(Display *dpy) if (_NXCollectedProperties[i] != NULL) { - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******_NXInternalResetResources: WARNING! Clearing collect property data " "for resource [%d].\n", i); #endif @@ -376,7 +392,7 @@ int _NXInternalResetResources(Display *dpy) if (_NXCollectedGrabPointers[i] != NULL) { - #ifdef TEST + #ifdef TEST_POINTER fprintf(stderr, "******_NXInternalResetResources: WARNING! Clearing grab pointer data " "for resource [%d].\n", i); #endif @@ -393,7 +409,7 @@ int _NXInternalResetResources(Display *dpy) if (_NXCollectedInputFocuses[i] != NULL) { - #ifdef TEST + #ifdef TEST_INPUT fprintf(stderr, "******_NXInternalResetResources: WARNING! Clearing collect input focus data " "for resource [%d].\n", i); #endif @@ -452,7 +468,7 @@ int NXSetDisplayBuffer(Display *dpy, int size) if (dpy -> bufmax - size == dpy -> buffer) { - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXSetDisplayBuffer: Nothing to do with buffer size matching.\n"); #endif @@ -482,7 +498,7 @@ int NXSetDisplayBuffer(Display *dpy, int size) dpy -> bufptr = dpy -> buffer; dpy -> bufmax = dpy -> bufptr + size; - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXSetDisplayBuffer: Set the display output buffer size to [%d].\n", size); #endif @@ -525,7 +541,7 @@ int NXHandleDisplayError(int value) _NXHandleDisplayError = value; - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXHandleDisplayError: Set the flag to [%d] with previous value [%d].\n", value, previous); #endif @@ -594,7 +610,7 @@ int NXDisplayReadable(Display *dpy) if (result == 0) { - #ifdef DEBUG + #ifdef DEBUG_DISPLAY fprintf(stderr, "******NXDisplayReadable: Returning [%d] bytes readable from fd [%d].\n", readable, dpy -> fd); #endif @@ -602,7 +618,7 @@ int NXDisplayReadable(Display *dpy) return readable; } - #ifdef DEBUG + #ifdef DEBUG_DISPLAY fprintf(stderr, "******NXDisplayReadable: WARNING! Error detected on display fd [%d].\n", dpy -> fd); #endif @@ -612,7 +628,7 @@ int NXDisplayReadable(Display *dpy) int NXDisplayFlushable(Display *dpy) { - #ifdef DEBUG + #ifdef DEBUG_DISPLAY int flushable; @@ -635,7 +651,7 @@ int NXDisplayFlushable(Display *dpy) int NXDisplayCongestion(Display *dpy) { - #ifdef DEBUG + #ifdef DEBUG_DISPLAY int congestion = NXTransCongestion(dpy -> fd); @@ -656,7 +672,7 @@ int NXFlushDisplay(Display *dpy, int what) if (!(dpy -> flags & XlibDisplayWriting) && dpy -> bufptr - dpy -> buffer > 0) { - #ifdef DEBUG + #ifdef DEBUG_DISPLAY fprintf(stderr, "******NXFlushDisplay: Writing with [%d] bytes in the buffer.\n", (int) (dpy -> bufptr - dpy -> buffer)); #endif @@ -669,7 +685,7 @@ int NXFlushDisplay(Display *dpy, int what) return 0; } - #ifdef DEBUG + #ifdef DEBUG_DISPLAY fprintf(stderr, "******NXFlushDisplay: Flushing with [%d] bytes in the NX transport.\n", NXDisplayFlushable(dpy)); #endif @@ -683,7 +699,7 @@ NXDisplayErrorPredicate NXSetDisplayErrorPredicate(NXDisplayErrorPredicate predi _NXDisplayErrorFunction = predicate; - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXSetDisplayErrorPredicate: Set the predicate to [%p] with previous value [%p].\n", predicate, previous); #endif @@ -697,7 +713,7 @@ NXDisplayBlockHandler NXSetDisplayBlockHandler(NXDisplayBlockHandler handler) _NXDisplayBlockFunction = handler; - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXSetDisplayBlockHandler: Set the handler to [%p] with previous value [%p].\n", handler, previous); #endif @@ -711,7 +727,7 @@ NXDisplayWriteHandler NXSetDisplayWriteHandler(NXDisplayWriteHandler handler) _NXDisplayWriteFunction = handler; - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXSetDisplayWriteHandler: Set the handler to [%p] with previous value [%p].\n", handler, previous); #endif @@ -728,7 +744,7 @@ NXDisplayFlushHandler NXSetDisplayFlushHandler(NXDisplayFlushHandler handler, Di NXTransHandler(NX_FD_ANY, NX_HANDLER_FLUSH, (void (*)(void *, int)) handler, (void *) display); - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXSetDisplayFlushHandler: Set the handler to [%p] with display [%p] " "and previous value [%p].\n", handler, display, previous); #endif @@ -749,7 +765,7 @@ NXDisplayStatisticsHandler NXSetDisplayStatisticsHandler(NXDisplayStatisticsHand NXTransHandler(NX_FD_ANY, NX_HANDLER_STATISTICS, (void (*)(void *, int)) handler, (void *) buffer); - #ifdef TEST + #ifdef TEST_DISPLAY fprintf(stderr, "******NXSetDisplayStatisticsHandler: Set the handler to [%p] with buffer pointer [%p] " "and previous value [%p].\n", handler, buffer, previous); #endif @@ -818,14 +834,14 @@ Status NXGetControlParameters(Display *dpy, unsigned int *link_type, unsigned in GetEmptyReq(NXGetControlParameters, req); - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetControlParameters: Sending message opcode [%d].\n", X_NXGetControlParameters); #endif if (_XReply(dpy, (xReply *) &rep, 0, xTrue) == xFalse) { - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetControlParameters: Error receiving reply.\n"); #endif @@ -836,7 +852,7 @@ Status NXGetControlParameters(Display *dpy, unsigned int *link_type, unsigned in return 0; } - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetControlParameters: Got reply with link type [%u].\n", rep.linkType); fprintf(stderr, "******NXGetControlParameters: Local protocol major [%u] minor [%u] patch [%u].\n", @@ -913,7 +929,7 @@ Status NXGetUnpackParameters(Display *dpy, unsigned int *entries, unsigned char if (*entries < NXNumberOfPackMethods) { - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetUnpackParameters: Requested only [%d] entries while they should be [%d].\n", *entries, NXNumberOfPackMethods); #endif @@ -927,14 +943,14 @@ Status NXGetUnpackParameters(Display *dpy, unsigned int *entries, unsigned char req -> entries = *entries; - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetUnpackParameters: Sending message opcode [%d] with [%d] requested entries.\n", X_NXGetUnpackParameters, *entries); #endif if (_XReply(dpy, (xReply *) &rep, 0, xFalse) == xFalse || rep.length == 0) { - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetUnpackParameters: Error receiving reply.\n"); #endif @@ -947,7 +963,7 @@ Status NXGetUnpackParameters(Display *dpy, unsigned int *entries, unsigned char if ((n = rep.length << 2) > *entries) { - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetUnpackParameters: Got [%d] bytes of reply data while they should be [%d].\n", n, *entries); #endif @@ -963,13 +979,13 @@ Status NXGetUnpackParameters(Display *dpy, unsigned int *entries, unsigned char *entries = n; - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetUnpackParameters: Reading [%d] bytes of reply data.\n", n); #endif _XReadPad(dpy, (char *) supported_methods, n); - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetUnpackParameters: Got reply with methods: "); @@ -1051,12 +1067,12 @@ Status NXGetShmemParameters(Display *dpy, unsigned int *enable_client, req -> clientSegment = *client_segment; req -> serverSegment = *server_segment; - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetShmemParameters: Sending message opcode [%d] at stage [%d].\n", X_NXGetShmemParameters, stage); #endif - #ifdef TEST + #ifdef TEST_PARAMS if (stage == 0) { @@ -1095,7 +1111,7 @@ Status NXGetShmemParameters(Display *dpy, unsigned int *enable_client, if (_XReply(dpy, (xReply *) &rep, 0, xTrue) == xFalse) { - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetShmemParameters: Error receiving reply.\n"); #endif @@ -1120,7 +1136,7 @@ Status NXGetShmemParameters(Display *dpy, unsigned int *enable_client, *client_size = rep.clientSize; *server_size = rep.serverSize; - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetShmemParameters: Got final reply with enabled client [%u] and server [%u].\n", *enable_client, *enable_server); @@ -1162,13 +1178,13 @@ Status NXGetFontParameters(Display *dpy, unsigned int path_length, char path_dat register unsigned n; - #ifdef TEST + #ifdef TEST_PARAMS register unsigned i; #endif if (path_length < 1) { - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetFontParameters: No room to store the reply.\n"); #endif @@ -1181,14 +1197,14 @@ Status NXGetFontParameters(Display *dpy, unsigned int path_length, char path_dat GetReq(NXGetFontParameters, req); - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetFontParameters: Sending message opcode [%d].\n", X_NXGetFontParameters); #endif if (_XReply(dpy, (xReply *) &rep, 0, xFalse) == xFalse || rep.length == 0) { - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetFontParameters: Error receiving reply.\n"); #endif @@ -1201,7 +1217,7 @@ Status NXGetFontParameters(Display *dpy, unsigned int path_length, char path_dat if ((n = rep.length << 2) > path_length) { - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetFontParameters: Got [%d] bytes of reply data with only room for [%d].\n", n, path_length); #endif @@ -1215,7 +1231,7 @@ Status NXGetFontParameters(Display *dpy, unsigned int path_length, char path_dat return 0; } - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetFontParameters: Reading [%d] bytes of reply data.\n", n); #endif @@ -1228,7 +1244,7 @@ Status NXGetFontParameters(Display *dpy, unsigned int path_length, char path_dat if (*path_data > path_length - 1) { - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetFontParameters: Inconsistent length in the returned string.\n"); #endif @@ -1239,7 +1255,7 @@ Status NXGetFontParameters(Display *dpy, unsigned int path_length, char path_dat return 0; } - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXGetFontParameters: Got font path of [%d] bytes and value [", (int) *path_data); @@ -1270,7 +1286,7 @@ unsigned int NXAllocSplit(Display *dpy, unsigned int resource) { _NXSplitResources[resource] = 1; - #ifdef TEST + #ifdef TEST_SPLIT fprintf(stderr, "******NXAllocSplit: Reserved resource [%u].\n", resource); #endif @@ -1279,7 +1295,7 @@ unsigned int NXAllocSplit(Display *dpy, unsigned int resource) } } - #ifdef TEST + #ifdef TEST_SPLIT fprintf(stderr, "******NXAllocSplit: WARNING! Resource limit exausted.\n"); #endif @@ -1287,7 +1303,7 @@ unsigned int NXAllocSplit(Display *dpy, unsigned int resource) } else if (resource >= 0 && resource < NXNumberOfResources) { - #ifdef TEST + #ifdef TEST_SPLIT if (_NXSplitResources[resource] == 0) { @@ -1328,7 +1344,7 @@ int NXStartSplit(Display *dpy, unsigned int resource, unsigned int mode) req -> resource = resource; req -> mode = mode; - #ifdef TEST + #ifdef TEST_SPLIT fprintf(stderr, "******NXStartSplit: Sending opcode [%d] with resource [%d] mode [%d].\n", X_NXStartSplit, resource, mode); #endif @@ -1355,7 +1371,7 @@ int NXEndSplit(Display *dpy, unsigned int resource) req -> resource = resource; - #ifdef TEST + #ifdef TEST_SPLIT fprintf(stderr, "******NXEndSplit: Sending opcode [%d] with resource [%d].\n", X_NXStartSplit, resource); #endif @@ -1389,7 +1405,7 @@ int NXCommitSplit(Display *dpy, unsigned int resource, unsigned int propagate, req -> request = request; req -> position = position; - #ifdef TEST + #ifdef TEST_SPLIT fprintf(stderr, "******NXCommitSplit: Sending opcode [%d] with resource [%d] propagate [%d] " "request [%d] position [%d].\n", X_NXCommitSplit, resource, propagate, request, position); @@ -1410,7 +1426,7 @@ int NXAbortSplit(Display *dpy, unsigned int resource) GetReq(NXAbortSplit, req); - #ifdef TEST + #ifdef TEST_SPLIT fprintf(stderr, "******NXAbortSplit: Sending message opcode [%d] with resource [%u].\n", X_NXAbortSplit, resource); #endif @@ -1432,7 +1448,7 @@ int NXFinishSplit(Display *dpy, unsigned int resource) GetReq(NXFinishSplit, req); - #ifdef TEST + #ifdef TEST_SPLIT fprintf(stderr, "******NXFinishSplit: Sending message opcode [%d] with resource [%u].\n", X_NXFinishSplit, resource); #endif @@ -1456,7 +1472,7 @@ int NXFreeSplit(Display *dpy, unsigned int resource) GetReq(NXFreeSplit, req); - #ifdef TEST + #ifdef TEST_SPLIT fprintf(stderr, "******NXFreeSplit: Sending message opcode [%d] with resource [%u].\n", X_NXFreeSplit, resource); #endif @@ -1467,14 +1483,14 @@ int NXFreeSplit(Display *dpy, unsigned int resource) SyncHandle(); - #ifdef TEST + #ifdef TEST_SPLIT fprintf(stderr, "******NXFreeSplit: Making the resource [%u] newly available.\n", resource); #endif _NXSplitResources[resource] = 0; } - #ifdef TEST + #ifdef TEST_SPLIT else { fprintf(stderr, "******NXFreeSplit: Nothing to do for resource [%u].\n", @@ -1502,7 +1518,7 @@ int NXSetExposeParameters(Display *dpy, int expose, int graphics_expose, int no_ req -> graphicsExpose = graphics_expose; req -> noExpose = no_expose; - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXSetExposeParameters: Sending message opcode [%d] with flags [%d][%d][%d].\n", X_NXSetExposeParameters, req -> expose, req -> graphicsExpose, req -> noExpose); #endif @@ -1532,7 +1548,7 @@ int NXSetCacheParameters(Display *dpy, int enable_cache, int enable_split, req -> enableSave = enable_save; req -> enableLoad = enable_load; - #ifdef TEST + #ifdef TEST_PARAMS fprintf(stderr, "******NXSetCacheParameters: Sending message opcode [%d] with " "flags [%d][%d][%d][%d].\n", X_NXSetCacheParameters, req -> enableCache, req -> enableSplit, req -> enableSave, req -> enableLoad); @@ -1555,7 +1571,7 @@ unsigned int NXAllocUnpack(Display *dpy, unsigned int resource) { _NXUnpackResources[resource] = 1; - #ifdef TEST + #ifdef TEST_UNPACK fprintf(stderr, "******NXAllocUnpack: Reserved resource [%u].\n", resource); #endif @@ -1564,7 +1580,7 @@ unsigned int NXAllocUnpack(Display *dpy, unsigned int resource) } } - #ifdef TEST + #ifdef TEST_UNPACK fprintf(stderr, "******NXAllocUnpack: WARNING! Resource limit exausted.\n"); #endif @@ -1572,7 +1588,7 @@ unsigned int NXAllocUnpack(Display *dpy, unsigned int resource) } else if (resource >= 0 && resource < NXNumberOfResources) { - #ifdef TEST + #ifdef TEST_UNPACK if (_NXUnpackResources[resource] == 0) { @@ -1634,7 +1650,7 @@ int NXSetUnpackGeometry(Display *dpy, unsigned int resource, Visual *visual) return -1; } - #ifdef TEST + #ifdef TEST_UNPACK fprintf(stderr, "******NXSetUnpackGeometry: Resource [%u] Depth/Bpp [1/%d][4/%d][8/%d]" "[16/%d][24/%d][32/%d].\n", resource, req -> depth1Bpp, req -> depth4Bpp, req -> depth8Bpp, req -> depth16Bpp, req -> depth24Bpp, req -> depth32Bpp); @@ -1677,7 +1693,7 @@ int NXSetUnpackColormap(Display *dpy, unsigned int resource, unsigned int method req -> length += (dst_data_length >> 2); - #ifdef TEST + #ifdef TEST_UNPACK fprintf(stderr, "******NXSetUnpackColormap: Resource [%u] data size [%u] destination " "data size [%u].\n", resource, data_length, dst_data_length); #endif @@ -1740,7 +1756,7 @@ int NXSetUnpackAlpha(Display *dpy, unsigned int resource, unsigned int method, req -> length += (dst_data_length >> 2); - #ifdef TEST + #ifdef TEST_UNPACK fprintf(stderr, "******NXSetUnpackAlpha: Resource [%u] data size [%u] destination data size [%u].\n", resource, data_length, dst_data_length); #endif @@ -1817,7 +1833,7 @@ int NXSetUnpackColormapCompat(Display *dpy, unsigned int resource, req -> length += (dst_data_length >> 2); - #ifdef TEST + #ifdef TEST_UNPACK fprintf(stderr, "******NXSetUnpackColormapCompat: Resource [%u] number of entries [%u] " "destination data size [%u].\n", resource, entries, dst_data_length); #endif @@ -1906,7 +1922,7 @@ int NXSetUnpackAlphaCompat(Display *dpy, unsigned int resource, req -> length += (dst_data_length >> 2); - #ifdef TEST + #ifdef TEST_UNPACK fprintf(stderr, "******NXSetUnpackAlphaCompat: Resource [%u] number of entries [%u] " "destination data size [%u].\n", resource, entries, dst_data_length); #endif @@ -1986,7 +2002,7 @@ int NXFreeUnpack(Display *dpy, unsigned int resource) GetReq(NXFreeUnpack, req); - #ifdef TEST + #ifdef TEST_UNPACK fprintf(stderr, "******NXFreeUnpack: Sending message opcode [%d] with resource [%u].\n", X_NXFreeUnpack, resource); #endif @@ -1997,14 +2013,14 @@ int NXFreeUnpack(Display *dpy, unsigned int resource) SyncHandle(); - #ifdef TEST + #ifdef TEST_UNPACK fprintf(stderr, "******NXFreeUnpack: Making the resource [%u] newly available.\n", resource); #endif _NXUnpackResources[resource] = 0; } - #ifdef TEST + #ifdef TEST_UNPACK else { fprintf(stderr, "******NXFreeUnpack: Nothing to do for resource [%u].\n", @@ -2056,7 +2072,7 @@ int NXDestroyPackedImage(NXPackedImage *image) int NXCleanImage(XImage *image) { - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXCleanImage: Cleaning image with format [%d] depth [%d] " "bits per pixel [%d].\n", image -> format, image -> depth, image -> bits_per_pixel); @@ -2091,7 +2107,7 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method) unsigned int dst_bits_per_pixel; unsigned int dst_packed_bits_per_pixel; - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXPackImage: Going to pack a new image with method [%d].\n", method); #endif @@ -2143,7 +2159,7 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method) *dst_image = *src_image; - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXPackImage: Source width [%d], bytes per line [%d] with depth [%d].\n", src_image -> width, src_image -> bytes_per_line, src_image -> depth); #endif @@ -2174,7 +2190,7 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method) dst_bits_per_pixel = dst_image -> bits_per_pixel; dst_packed_bits_per_pixel = MethodBitsPerPixel(method); - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXPackImage: Destination depth [%d], bits per pixel [%d], packed bits per pixel [%d].\n", dst_image -> depth, dst_bits_per_pixel, dst_packed_bits_per_pixel); #endif @@ -2221,7 +2237,7 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method) * be able to handle ovelapping areas. */ - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXPackImage: Plain bits per pixel [%d], data size [%d].\n", dst_bits_per_pixel, dst_data_size); #endif @@ -2229,7 +2245,7 @@ NXPackedImage *NXPackImage(Display *dpy, XImage *src_image, unsigned int method) dst_packed_data_size = dst_data_size * dst_packed_bits_per_pixel / dst_bits_per_pixel; - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXPackImage: Packed bits per pixel [%d], data size [%d].\n", dst_packed_bits_per_pixel, dst_packed_data_size); #endif @@ -2278,7 +2294,7 @@ XImage *NXInPlacePackImage(Display *dpy, XImage *src_image, unsigned int method) unsigned int dst_bits_per_pixel; unsigned int dst_packed_bits_per_pixel; - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXInPlacePackImage: Going to pack a new image with method [%d].\n", method); #endif @@ -2329,7 +2345,7 @@ XImage *NXInPlacePackImage(Display *dpy, XImage *src_image, unsigned int method) *dst_image = *src_image; - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXInPlacePackImage: Source width [%d], bytes per line [%d] with depth [%d].\n", src_image -> width, src_image -> bytes_per_line, src_image -> depth); #endif @@ -2347,7 +2363,7 @@ XImage *NXInPlacePackImage(Display *dpy, XImage *src_image, unsigned int method) dst_bits_per_pixel = dst_image -> bits_per_pixel; dst_packed_bits_per_pixel = MethodBitsPerPixel(method); - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXInPlacePackImage: Destination depth [%d], bits per pixel [%d], packed bits per pixel [%d].\n", dst_image -> depth, dst_bits_per_pixel, dst_packed_bits_per_pixel); #endif @@ -2355,7 +2371,7 @@ XImage *NXInPlacePackImage(Display *dpy, XImage *src_image, unsigned int method) if (dst_packed_bits_per_pixel > dst_bits_per_pixel || ShouldMaskImage(src_image, mask) == 0) { - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXInPlacePackImage: Just clean image packed_bits_per_pixel[%d], bits_per_pixel[%d].\n", dst_packed_bits_per_pixel, dst_bits_per_pixel); #endif @@ -2390,7 +2406,7 @@ XImage *NXInPlacePackImage(Display *dpy, XImage *src_image, unsigned int method) * be able to handle ovelapping areas. */ - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXInPlacePackImage: Plain bits per pixel [%d], data size [%d].\n", dst_bits_per_pixel, dst_data_size); #endif @@ -2398,7 +2414,7 @@ XImage *NXInPlacePackImage(Display *dpy, XImage *src_image, unsigned int method) dst_packed_data_size = dst_data_size * dst_packed_bits_per_pixel / dst_bits_per_pixel; - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXInPlacePackImage: Packed bits per pixel [%d], data size [%d].\n", dst_packed_bits_per_pixel, dst_packed_data_size); #endif @@ -2433,7 +2449,7 @@ int NXPutPackedImage(Display *dpy, unsigned int resource, Drawable drawable, req -> drawable = drawable; req -> gc = ((GC) gc) -> gid; - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXPutPackedImage: Image resource [%d] drawable [%d] gc [%d].\n", req -> resource, (int) req -> drawable, (int) req -> gc); #endif @@ -2474,7 +2490,7 @@ int NXPutPackedImage(Display *dpy, unsigned int resource, Drawable drawable, req -> method = method; - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXPutPackedImage: Source image depth [%d] destination depth [%d] " "method [%d].\n", req -> srcDepth, req -> dstDepth, req -> method); #endif @@ -2508,7 +2524,7 @@ int NXPutPackedImage(Display *dpy, unsigned int resource, Drawable drawable, dst_data_length = ROUNDUP(src_data_length, 4); - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXPutPackedImage: Source data length [%d] request data length [%d].\n", src_data_length, dst_data_length); #endif @@ -2921,7 +2937,7 @@ void NXMaskImage(XImage *image, unsigned int method) { maskMethod = MASK_8_COLORS; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXMaskImage: Method is MASK_8_COLORS\n"); #endif @@ -2932,7 +2948,7 @@ void NXMaskImage(XImage *image, unsigned int method) { maskMethod = MASK_64_COLORS; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXMaskImage: Method is MASK_64K_COLORS\n"); #endif @@ -2943,7 +2959,7 @@ void NXMaskImage(XImage *image, unsigned int method) { maskMethod = MASK_256_COLORS; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXMaskImage: Method is MASK_256_COLORS\n"); #endif @@ -2954,7 +2970,7 @@ void NXMaskImage(XImage *image, unsigned int method) { maskMethod = MASK_512_COLORS; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXMaskImage: Method is MASK_512K_COLORS\n"); #endif @@ -2965,7 +2981,7 @@ void NXMaskImage(XImage *image, unsigned int method) { maskMethod = MASK_4K_COLORS; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXMaskImage: Method is MASK_4K_COLORS\n"); #endif @@ -2976,7 +2992,7 @@ void NXMaskImage(XImage *image, unsigned int method) { maskMethod = MASK_32K_COLORS; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXMaskImage: Method is MASK_32K_COLORS\n"); #endif @@ -2987,7 +3003,7 @@ void NXMaskImage(XImage *image, unsigned int method) { maskMethod = MASK_64K_COLORS; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXMaskImage: Method is MASK_64K_COLORS\n"); #endif @@ -2998,7 +3014,7 @@ void NXMaskImage(XImage *image, unsigned int method) { maskMethod = MASK_256K_COLORS; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXMaskImage: Method is MASK_256K_COLORS\n"); #endif @@ -3009,7 +3025,7 @@ void NXMaskImage(XImage *image, unsigned int method) { maskMethod = MASK_2M_COLORS; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXMaskImage: Method is MASK_2M_COLORS\n"); #endif @@ -3020,7 +3036,7 @@ void NXMaskImage(XImage *image, unsigned int method) { maskMethod = MASK_16M_COLORS; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXMaskImage: Method is MASK_16M_COLORS\n"); #endif @@ -3037,7 +3053,7 @@ void NXMaskImage(XImage *image, unsigned int method) } } - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXMaskImage: packMethod[%d] => maskMethod[%d]\n", method, maskMethod); #endif @@ -3080,7 +3096,7 @@ void NXMaskImage(XImage *image, unsigned int method) if (ShouldMaskImage(image, mask) == 0) { - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXMaskImage: the image will not be masked\n"); #endif } @@ -3103,7 +3119,7 @@ void NXInitCache(Display *dpy, int entries) { if (NXImageCache != NULL && NXImageCacheSize == entries) { - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXInitCache: Nothing to do with image cache at [%p] and [%d] entries.\n", NXImageCache, NXImageCacheSize); #endif @@ -3111,7 +3127,7 @@ void NXInitCache(Display *dpy, int entries) return; } - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXInitCache: Initializing the cache with [%d] entries.\n", entries); #endif @@ -3130,7 +3146,7 @@ void NXInitCache(Display *dpy, int entries) NXImageCacheSize = entries; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXInitCache: Image cache initialized with [%d] entries.\n", entries); #endif } @@ -3143,7 +3159,7 @@ void _NXCacheDump(const char *label) { char s[MD5_LENGTH * 2 + 1]; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "%s: Dumping the content of image cache:\n", label); #endif @@ -3159,7 +3175,7 @@ void _NXCacheDump(const char *label) sprintf(s + (j * 2), "%02X", ((unsigned char *) NXImageCache[i].md5)[j]); } - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "%s: [%d][%s].\n", label, i, s); #endif } @@ -3221,7 +3237,7 @@ XImage *NXCacheFindImage(NXPackedImage *src_image, unsigned int *method, unsigne NXImageCacheHits++; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXCacheFindImage: Found at position [%d] with hits [%d] and [%d] packs.\n", i, NXImageCacheHits, NXImageCacheOps); #endif @@ -3236,7 +3252,7 @@ XImage *NXCacheFindImage(NXPackedImage *src_image, unsigned int *method, unsigne if (i > 16) { - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXCacheFindImage: Moving the image at the head of the list.\n"); #endif @@ -3297,7 +3313,7 @@ int NXCacheAddImage(NXPackedImage *image, unsigned int method, unsigned char *md if (NXImageCacheOps >= NXImageCacheSize) { - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXCacheAddImage: Freeing up the oldest entry.\n"); #endif @@ -3315,7 +3331,7 @@ int NXCacheAddImage(NXPackedImage *image, unsigned int method, unsigned char *md NXImageCacheOps++; - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXCacheAddImage: Going to add new image with data size [%d].\n", image -> xoffset); #endif @@ -3341,14 +3357,14 @@ void NXFreeCache(Display *dpy) { if (NXImageCache == NULL) { - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXFreeCache: Nothing to do with a null image cache.\n"); #endif return; } - #ifdef DEBUG + #ifdef DEBUG_IMAGE fprintf(stderr, "******NXFreeCache: Freeing the cache with [%d] entries.\n", NXImageCacheSize); #endif @@ -3412,7 +3428,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, if ((rep -> generic.sequenceNumber % 65536) != ((CARD16)(state -> sequence) % 65536)) { - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******_NXCollectImageHandler: Unmatched sequence [%d] for opcode [%d] " "with length [%d].\n", rep -> generic.sequenceNumber, rep -> generic.type, (int) rep -> generic.length << 2); @@ -3421,7 +3437,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******_NXCollectImageHandler: Going to handle asynchronous GetImage reply.\n"); #endif @@ -3438,7 +3454,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, if (rep -> generic.type == X_Error) { - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******_NXCollectImageHandler: Error received from X server for resource [%d].\n", state -> resource); #endif @@ -3452,7 +3468,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******_NXCollectImageHandler: Matched request with sequence [%ld].\n", state -> sequence); #endif @@ -3477,7 +3493,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******_NXCollectImageHandler: Going to get reply with size [%d].\n", (int) rep -> generic.length << 2); #endif @@ -3502,7 +3518,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******_NXCollectImageHandler: Got reply with depth [%d] visual [%d] size [%d].\n", async_rep -> depth, (int) async_rep -> visual, (int) async_rep -> length << 2); #endif @@ -3531,7 +3547,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******_NXCollectImageHandler: Going to get data with size [%d].\n", async_size); #endif @@ -3578,7 +3594,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, return True; } - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******_NXCollectImageHandler: Successfully stored image data for resource [%d].\n", state -> resource); #endif @@ -3668,7 +3684,7 @@ int NXCollectImage(Display *dpy, unsigned int resource, Drawable drawable, req -> height = height; req -> planeMask = plane_mask; - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXCollectImage: Sending message opcode [%d] sequence [%ld] for resource [%d].\n", X_GetImage, dpy -> request, resource); @@ -3745,7 +3761,7 @@ int NXGetCollectedImage(Display *dpy, unsigned int resource, XImage **image) SAFE_free(state); - #ifdef TEST + #ifdef TEST_IMAGE fprintf(stderr, "******NXGetCollectedImage: Returning GetImage data for resource [%u].\n", resource); #endif @@ -3794,7 +3810,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, if ((rep -> generic.sequenceNumber % 65536) != ((CARD16)(state -> sequence) % 65536)) { - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******_NXCollectPropertyHandler: Unmatched sequence [%d] for opcode [%d] " "with length [%d].\n", rep -> generic.sequenceNumber, rep -> generic.type, (int) rep -> generic.length << 2); @@ -3803,7 +3819,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******_NXCollectPropertyHandler: Going to handle asynchronous GetProperty reply.\n"); #endif @@ -3820,7 +3836,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, if (rep -> generic.type == X_Error) { - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******_NXCollectPropertyHandler: Error received from X server for resource [%d].\n", state -> resource); #endif @@ -3834,7 +3850,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******_NXCollectPropertyHandler: Matched request with sequence [%ld].\n", state -> sequence); #endif @@ -3859,7 +3875,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******_NXCollectPropertyHandler: Going to get reply with size [%d].\n", (int) rep -> generic.length << 2); #endif @@ -3884,7 +3900,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******_NXCollectPropertyHandler: Got reply with format [%d] type [%d] size [%d].\n", async_rep -> format, (int) async_rep -> propertyType, (int) async_rep -> length << 2); @@ -3921,7 +3937,7 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******_NXCollectPropertyHandler: Going to get data with size [%d].\n", async_size); #endif @@ -3935,12 +3951,12 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, state -> data = async_data; - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******_NXCollectPropertyHandler: Successfully stored property data for resource [%d].\n", state -> resource); #endif } - #ifdef TEST + #ifdef TEST_PROPERTY else { fprintf(stderr, "******_NXCollectPropertyHandler: WARNING! Null property data stored for resource [%d].\n", @@ -4019,7 +4035,7 @@ int NXCollectProperty(Display *dpy, unsigned int resource, Window window, Atom p req -> longOffset = long_offset; req -> longLength = long_length; - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******NXCollectProperty: Sending message opcode [%d] sequence [%ld] for resource [%d].\n", X_GetProperty, dpy -> request, resource); @@ -4105,7 +4121,7 @@ int NXGetCollectedProperty(Display *dpy, unsigned int resource, Atom *actual_typ _NXCollectedProperties[resource] = NULL; - #ifdef TEST + #ifdef TEST_PROPERTY fprintf(stderr, "******NXGetCollectedProperty: Returning GetProperty data for resource [%u].\n", resource); #endif @@ -4148,7 +4164,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, if ((rep -> generic.sequenceNumber % 65536) != ((CARD16)(state -> sequence) % 65536)) { - #ifdef TEST + #ifdef TEST_POINTER fprintf(stderr, "******_NXCollectGrabPointerHandler: Unmatched sequence [%d] for opcode [%d] " "with length [%d].\n", rep -> generic.sequenceNumber, rep -> generic.type, (int) rep -> generic.length << 2); @@ -4157,7 +4173,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_POINTER fprintf(stderr, "******_NXCollectGrabPointerHandler: Going to handle asynchronous GrabPointer reply.\n"); #endif @@ -4167,7 +4183,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, if (rep -> generic.type == X_Error) { - #ifdef TEST + #ifdef TEST_POINTER fprintf(stderr, "******_NXCollectGrabPointerHandler: Error received from X server for resource [%d].\n", state -> resource); #endif @@ -4181,7 +4197,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_POINTER fprintf(stderr, "******_NXCollectGrabPointerHandler: Matched request with sequence [%ld].\n", state -> sequence); #endif @@ -4206,7 +4222,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_POINTER fprintf(stderr, "******_NXCollectGrabPointerHandler: Going to get reply with size [%d].\n", (int) rep -> generic.length << 2); #endif @@ -4231,7 +4247,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_POINTER fprintf(stderr, "******_NXCollectGrabPointerHandler: Got reply with status [%d] size [%d].\n", async_rep -> status, (int) async_rep -> length << 2); #endif @@ -4311,7 +4327,7 @@ int NXCollectGrabPointer(Display *dpy, unsigned int resource, Window grab_window req -> cursor = cursor; req -> time = time; - #ifdef TEST + #ifdef TEST_POINTER fprintf(stderr, "******NXCollectGrabPointer: Sending message opcode [%d] sequence [%ld] " "for resource [%d].\n", X_GrabPointer, dpy -> request, resource); #endif @@ -4379,7 +4395,7 @@ int NXGetCollectedGrabPointer(Display *dpy, unsigned int resource, int *status) _NXCollectedGrabPointers[resource] = NULL; - #ifdef TEST + #ifdef TEST_POINTER fprintf(stderr, "******NXGetCollectedGrabPointer: Returning GrabPointer data for resource [%u].\n", resource); #endif @@ -4422,7 +4438,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, if ((rep -> generic.sequenceNumber % 65536) != ((CARD16)(state -> sequence) % 65536)) { - #ifdef TEST + #ifdef TEST_INPUT fprintf(stderr, "******_NXCollectInputFocusHandler: Unmatched sequence [%d] for opcode [%d] " "with length [%d].\n", rep -> generic.sequenceNumber, rep -> generic.type, (int) rep -> generic.length << 2); @@ -4431,7 +4447,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_INPUT fprintf(stderr, "******_NXCollectInputFocusHandler: Going to handle asynchronous GetInputFocus reply.\n"); #endif @@ -4441,7 +4457,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, if (rep -> generic.type == X_Error) { - #ifdef TEST + #ifdef TEST_INPUT fprintf(stderr, "******_NXCollectInputFocusHandler: Error received from X server for resource [%d].\n", state -> resource); #endif @@ -4455,7 +4471,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_INPUT fprintf(stderr, "******_NXCollectInputFocusHandler: Matched request with sequence [%ld].\n", state -> sequence); #endif @@ -4480,7 +4496,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_INPUT fprintf(stderr, "******_NXCollectInputFocusHandler: Going to get reply with size [%d].\n", (int) rep -> generic.length << 2); #endif @@ -4505,7 +4521,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, return False; } - #ifdef TEST + #ifdef TEST_INPUT fprintf(stderr, "******_NXCollectInputFocusHandler: Got reply with focus [%d] revert to [%d] " "size [%d].\n", (int) async_rep -> focus, (int) async_rep -> revertTo, (int) async_rep -> length << 2); @@ -4576,7 +4592,7 @@ int NXCollectInputFocus(Display *dpy, unsigned int resource) GetEmptyReq(GetInputFocus, req); - #ifdef TEST + #ifdef TEST_INPUT fprintf(stderr, "******NXCollectInputFocus: Sending message opcode [%d] sequence [%ld] for resource [%d].\n", X_GetInputFocus, dpy -> request, resource); #endif @@ -4647,7 +4663,7 @@ int NXGetCollectedInputFocus(Display *dpy, unsigned int resource, _NXCollectedInputFocuses[resource] = NULL; - #ifdef TEST + #ifdef TEST_INPUT fprintf(stderr, "******NXGetCollectedInputFocus: Returning GetInputFocus data for resource [%u].\n", resource); #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 3.6.x in repository nx-libs. commit 6208dade860c6429791a5897136506adfd505e9d Merge: b73374805 605a26691 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 8 08:21:58 2021 +0200 Merge branch 'Ponce-binutils-2.36' into 3.6.x Attributes GH PR #1012: https://github.com/ArcticaProject/nx-libs/pull/1012 nx-X11/config/cf/Imake.tmpl | 12 ------------ 1 file changed, 12 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 3.6.x in repository nx-libs. commit a14e1a59a4025cbb464b5deeed0f50d5a2898b0c Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Mar 17 21:16:26 2021 +0100 randr: Do not update ConnectionInfo if NULL Backport of this xorg-xserver commit: commit 941aeb3b92e644923bd112eef8023f033a140ee6 Author: Olivier Fourdan <ofourdan@redhat.com> Date: Fri May 13 08:58:58 2016 +0200 randr: Do not update ConnectionInfo if NULL RRScreenSizeNotify() will update the connection information block, but if this occurs during initialization before ConnectionInfo is even initialized, this will lead to a crash. Simply check for ConnectionInfo prior to update it to avoid the crash. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Fixes ArcticaProject/nx-libs#1009 --- nx-X11/programs/Xserver/randr/rrscreen.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c index 4f59e9aea..90371704a 100644 --- a/nx-X11/programs/Xserver/randr/rrscreen.c +++ b/nx-X11/programs/Xserver/randr/rrscreen.c @@ -66,6 +66,9 @@ RREditConnectionInfo(ScreenPtr pScreen) int screen = 0; int d; + if (ConnectionInfo == NULL) + return; + connSetup = (xConnSetup *) ConnectionInfo; vendor = (char *) connSetup + sizeof(xConnSetup); formats = (xPixmapFormat *) ((char *) vendor + -- 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 3.6.x in repository nx-libs. commit b73374805d06a1afbd49efb5cbf7a3be46217357 Merge: 1bd98ef77 a14e1a59a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 8 08:20:37 2021 +0200 Merge branch 'uli42-pr/fix_randr_crash' into 3.6.x Attributes GH PR #1011: https://github.com/ArcticaProject/nx-libs/pull/1011 nx-X11/programs/Xserver/randr/rrscreen.c | 3 +++ 1 file changed, 3 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 3.6.x in repository nx-libs. commit 111ac2eed54438971554bd71115316472f1c9976 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Feb 9 19:31:20 2021 +0100 nxagent: make X2GO support optional --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 6 ++++++ nx-X11/programs/Xserver/hw/nxagent/Display.c | 4 ++++ nx-X11/programs/Xserver/hw/nxagent/Icons.h | 2 ++ nx-X11/programs/Xserver/hw/nxagent/Imakefile | 2 ++ nx-X11/programs/Xserver/hw/nxagent/Init.c | 4 +++- nx-X11/programs/Xserver/hw/nxagent/Init.h | 2 ++ nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 4 +++- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 6 +++++- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 5 +++++ nx-X11/programs/Xserver/hw/nxagent/Splash.c | 7 +++++++ 10 files changed, 39 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 72d6d050c..9ecf2fb8a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -197,10 +197,12 @@ int ddxProcessArgument(int argc, char *argv[], int i) nxagentProgName = strdup(basename(basec)); SAFE_free(basec); +#ifdef X2GO /* * Check if we are running as X2Go Agent */ checkX2goAgent(); +#endif } #ifdef TEST @@ -691,6 +693,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) { SAFE_free(nxagentKeyboard); +#ifdef X2GO if (nxagentX2go && strcmp(argv[i], "null/null") == 0) { #ifdef TEST @@ -701,6 +704,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) nxagentKeyboard = strdup("clone"); } else +#endif { nxagentKeyboard = strdup(argv[i]); } @@ -1775,11 +1779,13 @@ N/A if (*nxagentWindowName == '\0') { +#ifdef X2GO if(nxagentX2go) { snprintf(nxagentWindowName, NXAGENTWINDOWNAMELENGTH, "X2Go Agent"); } else +#endif { snprintf(nxagentWindowName, NXAGENTWINDOWNAMELENGTH, "NX Agent"); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 89d49edf1..95b5aa3af 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -92,7 +92,9 @@ is" without express or implied warranty. #include "compext/Compext.h" #include NXAGENT_ICON_NAME +#ifdef X2GO #include X2GOAGENT_ICON_NAME +#endif /* * Set here the required log level. @@ -1849,6 +1851,7 @@ Bool nxagentMakeIcon(Display *disp, Pixmap *nxIcon, Pixmap *nxMask) { char** agentIconData; +#ifdef X2GO /* * selecting x2go icon when running as X2Go agent */ @@ -1857,6 +1860,7 @@ Bool nxagentMakeIcon(Display *disp, Pixmap *nxIcon, Pixmap *nxMask) agentIconData = x2goagentIconData; } else +#endif { agentIconData = nxagentIconData; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Icons.h b/nx-X11/programs/Xserver/hw/nxagent/Icons.h index a8a155cec..30457402b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Icons.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Icons.h @@ -32,6 +32,8 @@ #define NXAGENT_ICON_NAME "nxagent.xpm" +#ifdef X2GO #define X2GOAGENT_ICON_NAME "x2goagent.xpm" +#endif #endif /* __Icons_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index a713467ae..94ae5b2ff 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -206,6 +206,7 @@ INCLUDES = \ # This only has an effect if NX_TRANS_WAKEUP is also set for os/WaitFor.c # NXAGENT_ARTSD enable special handling of MCOPGLOBALS property used by artsd. # NXAGENT_RENDER_CLEANUP cleanup padding bits/bytes of glyphs to possibly increase compression rate +# X2GO include code to support running as x2goagent # ### macros not investigated yet: # @@ -259,6 +260,7 @@ DEFINES = \ -DRANDR_15_INTERFACE=1 \ -DPANORAMIX \ -UDEBUG_TREE \ + -DX2GO \ -DSYSTEMFONTDIR=\"$(SYSTEMFONTDIR)\" \ $(NULL) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index e8e230956..b120e685e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -173,7 +173,8 @@ int nxagentSaveUnder; */ Bool nxagentDoFullGeneration = True; - /* +#ifdef X2GO +/* * True if agent is running as X2goAgent * False if agent is running as NXAgent */ @@ -196,6 +197,7 @@ void checkX2goAgent(void) else nxagentX2go = False; } +#endif /* * Called at X server's initialization. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.h b/nx-X11/programs/Xserver/hw/nxagent/Init.h index 6fa1bedd7..1b87f2296 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h @@ -45,8 +45,10 @@ extern int nxagentDoFullGeneration; extern int nxagentBackingStore; extern int nxagentSaveUnder; +#ifdef X2GO extern int nxagentX2go; void checkX2goAgent(void); +#endif extern ServerGrabInfoRec nxagentGrabServerInfo; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 731844874..2142adc8e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -663,7 +663,8 @@ XkbError: #endif nxagentChangeOption(KeycodeConversion, KeycodeConversionOff); - /* +#ifdef X2GO + /* * 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 @@ -692,6 +693,7 @@ XkbError: { nxagentWriteKeyboardFile(nxagentRemoteRules, nxagentRemoteModel, nxagentRemoteLayout, nxagentRemoteVariant, nxagentRemoteOptions); } +#endif } nxagentKeycodeConversionSetup(); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index aff2e56ab..828649e5a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -314,11 +314,15 @@ void nxagentInitKeystrokes(Bool force) done = True; +#ifdef X2GO if (nxagentX2go) { homefile = "/.x2go/config/keystrokes.cfg"; etcfile = "/etc/x2go/keystrokes.cfg"; envvar = "X2GO_KEYSTROKEFILE"; - } else { + } + else +#endif + { homefile = "/.nx/config/keystrokes.cfg"; etcfile = "/etc/nxagent/keystrokes.cfg"; envvar = "NXAGENT_KEYSTROKEFILE"; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 500006868..febb47c12 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1814,11 +1814,13 @@ N/A #endif } +#ifdef X2GO /* * Setting WM_CLASS to "X2GoAgent" when running in X2Go Agent mode * we need it to properly display all window parameters by some WMs * (for example on Maemo) */ +#endif { #ifdef TEST fprintf(stderr, "nxagentOpenScreen: Setting WM_CLASS and WM_NAME for window with id [%ld].\n", @@ -1827,12 +1829,14 @@ N/A XClassHint hint; +#ifdef X2GO if(nxagentX2go) { hint.res_name = strdup("X2GoAgent"); hint.res_class = strdup("X2GoAgent"); } else +#endif { hint.res_name = strdup("NXAgent"); hint.res_class = strdup("NXAgent"); @@ -1850,6 +1854,7 @@ N/A if (nxagentOption(Fullscreen)) { +#ifdef NXAGENT_ONSTART /* * FIXME: Do we still need to set this property? */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.c b/nx-X11/programs/Xserver/hw/nxagent/Splash.c index a4dfb73d2..898868925 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c @@ -48,6 +48,12 @@ #undef TEST #undef DEBUG +#ifndef X2GO +void nxagentShowSplashWindow(XlibWindow parentWindow) {} +void nxagentPaintLogo(XlibWindow win, int scale, int width, int height) {} +void nxagentRemoveSplashWindow(void) {} +Bool nxagentHaveSplashWindow(void) {return False;} +#else /* * Colors used to paint the splash screen. */ @@ -361,3 +367,4 @@ void nxagentRemoveSplashWindow(void) nxagentPixmapLogo = (XlibPixmap) 0; } } +#endif /* ifdef X2GO */ -- 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 3.6.x in repository nx-libs. commit 666c4d16aea1f35a50595ef81ab8bb94b23b1097 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Feb 9 19:38:08 2021 +0100 nxagent: drop NXAGENT_SHAPE define was never used in the past years, we were always compiling with -DNXAGENT_SHAPE2 --- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 1 - nx-X11/programs/Xserver/hw/nxagent/Window.c | 20 +++++--------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 94ae5b2ff..f62ff9185 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -192,7 +192,6 @@ INCLUDES = \ ### list of existing NXAGENT macros: # -# NXAGENT_SHAPE Old shape code # NXAGENT_SHAPE2 New shape code # NXAGENT_FIXKEYS Force the release of pressed key when losing focus # NXAGENT_CLIPBOARD Enables clipboard cut and paste function between X servers. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 00439d2e0..0e26a322c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -2079,13 +2079,11 @@ void nxagentClipNotify(WindowPtr pWin, int dx, int dy) nxagentAddConfiguredWindow(pWin, CWStackMode); nxagentAddConfiguredWindow(pWin, CW_Shape); - #ifndef NXAGENT_SHAPE - #ifdef SHAPE - /* - * nxagentShapeWindow(pWin); - */ - #endif /* SHAPE */ - #endif /* NXAGENT_SHAPE */ + #ifdef SHAPE + /* + * nxagentShapeWindow(pWin); + */ + #endif /* SHAPE */ } /* @@ -2378,10 +2376,8 @@ void nxagentShapeWindow(WindowPtr pWin) XUnionRectWithRegion(&rect, reg, reg); } - #ifndef NXAGENT_SHAPE XShapeCombineRegion(nxagentDisplay, nxagentWindow(pWin), ShapeBounding, 0, 0, reg, ShapeSet); - #endif XDestroyRegion(reg); } @@ -2393,10 +2389,8 @@ void nxagentShapeWindow(WindowPtr pWin) RegionEmpty(nxagentWindowPriv(pWin)->boundingShape); - #ifndef NXAGENT_SHAPE XShapeCombineMask(nxagentDisplay, nxagentWindow(pWin), ShapeBounding, 0, 0, None, ShapeSet); - #endif } } @@ -2437,10 +2431,8 @@ void nxagentShapeWindow(WindowPtr pWin) XUnionRectWithRegion(&rect, reg, reg); } - #ifndef NXAGENT_SHAPE XShapeCombineRegion(nxagentDisplay, nxagentWindow(pWin), ShapeClip, 0, 0, reg, ShapeSet); - #endif XDestroyRegion(reg); } @@ -2452,10 +2444,8 @@ void nxagentShapeWindow(WindowPtr pWin) RegionEmpty(nxagentWindowPriv(pWin)->clipShape); - #ifndef NXAGENT_SHAPE XShapeCombineMask(nxagentDisplay, nxagentWindow(pWin), ShapeClip, 0, 0, None, ShapeSet); - #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 3.6.x in repository nx-libs. commit 8fe2c114084743e8726ae39089e3aa1491d22719 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Feb 9 19:09:21 2021 +0100 Use NXAGENT_ONSTART define at more locations marking all the code that is not really required when not using nomachine's nxclient. --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 7 +++++-- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 3 +++ nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 ++ nx-X11/programs/Xserver/hw/nxagent/Screen.c | 1 + nx-X11/programs/Xserver/hw/nxagent/Splash.c | 2 ++ nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 ++ 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index ea7ad7599..2ddf87e55 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -89,9 +89,12 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] = "WM_NX_READY", /* 3 */ /* nxagent takes the ownership of the selection with this name to signal the nxclient (or any other watching program) - it is ready. */ + it is ready. This is only used if NXAGENT_ONSTART is defined. + We cannot enclose it in #ifdef here because we use the numeric + indices to this structure at multiple places. */ "MCOPGLOBALS", /* 4 */ - /* used for artsd support. */ + /* used for artsd support. Only used if compiled with + NXAGENT_ARTSD */ "NX_CUT_BUFFER_SERVER", /* 5 */ /* this is the name of a property on nxagent's window on the real X server. This property is used for passing clipboard diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 8ac2241a6..22fc96f4f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2237,6 +2237,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) nxagentXFixesInfo.Initialized = True; } +#ifdef NXAGENT_ONSTART /* The first paste from CLIPBOARD did not work directly after session start. Removing this code makes it work. It is unsure why @@ -2247,6 +2248,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) if (nxagentSessionId[0]) { + // nxagentAtoms[10] is the CLIPBOARD atom #ifdef TEST fprintf(stderr, "%s: setting the ownership of %s to %lx" " and registering for PropertyChangeMask events\n", __func__, @@ -2258,6 +2260,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) nxagentChangeWindowAttributes(pWin, CWEventMask); } */ +#endif if (nxagentReconnectTrap) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index e6d3ce6ec..58c1fc4e2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -503,12 +503,14 @@ Bool nxagentReconnectSession(void) nxagentMapDefaultWindows(); +#ifdef NXAGENT_ONSTART /* * Ensure that the SetSelectionOwner request is sent through the * link. */ XFlush(nxagentDisplay); +#endif NXTransContinue(NULL); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index b87c1e225..500006868 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1865,6 +1865,7 @@ N/A (unsigned char*) "X-AGENT", strlen("X-AGENT")); } +#endif XSelectInput(nxagentDisplay, nxagentFullscreenWindow, nxagentGetDefaultEventMask()); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.c b/nx-X11/programs/Xserver/hw/nxagent/Splash.c index 37f965f04..a4dfb73d2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c @@ -344,6 +344,7 @@ void nxagentRemoveSplashWindow(void) nxagentSplashWindow = None; nxagentRefreshWindows(screenInfo.screens[0]->root); +#ifdef NXAGENT_ONSTART #ifdef TEST fprintf(stderr, "%s: setting the ownership of %s (%d) on window [0x%lx]\n", __func__, "NX_CUT_BUFFER_SERVER", (int)serverTransToAgentProperty, nxagentWindow(screenInfo.screens[0]->root)); @@ -351,6 +352,7 @@ void nxagentRemoveSplashWindow(void) XSetSelectionOwner(nxagentDisplay, serverTransToAgentProperty, nxagentWindow(screenInfo.screens[0]->root), CurrentTime); +#endif } if (nxagentPixmapLogo) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 5f12fd48a..00439d2e0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -2575,12 +2575,14 @@ void nxagentMapDefaultWindows(void) } } +#ifdef NXAGENT_ONSTART /* * Send a SetSelectionOwner request to notify of the agent start. */ XSetSelectionOwner(nxagentDisplay, serverTransToAgentProperty, nxagentDefaultWindows[i], CurrentTime); +#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 3.6.x in repository nx-libs. commit 3fcb7ae3f1bef5eab1b9a284dac24bc5db2aeaca Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Feb 9 19:40:47 2021 +0100 nxagent: drop NXAGENT_SHAPE2 define it was the default for years now, so let's drop the define and include the code unconditonally. --- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 2 -- nx-X11/programs/Xserver/hw/nxagent/Window.c | 34 ++++++++-------------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index f62ff9185..4e48f62f5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -192,7 +192,6 @@ INCLUDES = \ ### list of existing NXAGENT macros: # -# NXAGENT_SHAPE2 New shape code # NXAGENT_FIXKEYS Force the release of pressed key when losing focus # NXAGENT_CLIPBOARD Enables clipboard cut and paste function between X servers. # NXAGENT_RANDR_MODE_PREFIX Prefix for RandR display modes (i.e., nx_<x>x<y>) (default: nx_) @@ -245,7 +244,6 @@ DEFINES = \ -UXF86VIDMODE -UXFreeXDGA -UXF86MISC -UXF86DRI \ -DNXAGENT_SERVER \ -DNXAGENT_RENDER_CLEANUP \ - -DNXAGENT_SHAPE2 \ -DNXAGENT_FIXKEYS \ -DNXAGENT_CLIPBOARD \ -DNXAGENT_WAKEUP=1000 \ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 0e26a322c..6f98ee57b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -471,13 +471,8 @@ Bool nxagentCreateWindow(WindowPtr pWin) } #ifdef SHAPE - #ifdef NXAGENT_SHAPE2 - nxagentWindowPriv(pWin)->boundingShape = NULL; - nxagentWindowPriv(pWin)->clipShape = NULL; - #else - nxagentWindowPriv(pWin)->boundingShape = RegionCreate(NULL, 1); - nxagentWindowPriv(pWin)->clipShape = RegionCreate(NULL, 1); - #endif + nxagentWindowPriv(pWin)->boundingShape = NULL; + nxagentWindowPriv(pWin)->clipShape = NULL; #endif /* SHAPE */ fbCreateWindow(pWin); @@ -583,21 +578,16 @@ Bool nxagentDestroyWindow(WindowPtr pWin) pWindowPriv->siblingAbove; } - #ifdef NXAGENT_SHAPE2 - #ifdef SHAPE - if (pWindowPriv->boundingShape) - { - RegionDestroy(pWindowPriv->boundingShape); - } - - if (pWindowPriv->clipShape) - { - RegionDestroy(pWindowPriv->clipShape); - } - #endif - #else + #ifdef SHAPE + if (pWindowPriv->boundingShape) + { RegionDestroy(pWindowPriv->boundingShape); + } + + if (pWindowPriv->clipShape) + { RegionDestroy(pWindowPriv->clipShape); + } #endif if (pWindowPriv -> corruptedRegion) @@ -2352,12 +2342,10 @@ void nxagentShapeWindow(WindowPtr pWin) RegionNumRects(wBoundingShape(pWin))); #endif - #ifdef NXAGENT_SHAPE2 if (!nxagentWindowPriv(pWin)->boundingShape) { nxagentWindowPriv(pWin)->boundingShape = RegionCreate(NULL, 1); } - #endif RegionCopy(nxagentWindowPriv(pWin)->boundingShape, wBoundingShape(pWin)); @@ -2407,12 +2395,10 @@ void nxagentShapeWindow(WindowPtr pWin) RegionNumRects(wClipShape(pWin))); #endif - #ifdef NXAGENT_SHAPE2 if (!nxagentWindowPriv(pWin)->clipShape) { nxagentWindowPriv(pWin)->clipShape = RegionCreate(NULL, 1); } - #endif RegionCopy(nxagentWindowPriv(pWin)->clipShape, wClipShape(pWin)); -- 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 3.6.x in repository nx-libs. commit 5271eed2dbca1d24819578429dad1b0313a281f5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Mar 7 19:15:32 2021 +0100 Error.c: untabify --- nx-X11/programs/Xserver/hw/nxagent/Error.c | 150 ++++++++++++++--------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.c b/nx-X11/programs/Xserver/hw/nxagent/Error.c index 8c9a52d2e..93f4f4387 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c @@ -136,105 +136,105 @@ static int nxagentPrintError(dpy, event, fp) XGetErrorDatabaseText(dpy, mtype, "XError", "X Error", mesg, BUFSIZ); (void) fprintf(fp, "%s: %s\n ", mesg, buffer); XGetErrorDatabaseText(dpy, mtype, "MajorCode", "Request Major code %d", - mesg, BUFSIZ); + mesg, BUFSIZ); (void) fprintf(fp, mesg, event->request_code); if (event->request_code < 128) { - snprintf(number, sizeof(number), "%d", event->request_code); - XGetErrorDatabaseText(dpy, "XRequest", number, "", buffer, BUFSIZ); + snprintf(number, sizeof(number), "%d", event->request_code); + XGetErrorDatabaseText(dpy, "XRequest", number, "", buffer, BUFSIZ); } else { #ifndef NXAGENT_SERVER - for (ext = dpy->ext_procs; - ext && (ext->codes.major_opcode != event->request_code); - ext = ext->next) - ; - if (ext) { - strncpy(buffer, ext->name, BUFSIZ); - buffer[BUFSIZ - 1] = '\0'; + for (ext = dpy->ext_procs; + ext && (ext->codes.major_opcode != event->request_code); + ext = ext->next) + ; + if (ext) { + strncpy(buffer, ext->name, BUFSIZ); + buffer[BUFSIZ - 1] = '\0'; } else #endif - buffer[0] = '\0'; + buffer[0] = '\0'; } (void) fprintf(fp, " (%s)\n", buffer); if (event->request_code >= 128) { - XGetErrorDatabaseText(dpy, mtype, "MinorCode", "Request Minor code %d", - mesg, BUFSIZ); - fputs(" ", fp); - (void) fprintf(fp, mesg, event->minor_code); + XGetErrorDatabaseText(dpy, mtype, "MinorCode", "Request Minor code %d", + mesg, BUFSIZ); + fputs(" ", fp); + (void) fprintf(fp, mesg, event->minor_code); #ifndef NXAGENT_SERVER - if (ext) { - snprintf(mesg, sizeof(mesg), "%s.%d", ext->name, event->minor_code); - XGetErrorDatabaseText(dpy, "XRequest", mesg, "", buffer, BUFSIZ); - (void) fprintf(fp, " (%s)", buffer); - } + if (ext) { + snprintf(mesg, sizeof(mesg), "%s.%d", ext->name, event->minor_code); + XGetErrorDatabaseText(dpy, "XRequest", mesg, "", buffer, BUFSIZ); + (void) fprintf(fp, " (%s)", buffer); + } #endif - fputs("\n", fp); + fputs("\n", fp); } if (event->error_code >= 128) { - /* kludge, try to find the extension that caused it */ - buffer[0] = '\0'; + /* kludge, try to find the extension that caused it */ + buffer[0] = '\0'; #ifndef NXAGENT_SERVER - for (ext = dpy->ext_procs; ext; ext = ext->next) { - if (ext->error_string) - (*ext->error_string)(dpy, event->error_code, &ext->codes, - buffer, BUFSIZ); - if (buffer[0]) { - bext = ext; - break; - } - if (ext->codes.first_error && - ext->codes.first_error < (int)event->error_code && - (!bext || ext->codes.first_error > bext->codes.first_error)) - bext = ext; - } - if (bext) - snprintf(buffer, sizeof(buffer), "%s.%d", bext->name, - event->error_code - bext->codes.first_error); - else + for (ext = dpy->ext_procs; ext; ext = ext->next) { + if (ext->error_string) + (*ext->error_string)(dpy, event->error_code, &ext->codes, + buffer, BUFSIZ); + if (buffer[0]) { + bext = ext; + break; + } + if (ext->codes.first_error && + ext->codes.first_error < (int)event->error_code && + (!bext || ext->codes.first_error > bext->codes.first_error)) + bext = ext; + } + if (bext) + snprintf(buffer, sizeof(buffer), "%s.%d", bext->name, + event->error_code - bext->codes.first_error); + else #endif - strcpy(buffer, "Value"); - XGetErrorDatabaseText(dpy, mtype, buffer, "", mesg, BUFSIZ); - if (mesg[0]) { - fputs(" ", fp); - (void) fprintf(fp, mesg, event->resourceid); - fputs("\n", fp); - } - /* let extensions try to print the values */ + strcpy(buffer, "Value"); + XGetErrorDatabaseText(dpy, mtype, buffer, "", mesg, BUFSIZ); + if (mesg[0]) { + fputs(" ", fp); + (void) fprintf(fp, mesg, event->resourceid); + fputs("\n", fp); + } + /* let extensions try to print the values */ #ifndef NXAGENT_SERVER - for (ext = dpy->ext_procs; ext; ext = ext->next) { - if (ext->error_values) - (*ext->error_values)(dpy, event, fp); - } + for (ext = dpy->ext_procs; ext; ext = ext->next) { + if (ext->error_values) + (*ext->error_values)(dpy, event, fp); + } #endif } else if ((event->error_code == BadWindow) || - (event->error_code == BadPixmap) || - (event->error_code == BadCursor) || - (event->error_code == BadFont) || - (event->error_code == BadDrawable) || - (event->error_code == BadColor) || - (event->error_code == BadGC) || - (event->error_code == BadIDChoice) || - (event->error_code == BadValue) || - (event->error_code == BadAtom)) { - if (event->error_code == BadValue) - XGetErrorDatabaseText(dpy, mtype, "Value", "Value 0x%x", - mesg, BUFSIZ); - else if (event->error_code == BadAtom) - XGetErrorDatabaseText(dpy, mtype, "AtomID", "AtomID 0x%x", - mesg, BUFSIZ); - else - XGetErrorDatabaseText(dpy, mtype, "ResourceID", "ResourceID 0x%x", - mesg, BUFSIZ); - fputs(" ", fp); - (void) fprintf(fp, mesg, event->resourceid); - fputs("\n", fp); + (event->error_code == BadPixmap) || + (event->error_code == BadCursor) || + (event->error_code == BadFont) || + (event->error_code == BadDrawable) || + (event->error_code == BadColor) || + (event->error_code == BadGC) || + (event->error_code == BadIDChoice) || + (event->error_code == BadValue) || + (event->error_code == BadAtom)) { + if (event->error_code == BadValue) + XGetErrorDatabaseText(dpy, mtype, "Value", "Value 0x%x", + mesg, BUFSIZ); + else if (event->error_code == BadAtom) + XGetErrorDatabaseText(dpy, mtype, "AtomID", "AtomID 0x%x", + mesg, BUFSIZ); + else + XGetErrorDatabaseText(dpy, mtype, "ResourceID", "ResourceID 0x%x", + mesg, BUFSIZ); + fputs(" ", fp); + (void) fprintf(fp, mesg, event->resourceid); + fputs("\n", fp); } XGetErrorDatabaseText(dpy, mtype, "ErrorSerial", "Error Serial #%d", - mesg, BUFSIZ); + mesg, BUFSIZ); fputs(" ", fp); (void) fprintf(fp, mesg, event->serial); #ifndef NXAGENT_SERVER XGetErrorDatabaseText(dpy, mtype, "CurrentSerial", "Current Serial #%d", - mesg, BUFSIZ); + mesg, BUFSIZ); fputs("\n ", fp); (void) fprintf(fp, mesg, (unsigned long long)(X_DPY_GET_REQUEST(dpy))); #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 3.6.x in repository nx-libs. commit d3573613f209c7d133269a5953ef80f8f947ce0e Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 9 18:43:18 2021 +0100 Compext.c: document function return codes --- .../programs/Xserver/hw/nxagent/compext/Compext.c | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c index a77e4fc79..4aaa356e4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c @@ -454,6 +454,11 @@ int NXSetDisplayPolicy(Display *dpy, int policy) } } +/* + * return codes: + * -1 something went wrong + * 1 success + */ int NXSetDisplayBuffer(Display *dpy, int size) { /* @@ -817,6 +822,11 @@ void _NXInternalLostSequenceFunction(Display *dpy, unsigned long newseq, #endif } +/* + * return codes: + * 0 error receiving reply + * 1 success + */ Status NXGetControlParameters(Display *dpy, unsigned int *link_type, unsigned int *local_major, unsigned int *local_minor, unsigned int *local_patch, unsigned int *remote_major, unsigned int *remote_minor, @@ -919,6 +929,11 @@ Status NXGetControlParameters(Display *dpy, unsigned int *link_type, unsigned in * remote proxy? */ +/* + * return codes: + * 0 something went wrong + * 1 success + */ Status NXGetUnpackParameters(Display *dpy, unsigned int *entries, unsigned char supported_methods[]) { register xNXGetUnpackParametersReq *req; @@ -1021,6 +1036,11 @@ Status NXGetUnpackParameters(Display *dpy, unsigned int *entries, unsigned char * reserve the XID that will be used by the remote. */ +/* + * return codes: + * 0 something went wrong + * 1 success + */ Status NXGetShmemParameters(Display *dpy, unsigned int *enable_client, unsigned int *enable_server, unsigned int *client_segment, unsigned int *server_segment, unsigned int *client_size, @@ -1170,6 +1190,11 @@ Status NXGetShmemParameters(Display *dpy, unsigned int *enable_client, * advertise only the fonts that can be opened at both sides. */ +/* + * return codes: + * 0 something went wrong + * 1 success + */ Status NXGetFontParameters(Display *dpy, unsigned int path_length, char path_data[]) { _X_UNUSED register xNXGetFontParametersReq *req; @@ -3627,6 +3652,12 @@ int NXGetCollectImageResource(Display *dpy) return -1; } +/* + * return codes: + * 0 no data found for resource (currently unused) + * -1 Failed + * True (1) Handler has been installed, will generate NXCollectImageNotify event when answer arrives + */ int NXCollectImage(Display *dpy, unsigned int resource, Drawable drawable, int src_x, int src_y, unsigned int width, unsigned int height, unsigned long plane_mask, int format) @@ -3984,6 +4015,12 @@ int NXGetCollectPropertyResource(Display *dpy) return -1; } +/* + * return codes: + * 0 no data found for resource (currently unused) + * -1 Failed + * True Handler has been installed, will generate NXCollectPropertyNotify event when answer arrives + */ int NXCollectProperty(Display *dpy, unsigned int resource, Window window, Atom property, long long_offset, long long_length, Bool delete, Atom req_type) { @@ -4092,6 +4129,11 @@ int NXCollectProperty(Display *dpy, unsigned int resource, Window window, Atom p return True; } +/* + * return codes: + * 0 not data available + * True success + */ int NXGetCollectedProperty(Display *dpy, unsigned int resource, Atom *actual_type_return, int *actual_format_return, unsigned long *nitems_return, unsigned long *bytes_after_return, unsigned char **data) @@ -4274,6 +4316,12 @@ int NXGetCollectGrabPointerResource(Display *dpy) return -1; } +/* + * return codes: + * 0 no data found for resource + * -1 Failed + * True Handler has been installed, will generate NXCollectGrabPointerNotify event when answer arrives + */ int NXCollectGrabPointer(Display *dpy, unsigned int resource, Window grab_window, Bool owner_events, unsigned int event_mask, int pointer_mode, int keyboard_mode, Window confine_to, Cursor cursor, Time time) @@ -4373,6 +4421,11 @@ int NXCollectGrabPointer(Display *dpy, unsigned int resource, Window grab_window return True; } +/* + * return codes: + * 0 not data available + * True success + */ int NXGetCollectedGrabPointer(Display *dpy, unsigned int resource, int *status) { register _NXCollectGrabPointerState *state; @@ -4550,6 +4603,12 @@ int NXGetCollectInputFocusResource(Display *dpy) return -1; } +/* + * return codes: + * 0 no data found for resource (currently unused) + * -1 Failed + * True (1) Handler has been installed, will generate NXCollectInputFocusNotify event when answer arrives + */ int NXCollectInputFocus(Display *dpy, unsigned int resource) { _X_UNUSED register xReq *req; @@ -4639,6 +4698,11 @@ int NXCollectInputFocus(Display *dpy, unsigned int resource) return True; } +/* + * return codes: + * 0 not data available + * True success + */ int NXGetCollectedInputFocus(Display *dpy, unsigned int resource, Window *focus_return, int *revert_to_return) { -- 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 3.6.x in repository nx-libs. commit e9a0f94d058c4297e279bae98fbb7fc0ed5ed4c4 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Mar 10 22:50:46 2021 +0100 Compext.c: print received vs expected sequence number Should help in debugging "unexpected async reply" problems --- .../programs/Xserver/hw/nxagent/compext/Compext.c | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c index 4aaa356e4..7fd54e86f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c @@ -3450,6 +3450,13 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectImageState *) data; + #ifdef DEBUG_IMAGE + fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n", + __func__, + (long) rep -> generic.sequenceNumber, (long)state -> sequence, + rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536); + #endif + if ((rep -> generic.sequenceNumber % 65536) != ((CARD16)(state -> sequence) % 65536)) { @@ -3838,6 +3845,13 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectPropertyState *) data; + #ifdef DEBUG_PROPERTY + fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n", + __func__, + (long) rep -> generic.sequenceNumber, (long)state -> sequence, + rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536); + #endif + if ((rep -> generic.sequenceNumber % 65536) != ((CARD16)(state -> sequence) % 65536)) { @@ -4203,6 +4217,13 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectGrabPointerState *) data; + #ifdef DEBUG_POINTER + fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n", + __func__, + (long) rep -> generic.sequenceNumber, (long)state -> sequence, + rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536); + #endif + if ((rep -> generic.sequenceNumber % 65536) != ((CARD16)(state -> sequence) % 65536)) { @@ -4488,6 +4509,13 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectInputFocusState *) data; + #ifdef DEBUG_INPUT + fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n", + __func__, + (long) rep -> generic.sequenceNumber, (long)state -> sequence, + rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536); + #endif + if ((rep -> generic.sequenceNumber % 65536) != ((CARD16)(state -> sequence) % 65536)) { -- 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 3.6.x in repository nx-libs. commit 9b1dd340146ab62bfca9fc4c247edfbec2da2356 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Mar 7 20:21:37 2021 +0100 document additional options only nxagent knows about --- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 9 +++++ nxcomp/src/Misc.cpp | 41 ++++++++++++---------- nxproxy/man/nxproxy.1 | 44 ++++++++++++++---------- 3 files changed, 58 insertions(+), 36 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 index 2a83a5afb..ebc528d37 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 +++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 @@ -459,6 +459,9 @@ The nx-X11 system adds the following command line arguments: .B \-forcenx force use of NX protocol messages assuming communication through \fBnxproxy\fR .TP 8 +.B \-id \fIstring\fP +The session id. +.TP 8 .B \-autograb enable autograb mode on \fBnxagent\fR startup. The autograb feature can be toggled via nxagent keystrokes .TP 8 @@ -740,6 +743,9 @@ enable/disable shared pixmaps support. Accepted values: \fI1\fR (enable, default type of connecting operating system (supported: \fIlinux\fR, \fIwindows\fR, \fIsolaris\fR and \fImacosx\fR) .TP 8 +.B clients=<string> +filename where to log output of the nxagent's clients. This is ignored if no session id has been provided. It then points to stderr. Default: <sessiondir>/clients. +.TP 8 .B shadow=<string> define the display that should be shadowed .TP 8 @@ -749,6 +755,9 @@ unique identifier for the shadow session .B shadowmode=<bool> full access (set to \fI1\fR) or viewing-only (set to \fI0\fR, default) .TP 8 +.B state=<string> +filename where to store the state of the nxagent (for easier interoperation with software like x2go. Default: sessiondir/state. +.TP 8 .B defer=<int> defer image updates (enabled for all connection types except LAN), accepts values \fI0\fR, \fI1\fR and \fI2\fR diff --git a/nxcomp/src/Misc.cpp b/nxcomp/src/Misc.cpp index c626eb91b..d0d82d0aa 100644 --- a/nxcomp/src/Misc.cpp +++ b/nxcomp/src/Misc.cpp @@ -326,31 +326,36 @@ static const char UsageInfo[] = a program providing encryption of the point to point\n\ communication.\n\ \n\ -rootless=b\n\ -geometry=s\n\ -resize=b\n\ -fullscreen=b\n\ -keyboard=s\n\ -clipboard=s\n\ -streaming=n\n\ +autodpi=b\n\ +autograb=b\n\ backingstore=n\n\ +client=s\n\ +clients=s\n\ +clipboard=s\n\ composite=n\n\ -xinerama=n\n\ -shmem=b\n\ -shpix=b\n\ +copysize=n\n\ +defer=n\n\ +fullscreen=n\n\ +geometry=s\n\ kbtype=s\n\ -client=s\n\ +keyboard=s\n\ +keyconv=s\n\ +magicpixel=b\n\ +menu=n\n\ +resize=b\n\ +rootless=b\n\ shadow=n\n\ -shadowuid=n\n\ shadowmode=s\n\ -defer=n\n\ -tile=s\n\ -menu=n\n\ -magicpixel=n\n\ -autodpi=n\n\ +shadowuid=n\n\ +shmem=b\n\ +shpix=b\n\ sleep=n\n\ +state=s\n\ +streaming=n\n\ +textclipboard=b\n\ +tile=s\n\ tolerancechecks=s\n\ -keyconv=s\n\ +xinerama=b\n\ These options are interpreted by the NX agent. They\n\ are ignored by the proxy.\n\ \n\ diff --git a/nxproxy/man/nxproxy.1 b/nxproxy/man/nxproxy.1 index 67bf345f5..fdd5aa915 100644 --- a/nxproxy/man/nxproxy.1 +++ b/nxproxy/man/nxproxy.1 @@ -305,31 +305,39 @@ Should be set to 1 if the proxy is running as part of a program providing encryption of the point to point communication. .TP 8 -.I These options are interpreted by the nx-NX Agent. They are ignored by the proxy. +.I The following options are interpreted by the nx-NX Agent. They are ignored by the proxy: - rootless=<bool> - geometry=<string> - resize=<bool> - fullscreen=<bool> - keyboard=<string> - clipboard=<int> - streaming=<int> + autodpi=<bool> + autograb=<bool> backingstore=<int> + client=<string> + clients=<string> + clipboard=<int> composite=<int> - xinerama=<int> - shmem=<bool> - shpix=<bool> + copysize=<int> + defer=<int> + fullscreen=<bool> + geometry=<string> kbtype=<string> - client=<string> + keyboard=<string> + keyconv=<string> + magicpixel=<bool> + menu=<int> + resize=<bool> + rootless=<bool> shadow=<int> - shadowuid=<int> shadowmode=<string> - defer=<int> - tile=<string> - menu=<int> - magicpixel=<bool> - autodpi=<bool> + shadowuid=<int> + shmem=<bool> + shpix=<bool> sleep=<int> + state=<string> + streaming=<int> + textclipboard=<bool> + tile=<string> + tolerancechecks=<int> + xinerama=<int> + .SH NX ENVIRONMENT VARIABLES -- 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 3.6.x in repository nx-libs. commit 3228dcfc5643e18bc7f115b7ac835267d13f42ee Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Mar 10 23:04:01 2021 +0100 Compext.c: fix misleading error message An X reply contains a type which is X_Reply or X_Error. This is not an opcode which is used when installing the handler. --- nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c index 7fd54e86f..7e5a9799d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c @@ -3461,7 +3461,7 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, ((CARD16)(state -> sequence) % 65536)) { #ifdef TEST_IMAGE - fprintf(stderr, "******_NXCollectImageHandler: Unmatched sequence [%d] for opcode [%d] " + fprintf(stderr, "******_NXCollectImageHandler: Unmatched sequence [%d] of type [%d] " "with length [%d].\n", rep -> generic.sequenceNumber, rep -> generic.type, (int) rep -> generic.length << 2); #endif @@ -3856,9 +3856,10 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, ((CARD16)(state -> sequence) % 65536)) { #ifdef TEST_PROPERTY - fprintf(stderr, "******_NXCollectPropertyHandler: Unmatched sequence [%d] for opcode [%d] " - "with length [%d].\n", rep -> generic.sequenceNumber, rep -> generic.type, + fprintf(stderr, "******_NXCollectPropertyHandler: Unmatched sequence [%d] of type [%d] " + "with length [%d].\n", rep -> generic.sequenceNumber, rep -> generic.type, (int) rep -> generic.length << 2); + #endif return False; @@ -4228,7 +4229,7 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, ((CARD16)(state -> sequence) % 65536)) { #ifdef TEST_POINTER - fprintf(stderr, "******_NXCollectGrabPointerHandler: Unmatched sequence [%d] for opcode [%d] " + fprintf(stderr, "******_NXCollectGrabPointerHandler: Unmatched sequence [%d] of type [%d] " "with length [%d].\n", rep -> generic.sequenceNumber, rep -> generic.type, (int) rep -> generic.length << 2); #endif @@ -4520,7 +4521,7 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, ((CARD16)(state -> sequence) % 65536)) { #ifdef TEST_INPUT - fprintf(stderr, "******_NXCollectInputFocusHandler: Unmatched sequence [%d] for opcode [%d] " + fprintf(stderr, "******_NXCollectInputFocusHandler: Unmatched sequence [%d] of type [%d] " "with length [%d].\n", rep -> generic.sequenceNumber, rep -> generic.type, (int) rep -> generic.length << 2); #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 3.6.x in repository nx-libs. commit 2739d0868f849a186f7b06cb0032ee0d2c599532 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Mar 17 22:17:55 2021 +0100 Compext.c: fix comparisons of 16bit sequence numbers rep->generic.sequenceNumber is of type CARD16 state->sequence is of type unsigned long Converting state->sequence to an int as it has been done since the first version of nxcomp I know of (1.3.0-18 from 2003) is wrong here because for numbers > INT_MAX this will result in a negative number, which, after applying the 16bit modulo, will not match rep->generic.sequenceNumber. Example with numbers: CARD16 c = 24565 unsigned long u = 3179110389 c % 65536 = 24565 u % 65536 = 24565 (int)(u) = -1115856907 (int)(u) % 65536 = -40971 -40971 will not match 24565 To fix this we need to ensure the number stays positive. We use CARD16 for this to match the type in the request which is a 16bit number. On my system CARD16 is unsigned short which is guaranteed to contain _at least_ the 0-65,535 range. As there is no upper limit of the range we cannot drop the modulo because we need this value to be 16bit and not more. Thanks to Norm Green for providing log after log until we could finally identify the reason for him seeing "Xlib: unexpected async reply (sequence 0x94b01439)!" when pasting stopped working. --- .../programs/Xserver/hw/nxagent/compext/Compext.c | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c index 7e5a9799d..dcb91348b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Compext.c @@ -3451,10 +3451,10 @@ static Bool _NXCollectImageHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectImageState *) data; #ifdef DEBUG_IMAGE - fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n", + fprintf(stderr, "******%s: sequence: received [%hu] expected [%lu] 16bit received [%hu] expected [%hu]\n", __func__, - (long) rep -> generic.sequenceNumber, (long)state -> sequence, - rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536); + rep -> generic.sequenceNumber, state -> sequence, + rep -> generic.sequenceNumber % 65536, (CARD16)(state -> sequence) % 65536); #endif if ((rep -> generic.sequenceNumber % 65536) != @@ -3846,10 +3846,10 @@ static Bool _NXCollectPropertyHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectPropertyState *) data; #ifdef DEBUG_PROPERTY - fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n", + fprintf(stderr, "******%s: sequence: received [%hu] expected [%lu] 16bit received [%hu] expected [%hu]\n", __func__, - (long) rep -> generic.sequenceNumber, (long)state -> sequence, - rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536); + rep -> generic.sequenceNumber, state -> sequence, + rep -> generic.sequenceNumber % 65536, (CARD16)(state -> sequence) % 65536); #endif if ((rep -> generic.sequenceNumber % 65536) != @@ -4219,10 +4219,10 @@ static Bool _NXCollectGrabPointerHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectGrabPointerState *) data; #ifdef DEBUG_POINTER - fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n", + fprintf(stderr, "******%s: sequence: received [%hu] expected [%lu] 16bit received [%hu] expected [%hu]\n", __func__, - (long) rep -> generic.sequenceNumber, (long)state -> sequence, - rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536); + rep -> generic.sequenceNumber, state -> sequence, + rep -> generic.sequenceNumber % 65536, (CARD16)(state -> sequence) % 65536); #endif if ((rep -> generic.sequenceNumber % 65536) != @@ -4511,10 +4511,10 @@ static Bool _NXCollectInputFocusHandler(Display *dpy, xReply *rep, char *buf, state = (_NXCollectInputFocusState *) data; #ifdef DEBUG_INPUT - fprintf(stderr, "******%s: sequence: received [%ld] expected [%ld] 16bit received [%d] expected [%d]\n", + fprintf(stderr, "******%s: sequence: received [%hu] expected [%lu] 16bit received [%hu] expected [%hu]\n", __func__, - (long) rep -> generic.sequenceNumber, (long)state -> sequence, - rep -> generic.sequenceNumber % 65536, (int)(state -> sequence) % 65536); + rep -> generic.sequenceNumber, state -> sequence, + rep -> generic.sequenceNumber % 65536, (CARD16)(state -> sequence) % 65536); #endif if ((rep -> generic.sequenceNumber % 65536) != -- 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 3.6.x in repository nx-libs. commit 31c456bf358ea3bb87419aa0bcacd956b3e91e90 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Mar 29 23:43:45 2021 +0200 Composite.c: fix comment --- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index 745696219..7cecd3490 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -140,10 +140,10 @@ void nxagentRedirectDefaultWindows(void) /* * When trying to redirect only the top level window, and not the - * subwindows, we incur in a strange be- haviour. The top level is - * unmapped, mapped, unmap- ped and then reparented. This at first + * subwindows, we incur in a strange behaviour. The top level is + * unmapped, mapped, unmapped and then reparented. This at first * makes the agent think that the window manager is gone, then the - * agent window disappears. To make thinks even more weird, this + * agent window disappears. To make things even more weird, this * happens only at reconnection. */ -- 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 3.6.x in repository nx-libs. commit 3823b0a5b65bcfd4d38d9db9c481ef119781549e Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Mar 29 23:51:01 2021 +0200 nxagent: make nxagentCompositeEnable a Boolean there's no need for that variable to be tri-state --- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 12 +++++------- nx-X11/programs/Xserver/hw/nxagent/Composite.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index 7cecd3490..9e14a82bb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -47,7 +47,7 @@ * Set if the composite extension is supported by the remote display. */ -int nxagentCompositeEnable = UNDEFINED; +Bool nxagentCompositeEnable = False; void nxagentCompositeExtensionInit(void) { @@ -55,7 +55,7 @@ void nxagentCompositeExtensionInit(void) * Set the flag only if the initialization completes. */ - nxagentCompositeEnable = 0; + nxagentCompositeEnable = False; if (nxagentOption(Composite)) { @@ -96,7 +96,7 @@ void nxagentCompositeExtensionInit(void) fprintf(stderr, "nxagentCompositeExtensionInit: Enabling the use of the composite extension.\n"); #endif - nxagentCompositeEnable = 1; + nxagentCompositeEnable = True; } #ifdef TEST else @@ -115,8 +115,7 @@ void nxagentCompositeExtensionInit(void) void nxagentRedirectDefaultWindows(void) { - if (nxagentOption(Rootless) || - nxagentCompositeEnable == 0) + if (nxagentOption(Rootless) || !nxagentCompositeEnable) { #ifdef TEST fprintf(stderr, "nxagentRedirectDefaultWindows: Not redirecting default " @@ -154,8 +153,7 @@ void nxagentRedirectDefaultWindows(void) void nxagentRedirectWindow(WindowPtr pWin) { - if (!nxagentOption(Rootless) || - nxagentCompositeEnable == 0) + if (!nxagentOption(Rootless) || !nxagentCompositeEnable) { #ifdef TEST fprintf(stderr, "nxagentRedirectWindow: Not redirecting window id [%ld] " diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.h b/nx-X11/programs/Xserver/hw/nxagent/Composite.h index abe2551bf..02f08f878 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.h @@ -31,7 +31,7 @@ * its use is enabled. */ -extern int nxagentCompositeEnable; +extern Bool nxagentCompositeEnable; /* * Query the composite extension on the diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 57b7c2b57..bac9947f0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -700,7 +700,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, if (!nxagentOption(IgnoreVisibility) && pDstDrawable -> type == DRAWABLE_WINDOW && (!nxagentWindowIsVisible((WindowPtr) pDstDrawable) || - (!nxagentDefaultWindowIsVisible() && nxagentCompositeEnable == 0))) + (!nxagentDefaultWindowIsVisible() && !nxagentCompositeEnable))) { #ifdef TEST fprintf(stderr, "nxagentCopyArea: Prevented operation on fully obscured window at [%p].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index 8c828df20..ad278491e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -526,7 +526,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, if (!nxagentOption(IgnoreVisibility) && pDrawable -> type == DRAWABLE_WINDOW && (!nxagentWindowIsVisible((WindowPtr) pDrawable) || - (!nxagentDefaultWindowIsVisible() && nxagentCompositeEnable == 0))) + (!nxagentDefaultWindowIsVisible() && !nxagentCompositeEnable))) { #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index cf5e50c04..f2b43b0fc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -174,7 +174,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE #define NXAGENT_SHOULD_SYNCHRONIZE_WINDOW(pDrawable) \ (nxagentWindowIsVisible((WindowPtr) pDrawable) && \ - (nxagentDefaultWindowIsVisible() || nxagentCompositeEnable == 1)) + (nxagentDefaultWindowIsVisible() || nxagentCompositeEnable)) #define MINIMUM_PIXMAP_USAGE_COUNTER 2 -- 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 3.6.x in repository nx-libs. commit 555cbcb325887b3e19bf7ffc3890f60485681e54 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Mar 29 23:07:18 2021 +0200 nxagent: add command line switch to enable composite We have it disabled by default but there hasn't been a way to enable it. --- nx-X11/programs/Xserver/composite/compext.c | 6 ++++++ nx-X11/programs/Xserver/hw/nxagent/Args.c | 11 ++++++++++- nx-X11/programs/Xserver/hw/nxagent/Options.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 4 ++-- nx-X11/programs/Xserver/os/utils.c | 4 +--- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/composite/compext.c b/nx-X11/programs/Xserver/composite/compext.c index 8513c6d73..a63b02075 100644 --- a/nx-X11/programs/Xserver/composite/compext.c +++ b/nx-X11/programs/Xserver/composite/compext.c @@ -39,6 +39,7 @@ static DevPrivateKeyRec CompositeClientPrivateKeyRec; #define CompositeClientPrivateKey (&CompositeClientPrivateKeyRec) #else /* !defined(NXAGENT_SERVER) */ +#include "../hw/nxagent/Options.h" static int CompositeClientPrivIndex = -1; #endif /* !defined(NXAGENT_SERVER) */ @@ -623,6 +624,11 @@ CompositeExtensionInit (void) /* Assume initialization is going to fail */ noCompositeExtension = TRUE; +#ifdef NXAGENT_SERVER + if (!nxagentOption(Composite)) + return; +#endif + fprintf(stderr, "COMPOSITE: trying to initialize extension.\n"); for (s = 0; s < screenInfo.numScreens; s++) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 9ecf2fb8a..f96c2e238 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -737,6 +737,14 @@ int ddxProcessArgument(int argc, char *argv[], int i) return 1; } + /* the composite extension is disabled by default so we provide a + way to enable it */ + if (!strcmp(argv[i], "-composite")) + { + nxagentChangeOption(Composite, True); + return 1; + } + if (!strcmp(argv[i], "-nodamage")) { nxagentChangeOption(UseDamage, False); @@ -2106,7 +2114,8 @@ void ddxUseMsg(void) ErrorF("-sync synchronize with the real server\n"); #ifdef RENDER ErrorF("-norender disable the use of the render extension\n"); - ErrorF("-nocomposite disable the use of the composite extension\n"); + ErrorF("-nocomposite disable the use of the composite extension (default)\n"); + ErrorF("-composite enable the use of the composite extension\n"); #endif ErrorF("-nopersistent disable disconnection/reconnection to the X display on SIGHUP\n"); ErrorF("-noshmem disable use of shared memory extension\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index afc6899e3..be6e5d5e1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -129,7 +129,7 @@ void nxagentInitOptions(void) nxagentOptions.DisplayBuffer = UNDEFINED; nxagentOptions.DisplayCoalescence = 0; - nxagentOptions.Composite = True; + nxagentOptions.Composite = False; nxagentOptions.IgnoreVisibility = False; diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 index ebc528d37..74349cda7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 +++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 @@ -506,8 +506,8 @@ nx/nx option on session resumption .B \-norender disable the use of the render extension .TP 8 -.B \-nocomposite -disable the use of the composite extension +.B \-nocomposite/-composite +disable/enable the use of the composite extension (default ist disabled) .TP 8 .B \-nopersistent disable disconnection/reconnection to the X display on diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 853a33736..c788fae01 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -146,9 +146,7 @@ Bool noTestExtensions; Bool noBigReqExtension = FALSE; #endif #ifdef COMPOSITE -/* COMPOSITE is disabled by default for now until the - * interface is stable */ -Bool noCompositeExtension = TRUE; +Bool noCompositeExtension = FALSE; #endif #ifdef DAMAGE Bool noDamageExtension = 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 3.6.x in repository nx-libs. commit 9f1d0a807fd4da80e366d439b945e924bd2cfe95 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 30 00:20:26 2021 +0200 Trap.h: fix type of traps They are Booleans for some time now but this change was missing in Trap.h --- nx-X11/programs/Xserver/hw/nxagent/Trap.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.h b/nx-X11/programs/Xserver/hw/nxagent/Trap.h index 4203d2b13..1c10f00ea 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.h @@ -26,6 +26,8 @@ #ifndef __Traps_H__ #define __Traps_H__ +#include <nx-X11/Xdefs.h> + #ifndef False #define False 0 #endif @@ -38,72 +40,72 @@ * Set if we are dispatching a render extension request. Used to avoid * reentrancy in GC operations. */ -extern int nxagentGCTrap; +extern Bool nxagentGCTrap; /* * Set if we are enqueing an internal operation, CreateWindow and * Reparent- Window. Used to remove any screen operation. */ -extern int nxagentScreenTrap; +extern Bool nxagentScreenTrap; /* * Set if we are executing a GC operation only on the X side. Used to * avoid reentrancy in FB layer. */ -extern int nxagentFBTrap; +extern Bool nxagentFBTrap; /* * Set if we are dispatching a shared memory extension request. */ -extern int nxagentShmTrap; +extern Bool nxagentShmTrap; /* * Set if a shared pixmap operation is requested by the client. */ -extern int nxagentShmPixmapTrap; +extern Bool nxagentShmPixmapTrap; /* * Set if we are dispatching a XVideo extension request. */ -extern int nxagentXvTrap; +extern Bool nxagentXvTrap; /* * Set if we are dispatching a GLX extension request. */ -extern int nxagentGlxTrap; +extern Bool nxagentGlxTrap; /* * Set while we are resuming the session. */ -extern int nxagentReconnectTrap; +extern Bool nxagentReconnectTrap; /* * Set if we need to realize a drawable by using a lossless encoding. */ -extern int nxagentLosslessTrap; +extern Bool nxagentLosslessTrap; /* * Set to force the synchronization of a drawable. */ -extern int nxagentSplitTrap; +extern Bool nxagentSplitTrap; /* * Set to avoid CapsLock synchronization problems when CapsLock is the * first key to be pressed in the session. */ -extern int nxagentXkbCapsTrap; +extern Bool nxagentXkbCapsTrap; /* * Set to avoid NumLock synchronization problems when NumLock is the * first key to be pressed in the session. */ -extern int nxagentXkbNumTrap; +extern Bool nxagentXkbNumTrap; /* * Set to indicate we are processing a clipboard event triggered by * the real X server. This is used to avoid endless loops if callbacks * would trigger another event by the real X server */ -extern int nxagentExternalClipboardEventTrap; +extern Bool nxagentExternalClipboardEventTrap; #endif /* __Trap_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 3.6.x in repository nx-libs. commit af5cf2659c4cc7c009ed7fa0fbb1a58e210e6453 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Mar 29 23:58:49 2021 +0200 nxagent: treat enableBackingStore as Boolean Use TRUE and FALSE like dix does. --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index f96c2e238..b4f9e7c83 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1998,16 +1998,16 @@ FIXME: In rootless mode the backing-store support is not functional yet. */ if (nxagentOption(Rootless)) { - enableBackingStore = 0; + enableBackingStore = FALSE; } else if (nxagentOption(BackingStore) == BackingStoreUndefined || nxagentOption(BackingStore) == BackingStoreForce) { - enableBackingStore = 1; + enableBackingStore = TRUE; } else if (nxagentOption(BackingStore) == BackingStoreNever) { - enableBackingStore = 0; + enableBackingStore = FALSE; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index febb47c12..1cc4e5448 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1616,7 +1616,7 @@ N/A pScreen->ClearBackingStore = (RegionPtr (*)()) 0; pScreen->DrawGuarantee = (void (*)()) 0; - if (enableBackingStore == 1) + if (enableBackingStore) { #ifdef TEST fprintf(stderr, "nxagentOpenScreen: Going to initialize backing store.\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 3.6.x in repository nx-libs. commit fcc1b57fb980b821138301a9585b91d10bfd0901 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat May 1 19:53:17 2021 +0200 nxagent: add missing command line switches to usage text --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index b1c0231f1..be13efacd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -2112,6 +2112,9 @@ void ddxUseMsg(void) ErrorF("-autodpi detect real server's DPI and use that in the session\n"); ErrorF("-display string display name of the real server\n"); ErrorF("-sync synchronize with the real server\n"); + ErrorF("-nxrealwindowprop set property NX_REAL_WINDOW for each X11 window inside nxagent\n"); + ErrorF("-reportwids report externally exposed X11 window IDs to the session log\n"); + ErrorF("-reportprivatewids report internal X11 window ID to the session log\n"); #ifdef RENDER ErrorF("-norender disable the use of the render extension\n"); ErrorF("-nocomposite disable the use of the composite extension (default)\n"); @@ -2129,6 +2132,7 @@ void ddxUseMsg(void) ErrorF("-irlimit maximum image data rate to the encoder input in kB/s.\n"); ErrorF("-tile WxH maximum size of image tiles (minimum allowed: 32x32)\n"); ErrorF("-keystrokefile file file with keyboard shortcut definitions\n"); + ErrorF("-options file|string path to an options file or an option string (for testing/debugging)\n"); ErrorF("-verbose print more warning and error messages\n"); ErrorF("-D enable desktop mode\n"); ErrorF("-R enable rootless mode\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 3.6.x in repository nx-libs. commit a6d018bef8897ccac1b481e14d94f9436841b21a Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 30 00:02:05 2021 +0200 nxagent: make nxagentAlpha* Booleans --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/Image.c | 6 +++--- nx-X11/programs/Xserver/hw/nxagent/Image.h | 4 ++-- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index b4f9e7c83..e134d3be2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1884,11 +1884,11 @@ N/A fprintf(stderr, "nxagentPostProcessArgs: WARNING! Using backward compatible alpha encoding.\n"); #endif - nxagentAlphaCompat = 1; + nxagentAlphaCompat = True; } else { - nxagentAlphaCompat = 0; + nxagentAlphaCompat = False; } nxagentRemoteMajor = remoteMajor; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index ad278491e..c033bf70d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -87,8 +87,8 @@ int nxagentSplitThreshold = -1; * Set if images can use the alpha channel. */ -int nxagentAlphaEnabled = 0; -int nxagentAlphaCompat = 0; +Bool nxagentAlphaEnabled = False; +Bool nxagentAlphaCompat = False; /* * Used to reformat image when connecting to displays having different @@ -418,7 +418,7 @@ FIXME: Here the split trap is always set and so the caching of the * send the alpha data in compressed form. */ - if (nxagentAlphaCompat == 0) + if (!nxagentAlphaCompat) { NXSetUnpackAlpha(nxagentDisplay, resource, PACK_NONE, size, data, size); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.h b/nx-X11/programs/Xserver/hw/nxagent/Image.h index 6e22fa9f6..5876f5152 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.h @@ -61,8 +61,8 @@ extern int nxagentSplitThreshold; * can be sent in compressed form. */ -extern int nxagentAlphaEnabled; -extern int nxagentAlphaCompat; +extern Bool nxagentAlphaEnabled; +extern Bool nxagentAlphaCompat; /* * Reset the visual and alpha cache diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index 5851eb05c..eed64f808 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -123,7 +123,7 @@ extern void nxagentRenderCreateConicalGradient(PicturePtr pPicture, xRenderColor *colors); #ifdef NXAGENT_SERVER -extern int nxagentAlphaEnabled; +extern Bool nxagentAlphaEnabled; #endif /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 98d7aef67..205940ed7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -703,7 +703,7 @@ int nxagentCreatePicture(PicturePtr pPicture, Mask mask) nxagentPicturePriv(pPicture) -> picture = id; - if (nxagentAlphaEnabled == 1 && pPicture -> pDrawable->depth == 32 && + if (nxagentAlphaEnabled && pPicture -> pDrawable -> depth == 32 && pPicture -> pFormat -> direct.alpha != 0) { if (pPicture -> pDrawable -> type == DRAWABLE_PIXMAP) @@ -2431,7 +2431,7 @@ void nxagentReconnectPicture(void * p0, XID x1, void *p2) (void *) pPicture, nxagentPicture(pPicture)); #endif - if (nxagentAlphaEnabled == 1 && pPicture -> pDrawable -> depth == 32 && + if (nxagentAlphaEnabled && pPicture -> pDrawable -> depth == 32 && pPicture -> pFormat -> direct.alpha != 0) { if (pPicture -> pDrawable -> type == DRAWABLE_PIXMAP) -- 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 3.6.x in repository nx-libs. commit 4a6ca0033c568959123a58914c420ea4b866113a Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 30 00:10:47 2021 +0200 nxagent: make nxagentX2go a Boolean everywhere also correct ugly if formatting regarding nxagentX2go --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Init.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Splash.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index e134d3be2..b1c0231f1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1788,7 +1788,7 @@ N/A if (*nxagentWindowName == '\0') { #ifdef X2GO - if(nxagentX2go) + if (nxagentX2go) { snprintf(nxagentWindowName, NXAGENTWINDOWNAMELENGTH, "X2Go Agent"); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.h b/nx-X11/programs/Xserver/hw/nxagent/Init.h index 1b87f2296..f62193358 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h @@ -46,7 +46,7 @@ extern int nxagentBackingStore; extern int nxagentSaveUnder; #ifdef X2GO -extern int nxagentX2go; +extern Bool nxagentX2go; void checkX2goAgent(void); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index 828649e5a..5196e28b7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -35,7 +35,7 @@ #include "Options.h" #include "Keyboard.h" #include "Drawable.h" -#include "Init.h" /* extern int nxagentX2go */ +#include "Init.h" /* extern Bool nxagentX2go */ #include "Utils.h" #include <unistd.h> diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 1cc4e5448..31b8b68a3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1830,7 +1830,7 @@ N/A XClassHint hint; #ifdef X2GO - if(nxagentX2go) + if (nxagentX2go) { hint.res_name = strdup("X2GoAgent"); hint.res_class = strdup("X2GoAgent"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.c b/nx-X11/programs/Xserver/hw/nxagent/Splash.c index 898868925..d28a96df1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c @@ -74,7 +74,7 @@ void nxagentShowSplashWindow(XlibWindow parentWindow) /* * Show splash window only when running as X2Go Agent */ - if(!nxagentX2go) + if (!nxagentX2go) return; #ifdef TEST -- 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 3.6.x in repository nx-libs. commit 18a8a3610a4fff04aa77b360bb23cd4f308972f5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 30 00:15:20 2021 +0200 nxagent: fix some variable types in Init --- nx-X11/programs/Xserver/hw/nxagent/Init.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Init.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index b120e685e..8a9964154 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -156,7 +156,7 @@ FIXME: These, if not removed, should at least be moved to Display.h and Display.c. */ int nxagentBackingStore; -int nxagentSaveUnder; +Bool nxagentSaveUnder; /* * This is true at startup and set to the value of diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.h b/nx-X11/programs/Xserver/hw/nxagent/Init.h index f62193358..ec0bb3483 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h @@ -40,10 +40,10 @@ is" without express or implied warranty. #ifndef __Init_H__ #define __Init_H__ -extern int nxagentDoFullGeneration; +extern Bool nxagentDoFullGeneration; extern int nxagentBackingStore; -extern int nxagentSaveUnder; +extern Bool nxagentSaveUnder; #ifdef X2GO extern Bool nxagentX2go; -- 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 3.6.x in repository nx-libs. commit 32e194d460d82313706c72110652782e6c26b872 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 2 22:50:08 2020 +0200 Clipboard.c: improve debugging output --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 56 +++++++++++++++++--------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index f704e4702..a72449633 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -765,8 +765,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) char *strSelection = XGetAtomName(nxagentDisplay, X->xselectionrequest.selection); char *strProperty = XGetAtomName(nxagentDisplay, X->xselectionrequest.property); - fprintf(stderr, "%s: Received SelectionRequest from real server: selection [%ld][%s] " \ - "target [%ld][%s] requestor [%s/0x%lx] destination [%ld][%s] lastServerRequestor [0x%x]\n", + fprintf(stderr, "%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ + "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s] lastServerRequestor [0x%x]\n", __func__, X->xselectionrequest.selection, validateString(strSelection), X->xselectionrequest.target, validateString(strTarget), @@ -935,8 +935,18 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) serverWindow, lastClientTime); #ifdef DEBUG - fprintf(stderr, "%s: Sent XConvertSelection.\n", __func__); + char *strTarget = XGetAtomName(nxagentDisplay, X->xselectionrequest.target); + char *strSelection = XGetAtomName(nxagentDisplay, CurrentSelections[i].selection); + char *strProperty = XGetAtomName(nxagentDisplay, serverTransToAgentProperty); + fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%x] time [%u] .\n", __func__, + CurrentSelections[i].selection, strSelection, + X->xselectionrequest.target, strTarget, + serverTransToAgentProperty, strProperty, + serverWindow, lastClientTime); #endif + SAFE_XFree(strTarget); + SAFE_XFree(strSelection); + SAFE_XFree(strProperty); } else { @@ -1305,7 +1315,7 @@ void nxagentCollectPropertyEvent(int resource) { #ifdef DEBUG fprintf (stderr, "%s: WARNING! Inconsistent state [%s] for client %s.\n", __func__, - getClientSelectionStageString(lastClientStage), nxagentClientInfoString(lastClientClientPtr)); + getClientSelectionStageString(lastClientStage), nxagentClientInfoString(lastClientClientPtr)); #endif break; } @@ -1332,14 +1342,17 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) #ifdef DEBUG XSelectionEvent * e = (XSelectionEvent *)X; { - char * s = XGetAtomName(nxagentDisplay, e->property); + char * p = XGetAtomName(nxagentDisplay, e->property); char * t = XGetAtomName(nxagentDisplay, e->target); - fprintf(stderr, "%s: SelectionNotify event from real X server, property "\ - "[%ld][%s] requestor [0x%lx] target [%ld][%s] time [%ld] send_event [%d].\n", - __func__, e->property, validateString(s), e->requestor, e->target, + char * s = XGetAtomName(nxagentDisplay, e->selection); + fprintf(stderr, "%s: SelectionNotify event from real X server, property " \ + "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%ld] send_event [%d].\n", + __func__, e->property, validateString(p), e->requestor, + validateString(s), e->target, validateString(t), e->time, e->send_event); - SAFE_XFree(s); + SAFE_XFree(p); SAFE_XFree(t); + SAFE_XFree(s); } #endif @@ -1357,7 +1370,6 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) */ #ifdef DEBUG - fprintf(stderr, "%s: event selection is [%s]\n", __func__, XGetAtomName(nxagentDisplay, e->selection)); nxagentDumpClipboardStat(); #endif if (lastClientStage == SelectionStageNone) @@ -1399,7 +1411,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) else { #ifdef DEBUG - fprintf(stderr, "%s: WARNING! Resetting selection transferral for client [%d].\n", __func__, + fprintf(stderr, "%s: WARNING! Resetting selection transferral for client [%d] because of unexpected stage.\n", __func__, CLINDEX(lastClientClientPtr)); #endif @@ -1781,6 +1793,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, fprintf(stderr, "%s: lastClientWindowPtr != NULL.\n", __func__); #endif + #ifdef DEBUG + fprintf(stderr, "%s: lastClientSelection [%d] - selection [%d]\n", __func__, lastClientSelection, selection); + #endif + if ((GetTimeInMillis() - lastClientReqTime) >= CONVERSION_TIMEOUT) { #ifdef DEBUG @@ -1798,8 +1814,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * which we cannot handle (yet). So return an error. */ #ifdef DEBUG - fprintf(stderr, "%s: got request " - "before timeout expired on last request, notifying failure to client %s\n", + fprintf(stderr, "%s: got new request " + "before timeout expired on previous request, notifying failure to client %s\n", __func__, nxagentClientInfoString(client)); #endif @@ -1810,16 +1826,16 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, } } + const char *strTarget = NameForAtom(target); + #ifdef DEBUG fprintf(stderr, "%s: client %s requests sel [%s] " - "on window [%x] prop [%d][%s] target [%d][%s].\n", __func__, + "on window [0x%x] prop [%d][%s] target [%d][%s].\n", __func__, nxagentClientInfoString(client), validateString(NameForAtom(selection)), requestor, property, validateString(NameForAtom(property)), - target, validateString(NameForAtom(target))); + target, validateString(strTarget)); #endif - const char *strTarget = NameForAtom(target); - if (strTarget == NULL) { #ifdef DEBUG @@ -1840,7 +1856,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, int numTargets = sizeof(targets) / sizeof(targets[0]); #ifdef DEBUG - fprintf(stderr, "%s: available targets:\n", __func__); + fprintf(stderr, "%s: available targets [%d]:\n", __func__, numTargets); for (int i = 0; i < numTargets; i++) fprintf(stderr, "%s: %s\n", __func__, NameForAtom(targets[i])); fprintf(stderr, "\n"); @@ -1977,8 +1993,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, } #ifdef DEBUG - fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] time [%ld]\n", __func__, - serverWindow, t, tstr, p, pstr, CurrentTime); + fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] time [0][CurrentTime]\n", __func__, + serverWindow, t, tstr, p, pstr); #endif XConvertSelection(nxagentDisplay, selection, t, p, serverWindow, CurrentTime); -- 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 3.6.x in repository nx-libs. commit 59a0620f68e9377001f23f5f491a8b02b520d685 Merge: 6208dade8 fcc1b57fb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jun 8 12:59:56 2021 +0200 Merge branch 'uli42-pr/various7' into 3.6.x Attributes GH PR #1007: https://github.com/ArcticaProject/nx-libs/pull/1007 nx-X11/programs/Xserver/composite/compext.c | 6 + nx-X11/programs/Xserver/hw/nxagent/Args.c | 33 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 7 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 3 + nx-X11/programs/Xserver/hw/nxagent/Composite.c | 18 +- nx-X11/programs/Xserver/hw/nxagent/Composite.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 4 + nx-X11/programs/Xserver/hw/nxagent/Error.c | 150 +++---- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Icons.h | 2 + nx-X11/programs/Xserver/hw/nxagent/Image.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Image.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 5 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Init.h | 8 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 2 + nx-X11/programs/Xserver/hw/nxagent/Render.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/Splash.c | 11 +- nx-X11/programs/Xserver/hw/nxagent/Trap.h | 28 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 56 +-- .../programs/Xserver/hw/nxagent/compext/Compext.c | 452 ++++++++++++--------- nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 13 +- nx-X11/programs/Xserver/os/utils.c | 4 +- nxcomp/src/Misc.cpp | 41 +- nxproxy/man/nxproxy.1 | 44 +- 31 files changed, 542 insertions(+), 399 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 3.6.x in repository nx-libs. commit 2742fde0043d2690c3c7b22f137679d0b91dac6c Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Sep 20 16:45:51 2020 +0200 Clipboard.c: improve explanations/FIXMEs --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index a72449633..a4f61ef19 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -923,12 +923,18 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) int i = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); if (i < nxagentMaxSelections) { +#if 0 if (lastClientWindowPtr != NULL && IS_INTERNAL_OWNER(i)) { /* * Request the real X server to transfer the selection content * to the NX_CUT_BUFFER_SERVER property of the serverWindow. * FIXME: document how we can end up here + * + * It looks like this is only reached when the real X server is + * on Windows. I suspect that this is connected to the windows X + * server (VcXSrv in my test) pushing PRIMARY or CLIPBOARD + * content to the Windows clipboard whenever they change. */ XConvertSelection(nxagentDisplay, CurrentSelections[i].selection, X->xselectionrequest.target, serverTransToAgentProperty, @@ -949,6 +955,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) SAFE_XFree(strProperty); } else +#endif { /* * if one of our clients owns the selection we ask it to copy @@ -1683,6 +1690,7 @@ static void setSelectionOwner(Selection *pSelection) /* * we are in the process of communicating back and forth between * real X server and nxagent's clients - let's not disturb + * FIXME: by continuing after the warning were ARE disturbing! */ fprintf (stderr, "%s: WARNING! Requestor window [0x%x] already set.\n", __func__, lastServerRequestor); @@ -1804,6 +1812,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, "notifying failure to client %s\n", __func__, nxagentClientInfoString(client)); #endif + /* notify the waiting client of failure */ endTransfer(SELECTION_FAULT); } else @@ -1999,7 +2008,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, XConvertSelection(nxagentDisplay, selection, t, p, serverWindow, CurrentTime); - /* FIXME: check returncode of XConvertSelection */ + /* FIXME: check result of XConvertSelection? */ #ifdef DEBUG fprintf(stderr, "%s: Sent XConvertSelection with target [%s], property [%s]\n", __func__, tstr, pstr); -- 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 3.6.x in repository nx-libs. commit 972a92cab16a99d86a5b66b03967229799f1216d Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 2 22:48:51 2020 +0200 Clipboard.c: add/fix comments --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 22fc96f4f..bb8ca5843 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -827,9 +827,10 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * * The list is aligned with the one in nxagentConvertSelection. * - * FIXME: the perfect solution should not just answer with - * XA_STRING but ask the real owner what format it supports. The - * result should then be sent to the original requestor. + * FIXME: the perfect solution should not just answer with a + * hardcoded list but ask the real owner what format it + * supports. The result should then be sent to the original + * requestor. */ long targets[] = {XA_STRING, serverUTF8_STRING, serverTEXT, serverCOMPOUND_TEXT, serverTARGETS, serverTIMESTAMP}; @@ -877,6 +878,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * * FIXME: ensure we are reporting an _external_ timestamp * FIXME: for a 32 bit property list we need to pass a "long" array, not "char"! + * FIXME: selection has already been checked above, so we do not need to check again here */ int i = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); @@ -1784,6 +1786,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, __func__, nxagentClientInfoString(client)); #endif + /* notify the sender of the new request of failure */ sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); return 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 3.6.x in repository nx-libs. commit 18c91fd94c8bba7de44110e9db9daf41ee6f916d Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 2 22:59:12 2020 +0200 Clipboard.c: improve error message if we get an unexpected property print that as an error. Before we saw "unexpected stage" in that case which does not really help in debugging... --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 57 +++++++++++++++++--------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index bb8ca5843..f704e4702 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1330,8 +1330,8 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) } #ifdef DEBUG + XSelectionEvent * e = (XSelectionEvent *)X; { - XSelectionEvent * e = (XSelectionEvent *)X; char * s = XGetAtomName(nxagentDisplay, e->property); char * t = XGetAtomName(nxagentDisplay, e->target); fprintf(stderr, "%s: SelectionNotify event from real X server, property "\ @@ -1355,29 +1355,46 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) * the real X server). We now need to transfer it to the original * requestor, which is stored in the lastClient* variables. */ - if (lastClientStage == SelectionStageNone && - X->xselection.property == serverTransToAgentProperty) + + #ifdef DEBUG + fprintf(stderr, "%s: event selection is [%s]\n", __func__, XGetAtomName(nxagentDisplay, e->selection)); + nxagentDumpClipboardStat(); + #endif + if (lastClientStage == SelectionStageNone) { - #ifdef DEBUG - fprintf(stderr, "%s: Starting selection transferral for client %s.\n", __func__, - nxagentClientInfoString(lastClientClientPtr)); - #endif + if (X->xselection.property == serverTransToAgentProperty) + { + #ifdef DEBUG + fprintf(stderr, "%s: Starting selection transferral for client %s.\n", __func__, + nxagentClientInfoString(lastClientClientPtr)); + #endif - /* - * The state machine is able to work in two phases. In the first - * phase we get the size of property data, in the second we get - * the actual data. We save a round-trip by requesting a prede- - * termined amount of data in a single GetProperty and by discar- - * ding the remaining part. This is not the optimal solution (we - * could get the remaining part if it doesn't fit in a single - * reply) but, at least with text, it should work in most situa- - * tions. - */ + /* + * The state machine is able to work in two phases. In the first + * phase we get the size of property data, in the second we get + * the actual data. We save a round-trip by requesting a prede- + * termined amount of data in a single GetProperty and by discar- + * ding the remaining part. This is not the optimal solution (we + * could get the remaining part if it doesn't fit in a single + * reply) but, at least with text, it should work in most situa- + * tions. + */ - setClientSelectionStage(SelectionStageQueryData); - lastClientPropertySize = 262144; + setClientSelectionStage(SelectionStageQueryData); + lastClientPropertySize = 262144; - transferSelection(lastClientClientPtr -> index); + transferSelection(lastClientClientPtr -> index); + } + else + { + #ifdef DEBUG + char *s = XGetAtomName(nxagentDisplay, X->xselection.property); + fprintf(stderr, "%s: Unexpected property [%ld][%s] - reporting conversion failure.\n", + __func__, X->xselection.property, s); + SAFE_XFree(s); + #endif + endTransfer(SELECTION_FAULT); + } } else { -- 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 3.6.x in repository nx-libs. commit e9a25e7945a119a8843059dcc8e6ff621b6fb03e Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Oct 3 00:10:27 2020 +0200 Clipboard.c: catch selection failure from real X server --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index fddb53b97..4197dcebd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1413,6 +1413,14 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) transferSelection(lastClientClientPtr -> index); } + else if (X->xselection.property == 0) + { + #ifdef DEBUG + fprintf(stderr, "%s: WARNING! Resetting selection transferral for client [%d] because of failure notification from real X server.\n", __func__, + CLINDEX(lastClientClientPtr)); + #endif + endTransfer(SELECTION_FAULT); + } else { #ifdef DEBUG -- 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 3.6.x in repository nx-libs. commit 12ed2c635b6979f84832655ffe66171482d80469 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Sep 19 22:15:03 2020 +0200 Clipboard.c: print times unsigned there are no negative times... --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index a4f61ef19..11c6ae013 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1353,7 +1353,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) char * t = XGetAtomName(nxagentDisplay, e->target); char * s = XGetAtomName(nxagentDisplay, e->selection); fprintf(stderr, "%s: SelectionNotify event from real X server, property " \ - "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%ld] send_event [%d].\n", + "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", __func__, e->property, validateString(p), e->requestor, validateString(s), e->target, validateString(t), e->time, e->send_event); @@ -1709,7 +1709,7 @@ static void setSelectionOwner(Selection *pSelection) fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%x])\n", __func__, (void *)lastSelectionOwner[i].windowPtr, (void *)pSelection->pWin, nxagentWindow(pSelection->pWin), serverWindow); - fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%d]\n", __func__, + fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%u]\n", __func__, lastSelectionOwner[i].lastTimeChanged); #endif @@ -2199,7 +2199,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) #ifdef NXAGENT_TIMESTAMP { - fprintf(stderr, "%s: Clipboard init starts at [%ld] ms.\n", __func__, + fprintf(stderr, "%s: Clipboard init starts at [%lu] ms.\n", __func__, GetTimeInMillis() - startTime); } #endif @@ -2367,7 +2367,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) #ifdef NXAGENT_TIMESTAMP { - fprintf(stderr, "%s: Clipboard init ends at [%ld] ms.\n", __func__, + fprintf(stderr, "%s: Clipboard init ends at [%lu] ms.\n", __func__, GetTimeInMillis() - startTime); } #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 3.6.x in repository nx-libs. commit 717661b1d6d3e0ecd30611121d12ac637878fe64 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Oct 3 00:21:46 2020 +0200 Clipboard.c: improve function names once more --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 74 +++++++++++++------------- nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index b9af7e199..89d190451 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -237,15 +237,15 @@ static void setClientSelectionStage(int stage, int index); static void endTransfer(Bool success, int index); #define SELECTION_SUCCESS True #define SELECTION_FAULT False -static void transferSelection(int resource, int index); +static void transferSelectionFromXServer(int resource, int index); #if 0 -static void resetSelectionOwner(void); +static void resetSelectionOwnerOnXServer(void); #endif -static void initSelectionOwner(int index, Atom selection); -static void clearSelectionOwner(int index); -static void storeSelectionOwner(int index, Selection *sel); +static void initSelectionOwnerData(int index, Atom selection); +static void clearSelectionOwnerData(int index); +static void storeSelectionOwnerData(int index, Selection *sel); static Bool matchSelectionOwner(int index, ClientPtr pClient, WindowPtr pWindow); -static void setSelectionOwner(Selection *pSelection); +static void setSelectionOwnerOnXServer(Selection *pSelection); static int sendEventToClient(ClientPtr client, xEvent *pEvents); static void sendSelectionNotifyEventToClient(ClientPtr client, Time time, @@ -253,11 +253,11 @@ static void sendSelectionNotifyEventToClient(ClientPtr client, Atom selection, Atom target, Atom property); -static Status sendSelectionNotifyEventToServer(XSelectionEvent *event_to_send); +static Status sendSelectionNotifyEventToXServer(XSelectionEvent *event_to_send); #ifdef DEBUG static void printSelectionStat(int sel); #endif -static void replyRequestSelection(XEvent *X, Bool success); +static void replyRequestSelectionToXServer(XEvent *X, Bool success); void nxagentPrintClipboardStat(char *); @@ -461,7 +461,7 @@ int GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, long longL * Send a SelectionNotify event to the real X server and do some error * handling (in DEBUG mode) */ -static Status sendSelectionNotifyEventToServer(XSelectionEvent *event_to_send) +static Status sendSelectionNotifyEventToXServer(XSelectionEvent *event_to_send) { Window w = event_to_send->requestor; @@ -600,7 +600,7 @@ static Bool validServerTargets(XlibAtom target) return False; } -static void initSelectionOwner(int index, Atom selection) +static void initSelectionOwnerData(int index, Atom selection) { lastSelectionOwner[index].selection = selection; lastSelectionOwner[index].client = NullClient; @@ -610,7 +610,7 @@ static void initSelectionOwner(int index, Atom selection) } /* there's no owner on nxagent side anymore */ -static void clearSelectionOwner(int index) +static void clearSelectionOwnerData(int index) { lastSelectionOwner[index].client = NULL; lastSelectionOwner[index].window = None; @@ -618,7 +618,7 @@ static void clearSelectionOwner(int index) lastSelectionOwner[index].lastTimeChanged = GetTimeInMillis(); } -static void storeSelectionOwner(int index, Selection *sel) +static void storeSelectionOwnerData(int index, Selection *sel) { lastSelectionOwner[index].client = sel->client; lastSelectionOwner[index].window = sel->window; @@ -658,7 +658,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) i, (void *) pClient, (void *) pWindow); #endif - clearSelectionOwner(i); + clearSelectionOwnerData(i); setClientSelectionStage(SelectionStageNone, i); @@ -752,7 +752,7 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) CurrentSelections[i].window = screenInfo.screens[0]->root->drawable.id; CurrentSelections[i].client = NullClient; - clearSelectionOwner(i); + clearSelectionOwnerData(i); setClientSelectionStage(SelectionStageNone, i); } @@ -763,7 +763,7 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) * event X. If success is True take the property from the event, else * take None (which reports "failed/denied" to the requestor). */ -static void replyRequestSelection(XEvent *X, Bool success) +static void replyRequestSelectionToXServer(XEvent *X, Bool success) { XSelectionEvent eventSelection = { .requestor = X->xselectionrequest.requestor, @@ -781,7 +781,7 @@ static void replyRequestSelection(XEvent *X, Bool success) eventSelection.property = None; } - sendSelectionNotifyEventToServer(&eventSelection); + sendSelectionNotifyEventToXServer(&eventSelection); } /* @@ -829,7 +829,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) fprintf(stderr, "%s: denying additional request during transfer phase.\n", __func__); #endif - replyRequestSelection(X, False); + replyRequestSelectionToXServer(X, False); return; } @@ -842,7 +842,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) fprintf(stderr, "%s: not owning selection [%ld] - denying request.\n", __func__, X->xselectionrequest.selection); #endif - replyRequestSelection(X, False); + replyRequestSelectionToXServer(X, False); return; } } @@ -896,7 +896,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) (unsigned char*)&targets, numTargets); - replyRequestSelection(X, True); + replyRequestSelectionToXServer(X, True); } else if (X->xselectionrequest.target == serverTIMESTAMP) { @@ -926,7 +926,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) PropModeReplace, (unsigned char *) &lastSelectionOwner[i].lastTimeChanged, 1); - replyRequestSelection(X, True); + replyRequestSelectionToXServer(X, True); } } else @@ -938,7 +938,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) #ifdef DEBUG fprintf(stderr, "%s: unknown special target [%ld] - denying request.\n", __func__, X->xselectionrequest.target); #endif - replyRequestSelection(X, False); + replyRequestSelectionToXServer(X, False); } return; } @@ -1052,7 +1052,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) else { /* deny the request */ - replyRequestSelection(X, False); + replyRequestSelectionToXServer(X, False); } } } @@ -1098,7 +1098,7 @@ static void endTransfer(Bool success, int index) setClientSelectionStage(SelectionStageNone, index); } -static void transferSelection(int resource, int index) +static void transferSelectionFromXServer(int resource, int index) { #ifdef DEBUG fprintf(stderr, "%s: resource [%d] lastClients[%d].clientPtr->index [%d].\n", __func__, @@ -1256,7 +1256,7 @@ static void transferSelection(int resource, int index) False: not processed, resource is not ours */ -Bool nxagentCollectPropertyEvent(int resource) +Bool nxagentCollectPropertyEventFromXServer(int resource) { XlibAtom atomReturnType; int resultFormat; @@ -1349,7 +1349,7 @@ Bool nxagentCollectPropertyEvent(int resource) lastClients[index].propertySize = ulReturnBytesLeft; setClientSelectionStage(SelectionStageQueryData, index); - transferSelection(resource, index); + transferSelectionFromXServer(resource, index); } break; } @@ -1504,7 +1504,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) setClientSelectionStage(SelectionStageQueryData, index); lastClients[index].propertySize = 262144; - transferSelection(lastClients[index].clientPtr -> index, index); + transferSelectionFromXServer(lastClients[index].clientPtr -> index, index); } else if (X->xselection.property == 0) { @@ -1644,7 +1644,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) (void *)eventSelection.requestor); #endif - sendSelectionNotifyEventToServer(&eventSelection); + sendSelectionNotifyEventToXServer(&eventSelection); lastServerRequestor = None; /* allow further request */ } @@ -1659,7 +1659,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) * the real X server (or its clients) will be sent to this window. The * real X server never communicates with our windows directly. */ -static void resetSelectionOwner(void) +static void resetSelectionOwnerOnXServer(void) { if (lastServerRequestor != None) { @@ -1688,7 +1688,7 @@ static void resetSelectionOwner(void) fprintf(stderr, "%s: Reset selection state for selection [%d].\n", __func__, i); #endif - clearSelectionOwner(i); + clearSelectionOwnerData(i); setClientSelectionStage(SelectionStageNone, i); } @@ -1749,9 +1749,9 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, pCurSel->selection == clientCLIPBOARD)) { #ifdef DEBUG - fprintf(stderr, "%s: calling setSelectionOwner\n", __func__); + fprintf(stderr, "%s: calling setSelectionOwnerOnXServer\n", __func__); #endif - setSelectionOwner(pCurSel); + setSelectionOwnerOnXServer(pCurSel); } } else if (info->kind == SelectionWindowDestroy) @@ -1779,7 +1779,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, * This is called from the nxagentSetSelectionCallback, so it is using * internal Atoms */ -static void setSelectionOwner(Selection *pSelection) +static void setSelectionOwnerOnXServer(Selection *pSelection) { if (!agentClipboardInitialized) { @@ -1835,7 +1835,7 @@ static void setSelectionOwner(Selection *pSelection) * points to the struct that contains all information about the * owner window. */ - storeSelectionOwner(i, pSelection); + storeSelectionOwnerData(i, pSelection); setClientSelectionStage(SelectionStageNone, i); } @@ -2263,7 +2263,7 @@ int nxagentSendNotify(xEvent *event) NameForAtom(event->u.selectionNotify.property)); #endif - sendSelectionNotifyEventToServer(&eventSelection); + sendSelectionNotifyEventToXServer(&eventSelection); return 1; } @@ -2325,8 +2325,8 @@ Bool nxagentInitClipboard(WindowPtr pWin) { FatalError("nxagentInitClipboard: Failed to allocate memory for the clipboard selections.\n"); } - initSelectionOwner(nxagentPrimarySelection, XA_PRIMARY); - initSelectionOwner(nxagentClipboardSelection, nxagentAtoms[10]); /* CLIPBOARD */ + initSelectionOwnerData(nxagentPrimarySelection, XA_PRIMARY); + initSelectionOwnerData(nxagentClipboardSelection, nxagentAtoms[10]); /* CLIPBOARD */ SAFE_free(lastClients); @@ -2447,7 +2447,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) { for (int i = 0; i < nxagentMaxSelections; i++) { - clearSelectionOwner(i); + clearSelectionOwnerData(i); resetClientSelectionStage(i); /* FIXME: required? move to setSelctionStage? */ lastClients[i].reqTime = GetTimeInMillis(); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h index 18d0094d2..f902bb50b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h @@ -72,7 +72,7 @@ extern int nxagentFindCurrentSelectionIndex(Atom sel); * Handle the selection property received in the event loop in * Events.c. */ -extern Bool nxagentCollectPropertyEvent(int resource); +extern Bool nxagentCollectPropertyEventFromXServer(int resource); extern WindowPtr nxagentGetClipboardWindow(Atom property); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 0918073a9..4e45e0d24 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -3982,7 +3982,7 @@ void nxagentHandleCollectPropertyEvent(XEvent *X) return; } - if (!nxagentCollectPropertyEvent(resource)) + if (!nxagentCollectPropertyEventFromXServer(resource)) { XlibAtom atomReturnType; int resultFormat; -- 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 3.6.x in repository nx-libs. commit 60380a6a5ed99680f86c5daf14bb412b6d3383a4 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Sep 20 16:41:56 2020 +0200 Clipboard.c: do not set stage to new value if already set to that value --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 11c6ae013..fddb53b97 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -394,6 +394,15 @@ void nxagentDumpClipboardStat(void) */ static void setClientSelectionStage(int stage) { + if (lastClientStage == stage) + { + #ifdef DEBUG + fprintf(stderr, "%s: selection stage already set to [%s] - doing nothing\n", __func__, + getClientSelectionStageString(lastClientStage)); + #endif + return; + } + #ifdef DEBUG fprintf(stderr, "%s: Changing selection stage from [%s] to [%s]\n", __func__, getClientSelectionStageString(lastClientStage), getClientSelectionStageString(stage)); -- 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 3.6.x in repository nx-libs. commit 619236b9880f608e50b69fa5924a3a6e96942530 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Oct 3 00:48:27 2020 +0200 Clipboard.c: reformat for better readability --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 89d190451..c0fe74c25 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -129,10 +129,10 @@ typedef struct _lastClient static lastClient *lastClients; -static Window lastServerRequestor; -static XlibAtom lastServerProperty; -static XlibAtom lastServerTarget; -static Time lastServerTime; +static Window lastServerRequestor; +static XlibAtom lastServerProperty; +static XlibAtom lastServerTarget; +static Time lastServerTime; static XlibAtom serverTARGETS; static XlibAtom serverTIMESTAMP; @@ -140,20 +140,20 @@ static XlibAtom serverTEXT; static XlibAtom serverCOMPOUND_TEXT; static XlibAtom serverUTF8_STRING; static XlibAtom serverTransFromAgentProperty; -static Atom clientTARGETS; -static Atom clientTIMESTAMP; -static Atom clientTEXT; -static Atom clientCOMPOUND_TEXT; -static Atom clientUTF8_STRING; -static Atom clientCLIPBOARD; - -static char szAgentTARGETS[] = "TARGETS"; -static char szAgentTEXT[] = "TEXT"; -static char szAgentTIMESTAMP[] = "TIMESTAMP"; -static char szAgentCOMPOUND_TEXT[] = "COMPOUND_TEXT"; -static char szAgentUTF8_STRING[] = "UTF8_STRING"; -static char szAgentNX_CUT_BUFFER_CLIENT[] = "NX_CUT_BUFFER_CLIENT"; -static char szAgentCLIPBOARD[] = "CLIPBOARD"; +static Atom clientTARGETS; +static Atom clientTIMESTAMP; +static Atom clientTEXT; +static Atom clientCOMPOUND_TEXT; +static Atom clientUTF8_STRING; +static Atom clientCLIPBOARD; + +static char szAgentTARGETS[] = "TARGETS"; +static char szAgentTEXT[] = "TEXT"; +static char szAgentTIMESTAMP[] = "TIMESTAMP"; +static char szAgentCOMPOUND_TEXT[] = "COMPOUND_TEXT"; +static char szAgentUTF8_STRING[] = "UTF8_STRING"; +static char szAgentNX_CUT_BUFFER_CLIENT[] = "NX_CUT_BUFFER_CLIENT"; +static char szAgentCLIPBOARD[] = "CLIPBOARD"; /* number of milliseconds to wait for a conversion from the real X server. */ #define CONVERSION_TIMEOUT 5000 @@ -505,11 +505,11 @@ static int sendEventToClient(ClientPtr client, xEvent *pEvents) } static void sendSelectionNotifyEventToClient(ClientPtr client, - Time time, - Window requestor, - Atom selection, - Atom target, - Atom property) + Time time, + Window requestor, + Atom selection, + Atom target, + Atom property) { /* * Check if the client is still valid. -- 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 3.6.x in repository nx-libs. commit 94fd5f5905329777ba34345f93cc6ce9d19448fe Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Sep 20 19:48:46 2020 +0200 Clipboard.c: rework LastClient stuff to work _per selection_ --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 547 +++++++++++++++---------- nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 8 +- 3 files changed, 325 insertions(+), 232 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 4197dcebd..b9af7e199 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -66,8 +66,6 @@ extern int NumCurrentSelections; extern Selection *CurrentSelections; -int nxagentLastClipboardClient = -1; - static int agentClipboardInitialized = False; static int clientAccum; @@ -114,17 +112,22 @@ typedef enum SelectionStageWaitData } ClientSelectionStage; -static WindowPtr lastClientWindowPtr; -static ClientPtr lastClientClientPtr; -static Window lastClientRequestor; -static Atom lastClientProperty; -static Atom lastClientSelection; -static Atom lastClientTarget; -static Time lastClientTime; -static Time lastClientReqTime; -static unsigned long lastClientPropertySize; - -static ClientSelectionStage lastClientStage; +typedef struct _lastClient +{ + WindowPtr windowPtr; + ClientPtr clientPtr; + Window requestor; + Atom property; + Atom selection; + Atom target; + Time time; + Time reqTime; + unsigned long propertySize; + ClientSelectionStage stage; + int resource; /* nxcompext resource where collected proeprty data is stored */ +} lastClient; + +static lastClient *lastClients; static Window lastServerRequestor; static XlibAtom lastServerProperty; @@ -179,9 +182,9 @@ static const char * getClientSelectionStageString(int stage) } #ifdef DEBUG -#define printClientSelectionStage() do {fprintf(stderr, "%s: Current selection stage [%s]\n", __func__, getClientSelectionStageString(lastClientStage));} while (0) +#define printClientSelectionStage(_index) do {fprintf(stderr, "%s: Current selection stage for selection [%d] is [%s]\n", __func__, _index, getClientSelectionStageString(lastClients[_index].stage));} while (0) #else -#define printClientSelectionStage() +#define printClientSelectionStage(_index) #endif #define WINDOWID(ptr) (ptr) ? (ptr->drawable.id) : 0 @@ -230,11 +233,11 @@ XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, False }; extern Display *nxagentDisplay; static Bool validServerTargets(XlibAtom target); -static void setClientSelectionStage(int stage); -static void endTransfer(Bool success); +static void setClientSelectionStage(int stage, int index); +static void endTransfer(Bool success, int index); #define SELECTION_SUCCESS True #define SELECTION_FAULT False -static void transferSelection(int resource); +static void transferSelection(int resource, int index); #if 0 static void resetSelectionOwner(void); #endif @@ -262,6 +265,7 @@ void nxagentPrintClipboardStat(char *); extern unsigned long startTime; #endif +// FIXME: change sel to index static void printSelectionStat(int sel) { SelectionOwner lOwner = lastSelectionOwner[sel]; @@ -298,6 +302,32 @@ static void printSelectionStat(int sel) return; } +static void printLastClientStat(int index) +{ + lastClient lc = lastClients[index]; + if (lc.windowPtr) + fprintf(stderr, " lastClients[].windowPtr (WindowPtr) [%p] ([0x%x])\n", (void *)lc.windowPtr, WINDOWID(lc.windowPtr)); + else + fprintf(stderr, " lastClients[].windowPtr (WindowPtr) -\n"); + fprintf(stderr, " lastClients[].clientPtr (ClientPtr) %s\n", nxagentClientInfoString(lc.clientPtr)); + fprintf(stderr, " lastClients[].requestor (Window) [0x%x]\n", lc.requestor); + fprintf(stderr, " lastClients[].property (Atom) [% 4d][%s]\n", lc.property, NameForAtom(lc.property)); + fprintf(stderr, " lastClients[].selection (Atom) [% 4d][%s]\n", lc.selection, NameForAtom(lc.selection)); + fprintf(stderr, " lastClients[].target (Atom) [% 4d][%s]\n", lc.target, NameForAtom(lc.target)); + if (lc.time > 0) + fprintf(stderr, " lastClients[].time (Time) [%u] ([%u]ms ago)\n", lc.time, GetTimeInMillis() - lc.time); + else + fprintf(stderr, " lastClients[].time (Time) [%u]\n", lc.time); + if (lc.reqTime > 0) + fprintf(stderr, " lastClients[].reqTime (Time) [%u] ([%u]ms ago)\n", lc.reqTime, GetTimeInMillis() - lc.reqTime); + else + fprintf(stderr, " lastClients[].reqTime (Time) [%u]\n", lc.reqTime); + fprintf(stderr, " lastClients[].propertySize (ulong) [%lu]\n", lc.propertySize); + fprintf(stderr, " lastClients[].stage (ClientSelStage) [%d][%s]\n", lc.stage, getClientSelectionStageString(lc.stage)); + fprintf(stderr, " lastClients[].resource (int) [%d]\n", lc.resource); +} + + void nxagentDumpClipboardStat(void) { char *s = NULL; @@ -310,7 +340,6 @@ void nxagentDumpClipboardStat(void) fprintf(stderr, " nxagentMaxSelections (int) [%d]\n", nxagentMaxSelections); fprintf(stderr, " NumCurrentSelections (int) [%d]\n", NumCurrentSelections); fprintf(stderr, " serverWindow (Window) [0x%x]\n", serverWindow); - fprintf(stderr, " nxagentLastClipboardClient (int) [%d]\n", nxagentLastClipboardClient); fprintf(stderr, " Clipboard mode "); switch(nxagentOption(Clipboard)) @@ -331,31 +360,12 @@ void nxagentDumpClipboardStat(void) fprintf(stderr, " lastServerTarget (Atom) [% 4ld][%s]\n", lastServerTarget, validateString(s)); fprintf(stderr, " lastServerTime (Time) [%u]\n", lastServerTime); - fprintf(stderr, "lastClient\n"); - if (lastClientWindowPtr) - fprintf(stderr, " lastClientWindowPtr (WindowPtr) [%p] ([0x%x])\n", (void *)lastClientWindowPtr, WINDOWID(lastClientWindowPtr)); - else - fprintf(stderr, " lastClientWindowPtr (WindowPtr) -\n"); - fprintf(stderr, " lastClientClientPtr (ClientPtr) %s\n", nxagentClientInfoString(lastClientClientPtr)); - fprintf(stderr, " lastClientRequestor (Window) [0x%x]\n", lastClientRequestor); - fprintf(stderr, " lastClientProperty (Atom) [% 4d][%s]\n", lastClientProperty, NameForAtom(lastClientProperty)); - fprintf(stderr, " lastClientSelection (Atom) [% 4d][%s]\n", lastClientSelection, NameForAtom(lastClientSelection)); - fprintf(stderr, " lastClientTarget (Atom) [% 4d][%s]\n", lastClientTarget, NameForAtom(lastClientTarget)); - if (lastClientTime > 0) - fprintf(stderr, " lastClientTime (Time) [%u] ([%u]ms ago)\n", lastClientTime, GetTimeInMillis() - lastClientTime); - else - fprintf(stderr, " lastClientTime (Time) [%u]\n", lastClientTime); - if (lastClientReqTime > 0) - fprintf(stderr, " lastClientReqTime (Time) [%u] ([%u]ms ago)\n", lastClientReqTime, GetTimeInMillis() - lastClientReqTime); - else - fprintf(stderr, " lastClientReqTime (Time) [%u]\n", lastClientReqTime); - fprintf(stderr, " lastClientPropertySize (unsigned long) [%lu]\n", lastClientPropertySize); - fprintf(stderr, " lastClientStage (ClientSelectionStage) [%d][%s]\n", lastClientStage, getClientSelectionStageString(lastClientStage)); - fprintf(stderr, "PRIMARY\n"); printSelectionStat(nxagentPrimarySelection); + printLastClientStat(nxagentPrimarySelection); fprintf(stderr, "CLIPBOARD\n"); printSelectionStat(nxagentClipboardSelection); + printLastClientStat(nxagentClipboardSelection); fprintf(stderr, "Atoms (remote X server)\n"); SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverTARGETS); @@ -392,34 +402,49 @@ void nxagentDumpClipboardStat(void) /* * Helper to handle data transfer */ -static void setClientSelectionStage(int stage) +static void resetClientSelectionStage(int index) { - if (lastClientStage == stage) + #ifdef DEBUG + fprintf(stderr, "%s: Resetting selection stage for [%d]\n", __func__, index); + #endif + + lastClients[index].stage = SelectionStageNone; + lastClients[index].windowPtr = NULL; + lastClients[index].clientPtr = NULL; + lastClients[index].requestor = 0; + lastClients[index].property = 0; + /* NX_PRIMARY or clipboard atom */ + lastClients[index].selection = lastSelectionOwner[index].selection; + lastClients[index].target = 0; + lastClients[index].time = 0; + lastClients[index].reqTime = 0; + lastClients[index].propertySize = 0; + lastClients[index].resource = -1; +} + +static void setClientSelectionStage(int stage, int index) +{ + if (lastClients[index].stage == stage) { #ifdef DEBUG - fprintf(stderr, "%s: selection stage already set to [%s] - doing nothing\n", __func__, - getClientSelectionStageString(lastClientStage)); + fprintf(stderr, "%s: lastClient [%d] selection stage already set to [%s] - doing nothing\n", __func__, + index, getClientSelectionStageString(lastClients[index].stage)); #endif return; } #ifdef DEBUG - fprintf(stderr, "%s: Changing selection stage from [%s] to [%s]\n", __func__, - getClientSelectionStageString(lastClientStage), getClientSelectionStageString(stage)); + fprintf(stderr, "%s: Changing selection stage for [%d] from [%s] to [%s]\n", __func__, index, + getClientSelectionStageString(lastClients[index].stage), getClientSelectionStageString(stage)); #endif - lastClientStage = stage; if (stage == SelectionStageNone) { - lastClientWindowPtr = NULL; - lastClientClientPtr = NULL; - lastClientRequestor = 0; - lastClientProperty = 0; - lastClientSelection = 0; - lastClientTarget = 0; - lastClientTime = 0; - lastClientReqTime = 0; - lastClientPropertySize = 0; + resetClientSelectionStage(index); + } + else + { + lastClients[index].stage = stage; } } @@ -629,21 +654,21 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) if (matchSelectionOwner(i, pClient, pWindow)) { #ifdef TEST - fprintf(stderr, "%s: Resetting state with client [%p] window [%p].\n", __func__, - (void *) pClient, (void *) pWindow); + fprintf(stderr, "%s: Resetting state [%d] with client [%p] window [%p].\n", __func__, + i, (void *) pClient, (void *) pWindow); #endif clearSelectionOwner(i); - setClientSelectionStage(SelectionStageNone); + setClientSelectionStage(SelectionStageNone, i); lastServerRequestor = None; } - } - if (pWindow && pWindow == lastClientWindowPtr) - { - setClientSelectionStage(SelectionStageNone); + if (pWindow && pWindow == lastClients[i].windowPtr) + { + setClientSelectionStage(SelectionStageNone, i); + } } } @@ -728,9 +753,9 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) CurrentSelections[i].client = NullClient; clearSelectionOwner(i); - } - setClientSelectionStage(SelectionStageNone); + setClientSelectionStage(SelectionStageNone, i); + } } /* @@ -933,31 +958,32 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) if (i < nxagentMaxSelections) { #if 0 - if (lastClientWindowPtr != NULL && IS_INTERNAL_OWNER(i)) + if (lastClients[i].windowPtr != NULL && IS_INTERNAL_OWNER(i)) { /* * Request the real X server to transfer the selection content * to the NX_CUT_BUFFER_SERVER property of the serverWindow. - * FIXME: document how we can end up here - * - * It looks like this is only reached when the real X server is - * on Windows. I suspect that this is connected to the windows X - * server (VcXSrv in my test) pushing PRIMARY or CLIPBOARD - * content to the Windows clipboard whenever they change. + * We reach here as follows: + * - mark someting in the nx session + * -> nxagent claims ownership of PRIMARY on real X server + * - at the same time paste _clipboard_ to the client (now) owning primary + * ->vcxsrv will ask for primary contents to store them to Windows clipboard + * - vcxsrv request is for _primary_ and takes this path as the _clipboard_ transfer + * has set lastClients[i].windowPtr */ XConvertSelection(nxagentDisplay, CurrentSelections[i].selection, X->xselectionrequest.target, serverTransToAgentProperty, - serverWindow, lastClientTime); + serverWindow, lastClients[i].time); #ifdef DEBUG char *strTarget = XGetAtomName(nxagentDisplay, X->xselectionrequest.target); char *strSelection = XGetAtomName(nxagentDisplay, CurrentSelections[i].selection); char *strProperty = XGetAtomName(nxagentDisplay, serverTransToAgentProperty); fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%x] time [%u] .\n", __func__, - CurrentSelections[i].selection, strSelection, - X->xselectionrequest.target, strTarget, - serverTransToAgentProperty, strProperty, - serverWindow, lastClientTime); + CurrentSelections[i].selection, strSelection, + X->xselectionrequest.target, strTarget, + serverTransToAgentProperty, strProperty, + serverWindow, lastClients[i].time); #endif SAFE_XFree(strTarget); SAFE_XFree(strSelection); @@ -973,8 +999,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * content to the real X server. */ if (IS_INTERNAL_OWNER(i) && - (nxagentOption(Clipboard) == ClipboardServer || - nxagentOption(Clipboard) == ClipboardBoth)) + (nxagentOption(Clipboard) == ClipboardServer || + nxagentOption(Clipboard) == ClipboardBoth)) { /* * store who on the real X server requested the data and how @@ -1039,12 +1065,12 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * denied/failed" * Use SELECTION_SUCCESS and SELECTION_FAULT macros for success. */ -static void endTransfer(Bool success) +static void endTransfer(Bool success, int index) { - if (lastClientClientPtr == NULL) + if (lastClients[index].clientPtr == NULL) { #ifdef DEBUG - fprintf(stderr, "%s: lastClientClientPtr is NULL - doing nothing.\n", __func__); + fprintf(stderr, "%s: lastClients[%d].clientPtr is NULL - doing nothing.\n", __func__, index); #endif } else @@ -1052,56 +1078,64 @@ static void endTransfer(Bool success) #ifdef DEBUG if (success == SELECTION_SUCCESS) fprintf(stderr, "%s: sending notification to client %s, property [%d][%s]\n", __func__, - nxagentClientInfoString(lastClientClientPtr), lastClientProperty, NameForAtom(lastClientProperty)); + nxagentClientInfoString(lastClients[index].clientPtr), lastClients[index].property, NameForAtom(lastClients[index].property)); else fprintf(stderr, "%s: sending negative notification to client %s\n", __func__, - nxagentClientInfoString(lastClientClientPtr)); + nxagentClientInfoString(lastClients[index].clientPtr)); #endif - sendSelectionNotifyEventToClient(lastClientClientPtr, - lastClientTime, - lastClientRequestor, - lastClientSelection, - lastClientTarget, - success == SELECTION_SUCCESS ? lastClientProperty : None); + sendSelectionNotifyEventToClient(lastClients[index].clientPtr, + lastClients[index].time, + lastClients[index].requestor, + lastClients[index].selection, + lastClients[index].target, + success == SELECTION_SUCCESS ? lastClients[index].property : None); } /* * Enable further requests from clients. */ - setClientSelectionStage(SelectionStageNone); + setClientSelectionStage(SelectionStageNone, index); } -static void transferSelection(int resource) +static void transferSelection(int resource, int index) { - if (lastClientClientPtr -> index != resource) + #ifdef DEBUG + fprintf(stderr, "%s: resource [%d] lastClients[%d].clientPtr->index [%d].\n", __func__, + resource, index, lastClients[index].clientPtr -> index); + #endif + /* FIXME: can we use this instead of lastClients[index].resource? */ + if (lastClients[index].clientPtr -> index != resource) { #ifdef DEBUG fprintf (stderr, "%s: WARNING! Inconsistent resource [%d] with current client %s.\n", __func__, - resource, nxagentClientInfoString(lastClientClientPtr)); + resource, nxagentClientInfoString(lastClients[index].clientPtr)); #endif - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); return; } - switch (lastClientStage) + switch (lastClients[index].stage) { case SelectionStageQuerySize: { int result; - printClientSelectionStage(); + printClientSelectionStage(index); /* * Don't get data yet, just get size. We skip this stage in * current implementation and go straight to the data. */ - nxagentLastClipboardClient = NXGetCollectPropertyResource(nxagentDisplay); + /* get next free resource index */ + int free_resource = NXGetCollectPropertyResource(nxagentDisplay); + + lastClients[index].resource = free_resource; - if (nxagentLastClipboardClient == -1) + if (free_resource == -1) { #ifdef WARNING fprintf(stderr, "%s: WARNING! Asynchronous GetProperty queue full.\n", __func__); @@ -1111,8 +1145,9 @@ static void transferSelection(int resource) } else { + /* collect property and store with index "resource" */ result = NXCollectProperty(nxagentDisplay, - nxagentLastClipboardClient, + free_resource, serverWindow, serverTransToAgentProperty, 0, @@ -1125,15 +1160,15 @@ static void transferSelection(int resource) { #ifdef DEBUG fprintf (stderr, "%s: Aborting selection notify procedure for client %s.\n", __func__, - nxagentClientInfoString(lastClientClientPtr)); + nxagentClientInfoString(lastClients[index].clientPtr)); #endif - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); return; } - setClientSelectionStage(SelectionStageWaitSize); + setClientSelectionStage(SelectionStageWaitSize, index); NXFlushDisplay(nxagentDisplay, NXFlushLink); @@ -1143,7 +1178,7 @@ static void transferSelection(int resource) { int result; - printClientSelectionStage(); + printClientSelectionStage(index); /* * Request the selection data now. @@ -1153,9 +1188,12 @@ static void transferSelection(int resource) fprintf(stderr, "%s: Getting property content from remote server.\n", __func__); #endif - nxagentLastClipboardClient = NXGetCollectPropertyResource(nxagentDisplay); + /* get next free resouce index */ + resource = NXGetCollectPropertyResource(nxagentDisplay); + + lastClients[index].resource = resource; - if (nxagentLastClipboardClient == -1) + if (resource == -1) { #ifdef WARNING fprintf(stderr, "%s: WARNING! Asynchronous GetProperty queue full.\n", __func__); @@ -1166,11 +1204,11 @@ static void transferSelection(int resource) else { result = NXCollectProperty(nxagentDisplay, - nxagentLastClipboardClient, + resource, serverWindow, serverTransToAgentProperty, 0, - lastClientPropertySize, + lastClients[index].propertySize, False, AnyPropertyType); } @@ -1179,15 +1217,15 @@ static void transferSelection(int resource) { #ifdef DEBUG fprintf (stderr, "%s: Aborting selection notify procedure for client %s.\n", __func__, - nxagentClientInfoString(lastClientClientPtr)); + nxagentClientInfoString(lastClients[index].clientPtr)); #endif - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); return; } - setClientSelectionStage(SelectionStageWaitData); + setClientSelectionStage(SelectionStageWaitData, index); /* we've seen situations where you had to move the mouse or press a key to let the transfer complete. Flushing here fixed it */ @@ -1198,8 +1236,9 @@ static void transferSelection(int resource) default: { #ifdef DEBUG - fprintf (stderr, "%s: WARNING! Inconsistent state [%s] for client %s.\n", __func__, - getClientSelectionStageString(lastClientStage), nxagentClientInfoString(lastClientClientPtr)); + fprintf (stderr, "%s: WARNING! Inconsistent state [%s] for selection [%d] for client %s.\n", __func__, + getClientSelectionStageString(lastClients[index].stage), index, + nxagentClientInfoString(lastClients[index].clientPtr)); #endif break; @@ -1208,13 +1247,16 @@ static void transferSelection(int resource) } /* - Called from Events.c/nxagentHandlePropertyNotify - + Called from Events.c/nxagentHandleCollectPropertyEvent This event is generated after XChangeProperty(), XDeleteProperty() or XGetWindowProperty(delete=True) + + Returncode: + True: processed + False: not processed, resource is not ours */ -void nxagentCollectPropertyEvent(int resource) +Bool nxagentCollectPropertyEvent(int resource) { XlibAtom atomReturnType; int resultFormat; @@ -1222,6 +1264,28 @@ void nxagentCollectPropertyEvent(int resource) unsigned long ulReturnBytesLeft; unsigned char *pszReturnData = NULL; + int index = 0; + + /* determine the selection we are talking about here */ + for (index = 0; index < nxagentMaxSelections; index++) + { + #ifdef DEBUG + fprintf(stderr, "%s: lastClients[%d].resource [%d] resource [%d]\n", __func__, index, lastClients[index].resource, resource); + #endif + if (lastClients[index].resource == resource) + { + break; + } + } + + if (index == nxagentMaxSelections) + { + #ifdef DEBUG + fprintf (stderr, "%s: resource does not belong to any selection we handle.\n", __func__); + #endif + return False; + } + /* * We have received the notification so we can safely retrieve data * from the client structure. @@ -1235,7 +1299,7 @@ void nxagentCollectPropertyEvent(int resource) &ulReturnBytesLeft, &pszReturnData); - nxagentLastClipboardClient = -1; + lastClients[index].resource = -1; if (result == 0) { @@ -1243,25 +1307,26 @@ void nxagentCollectPropertyEvent(int resource) fprintf (stderr, "%s: Failed to get reply data.\n", __func__); #endif - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); } else if (resultFormat != 8 && resultFormat != 16 && resultFormat != 32) { #ifdef DEBUG - fprintf (stderr, "%s: WARNING! Invalid property format.\n", __func__); + fprintf(stderr, "%s: WARNING! Invalid property format.\n", __func__); #endif - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); } else { - switch (lastClientStage) + switch (lastClients[index].stage) { case SelectionStageWaitSize: { - printClientSelectionStage(); + printClientSelectionStage(index); #ifdef DEBUG - fprintf (stderr, "%s: Got size notify event for client %s.\n", __func__, nxagentClientInfoString(lastClientClientPtr)); + fprintf (stderr, "%s: Got size notify event for client %s.\n", __func__, + nxagentClientInfoString(lastClients[index].clientPtr)); #endif if (ulReturnBytesLeft == 0) @@ -1270,7 +1335,7 @@ void nxagentCollectPropertyEvent(int resource) fprintf (stderr, "%s: data size is [0] - aborting selection notify procedure.\n", __func__); #endif - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); } else { @@ -1281,18 +1346,19 @@ void nxagentCollectPropertyEvent(int resource) /* * Request the selection data now. */ - lastClientPropertySize = ulReturnBytesLeft; - setClientSelectionStage(SelectionStageQueryData); + lastClients[index].propertySize = ulReturnBytesLeft; + setClientSelectionStage(SelectionStageQueryData, index); - transferSelection(resource); + transferSelection(resource, index); } break; } case SelectionStageWaitData: { - printClientSelectionStage(); + printClientSelectionStage(index); #ifdef DEBUG - fprintf (stderr, "%s: Got data notify event for waiting client %s.\n", __func__, nxagentClientInfoString(lastClientClientPtr)); + fprintf (stderr, "%s: Got data notify event for waiting client %s.\n", __func__, + nxagentClientInfoString(lastClients[index].clientPtr)); #endif if (ulReturnBytesLeft != 0) @@ -1301,7 +1367,7 @@ void nxagentCollectPropertyEvent(int resource) fprintf (stderr, "%s: not all content could be retrieved - [%lu] bytes left - aborting selection notify procedure.\n", __func__, ulReturnBytesLeft); #endif - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); } else { @@ -1309,35 +1375,39 @@ void nxagentCollectPropertyEvent(int resource) fprintf(stderr, "%s: Got property content from remote server. size [%lu] bytes.\n", __func__, (ulReturnItems * resultFormat / 8)); #endif - ChangeWindowProperty(lastClientWindowPtr, - lastClientProperty, - lastClientTarget, + ChangeWindowProperty(lastClients[index].windowPtr, + lastClients[index].property, + lastClients[index].target, resultFormat, PropModeReplace, ulReturnItems, pszReturnData, 1); #ifdef DEBUG fprintf(stderr, "%s: Selection property [%d][%s] changed to [\"%*.*s\"...]\n", __func__, - lastClientProperty, validateString(NameForAtom(lastClientProperty)), - (int)(min(20, ulReturnItems * resultFormat / 8)), + lastClients[index].property, + validateString(NameForAtom(lastClients[index].property)), (int)(min(20, ulReturnItems * resultFormat / 8)), - pszReturnData); + (int)(min(20, ulReturnItems * resultFormat / 8)), + pszReturnData); #endif - endTransfer(SELECTION_SUCCESS); + endTransfer(SELECTION_SUCCESS, index); } break; } default: { #ifdef DEBUG - fprintf (stderr, "%s: WARNING! Inconsistent state [%s] for client %s.\n", __func__, - getClientSelectionStageString(lastClientStage), nxagentClientInfoString(lastClientClientPtr)); + fprintf(stderr, "%s: WARNING! Inconsistent state [%s] for client %s.\n", __func__, + getClientSelectionStageString(lastClients[index].stage), + nxagentClientInfoString(lastClients[index].clientPtr)); #endif break; } } } SAFE_XFree(pszReturnData); + + return True; } /* @@ -1362,19 +1432,42 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) char * t = XGetAtomName(nxagentDisplay, e->target); char * s = XGetAtomName(nxagentDisplay, e->selection); fprintf(stderr, "%s: SelectionNotify event from real X server, property " \ - "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", - __func__, e->property, validateString(p), e->requestor, - validateString(s), e->target, - validateString(t), e->time, e->send_event); + "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", + __func__, e->property, validateString(p), e->requestor, + validateString(s), e->target, + validateString(t), e->time, e->send_event); SAFE_XFree(p); SAFE_XFree(t); SAFE_XFree(s); } #endif - printClientSelectionStage(); + /* determine the selection we are talking about here */ + int index = 0; + for (index = 0; index < nxagentMaxSelections; index++) + { + #ifdef DEBUG + fprintf (stderr, "%s: lastClients[%d].selection [%d] selection [%d] .\n", + __func__, index, lastClients[index].selection, + nxagentRemoteToLocalAtom(e->selection)); + #endif + if (lastClients[index].selection == nxagentRemoteToLocalAtom(e->selection)) + { + break; + } + } + + if (index == nxagentMaxSelections) + { + #ifdef DEBUG + fprintf (stderr, "%s: unknown selection [%ld] .\n", __func__, e->selection); + #endif + return; + } - if (lastClientWindowPtr != NULL) + printClientSelectionStage(index); + + if (lastClients[index].windowPtr != NULL) { /* * We reach here after a paste inside the nxagent, triggered by @@ -1382,19 +1475,19 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) * means that data we need has been transferred to the * serverTransToAgentProperty of the serverWindow (our window on * the real X server). We now need to transfer it to the original - * requestor, which is stored in the lastClient* variables. + * requestor, which is stored in the lastClients[index].* variables. */ #ifdef DEBUG nxagentDumpClipboardStat(); #endif - if (lastClientStage == SelectionStageNone) + if (lastClients[index].stage == SelectionStageNone) { if (X->xselection.property == serverTransToAgentProperty) { #ifdef DEBUG fprintf(stderr, "%s: Starting selection transferral for client %s.\n", __func__, - nxagentClientInfoString(lastClientClientPtr)); + nxagentClientInfoString(lastClients[index].clientPtr)); #endif /* @@ -1408,18 +1501,18 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) * tions. */ - setClientSelectionStage(SelectionStageQueryData); - lastClientPropertySize = 262144; + setClientSelectionStage(SelectionStageQueryData, index); + lastClients[index].propertySize = 262144; - transferSelection(lastClientClientPtr -> index); + transferSelection(lastClients[index].clientPtr -> index, index); } else if (X->xselection.property == 0) { #ifdef DEBUG fprintf(stderr, "%s: WARNING! Resetting selection transferral for client [%d] because of failure notification from real X server.\n", __func__, - CLINDEX(lastClientClientPtr)); + CLINDEX(lastClients[index].clientPtr)); #endif - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); } else { @@ -1429,17 +1522,17 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) __func__, X->xselection.property, s); SAFE_XFree(s); #endif - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); } } else { #ifdef DEBUG fprintf(stderr, "%s: WARNING! Resetting selection transferral for client [%d] because of unexpected stage.\n", __func__, - CLINDEX(lastClientClientPtr)); + CLINDEX(lastClients[index].clientPtr)); #endif - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); } } else @@ -1596,9 +1689,9 @@ static void resetSelectionOwner(void) #endif clearSelectionOwner(i); - } - setClientSelectionStage(SelectionStageNone); + setClientSelectionStage(SelectionStageNone, i); + } /* Hmm, this is already None when reaching this */ lastServerRequestor = None; @@ -1743,9 +1836,9 @@ static void setSelectionOwner(Selection *pSelection) * owner window. */ storeSelectionOwner(i, pSelection); - } - setClientSelectionStage(SelectionStageNone); + setClientSelectionStage(SelectionStageNone, i); + } lastServerRequestor = None; @@ -1795,34 +1888,40 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, return 0; } + int index = nxagentFindCurrentSelectionIndex(selection); + if (index == NumCurrentSelections) { - int i = nxagentFindCurrentSelectionIndex(selection); - if (i < NumCurrentSelections && IS_INTERNAL_OWNER(i)) - { - /* - * There is a client owner on the agent side, let normal dix stuff happen. - */ - return 0; - } + #ifdef DEBUG + fprintf(stderr, "%s: cannot find index for selection [%u]\n", __func__, selection); + #endif + return 0; + } + + if (IS_INTERNAL_OWNER(index)) + { + /* + * There is a client owner on the agent side, let normal dix stuff happen. + */ + return 0; } /* - * if lastClientWindowPtr is set we are waiting for an answer from + * if lastClients[index].windowPtr is set we are waiting for an answer from * the real X server. If that answer takes more than 5 seconds we * consider the conversion failed and tell our client about that. * The new request that lead us here is then processed. */ - if (lastClientWindowPtr != NULL) + if (lastClients[index].windowPtr != NULL) { #ifdef TEST - fprintf(stderr, "%s: lastClientWindowPtr != NULL.\n", __func__); + fprintf(stderr, "%s: lastClients[%d].windowPtr != NULL.\n", __func__, index); #endif #ifdef DEBUG - fprintf(stderr, "%s: lastClientSelection [%d] - selection [%d]\n", __func__, lastClientSelection, selection); + fprintf(stderr, "%s: lastClients[%d].selection [%d] - selection [%d]\n", __func__, index, lastClients[index].selection, selection); #endif - if ((GetTimeInMillis() - lastClientReqTime) >= CONVERSION_TIMEOUT) + if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) { #ifdef DEBUG fprintf(stderr, "%s: timeout expired on last request, " @@ -1830,7 +1929,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #endif /* notify the waiting client of failure */ - endTransfer(SELECTION_FAULT); + endTransfer(SELECTION_FAULT, index); + return 1; } else { @@ -1883,8 +1983,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #ifdef DEBUG fprintf(stderr, "%s: available targets [%d]:\n", __func__, numTargets); - for (int i = 0; i < numTargets; i++) - fprintf(stderr, "%s: %s\n", __func__, NameForAtom(targets[i])); + for (int j = 0; j < numTargets; j++) + fprintf(stderr, "%s: %s\n", __func__, NameForAtom(targets[j])); fprintf(stderr, "\n"); #endif @@ -1914,52 +2014,43 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, */ if (target == clientTIMESTAMP) { - int i = nxagentFindCurrentSelectionIndex(selection); - if (i < NumCurrentSelections) - { - /* - * "If the specified property is not None, the owner should place - * the data resulting from converting the selection into the - * specified property on the requestor window and should set the - * property's type to some appropriate value, which need not be - * the same as the specified target." - */ - ChangeWindowProperty(pWin, - property, - XA_INTEGER, - 32, - PropModeReplace, - 1, - (unsigned char *) &lastSelectionOwner[i].lastTimeChanged, - 1); - - sendSelectionNotifyEventToClient(client, time, requestor, selection, target, property); - - return 1; - } + /* + * "If the specified property is not None, the owner should place + * the data resulting from converting the selection into the + * specified property on the requestor window and should set the + * property's type to some appropriate value, which need not be + * the same as the specified target." + */ + ChangeWindowProperty(pWin, + property, + XA_INTEGER, + 32, + PropModeReplace, + 1, + (unsigned char *) &lastSelectionOwner[index].lastTimeChanged, + 1); + sendSelectionNotifyEventToClient(client, time, requestor, selection, target, property); + return 1; } - if (lastClientClientPtr == client && (GetTimeInMillis() - lastClientReqTime < ACCUM_TIME)) + if (lastClients[index].clientPtr == client && (GetTimeInMillis() - lastClients[index].reqTime < ACCUM_TIME)) { /* * The same client made consecutive requests of clipboard content * with less than 5 seconds time interval between them. - * FIXME: this does not take the selection into account, so a - * client requesting PRIMARY and CLIPBOARD would match here, too */ - - #ifdef DEBUG - fprintf(stderr, "%s: Consecutives request from client %s selection [%u] " + #ifdef DEBUG + fprintf(stderr, "%s: Consecutives request from client %s selection [%u] " "elapsed time [%u] clientAccum [%d]\n", __func__, nxagentClientInfoString(client), - selection, GetTimeInMillis() - lastClientReqTime, clientAccum); - #endif + selection, GetTimeInMillis() - lastClients[index].reqTime, clientAccum); + #endif - clientAccum++; + clientAccum++; } else { /* reset clientAccum as now another client requested the clipboard content */ - if (lastClientClientPtr != client) + if (lastClients[index].clientPtr != client) { clientAccum = 0; } @@ -1970,23 +2061,22 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, target == clientCOMPOUND_TEXT || target == clientUTF8_STRING) { - setClientSelectionStage(SelectionStageNone); + setClientSelectionStage(SelectionStageNone, index); /* * store the original requestor, we need that later after * serverTransToAgentProperty contains the desired selection content */ - lastClientRequestor = requestor; - lastClientWindowPtr = pWin; - lastClientClientPtr = client; - lastClientTime = time; - lastClientProperty = property; - lastClientSelection = selection; - lastClientTarget = target; - + lastClients[index].requestor = requestor; + lastClients[index].windowPtr = pWin; + lastClients[index].clientPtr = client; + lastClients[index].time = time; + lastClients[index].property = property; + lastClients[index].selection = selection; + lastClients[index].target = target; /* if the last client request time is more than 5s ago update it. Why? */ - if ((GetTimeInMillis() - lastClientReqTime) >= CONVERSION_TIMEOUT) - lastClientReqTime = GetTimeInMillis(); + if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) + lastClients[index].reqTime = GetTimeInMillis(); if (selection == clientCLIPBOARD) { @@ -2044,6 +2134,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, return 1; } + return 0; } @@ -2236,6 +2327,14 @@ Bool nxagentInitClipboard(WindowPtr pWin) } initSelectionOwner(nxagentPrimarySelection, XA_PRIMARY); initSelectionOwner(nxagentClipboardSelection, nxagentAtoms[10]); /* CLIPBOARD */ + + SAFE_free(lastClients); + + lastClients = (lastClient *) malloc(nxagentMaxSelections * sizeof(lastClient)); + if (lastClients == NULL) + { + FatalError("nxagentInitClipboard: Failed to allocate memory for the last client array.\n"); + } } else { @@ -2342,20 +2441,20 @@ Bool nxagentInitClipboard(WindowPtr pWin) } } } - /* FIXME: Shouldn't we reset lastServer* and lastClient* here? */ + /* FIXME: Shouldn't we reset lastServer* and lastClients[index].* here? */ } else { for (int i = 0; i < nxagentMaxSelections; i++) { clearSelectionOwner(i); + resetClientSelectionStage(i); + /* FIXME: required? move to setSelctionStage? */ + lastClients[i].reqTime = GetTimeInMillis(); } lastServerRequestor = None; - setClientSelectionStage(SelectionStageNone); - lastClientReqTime = GetTimeInMillis(); - clientTARGETS = MakeAtom(szAgentTARGETS, strlen(szAgentTARGETS), True); clientTEXT = MakeAtom(szAgentTEXT, strlen(szAgentTEXT), True); clientCOMPOUND_TEXT = MakeAtom(szAgentCOMPOUND_TEXT, strlen(szAgentCOMPOUND_TEXT), True); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h index d401dae51..18d0094d2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h @@ -72,7 +72,7 @@ extern int nxagentFindCurrentSelectionIndex(Atom sel); * Handle the selection property received in the event loop in * Events.c. */ -extern void nxagentCollectPropertyEvent(int resource); +extern Bool nxagentCollectPropertyEvent(int resource); extern WindowPtr nxagentGetClipboardWindow(Atom property); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 2a3654731..0918073a9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -131,8 +131,6 @@ extern Bool nxagentOnce; -extern int nxagentLastClipboardClient; - #ifdef NX_DEBUG_INPUT int nxagentDebugInput = 0; #endif @@ -3984,11 +3982,7 @@ void nxagentHandleCollectPropertyEvent(XEvent *X) return; } - if (resource == nxagentLastClipboardClient) - { - nxagentCollectPropertyEvent(resource); - } - else + if (!nxagentCollectPropertyEvent(resource)) { XlibAtom atomReturnType; int resultFormat; -- 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 3.6.x in repository nx-libs. commit 0ad6b8bd6013bb3040343188e0258488b6434710 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Oct 3 00:48:45 2020 +0200 Clipboard.c: use index everywhere --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 175 ++++++++++++------------- 1 file changed, 87 insertions(+), 88 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index a07e5a5e8..01cdcad21 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -269,14 +269,13 @@ XlibAtom translateLocalToRemoteTarget(Atom local); extern unsigned long startTime; #endif -// FIXME: change sel to index -static void printSelectionStat(int sel) +static void printSelectionStat(int index) { - SelectionOwner lOwner = lastSelectionOwner[sel]; - Selection curSel = CurrentSelections[sel]; + SelectionOwner lOwner = lastSelectionOwner[index]; + Selection curSel = CurrentSelections[index]; char *s = NULL; - fprintf(stderr, " owner is inside nxagent? %s\n", IS_INTERNAL_OWNER(sel) ? "yes" : "no"); + fprintf(stderr, " owner is inside nxagent? %s\n", IS_INTERNAL_OWNER(index) ? "yes" : "no"); fprintf(stderr, " lastSelectionOwner[].client %s\n", nxagentClientInfoString(lOwner.client)); fprintf(stderr, " lastSelectionOwner[].window [0x%x]\n", lOwner.window); if (lOwner.windowPtr) @@ -653,25 +652,25 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) * Only for PRIMARY and CLIPBOARD selections. */ - for (int i = 0; i < nxagentMaxSelections; i++) + for (int index = 0; index < nxagentMaxSelections; index++) { - if (matchSelectionOwner(i, pClient, pWindow)) + if (matchSelectionOwner(index, pClient, pWindow)) { #ifdef TEST fprintf(stderr, "%s: Resetting state [%d] with client [%p] window [%p].\n", __func__, - i, (void *) pClient, (void *) pWindow); + index, (void *) pClient, (void *) pWindow); #endif - clearSelectionOwnerData(i); + clearSelectionOwnerData(index); - setClientSelectionStage(SelectionStageNone, i); + setClientSelectionStage(SelectionStageNone, index); lastServerRequestor = None; } - if (pWindow && pWindow == lastClients[i].windowPtr) + if (pWindow && pWindow == lastClients[index].windowPtr) { - setClientSelectionStage(SelectionStageNone, i); + setClientSelectionStage(SelectionStageNone, index); } } } @@ -682,13 +681,13 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) */ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) { - int i = 0; - while (i < nxagentMaxSelections && - lastSelectionOwner[i].remSelection != sel) + int index = 0; + while (index < nxagentMaxSelections && + lastSelectionOwner[index].remSelection != sel) { - i++; + index++; } - return i; + return index; } /* @@ -697,13 +696,13 @@ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) */ int nxagentFindCurrentSelectionIndex(Atom sel) { - int i = 0; - while (i < NumCurrentSelections && - CurrentSelections[i].selection != sel) + int index = 0; + while (index < NumCurrentSelections && + CurrentSelections[index].selection != sel) { - i++; + index++; } - return i; + return index; } /* @@ -733,19 +732,19 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) return; } - int i = nxagentFindLastSelectionOwnerIndex(X->xselectionclear.selection); - if (i < nxagentMaxSelections) + int index = nxagentFindLastSelectionOwnerIndex(X->xselectionclear.selection); + if (index < nxagentMaxSelections) { - if (IS_INTERNAL_OWNER(i)) + if (IS_INTERNAL_OWNER(index)) { /* send a SelectionClear event to (our) previous owner */ xEvent x = {0}; x.u.u.type = SelectionClear; x.u.selectionClear.time = GetTimeInMillis(); - x.u.selectionClear.window = lastSelectionOwner[i].window; - x.u.selectionClear.atom = CurrentSelections[i].selection; + x.u.selectionClear.window = lastSelectionOwner[index].window; + x.u.selectionClear.atom = CurrentSelections[index].selection; - sendEventToClient(lastSelectionOwner[i].client, &x); + sendEventToClient(lastSelectionOwner[index].client, &x); } /* @@ -753,12 +752,12 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) * clients asking for the owner via XGetSelectionOwner() will get * these for an answer */ - CurrentSelections[i].window = screenInfo.screens[0]->root->drawable.id; - CurrentSelections[i].client = NullClient; + CurrentSelections[index].window = screenInfo.screens[0]->root->drawable.id; + CurrentSelections[index].client = NullClient; - clearSelectionOwnerData(i); + clearSelectionOwnerData(index); - setClientSelectionStage(SelectionStageNone, i); + setClientSelectionStage(SelectionStageNone, index); } } @@ -839,8 +838,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) /* the selection in this request is none we own. */ { - int i = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); - if (i == nxagentMaxSelections) + int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); + if (index == nxagentMaxSelections) { #ifdef DEBUG fprintf(stderr, "%s: not owning selection [%ld] - denying request.\n", __func__, X->xselectionrequest.selection); @@ -919,8 +918,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * FIXME: selection has already been checked above, so we do not need to check again here */ - int i = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); - if (i < nxagentMaxSelections) + int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); + if (index < nxagentMaxSelections) { XChangeProperty(nxagentDisplay, X->xselectionrequest.requestor, @@ -928,7 +927,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) XA_INTEGER, 32, PropModeReplace, - (unsigned char *) &lastSelectionOwner[i].lastTimeChanged, + (unsigned char *) &lastSelectionOwner[index].lastTimeChanged, 1); replyRequestSelectionToXServer(X, True); } @@ -958,11 +957,11 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) serverLastRequestedSelection = X->xselectionrequest.selection; /* find the index of the requested selection */ - int i = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); - if (i < nxagentMaxSelections) + int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); + if (index < nxagentMaxSelections) { #if 0 - if (lastClients[i].windowPtr != NULL && IS_INTERNAL_OWNER(i)) + if (lastClients[index].windowPtr != NULL && IS_INTERNAL_OWNER(index)) { /* * Request the real X server to transfer the selection content @@ -973,21 +972,21 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * - at the same time paste _clipboard_ to the client (now) owning primary * ->vcxsrv will ask for primary contents to store them to Windows clipboard * - vcxsrv request is for _primary_ and takes this path as the _clipboard_ transfer - * has set lastClients[i].windowPtr + * has set lastClients[index].windowPtr */ - XConvertSelection(nxagentDisplay, CurrentSelections[i].selection, + XConvertSelection(nxagentDisplay, CurrentSelections[index].selection, X->xselectionrequest.target, serverTransToAgentProperty, - serverWindow, lastClients[i].time); + serverWindow, lastClients[index].time); #ifdef DEBUG char *strTarget = XGetAtomName(nxagentDisplay, X->xselectionrequest.target); - char *strSelection = XGetAtomName(nxagentDisplay, CurrentSelections[i].selection); + char *strSelection = XGetAtomName(nxagentDisplay, CurrentSelections[index].selection); char *strProperty = XGetAtomName(nxagentDisplay, serverTransToAgentProperty); fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%x] time [%u] .\n", __func__, - CurrentSelections[i].selection, strSelection, + CurrentSelections[index].selection, strSelection, X->xselectionrequest.target, strTarget, serverTransToAgentProperty, strProperty, - serverWindow, lastClients[i].time); + serverWindow, lastClients[index].time); #endif SAFE_XFree(strTarget); SAFE_XFree(strSelection); @@ -1002,7 +1001,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * window in the first step. We then later push that property's * content to the real X server. */ - if (IS_INTERNAL_OWNER(i) && + if (IS_INTERNAL_OWNER(index) && (nxagentOption(Clipboard) == ClipboardServer || nxagentOption(Clipboard) == ClipboardBoth)) { @@ -1023,8 +1022,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) xEvent x = {0}; x.u.u.type = SelectionRequest; x.u.selectionRequest.time = GetTimeInMillis(); - x.u.selectionRequest.owner = lastSelectionOwner[i].window; - x.u.selectionRequest.selection = CurrentSelections[i].selection; + x.u.selectionRequest.owner = lastSelectionOwner[index].window; + x.u.selectionRequest.selection = CurrentSelections[index].selection; x.u.selectionRequest.property = clientCutProperty; x.u.selectionRequest.requestor = screenInfo.screens[0]->root->drawable.id; /* Fictitious window.*/ @@ -1042,12 +1041,12 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) else x.u.selectionRequest.target = XA_STRING; - sendEventToClient(lastSelectionOwner[i].client, &x); + sendEventToClient(lastSelectionOwner[index].client, &x); #ifdef DEBUG fprintf(stderr, "%s: sent SelectionRequest event to client %s property [%d][%s]" \ "target [%d][%s] requestor [0x%x].\n", __func__, - nxagentClientInfoString(lastSelectionOwner[i].client), + nxagentClientInfoString(lastSelectionOwner[index].client), x.u.selectionRequest.property, NameForAtom(x.u.selectionRequest.property), x.u.selectionRequest.target, NameForAtom(x.u.selectionRequest.target), x.u.selectionRequest.requestor); @@ -1541,15 +1540,15 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) } else { - int i = nxagentFindLastSelectionOwnerIndex(X->xselection.selection); - if (i < nxagentMaxSelections) + int index = nxagentFindLastSelectionOwnerIndex(X->xselection.selection); + if (index < nxagentMaxSelections) { /* if the last owner was an internal one, read the * clientCutProperty and push the contents to the * lastServerRequestor on the real X server. */ - if (IS_INTERNAL_OWNER(i) && - lastSelectionOwner[i].windowPtr != NULL && + if (IS_INTERNAL_OWNER(index) && + lastSelectionOwner[index].windowPtr != NULL && X->xselection.property == serverTransFromAgentProperty) { Atom atomReturnType; @@ -1559,13 +1558,13 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) unsigned char *pszReturnData = NULL; /* first get size values ... */ - int result = GetWindowProperty(lastSelectionOwner[i].windowPtr, clientCutProperty, 0, 0, False, + int result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, 0, False, AnyPropertyType, &atomReturnType, &resultFormat, &ulReturnItems, &ulReturnBytesLeft, &pszReturnData); #ifdef DEBUG fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d] returned [%s]\n", __func__, - lastSelectionOwner[i].window, clientCutProperty, getXErrorString(result)); + lastSelectionOwner[index].window, clientCutProperty, getXErrorString(result)); #endif if (result == BadAlloc || result == BadAtom || result == BadWindow || result == BadValue) @@ -1575,13 +1574,13 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) else { /* ... then use the size values for the actual request */ - result = GetWindowProperty(lastSelectionOwner[i].windowPtr, clientCutProperty, 0, + result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, ulReturnBytesLeft, False, AnyPropertyType, &atomReturnType, &resultFormat, &ulReturnItems, &ulReturnBytesLeft, &pszReturnData); #ifdef DEBUG fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d] returned [%s]\n", __func__, - lastSelectionOwner[i].window, clientCutProperty, getXErrorString(result)); + lastSelectionOwner[index].window, clientCutProperty, getXErrorString(result)); #endif if (result == BadAlloc || result == BadAtom || @@ -1684,17 +1683,17 @@ static void resetSelectionOwnerOnXServer(void) * Only for PRIMARY and CLIPBOARD selections. */ - for (int i = 0; i < nxagentMaxSelections; i++) + for (int index = 0; index < nxagentMaxSelections; index++) { - XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].remSelection, serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[index].remSelection, serverWindow, CurrentTime); #ifdef DEBUG - fprintf(stderr, "%s: Reset selection state for selection [%d].\n", __func__, i); + fprintf(stderr, "%s: Reset selection state for selection [%d].\n", __func__, index); #endif - clearSelectionOwnerData(i); + clearSelectionOwnerData(index); - setClientSelectionStage(SelectionStageNone, i); + setClientSelectionStage(SelectionStageNone, index); } /* Hmm, this is already None when reaching this */ @@ -1811,27 +1810,27 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) } #endif - int i = nxagentFindCurrentSelectionIndex(pSelection->selection); - if (i < NumCurrentSelections) + int index = nxagentFindCurrentSelectionIndex(pSelection->selection); + if (index < NumCurrentSelections) { #ifdef DEBUG fprintf(stderr, "%s: lastSelectionOwner.client %s -> %s\n", __func__, - nxagentClientInfoString(lastSelectionOwner[i].client), + nxagentClientInfoString(lastSelectionOwner[index].client), nxagentClientInfoString(pSelection->client)); fprintf(stderr, "%s: lastSelectionOwner.window [0x%x] -> [0x%x]\n", __func__, - lastSelectionOwner[i].window, pSelection->window); + lastSelectionOwner[index].window, pSelection->window); fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%x])\n", __func__, - (void *)lastSelectionOwner[i].windowPtr, (void *)pSelection->pWin, + (void *)lastSelectionOwner[index].windowPtr, (void *)pSelection->pWin, nxagentWindow(pSelection->pWin), serverWindow); fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%u]\n", __func__, - lastSelectionOwner[i].lastTimeChanged); + lastSelectionOwner[index].lastTimeChanged); #endif /* * inform the real X server that our serverWindow is the * clipboard owner. */ - XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].remSelection, serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[index].remSelection, serverWindow, CurrentTime); /* * The real owner window (inside nxagent) is stored in @@ -1839,9 +1838,9 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) * points to the struct that contains all information about the * owner window. */ - storeSelectionOwnerData(i, pSelection); + storeSelectionOwnerData(index, pSelection); - setClientSelectionStage(SelectionStageNone, i); + setClientSelectionStage(SelectionStageNone, index); } lastServerRequestor = None; @@ -2292,18 +2291,18 @@ int nxagentSendNotify(xEvent *event) */ WindowPtr nxagentGetClipboardWindow(Atom property) { - int i = nxagentFindLastSelectionOwnerIndex(serverLastRequestedSelection); - if (i < nxagentMaxSelections && + int index = nxagentFindLastSelectionOwnerIndex(serverLastRequestedSelection); + if (index < nxagentMaxSelections && property == clientCutProperty && - lastSelectionOwner[i].windowPtr != NULL) + lastSelectionOwner[index].windowPtr != NULL) { #ifdef DEBUG fprintf(stderr, "%s: Returning last [%d] selection owner window [%p] (0x%x).\n", __func__, - lastSelectionOwner[i].intSelection, - (void *)lastSelectionOwner[i].windowPtr, WINDOWID(lastSelectionOwner[i].windowPtr)); + lastSelectionOwner[index].intSelection, + (void *)lastSelectionOwner[index].windowPtr, WINDOWID(lastSelectionOwner[index].windowPtr)); #endif - return lastSelectionOwner[i].windowPtr; + return lastSelectionOwner[index].windowPtr; } else { @@ -2411,10 +2410,10 @@ Bool nxagentInitClipboard(WindowPtr pWin) fprintf(stderr, "%s: Registering for XFixesSelectionNotify events.\n", __func__); #endif - for (int i = 0; i < nxagentMaxSelections; i++) + for (int index = 0; index < nxagentMaxSelections; index++) { XFixesSelectSelectionInput(nxagentDisplay, serverWindow, - lastSelectionOwner[i].remSelection, + lastSelectionOwner[index].remSelection, XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask); @@ -2453,16 +2452,16 @@ Bool nxagentInitClipboard(WindowPtr pWin) if (nxagentOption(Clipboard) == ClipboardServer || nxagentOption(Clipboard) == ClipboardBoth) { - for (int i = 0; i < nxagentMaxSelections; i++) + for (int index = 0; index < nxagentMaxSelections; index++) { /* * if we have a selection inform the (new) real Xserver and * claim the ownership. Note that we report our serverWindow as * owner, not the real window! */ - if (IS_INTERNAL_OWNER(i) && lastSelectionOwner[i].window) + if (IS_INTERNAL_OWNER(index) && lastSelectionOwner[index].window) { - XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].remSelection, serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[index].remSelection, serverWindow, CurrentTime); } } } @@ -2470,12 +2469,12 @@ Bool nxagentInitClipboard(WindowPtr pWin) } else { - for (int i = 0; i < nxagentMaxSelections; i++) + for (int index = 0; index < nxagentMaxSelections; index++) { - clearSelectionOwnerData(i); - resetClientSelectionStage(i); + clearSelectionOwnerData(index); + resetClientSelectionStage(index); /* FIXME: required? move to setSelctionStage? */ - lastClients[i].reqTime = GetTimeInMillis(); + lastClients[index].reqTime = GetTimeInMillis(); } lastServerRequestor = None; -- 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 3.6.x in repository nx-libs. commit 4701db7bcf0c66f153c172aa9a31197ab4a48bbd Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Sep 22 23:19:55 2020 +0200 Clipboard.c: improve debug/test messages --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 5a85b0f87..60792bb44 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1032,12 +1032,13 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) sendEventToClient(lastSelectionOwner[index].client, &x); #ifdef DEBUG - fprintf(stderr, "%s: sent SelectionRequest event to client %s property [%d][%s]" \ - "target [%d][%s] requestor [0x%x].\n", __func__, + fprintf(stderr, "%s: sent SelectionRequest event to client %s property [%d][%s] " \ + "target [%d][%s] requestor [0x%x] selection [%d][%s].\n", __func__, nxagentClientInfoString(lastSelectionOwner[index].client), x.u.selectionRequest.property, NameForAtom(x.u.selectionRequest.property), x.u.selectionRequest.target, NameForAtom(x.u.selectionRequest.target), - x.u.selectionRequest.requestor); + x.u.selectionRequest.requestor, + x.u.selectionRequest.selection, NameForAtom(x.u.selectionRequest.selection)); #endif } else @@ -2377,7 +2378,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) } #ifdef TEST - fprintf(stderr, "%s: Setting owner of selection [%d][%s] on window 0x%x\n", __func__, + fprintf(stderr, "%s: Setting owner of selection [%d][%s] to serverwindow [0x%x]\n", __func__, (int) serverTransToAgentProperty, "NX_CUT_BUFFER_SERVER", serverWindow); #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 3.6.x in repository nx-libs. commit edfea3cd18853ff82d866168186dd5687dba56f9 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Sep 22 22:00:20 2020 +0200 Clipboard.c: introduce translateLocalToRemote* helpers This also unifies target handling to never use TEXT or COMPOUND_TEXT (despite announcing it) --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 198 +++++++++++-------------- 1 file changed, 90 insertions(+), 108 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index f35ab583a..a07e5a5e8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -262,6 +262,9 @@ static void replyRequestSelectionToXServer(XEvent *X, Bool success); void nxagentPrintClipboardStat(char *); +XlibAtom translateLocalToRemoteSelection(Atom local); +XlibAtom translateLocalToRemoteTarget(Atom local); + #ifdef NXAGENT_TIMESTAMP extern unsigned long startTime; #endif @@ -2079,64 +2082,24 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) lastClients[index].reqTime = GetTimeInMillis(); - XlibAtom remSelection = 0; - - /* FIXME: we should use/have a function for stuff like that */ - if (selection == XA_PRIMARY) - { - remSelection = XA_PRIMARY; - } - else if (selection == clientCLIPBOARD) - { - remSelection = lastSelectionOwner[nxagentClipboardSelection].remSelection; - } - else - { - remSelection = nxagentLocalToRemoteAtom(selection); - } - - /* - * we only convert to either UTF8 or XA_STRING, despite accepting - * TEXT and COMPOUND_TEXT. - */ + XlibAtom remSelection = translateLocalToRemoteSelection(selection); + XlibAtom remTarget = translateLocalToRemoteTarget(target); XlibAtom remProperty = serverTransToAgentProperty; - XlibAtom remTarget; - #ifdef DEBUG - char * pstr = "NX_CUT_BUFFER_SERVER"; - const char * tstr; - #endif - if (target == clientUTF8_STRING) - { - remTarget = serverUTF8_STRING; - #ifdef DEBUG - tstr = szAgentUTF8_STRING; - #endif - } - else - { - remTarget = XA_STRING; - #ifdef DEBUG - tstr = validateString(NameForAtom(XA_STRING)); - #endif - } #ifdef DEBUG - /* FIXME: check Atoms.c for alternative to XGetAtomName */ - fprintf(stderr, "%s: mapping local to remote Atom: [%d][%s] -> [%ld][%s]\n", - __func__, selection, NameForAtom(selection), remSelection, - XGetAtomName(nxagentDisplay, remSelection)); - fprintf(stderr, "%s: mapping local to remote Atom: [%d][%s] -> [%ld][%s]\n", - __func__, target, NameForAtom(target), remTarget, tstr); - fprintf(stderr, "%s: mapping local to remote Atom: [%d][%s] -> [%ld][%s]\n", - __func__, property, NameForAtom(property), remProperty, pstr); + fprintf(stderr, "%s: replacing local by remote property: [%d][%s] -> [%ld][%s]\n", + __func__, property, NameForAtom(property), + remProperty, "NX_CUT_BUFFER_SERVER"); #endif /* FIXME: check why using CurrentTime will not replace the value * by a real time. The reply also contains time "0" which is * unexpected (for me) */ #ifdef DEBUG - fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] selection [%ld] time [0][CurrentTime]\n", __func__, - serverWindow, remTarget, tstr, remProperty, pstr, remSelection); + fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, + serverWindow, remTarget, XGetAtomName(nxagentDisplay, remTarget), + remProperty, XGetAtomName(nxagentDisplay, remProperty), + remSelection, XGetAtomName(nxagentDisplay, remSelection)); #endif XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime); @@ -2144,7 +2107,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, /* XConvertSelection will always return (check the source!), so no need to check */ #ifdef DEBUG - fprintf(stderr, "%s: Sent XConvertSelection with target [%s], property [%s]\n", __func__, tstr, pstr); + fprintf(stderr, "%s: Sent XConvertSelection\n", __func__); #endif return 1; @@ -2164,6 +2127,81 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, return 0; } +XlibAtom translateLocalToRemoteSelection(Atom local) +{ + /* + * On the real server, the right CLIPBOARD atom is + * XInternAtom(nxagentDisplay, "CLIPBOARD", 1), which is stored in + * lastSelectionOwner[nxagentClipboardSelection].remSelection. For + * PRIMARY there's nothing to map because that is identical on all + * X servers (defined in Xatom.h). + */ + + XlibAtom remote; + + if (local == XA_PRIMARY) + { + remote = XA_PRIMARY; + } + else if (local == clientCLIPBOARD) + { + remote = lastSelectionOwner[nxagentClipboardSelection].remSelection; + } + else + { + remote = nxagentLocalToRemoteAtom(local); + } + + #ifdef DEBUG + fprintf(stderr, "%s: mapping local to remote selection: [%d][%s] -> [%ld] [%s]\n", __func__, + local, NameForAtom(local), remote, XGetAtomName(nxagentDisplay, remote)); + #endif + + return remote; +} + +XlibAtom translateLocalToRemoteTarget(Atom local) +{ + /* + * .target must be translated, too, as a client on the real + * server is requested to fill our property and it needs to know + * the format. + */ + + XlibAtom remote; + + /* + * we only convert to either UTF8 or XA_STRING, despite accepting + * TEXT and COMPOUND_TEXT. + */ + + if (local == clientUTF8_STRING) + { + remote = serverUTF8_STRING; + } +#if 0 + else if (local == clientTEXT) + { + remote = serverTEXT; + } + else if (local == clientCOMPOUND_TEXT) + { + remote = serverCOMPOUND_TEXT; + } +#endif + else + { + remote = XA_STRING; + } + + #ifdef DEBUG + fprintf(stderr, "%s: mapping local to remote target: [%d][%s] -> [%ld] [%s]\n", __func__, + local, NameForAtom(local), remote, XGetAtomName(nxagentDisplay, remote)); + #endif + + return remote; +} + /* * This is _only_ called from ProcSendEvent in NXevents.c. It is used * to send a SelectionNotify event to our server window which will @@ -2235,68 +2273,12 @@ int nxagentSendNotify(xEvent *event) XSelectionEvent eventSelection = { .requestor = serverWindow, - .selection = event->u.selectionNotify.selection, - .target = event->u.selectionNotify.target, + .selection = translateLocalToRemoteSelection(event->u.selectionNotify.selection), + .target = translateLocalToRemoteTarget(event->u.selectionNotify.target), .property = serverTransFromAgentProperty, .time = CurrentTime, }; - /* - * On the real server, the right CLIPBOARD atom is - * XInternAtom(nxagentDisplay, "CLIPBOARD", 1), which is stored in - * lastSelectionOwner[nxagentClipboardSelection].selection. For - * PRIMARY there's nothing to map because that is identical on all - * X servers (defined in Xatom.h). - */ - - if (event->u.selectionNotify.selection == XA_PRIMARY) - { - eventSelection.selection = XA_PRIMARY; - } - else if (event->u.selectionNotify.selection == clientCLIPBOARD) - { - eventSelection.selection = lastSelectionOwner[nxagentClipboardSelection].remSelection; - } - else - { - eventSelection.selection = nxagentLocalToRemoteAtom(event->u.selectionNotify.selection); - } - - /* - * .target must be translated, too, as a client on the real - * server is requested to fill our property and it needs to know - * the format. - */ - - if (event->u.selectionNotify.target == clientUTF8_STRING) - { - eventSelection.target = serverUTF8_STRING; - } - else if (event->u.selectionNotify.target == clientTEXT) - { - eventSelection.target = serverTEXT; - } - else if (event->u.selectionNotify.target == clientCOMPOUND_TEXT) - { - eventSelection.target = serverCOMPOUND_TEXT; - } - else - { - eventSelection.target = XA_STRING; - } - - #ifdef DEBUG - fprintf(stderr, "%s: mapping local to remote Atom: [%d] -> [%ld] [%s]\n", __func__, - event->u.selectionNotify.selection, eventSelection.selection, - NameForAtom(event->u.selectionNotify.selection)); - fprintf(stderr, "%s: mapping local to remote Atom: [%d] -> [%ld] [%s]\n", __func__, - event->u.selectionNotify.target, eventSelection.target, - NameForAtom(event->u.selectionNotify.target)); - fprintf(stderr, "%s: mapping local to remote Atom: [%d] -> [%ld] [%s]\n", __func__, - event->u.selectionNotify.property, eventSelection.property, - NameForAtom(event->u.selectionNotify.property)); - #endif - sendSelectionNotifyEventToXServer(&eventSelection); return 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 3.6.x in repository nx-libs. commit 550742511cc6d546b3618c0944396767e53d3829 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Sep 22 21:36:03 2020 +0200 Clipboard.c: rename selection fields to {int,rem}Selection This helps in avoiding storing the wrong value in a field. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 140 ++++++++++++++++--------- 1 file changed, 88 insertions(+), 52 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index c0fe74c25..f35ab583a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -79,11 +79,12 @@ const int nxagentMaxSelections = 2; typedef struct _SelectionOwner { - XlibAtom selection; /* _external_ Atom */ - ClientPtr client; /* internal client */ - Window window; /* internal window id */ - WindowPtr windowPtr; /* internal window struct */ - Time lastTimeChanged; /* internal time */ + ClientPtr client; /* internal client */ + Atom intSelection; /* internal Atom */ + XlibAtom remSelection; /* _external_ Atom */ + Window window; /* internal window id */ + WindowPtr windowPtr; /* internal window struct */ + Time lastTimeChanged; /* internal time */ } SelectionOwner; /* @@ -118,7 +119,7 @@ typedef struct _lastClient ClientPtr clientPtr; Window requestor; Atom property; - Atom selection; + Atom intSelection; Atom target; Time time; Time reqTime; @@ -241,7 +242,7 @@ static void transferSelectionFromXServer(int resource, int index); #if 0 static void resetSelectionOwnerOnXServer(void); #endif -static void initSelectionOwnerData(int index, Atom selection); +static void initSelectionOwnerData(int index, Atom intSelection, XlibAtom remSelection); static void clearSelectionOwnerData(int index); static void storeSelectionOwnerData(int index, Selection *sel); static Bool matchSelectionOwner(int index, ClientPtr pClient, WindowPtr pWindow); @@ -281,11 +282,9 @@ static void printSelectionStat(int sel) fprintf(stderr, " lastSelectionOwner[].windowPtr -\n"); fprintf(stderr, " lastSelectionOwner[].lastTimeChanged [%u]\n", lOwner.lastTimeChanged); - /* - print the selection name. selection is _always_ a a remote Atom! - */ - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, lOwner.selection); - fprintf(stderr, " lastSelectionOwner[].selection [% 4ld][%s] (%s)\n", lOwner.selection, validateString(s), lOwner.client ? "inside nxagent" : "remote X server"); + fprintf(stderr, " lastSelectionOwner[].intSelection [% 4d][%s] (%s)\n", lOwner.intSelection, validateString(NameForAtom(lOwner.intSelection)), "inside nxagent"); + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, lOwner.remSelection); + fprintf(stderr, " lastSelectionOwner[].remSelection [% 4ld][%s] (%s)\n", lOwner.remSelection, validateString(s), "remote X server"); SAFE_XFree(s); #ifdef CLIENTIDS fprintf(stderr, " CurrentSelections[].client [%p] index [%d] PID [%d] Cmd [%s]\n", @@ -312,7 +311,7 @@ static void printLastClientStat(int index) fprintf(stderr, " lastClients[].clientPtr (ClientPtr) %s\n", nxagentClientInfoString(lc.clientPtr)); fprintf(stderr, " lastClients[].requestor (Window) [0x%x]\n", lc.requestor); fprintf(stderr, " lastClients[].property (Atom) [% 4d][%s]\n", lc.property, NameForAtom(lc.property)); - fprintf(stderr, " lastClients[].selection (Atom) [% 4d][%s]\n", lc.selection, NameForAtom(lc.selection)); + fprintf(stderr, " lastClients[].intSelection (Atom) [% 4d][%s]\n", lc.intSelection, NameForAtom(lc.intSelection)); fprintf(stderr, " lastClients[].target (Atom) [% 4d][%s]\n", lc.target, NameForAtom(lc.target)); if (lc.time > 0) fprintf(stderr, " lastClients[].time (Time) [%u] ([%u]ms ago)\n", lc.time, GetTimeInMillis() - lc.time); @@ -414,7 +413,8 @@ static void resetClientSelectionStage(int index) lastClients[index].requestor = 0; lastClients[index].property = 0; /* NX_PRIMARY or clipboard atom */ - lastClients[index].selection = lastSelectionOwner[index].selection; + /* FIXME: we should only set the once on init and then never touch it again */ + lastClients[index].intSelection = lastSelectionOwner[index].intSelection; lastClients[index].target = 0; lastClients[index].time = 0; lastClients[index].reqTime = 0; @@ -600,9 +600,10 @@ static Bool validServerTargets(XlibAtom target) return False; } -static void initSelectionOwnerData(int index, Atom selection) +static void initSelectionOwnerData(int index, Atom intSelection, XlibAtom remSelection) { - lastSelectionOwner[index].selection = selection; + lastSelectionOwner[index].intSelection = intSelection; + lastSelectionOwner[index].remSelection = remSelection; lastSelectionOwner[index].client = NullClient; lastSelectionOwner[index].window = screenInfo.screens[0]->root->drawable.id; lastSelectionOwner[index].windowPtr = NULL; @@ -680,7 +681,7 @@ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) { int i = 0; while (i < nxagentMaxSelections && - lastSelectionOwner[i].selection != sel) + lastSelectionOwner[i].remSelection != sel) { i++; } @@ -1087,7 +1088,7 @@ static void endTransfer(Bool success, int index) sendSelectionNotifyEventToClient(lastClients[index].clientPtr, lastClients[index].time, lastClients[index].requestor, - lastClients[index].selection, + lastClients[index].intSelection, lastClients[index].target, success == SELECTION_SUCCESS ? lastClients[index].property : None); } @@ -1447,11 +1448,11 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) for (index = 0; index < nxagentMaxSelections; index++) { #ifdef DEBUG - fprintf (stderr, "%s: lastClients[%d].selection [%d] selection [%d] .\n", - __func__, index, lastClients[index].selection, - nxagentRemoteToLocalAtom(e->selection)); + fprintf (stderr, "%s: lastClients[%d].intSelection [%d] selection [%d] .\n", + __func__, index, lastClients[index].intSelection, + nxagentRemoteToLocalAtom(e->selection)); #endif - if (lastClients[index].selection == nxagentRemoteToLocalAtom(e->selection)) + if (lastClients[index].intSelection == nxagentRemoteToLocalAtom(e->selection)) { break; } @@ -1682,7 +1683,7 @@ static void resetSelectionOwnerOnXServer(void) for (int i = 0; i < nxagentMaxSelections; i++) { - XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].selection, serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].remSelection, serverWindow, CurrentTime); #ifdef DEBUG fprintf(stderr, "%s: Reset selection state for selection [%d].\n", __func__, i); @@ -1827,7 +1828,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) * inform the real X server that our serverWindow is the * clipboard owner. */ - XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].selection, serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].remSelection, serverWindow, CurrentTime); /* * The real owner window (inside nxagent) is stored in @@ -1918,7 +1919,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #endif #ifdef DEBUG - fprintf(stderr, "%s: lastClients[%d].selection [%d] - selection [%d]\n", __func__, index, lastClients[index].selection, selection); + fprintf(stderr, "%s: lastClients[%d].intSelection [%d] - selection [%d]\n", __func__, index, lastClients[index].intSelection, selection); #endif if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) @@ -2072,50 +2073,75 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, lastClients[index].clientPtr = client; lastClients[index].time = time; lastClients[index].property = property; - lastClients[index].selection = selection; + lastClients[index].intSelection = selection; lastClients[index].target = target; /* if the last client request time is more than 5s ago update it. Why? */ if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) lastClients[index].reqTime = GetTimeInMillis(); - if (selection == clientCLIPBOARD) + XlibAtom remSelection = 0; + + /* FIXME: we should use/have a function for stuff like that */ + if (selection == XA_PRIMARY) + { + remSelection = XA_PRIMARY; + } + else if (selection == clientCLIPBOARD) + { + remSelection = lastSelectionOwner[nxagentClipboardSelection].remSelection; + } + else { - selection = lastSelectionOwner[nxagentClipboardSelection].selection; + remSelection = nxagentLocalToRemoteAtom(selection); } /* * we only convert to either UTF8 or XA_STRING, despite accepting * TEXT and COMPOUND_TEXT. */ - XlibAtom p = serverTransToAgentProperty; - XlibAtom t; + XlibAtom remProperty = serverTransToAgentProperty; + XlibAtom remTarget; #ifdef DEBUG char * pstr = "NX_CUT_BUFFER_SERVER"; const char * tstr; #endif if (target == clientUTF8_STRING) { - t = serverUTF8_STRING; + remTarget = serverUTF8_STRING; #ifdef DEBUG tstr = szAgentUTF8_STRING; #endif } else { - t = XA_STRING; + remTarget = XA_STRING; #ifdef DEBUG tstr = validateString(NameForAtom(XA_STRING)); #endif } #ifdef DEBUG - fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] time [0][CurrentTime]\n", __func__, - serverWindow, t, tstr, p, pstr); + /* FIXME: check Atoms.c for alternative to XGetAtomName */ + fprintf(stderr, "%s: mapping local to remote Atom: [%d][%s] -> [%ld][%s]\n", + __func__, selection, NameForAtom(selection), remSelection, + XGetAtomName(nxagentDisplay, remSelection)); + fprintf(stderr, "%s: mapping local to remote Atom: [%d][%s] -> [%ld][%s]\n", + __func__, target, NameForAtom(target), remTarget, tstr); + fprintf(stderr, "%s: mapping local to remote Atom: [%d][%s] -> [%ld][%s]\n", + __func__, property, NameForAtom(property), remProperty, pstr); #endif - XConvertSelection(nxagentDisplay, selection, t, p, serverWindow, CurrentTime); + /* FIXME: check why using CurrentTime will not replace the value + * by a real time. The reply also contains time "0" which is + * unexpected (for me) */ + #ifdef DEBUG + fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] selection [%ld] time [0][CurrentTime]\n", __func__, + serverWindow, remTarget, tstr, remProperty, pstr, remSelection); + #endif - /* FIXME: check result of XConvertSelection? */ + XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime); + + /* XConvertSelection will always return (check the source!), so no need to check */ #ifdef DEBUG fprintf(stderr, "%s: Sent XConvertSelection with target [%s], property [%s]\n", __func__, tstr, pstr); @@ -2223,9 +2249,17 @@ int nxagentSendNotify(xEvent *event) * X servers (defined in Xatom.h). */ - if (event->u.selectionNotify.selection == clientCLIPBOARD) + if (event->u.selectionNotify.selection == XA_PRIMARY) + { + eventSelection.selection = XA_PRIMARY; + } + else if (event->u.selectionNotify.selection == clientCLIPBOARD) + { + eventSelection.selection = lastSelectionOwner[nxagentClipboardSelection].remSelection; + } + else { - eventSelection.selection = lastSelectionOwner[nxagentClipboardSelection].selection; + eventSelection.selection = nxagentLocalToRemoteAtom(event->u.selectionNotify.selection); } /* @@ -2282,8 +2316,8 @@ WindowPtr nxagentGetClipboardWindow(Atom property) lastSelectionOwner[i].windowPtr != NULL) { #ifdef DEBUG - fprintf(stderr, "%s: Returning last [%ld] selection owner window [%p] (0x%x).\n", __func__, - lastSelectionOwner[i].selection, + fprintf(stderr, "%s: Returning last [%d] selection owner window [%p] (0x%x).\n", __func__, + lastSelectionOwner[i].intSelection, (void *)lastSelectionOwner[i].windowPtr, WINDOWID(lastSelectionOwner[i].windowPtr)); #endif @@ -2317,6 +2351,15 @@ Bool nxagentInitClipboard(WindowPtr pWin) if (!nxagentReconnectTrap) { + /* cannot move that down to others - we need it for + * initSelectionOwnerData ! */ + clientCLIPBOARD = MakeAtom(szAgentCLIPBOARD, strlen(szAgentCLIPBOARD), True); + clientTARGETS = MakeAtom(szAgentTARGETS, strlen(szAgentTARGETS), True); + clientTEXT = MakeAtom(szAgentTEXT, strlen(szAgentTEXT), True); + clientCOMPOUND_TEXT = MakeAtom(szAgentCOMPOUND_TEXT, strlen(szAgentCOMPOUND_TEXT), True); + clientUTF8_STRING = MakeAtom(szAgentUTF8_STRING, strlen(szAgentUTF8_STRING), True); + clientTIMESTAMP = MakeAtom(szAgentTIMESTAMP, strlen(szAgentTIMESTAMP), True); + SAFE_free(lastSelectionOwner); lastSelectionOwner = (SelectionOwner *) malloc(nxagentMaxSelections * sizeof(SelectionOwner)); @@ -2325,8 +2368,8 @@ Bool nxagentInitClipboard(WindowPtr pWin) { FatalError("nxagentInitClipboard: Failed to allocate memory for the clipboard selections.\n"); } - initSelectionOwnerData(nxagentPrimarySelection, XA_PRIMARY); - initSelectionOwnerData(nxagentClipboardSelection, nxagentAtoms[10]); /* CLIPBOARD */ + initSelectionOwnerData(nxagentPrimarySelection, XA_PRIMARY, XA_PRIMARY); + initSelectionOwnerData(nxagentClipboardSelection, clientCLIPBOARD, nxagentAtoms[10]); /* CLIPBOARD */ SAFE_free(lastClients); @@ -2340,7 +2383,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) { /* the clipboard selection atom might have changed on a new X server. Primary is constant. */ - lastSelectionOwner[nxagentClipboardSelection].selection = nxagentAtoms[10]; /* CLIPBOARD */ + lastSelectionOwner[nxagentClipboardSelection].remSelection = nxagentAtoms[10]; /* CLIPBOARD */ } serverTARGETS = nxagentAtoms[6]; /* TARGETS */ @@ -2389,7 +2432,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) for (int i = 0; i < nxagentMaxSelections; i++) { XFixesSelectSelectionInput(nxagentDisplay, serverWindow, - lastSelectionOwner[i].selection, + lastSelectionOwner[i].remSelection, XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask); @@ -2437,7 +2480,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) */ if (IS_INTERNAL_OWNER(i) && lastSelectionOwner[i].window) { - XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].selection, serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].remSelection, serverWindow, CurrentTime); } } } @@ -2455,13 +2498,6 @@ Bool nxagentInitClipboard(WindowPtr pWin) lastServerRequestor = None; - clientTARGETS = MakeAtom(szAgentTARGETS, strlen(szAgentTARGETS), True); - clientTEXT = MakeAtom(szAgentTEXT, strlen(szAgentTEXT), True); - clientCOMPOUND_TEXT = MakeAtom(szAgentCOMPOUND_TEXT, strlen(szAgentCOMPOUND_TEXT), True); - clientUTF8_STRING = MakeAtom(szAgentUTF8_STRING, strlen(szAgentUTF8_STRING), True); - clientTIMESTAMP = MakeAtom(szAgentTIMESTAMP, strlen(szAgentTIMESTAMP), True); - clientCLIPBOARD = MakeAtom(szAgentCLIPBOARD, strlen(szAgentCLIPBOARD), True); - clientCutProperty = MakeAtom(szAgentNX_CUT_BUFFER_CLIENT, strlen(szAgentNX_CUT_BUFFER_CLIENT), True); if (clientCutProperty == None) -- 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 3.6.x in repository nx-libs. commit e8b00edb59400d63d3c849dee6a2705228815e97 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Sep 22 23:12:25 2020 +0200 Clipboard.c: simplify nxagentHandleSelectionRequestFromXServer - remove redundant calls to nxagentFindLastSelectionOwnerIndex which reduce indentation level - scope improvements --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 227 ++++++++++++------------- 1 file changed, 107 insertions(+), 120 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 01cdcad21..5a85b0f87 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -837,17 +837,15 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } /* the selection in this request is none we own. */ + int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); + if (index == nxagentMaxSelections) { - int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); - if (index == nxagentMaxSelections) - { - #ifdef DEBUG - fprintf(stderr, "%s: not owning selection [%ld] - denying request.\n", __func__, X->xselectionrequest.selection); - #endif + #ifdef DEBUG + fprintf(stderr, "%s: not owning selection [%ld] - denying request.\n", __func__, X->xselectionrequest.selection); + #endif - replyRequestSelectionToXServer(X, False); - return; - } + replyRequestSelectionToXServer(X, False); + return; } /* this is a special request like TARGETS or TIMESTAMP */ @@ -874,16 +872,14 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) int numTargets = sizeof(targets) / sizeof(targets[0]); #ifdef DEBUG + fprintf(stderr, "%s: Sending %d available targets:\n", __func__, numTargets); + for (int i = 0; i < numTargets; i++) { - fprintf(stderr, "%s: Sending %d available targets:\n", __func__, numTargets); - for (int i = 0; i < numTargets; i++) - { - char *s = XGetAtomName(nxagentDisplay, targets[i]); - fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], s); - SAFE_XFree(s); - } - fprintf(stderr, "\n"); + char *s = XGetAtomName(nxagentDisplay, targets[i]); + fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], s); + SAFE_XFree(s); } + fprintf(stderr, "\n"); #endif /* @@ -918,19 +914,15 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * FIXME: selection has already been checked above, so we do not need to check again here */ - int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); - if (index < nxagentMaxSelections) - { - XChangeProperty(nxagentDisplay, - X->xselectionrequest.requestor, - X->xselectionrequest.property, - XA_INTEGER, - 32, - PropModeReplace, - (unsigned char *) &lastSelectionOwner[index].lastTimeChanged, - 1); - replyRequestSelectionToXServer(X, True); - } + XChangeProperty(nxagentDisplay, + X->xselectionrequest.requestor, + X->xselectionrequest.property, + XA_INTEGER, + 32, + PropModeReplace, + (unsigned char *) &lastSelectionOwner[index].lastTimeChanged, + 1); + replyRequestSelectionToXServer(X, True); } else { @@ -956,107 +948,102 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) */ serverLastRequestedSelection = X->xselectionrequest.selection; - /* find the index of the requested selection */ - int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); - if (index < nxagentMaxSelections) - { #if 0 - if (lastClients[index].windowPtr != NULL && IS_INTERNAL_OWNER(index)) - { - /* - * Request the real X server to transfer the selection content - * to the NX_CUT_BUFFER_SERVER property of the serverWindow. - * We reach here as follows: - * - mark someting in the nx session - * -> nxagent claims ownership of PRIMARY on real X server - * - at the same time paste _clipboard_ to the client (now) owning primary - * ->vcxsrv will ask for primary contents to store them to Windows clipboard - * - vcxsrv request is for _primary_ and takes this path as the _clipboard_ transfer - * has set lastClients[index].windowPtr - */ - XConvertSelection(nxagentDisplay, CurrentSelections[index].selection, - X->xselectionrequest.target, serverTransToAgentProperty, - serverWindow, lastClients[index].time); - - #ifdef DEBUG - char *strTarget = XGetAtomName(nxagentDisplay, X->xselectionrequest.target); - char *strSelection = XGetAtomName(nxagentDisplay, CurrentSelections[index].selection); - char *strProperty = XGetAtomName(nxagentDisplay, serverTransToAgentProperty); - fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%x] time [%u] .\n", __func__, - CurrentSelections[index].selection, strSelection, - X->xselectionrequest.target, strTarget, - serverTransToAgentProperty, strProperty, + if (lastClients[index].windowPtr != NULL && IS_INTERNAL_OWNER(index)) + { + /* + * Request the real X server to transfer the selection content + * to the NX_CUT_BUFFER_SERVER property of the serverWindow. + * We reach here as follows: + * - mark someting in the nx session + * -> nxagent claims ownership of PRIMARY on real X server + * - at the same time paste _clipboard_ to the client (now) owning primary + * ->vcxsrv will ask for primary contents to store them to Windows clipboard + * - vcxsrv request is for _primary_ and takes this path as the _clipboard_ transfer + * has set lastClients[index].windowPtr + */ + XConvertSelection(nxagentDisplay, CurrentSelections[index].selection, + X->xselectionrequest.target, serverTransToAgentProperty, serverWindow, lastClients[index].time); - #endif - SAFE_XFree(strTarget); - SAFE_XFree(strSelection); - SAFE_XFree(strProperty); - } - else + + #ifdef DEBUG + char *strTarget = XGetAtomName(nxagentDisplay, X->xselectionrequest.target); + char *strSelection = XGetAtomName(nxagentDisplay, CurrentSelections[index].selection); + char *strProperty = XGetAtomName(nxagentDisplay, serverTransToAgentProperty); + fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%x] time [%u] .\n", __func__, + CurrentSelections[index].selection, strSelection, + X->xselectionrequest.target, strTarget, + serverTransToAgentProperty, strProperty, + serverWindow, lastClients[index].time); + SAFE_XFree(strTarget); + SAFE_XFree(strSelection); + SAFE_XFree(strProperty); + #endif + } + else #endif + { + /* + * if one of our clients owns the selection we ask it to copy + * the selection to the clientCutProperty on nxagent's root + * window in the first step. We then later push that property's + * content to the real X server. + */ + if (IS_INTERNAL_OWNER(index) && + (nxagentOption(Clipboard) == ClipboardServer || + nxagentOption(Clipboard) == ClipboardBoth)) { /* - * if one of our clients owns the selection we ask it to copy - * the selection to the clientCutProperty on nxagent's root - * window in the first step. We then later push that property's - * content to the real X server. + * store who on the real X server requested the data and how + * and where it wants to have it */ - if (IS_INTERNAL_OWNER(index) && - (nxagentOption(Clipboard) == ClipboardServer || - nxagentOption(Clipboard) == ClipboardBoth)) - { - /* - * store who on the real X server requested the data and how - * and where it wants to have it - */ - lastServerProperty = X->xselectionrequest.property; - lastServerRequestor = X->xselectionrequest.requestor; - lastServerTarget = X->xselectionrequest.target; - lastServerTime = X->xselectionrequest.time; - - /* by dimbor */ - if (lastServerTarget != XA_STRING) - lastServerTarget = serverUTF8_STRING; - - /* prepare the request (like XConvertSelection, but internally) */ - xEvent x = {0}; - x.u.u.type = SelectionRequest; - x.u.selectionRequest.time = GetTimeInMillis(); - x.u.selectionRequest.owner = lastSelectionOwner[index].window; - x.u.selectionRequest.selection = CurrentSelections[index].selection; - x.u.selectionRequest.property = clientCutProperty; - x.u.selectionRequest.requestor = screenInfo.screens[0]->root->drawable.id; /* Fictitious window.*/ + lastServerProperty = X->xselectionrequest.property; + lastServerRequestor = X->xselectionrequest.requestor; + lastServerTarget = X->xselectionrequest.target; + lastServerTime = X->xselectionrequest.time; - /* - * Don't send the same window, some programs are clever and - * verify cut and paste operations inside the same window and - * don't Notify at all. - * - * x.u.selectionRequest.requestor = lastSelectionOwnerWindow; - */ + /* by dimbor */ + if (lastServerTarget != XA_STRING) + lastServerTarget = serverUTF8_STRING; - /* by dimbor (idea from zahvatov) */ - if (X->xselectionrequest.target != XA_STRING) - x.u.selectionRequest.target = clientUTF8_STRING; - else - x.u.selectionRequest.target = XA_STRING; + /* prepare the request (like XConvertSelection, but internally) */ + xEvent x = {0}; + x.u.u.type = SelectionRequest; + x.u.selectionRequest.time = GetTimeInMillis(); + x.u.selectionRequest.owner = lastSelectionOwner[index].window; + x.u.selectionRequest.selection = CurrentSelections[index].selection; + x.u.selectionRequest.property = clientCutProperty; + x.u.selectionRequest.requestor = screenInfo.screens[0]->root->drawable.id; /* Fictitious window.*/ - sendEventToClient(lastSelectionOwner[index].client, &x); + /* + * Don't send the same window, some programs are clever and + * verify cut and paste operations inside the same window and + * don't Notify at all. + * + * x.u.selectionRequest.requestor = lastSelectionOwner[index].window; + */ - #ifdef DEBUG - fprintf(stderr, "%s: sent SelectionRequest event to client %s property [%d][%s]" \ - "target [%d][%s] requestor [0x%x].\n", __func__, - nxagentClientInfoString(lastSelectionOwner[index].client), - x.u.selectionRequest.property, NameForAtom(x.u.selectionRequest.property), - x.u.selectionRequest.target, NameForAtom(x.u.selectionRequest.target), - x.u.selectionRequest.requestor); - #endif - } + /* by dimbor (idea from zahvatov) */ + if (X->xselectionrequest.target != XA_STRING) + x.u.selectionRequest.target = clientUTF8_STRING; else - { - /* deny the request */ - replyRequestSelectionToXServer(X, False); - } + x.u.selectionRequest.target = XA_STRING; + + sendEventToClient(lastSelectionOwner[index].client, &x); + + #ifdef DEBUG + fprintf(stderr, "%s: sent SelectionRequest event to client %s property [%d][%s]" \ + "target [%d][%s] requestor [0x%x].\n", __func__, + nxagentClientInfoString(lastSelectionOwner[index].client), + x.u.selectionRequest.property, NameForAtom(x.u.selectionRequest.property), + x.u.selectionRequest.target, NameForAtom(x.u.selectionRequest.target), + x.u.selectionRequest.requestor); + #endif + } + else + { + /* deny the request */ + replyRequestSelectionToXServer(X, 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 3.6.x in repository nx-libs. commit a3adf6641e9d93fdeb7d345b28f59f6415bb9aa6 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Sep 23 23:21:37 2020 +0200 Clipboard.c: remove superflous index determination we already have it at that stage --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 172 ++++++++++++------------- 1 file changed, 84 insertions(+), 88 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 40a812b9b..da07cad40 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1554,32 +1554,46 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) } else { - int index = nxagentFindLastSelectionOwnerIndex(X->xselection.selection); - if (index < nxagentMaxSelections) + /* if the last owner was an internal one, read the + * clientCutProperty and push the contents to the + * lastServers[index].requestor on the real X server. + */ + if (IS_INTERNAL_OWNER(index) && + lastSelectionOwner[index].windowPtr != NULL && + X->xselection.property == serverTransFromAgentProperty) { - /* if the last owner was an internal one, read the - * clientCutProperty and push the contents to the - * lastServers[index].requestor on the real X server. - */ - if (IS_INTERNAL_OWNER(index) && - lastSelectionOwner[index].windowPtr != NULL && - X->xselection.property == serverTransFromAgentProperty) - { - Atom atomReturnType; - int resultFormat; - unsigned long ulReturnItems; - unsigned long ulReturnBytesLeft; - unsigned char *pszReturnData = NULL; + Atom atomReturnType; + int resultFormat; + unsigned long ulReturnItems; + unsigned long ulReturnBytesLeft; + unsigned char *pszReturnData = NULL; - /* first get size values ... */ - int result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, 0, False, - AnyPropertyType, &atomReturnType, &resultFormat, - &ulReturnItems, &ulReturnBytesLeft, &pszReturnData); + /* first get size values ... */ + int result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, 0, False, + AnyPropertyType, &atomReturnType, &resultFormat, + &ulReturnItems, &ulReturnBytesLeft, &pszReturnData); + #ifdef DEBUG + fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d] returned [%s]\n", __func__, + lastSelectionOwner[index].window, clientCutProperty, getXErrorString(result)); + #endif + if (result == BadAlloc || result == BadAtom || + result == BadWindow || result == BadValue) + { + lastServers[index].property = None; + } + else + { + /* ... then use the size values for the actual request */ + result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, + ulReturnBytesLeft, False, AnyPropertyType, &atomReturnType, + &resultFormat, &ulReturnItems, &ulReturnBytesLeft, + &pszReturnData); #ifdef DEBUG fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d] returned [%s]\n", __func__, lastSelectionOwner[index].window, clientCutProperty, getXErrorString(result)); #endif + if (result == BadAlloc || result == BadAtom || result == BadWindow || result == BadValue) { @@ -1587,84 +1601,66 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) } else { - /* ... then use the size values for the actual request */ - result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, - ulReturnBytesLeft, False, AnyPropertyType, &atomReturnType, - &resultFormat, &ulReturnItems, &ulReturnBytesLeft, - &pszReturnData); - #ifdef DEBUG - fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d] returned [%s]\n", __func__, - lastSelectionOwner[index].window, clientCutProperty, getXErrorString(result)); - #endif + /* Fill the property on the initial requestor with the requested data */ + /* The XChangeProperty source code reveals it will always + return 1, no matter what, so no need to check the result */ + /* FIXME: better use the format returned by above request */ + XChangeProperty(nxagentDisplay, + lastServers[index].requestor, + lastServers[index].property, + lastServers[index].target, + 8, + PropModeReplace, + pszReturnData, + ulReturnItems); - if (result == BadAlloc || result == BadAtom || - result == BadWindow || result == BadValue) - { - lastServers[index].property = None; - } - else + #ifdef DEBUG { - /* Fill the property on the initial requestor with the requested data */ - /* The XChangeProperty source code reveals it will always - return 1, no matter what, so no need to check the result */ - /* FIXME: better use the format returned by above request */ - XChangeProperty(nxagentDisplay, - lastServers[index].requestor, - lastServers[index].property, - lastServers[index].target, - 8, - PropModeReplace, - pszReturnData, - ulReturnItems); - - #ifdef DEBUG - { - char *s = XGetAtomName(nxagentDisplay, lastServers[index].property); - fprintf(stderr, "%s: XChangeProperty sent to window [0x%x] for property [%ld][%s] value [\"%*.*s\"...]\n", - __func__, - lastServers[index].requestor, - lastServers[index].property, - s, - (int)(min(20, ulReturnItems * 8 / 8)), - (int)(min(20, ulReturnItems * 8 / 8)), - pszReturnData); - SAFE_XFree(s); - } - #endif + char *s = XGetAtomName(nxagentDisplay, lastServers[index].property); + fprintf(stderr, "%s: XChangeProperty sent to window [0x%x] for property [%ld][%s] value [\"%*.*s\"...]\n", + __func__, + lastServers[index].requestor, + lastServers[index].property, + s, + (int)(min(20, ulReturnItems * 8 / 8)), + (int)(min(20, ulReturnItems * 8 / 8)), + pszReturnData); + SAFE_XFree(s); } - - /* FIXME: free it or not? */ - /* - * SAFE_XFree(pszReturnData); - */ + #endif } + /* FIXME: free it or not? */ /* - * inform the initial requestor that the requested data has - * arrived in the desired property. If we have been unable to - * get the data from the owner XChangeProperty will not have - * been called and lastServers[index].property will be None which - * effectively will send a "Request denied" to the initial - * requestor. + * SAFE_XFree(pszReturnData); */ - XSelectionEvent eventSelection = { - .requestor = lastServers[index].requestor, - .selection = X->xselection.selection, - /* .target = X->xselection.target, */ - .target = lastServers[index].target, - .property = lastServers[index].property, - .time = lastServers[index].time, - /* .time = CurrentTime */ - }; - #ifdef DEBUG - fprintf(stderr, "%s: Sending SelectionNotify event to requestor [%p].\n", __func__, - (void *)eventSelection.requestor); - #endif + } - sendSelectionNotifyEventToXServer(&eventSelection); + /* + * inform the initial requestor that the requested data has + * arrived in the desired property. If we have been unable to + * get the data from the owner XChangeProperty will not have + * been called and lastServers[index].property will be None which + * effectively will send a "Request denied" to the initial + * requestor. + */ + XSelectionEvent eventSelection = { + .requestor = lastServers[index].requestor, + .selection = X->xselection.selection, + /* .target = X->xselection.target, */ + .target = lastServers[index].target, + .property = lastServers[index].property, + .time = lastServers[index].time, + /* .time = CurrentTime */ + }; + #ifdef DEBUG + fprintf(stderr, "%s: Sending SelectionNotify event to requestor [%p].\n", __func__, + (void *)eventSelection.requestor); + #endif - lastServers[index].requestor = None; /* allow further request */ - } + sendSelectionNotifyEventToXServer(&eventSelection); + + lastServers[index].requestor = None; /* allow further 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 3.6.x in repository nx-libs. commit e526e1cd0fec37b35a746d600170e923e8e86041 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Sep 22 23:33:35 2020 +0200 Clipboard.c: fix nxagentConvertSelection - debug output was not printed at the beginning but later and was therefore missing sometimes - add comments/FIXMEs - re-enable failure notification for second call --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 46 ++++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 60792bb44..fe6d39281 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1863,6 +1863,24 @@ FIXME int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, Window requestor, Atom property, Atom target, Time time) { + const char *strTarget = NameForAtom(target); + + #ifdef DEBUG + fprintf(stderr, "%s: client %s requests sel [%s] " + "on window [0x%x] prop [%d][%s] target [%d][%s].\n", __func__, + nxagentClientInfoString(client), validateString(NameForAtom(selection)), requestor, + property, validateString(NameForAtom(property)), + target, validateString(strTarget)); + #endif + + if (strTarget == NULL) + { + #ifdef DEBUG + fprintf(stderr, "%s: cannot find name for target Atom [%d] - returning\n", __func__, target); + #endif + return 1; + } + if (!agentClipboardInitialized) { #ifdef DEBUG @@ -1915,20 +1933,22 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) { #ifdef DEBUG - fprintf(stderr, "%s: timeout expired on last request, " + fprintf(stderr, "%s: timeout expired on previous request, " "notifying failure to client %s\n", __func__, nxagentClientInfoString(client)); #endif /* notify the waiting client of failure */ endTransfer(SELECTION_FAULT, index); - return 1; + + /* do NOT return here but process the new request instead! */ } else { /* * we got another convert request while already waiting for an - * answer from the real X server to a previous convert request, - * which we cannot handle (yet). So return an error. + * answer from the real X server to a previous convert request + * for this selection, which we cannot handle (yet). So return + * an error for the new request. */ #ifdef DEBUG fprintf(stderr, "%s: got new request " @@ -1943,24 +1963,6 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, } } - const char *strTarget = NameForAtom(target); - - #ifdef DEBUG - fprintf(stderr, "%s: client %s requests sel [%s] " - "on window [0x%x] prop [%d][%s] target [%d][%s].\n", __func__, - nxagentClientInfoString(client), validateString(NameForAtom(selection)), requestor, - property, validateString(NameForAtom(property)), - target, validateString(strTarget)); - #endif - - if (strTarget == NULL) - { - #ifdef DEBUG - fprintf(stderr, "%s: cannot find name for target Atom [%d] - returning\n", __func__, target); - #endif - return 1; - } - /* * The selection request target is TARGETS. The requestor is asking * for a list of supported data formats. -- 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 3.6.x in repository nx-libs. commit d79db429dd1db5a507dcecb2bd8f79d4e3545be4 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Sep 23 17:03:00 2020 +0200 Clipboard.c: always print SelectionCallBackKind in debug output --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 38 ++++++++++++++++++-------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 605716e9d..40a812b9b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -815,6 +815,10 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) char *strSelection = XGetAtomName(nxagentDisplay, X->xselectionrequest.selection); char *strProperty = XGetAtomName(nxagentDisplay, X->xselectionrequest.property); + if (X->xselectionrequest.requestor == serverWindow) + { + fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; + } fprintf(stderr, "%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s]\n", __func__, @@ -1732,6 +1736,28 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, * way to identify that situation during callback processing we * could get rid of the Trap... */ + + SelectionInfoRec *info = (SelectionInfoRec *)args; + + #ifdef DEBUG + if (info->kind == SelectionSetOwner) + { + fprintf(stderr, "%s: SelectionCallbackKind [SelectionSetOwner]\n", __func__); + } + else if (info->kind == SelectionWindowDestroy) + { + fprintf(stderr, "%s: SelectionCallbackKind [SelectionWindowDestroy]\n", __func__); + } + else if (info->kind == SelectionClientClose) + { + fprintf(stderr, "%s: SelectionCallbackKind [SelectionClientClose]\n", __func__); + } + else + { + fprintf(stderr, "%s: SelectionCallbackKind [unknown]\n", __func__); + } + #endif + if (nxagentExternalClipboardEventTrap) { #ifdef DEBUG @@ -1740,8 +1766,6 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, return; } - SelectionInfoRec *info = (SelectionInfoRec *)args; - Selection * pCurSel = (Selection *)info->selection; #ifdef DEBUG @@ -1751,7 +1775,6 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, if (info->kind == SelectionSetOwner) { #ifdef DEBUG - fprintf(stderr, "%s: called with SelectionCallbackKind SelectionSetOwner\n", __func__); fprintf(stderr, "%s: pCurSel->pWin [0x%x]\n", __func__, WINDOWID(pCurSel->pWin)); fprintf(stderr, "%s: pCurSel->selection [%s]\n", __func__, NameForAtom(pCurSel->selection)); #endif @@ -1769,21 +1792,12 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, } else if (info->kind == SelectionWindowDestroy) { - #ifdef DEBUG - fprintf(stderr, "%s: called with SelectionCallbackKind SelectionWindowDestroy\n", __func__); - #endif } else if (info->kind == SelectionClientClose) { - #ifdef DEBUG - fprintf(stderr, "%s: called with SelectionCallbackKind SelectionClientClose\n", __func__); - #endif } else { - #ifdef DEBUG - fprintf(stderr, "%s: called with unknown SelectionCallbackKind\n", __func__); - #endif } } #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 3.6.x in repository nx-libs. commit a8d09f81501b76b507f080e6a812101f6cc2ada5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Sep 23 15:48:43 2020 +0200 Clipboard.c: have lastServer* per selection This will help in PRIMARY content appearing in CLIPBOARD and vice versa. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 183 +++++++++++++++---------- 1 file changed, 110 insertions(+), 73 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index fe6d39281..fefb0286e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -93,6 +93,8 @@ typedef struct _SelectionOwner * owner is outside nxagent. .selection will _always_ contain the * external atom of the selection */ + +/* FIXME: these should also be stored per selection */ static SelectionOwner *lastSelectionOwner; static XlibAtom serverLastRequestedSelection; @@ -130,10 +132,14 @@ typedef struct _lastClient static lastClient *lastClients; -static Window lastServerRequestor; -static XlibAtom lastServerProperty; -static XlibAtom lastServerTarget; -static Time lastServerTime; +typedef struct _lastServer { + Window requestor; + XlibAtom property; + XlibAtom target; + Time time; +} lastServer; + +static lastServer *lastServers; static XlibAtom serverTARGETS; static XlibAtom serverTIMESTAMP; @@ -328,6 +334,19 @@ static void printLastClientStat(int index) fprintf(stderr, " lastClients[].resource (int) [%d]\n", lc.resource); } +static void printLastServerStat(int index) +{ + lastServer ls = lastServers[index]; + char *s = NULL; + + fprintf(stderr, " lastServer[].requestor (Window) [0x%x]\n", ls.requestor); + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, ls.property); + fprintf(stderr, " lastServer[].property (Atom) [% 4ld][%s]\n", ls.property, validateString(s)); + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, ls.target); + fprintf(stderr, " lastServer[].target (Atom) [% 4ld][%s]\n", ls.target, validateString(s)); + fprintf(stderr, " lastServer[].time (Time) [%u]\n", ls.time); + SAFE_XFree(s); +} void nxagentDumpClipboardStat(void) { @@ -353,20 +372,14 @@ void nxagentDumpClipboardStat(void) } fprintf(stderr, "\n"); - fprintf(stderr, "lastServer\n"); - fprintf(stderr, " lastServerRequestor (Window) [0x%x]\n", lastServerRequestor); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, lastServerProperty); - fprintf(stderr, " lastServerProperty (Atom) [% 4ld][%s]\n", lastServerProperty, validateString(s)); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, lastServerTarget); - fprintf(stderr, " lastServerTarget (Atom) [% 4ld][%s]\n", lastServerTarget, validateString(s)); - fprintf(stderr, " lastServerTime (Time) [%u]\n", lastServerTime); - fprintf(stderr, "PRIMARY\n"); printSelectionStat(nxagentPrimarySelection); printLastClientStat(nxagentPrimarySelection); + printLastServerStat(nxagentPrimarySelection); fprintf(stderr, "CLIPBOARD\n"); printSelectionStat(nxagentClipboardSelection); printLastClientStat(nxagentClipboardSelection); + printLastServerStat(nxagentClipboardSelection); fprintf(stderr, "Atoms (remote X server)\n"); SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverTARGETS); @@ -665,7 +678,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) setClientSelectionStage(SelectionStageNone, index); - lastServerRequestor = None; + lastServers[index].requestor = None; } if (pWindow && pWindow == lastClients[index].windowPtr) @@ -803,13 +816,12 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) char *strProperty = XGetAtomName(nxagentDisplay, X->xselectionrequest.property); fprintf(stderr, "%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ - "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s] lastServerRequestor [0x%x]\n", + "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s]\n", __func__, X->xselectionrequest.selection, validateString(strSelection), X->xselectionrequest.target, validateString(strTarget), DisplayString(nxagentDisplay), X->xselectionrequest.requestor, - X->xselectionrequest.property, validateString(strProperty), - lastServerRequestor); + X->xselectionrequest.property, validateString(strProperty)); SAFE_XFree(strTarget); SAFE_XFree(strSelection); @@ -825,23 +837,27 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) return; } - /* lastServerRequestor in non-NULL (= we are currently in the transfer phase) */ - if (lastServerRequestor != None) + /* the selection in this request is none we own. */ + int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); + if (index == nxagentMaxSelections) { #ifdef DEBUG - fprintf(stderr, "%s: denying additional request during transfer phase.\n", __func__); + fprintf(stderr, "%s: not owning selection [%ld] - denying request.\n", __func__, X->xselectionrequest.selection); #endif replyRequestSelectionToXServer(X, False); return; } - /* the selection in this request is none we own. */ - int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); - if (index == nxagentMaxSelections) + #ifdef DEBUG + fprintf(stderr, "%s: lastServers[%d].requestor [0x%x].\n", __func__, index, lastServers[index].requestor); + #endif + + /* lastServers[index].requestor in non-NULL (= we are currently in the transfer phase) */ + if (lastServers[index].requestor != None) { #ifdef DEBUG - fprintf(stderr, "%s: not owning selection [%ld] - denying request.\n", __func__, X->xselectionrequest.selection); + fprintf(stderr, "%s: denying additional request during transfer phase.\n", __func__); #endif replyRequestSelectionToXServer(X, False); @@ -997,14 +1013,14 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * store who on the real X server requested the data and how * and where it wants to have it */ - lastServerProperty = X->xselectionrequest.property; - lastServerRequestor = X->xselectionrequest.requestor; - lastServerTarget = X->xselectionrequest.target; - lastServerTime = X->xselectionrequest.time; + lastServers[index].property = X->xselectionrequest.property; + lastServers[index].requestor = X->xselectionrequest.requestor; + lastServers[index].target = X->xselectionrequest.target; + lastServers[index].time = X->xselectionrequest.time; /* by dimbor */ - if (lastServerTarget != XA_STRING) - lastServerTarget = serverUTF8_STRING; + if (lastServers[index].target != XA_STRING) + lastServers[index].target = serverUTF8_STRING; /* prepare the request (like XConvertSelection, but internally) */ xEvent x = {0}; @@ -1029,6 +1045,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) else x.u.selectionRequest.target = XA_STRING; + x.u.selectionRequest.target = nxagentRemoteToLocalAtom(X->xselectionrequest.target); sendEventToClient(lastSelectionOwner[index].client, &x); #ifdef DEBUG @@ -1533,7 +1550,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) { /* if the last owner was an internal one, read the * clientCutProperty and push the contents to the - * lastServerRequestor on the real X server. + * lastServers[index].requestor on the real X server. */ if (IS_INTERNAL_OWNER(index) && lastSelectionOwner[index].windowPtr != NULL && @@ -1557,7 +1574,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) if (result == BadAlloc || result == BadAtom || result == BadWindow || result == BadValue) { - lastServerProperty = None; + lastServers[index].property = None; } else { @@ -1574,7 +1591,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) if (result == BadAlloc || result == BadAtom || result == BadWindow || result == BadValue) { - lastServerProperty = None; + lastServers[index].property = None; } else { @@ -1583,9 +1600,9 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) return 1, no matter what, so no need to check the result */ /* FIXME: better use the format returned by above request */ XChangeProperty(nxagentDisplay, - lastServerRequestor, - lastServerProperty, - lastServerTarget, + lastServers[index].requestor, + lastServers[index].property, + lastServers[index].target, 8, PropModeReplace, pszReturnData, @@ -1593,11 +1610,11 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) #ifdef DEBUG { - char *s = XGetAtomName(nxagentDisplay, lastServerProperty); + char *s = XGetAtomName(nxagentDisplay, lastServers[index].property); fprintf(stderr, "%s: XChangeProperty sent to window [0x%x] for property [%ld][%s] value [\"%*.*s\"...]\n", __func__, - lastServerRequestor, - lastServerProperty, + lastServers[index].requestor, + lastServers[index].property, s, (int)(min(20, ulReturnItems * 8 / 8)), (int)(min(20, ulReturnItems * 8 / 8)), @@ -1617,17 +1634,17 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) * inform the initial requestor that the requested data has * arrived in the desired property. If we have been unable to * get the data from the owner XChangeProperty will not have - * been called and lastServerProperty will be None which + * been called and lastServers[index].property will be None which * effectively will send a "Request denied" to the initial * requestor. */ XSelectionEvent eventSelection = { - .requestor = lastServerRequestor, + .requestor = lastServers[index].requestor, .selection = X->xselection.selection, /* .target = X->xselection.target, */ - .target = lastServerTarget, - .property = lastServerProperty, - .time = lastServerTime, + .target = lastServers[index].target, + .property = lastServers[index].property, + .time = lastServers[index].time, /* .time = CurrentTime */ }; #ifdef DEBUG @@ -1637,7 +1654,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) sendSelectionNotifyEventToXServer(&eventSelection); - lastServerRequestor = None; /* allow further request */ + lastServers[index].requestor = None; /* allow further request */ } } } @@ -1652,15 +1669,15 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) */ static void resetSelectionOwnerOnXServer(void) { - if (lastServerRequestor != None) + if (lastServers[index].requestor != None) { /* * we are in the process of communicating back and forth between * real X server and nxagent's clients - let's not disturb. */ #if defined(TEST) || defined(DEBUG) - fprintf(stderr, "%s: WARNING! Requestor window [0x%x] already found.\n", __func__, - lastServerRequestor); + fprintf(stderr, "%s: WARNING! Requestor window [0x%x] already set.\n", __func__, + lastServers[index].requestor); #endif /* FIXME: maybe we should put back the event that lead us here. */ @@ -1685,7 +1702,7 @@ static void resetSelectionOwnerOnXServer(void) } /* Hmm, this is already None when reaching this */ - lastServerRequestor = None; + lastServers[index].requestor = None; } #endif @@ -1785,19 +1802,6 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) serverWindow); #endif - #if defined(TEST) || defined(DEBUG) - if (lastServerRequestor != None) - { - /* - * we are in the process of communicating back and forth between - * real X server and nxagent's clients - let's not disturb - * FIXME: by continuing after the warning were ARE disturbing! - */ - fprintf (stderr, "%s: WARNING! Requestor window [0x%x] already set.\n", __func__, - lastServerRequestor); - } - #endif - int index = nxagentFindCurrentSelectionIndex(pSelection->selection); if (index < NumCurrentSelections) { @@ -1814,6 +1818,19 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) lastSelectionOwner[index].lastTimeChanged); #endif + #if defined(TEST) || defined(DEBUG) + if (lastServers[index].requestor != None) + { + /* + * we are in the process of communicating back and forth between + * real X server and nxagent's clients - let's not disturb + * FIXME: by continuing after the warning were ARE disturbing! + */ + fprintf (stderr, "%s: WARNING! lastServers[%d].requestor window [0x%x] already set.\n", + __func__, index, lastServers[index].requestor); + } + #endif + /* * inform the real X server that our serverWindow is the * clipboard owner. @@ -1831,7 +1848,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) setClientSelectionStage(SelectionStageNone, index); } - lastServerRequestor = None; + lastServers[index].requestor = None; /* FIXME @@ -1847,7 +1864,7 @@ FIXME setClientSelectionStage(SelectionStageNone); - lastServerRequestor = None; + lastServers[index].requestor = None; } else fprintf (stderr, "%s: SetSelectionOwner failed\n", __func__); */ @@ -2227,8 +2244,24 @@ int nxagentSendNotify(xEvent *event) fprintf(stderr, "%s: property is [%d][%s].\n", __func__, event->u.selectionNotify.property, NameForAtom(event->u.selectionNotify.property)); + fprintf(stderr, "%s: selection is [%d][%s].\n", __func__, + event->u.selectionNotify.selection, + NameForAtom(event->u.selectionNotify.selection)); fprintf(stderr, "%s: requestor is [0x%x].\n", __func__, event->u.selectionNotify.requestor); - fprintf(stderr, "%s: lastServerRequestor is [0x%x].\n", __func__, lastServerRequestor); + #endif + + int index = nxagentFindCurrentSelectionIndex(event->u.selectionNotify.selection); + if (index == nxagentMaxSelections) + { + #ifdef DEBUG + fprintf(stderr, "%s: unknown selection [%d]\n", __func__, + event->u.selectionNotify.selection); + #endif + return 0; + } + + #ifdef DEBUG + fprintf(stderr, "%s: lastServers[index].requestor is [0x%x].\n", __func__, lastServers[index].requestor); #endif /* @@ -2239,7 +2272,7 @@ int nxagentSendNotify(xEvent *event) * dix to go on) and do nothing! * Be sure to not let this trigger for the failure answer (property 0) */ - if (!(event->u.selectionNotify.property == clientCutProperty || event->u.selectionNotify.property == 0) || lastServerRequestor == None) + if (!(event->u.selectionNotify.property == clientCutProperty || event->u.selectionNotify.property == 0) || lastServers[index].requestor == None) { #ifdef DEBUG fprintf(stderr, "%s: sent nothing - message to real X server is not required.\n", __func__); @@ -2332,7 +2365,6 @@ Bool nxagentInitClipboard(WindowPtr pWin) clientTIMESTAMP = MakeAtom(szAgentTIMESTAMP, strlen(szAgentTIMESTAMP), True); SAFE_free(lastSelectionOwner); - lastSelectionOwner = (SelectionOwner *) malloc(nxagentMaxSelections * sizeof(SelectionOwner)); if (lastSelectionOwner == NULL) @@ -2343,11 +2375,17 @@ Bool nxagentInitClipboard(WindowPtr pWin) initSelectionOwnerData(nxagentClipboardSelection, clientCLIPBOARD, nxagentAtoms[10]); /* CLIPBOARD */ SAFE_free(lastClients); - - lastClients = (lastClient *) malloc(nxagentMaxSelections * sizeof(lastClient)); + lastClients = (lastClient *) calloc(nxagentMaxSelections, sizeof(lastClient)); if (lastClients == NULL) { - FatalError("nxagentInitClipboard: Failed to allocate memory for the last client array.\n"); + FatalError("nxagentInitClipboard: Failed to allocate memory for the last clients array.\n"); + } + + SAFE_free(lastServers); + lastServers = (lastServer *) calloc(nxagentMaxSelections, sizeof(lastServer)); + if (lastServers == NULL) + { + FatalError("nxagentInitClipboard: Failed to allocate memory for the last servers array.\n"); } } else @@ -2455,7 +2493,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) } } } - /* FIXME: Shouldn't we reset lastServer* and lastClients[index].* here? */ + /* FIXME: Shouldn't we reset lastServers[index].* and lastClients[index].* here? */ } else { @@ -2463,12 +2501,11 @@ Bool nxagentInitClipboard(WindowPtr pWin) { clearSelectionOwnerData(index); resetClientSelectionStage(index); - /* FIXME: required? move to setSelctionStage? */ + /* FIXME: required? move to setSelectionStage? */ lastClients[index].reqTime = GetTimeInMillis(); + lastServers[index].requestor = None; } - lastServerRequestor = None; - clientCutProperty = MakeAtom(szAgentNX_CUT_BUFFER_CLIENT, strlen(szAgentNX_CUT_BUFFER_CLIENT), True); if (clientCutProperty == None) -- 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 3.6.x in repository nx-libs. commit d2370a1ba10faffeca51d78695e8c58f4715f06e Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Sep 23 16:36:42 2020 +0200 Clipboard.c: rename function to better reflect meaning Also improve Debug output. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 29 +++++++++++--------------- nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 4 ++-- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index fefb0286e..e53b454da 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1699,10 +1699,10 @@ static void resetSelectionOwnerOnXServer(void) clearSelectionOwnerData(index); setClientSelectionStage(SelectionStageNone, index); - } - /* Hmm, this is already None when reaching this */ - lastServers[index].requestor = None; + /* Hmm, this is already None when reaching this */ + lastServers[index].requestor = None; + } } #endif @@ -1848,7 +1848,8 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) setClientSelectionStage(SelectionStageNone, index); } - lastServers[index].requestor = None; + /* FIXME: commented because index is invalid here! */ + /* lastServers[index].requestor = None; */ /* FIXME @@ -2226,12 +2227,8 @@ XlibAtom translateLocalToRemoteTarget(Atom local) * selection. When there is an owner, it should be generated by the * owner of the selection by using XSendEvent()." */ -int nxagentSendNotify(xEvent *event) +int nxagentSendNotificationToSelfViaXServer(xEvent *event) { - #ifdef DEBUG - fprintf(stderr, "%s: Got called.\n", __func__); - #endif - if (!agentClipboardInitialized) { #ifdef DEBUG @@ -2241,13 +2238,11 @@ int nxagentSendNotify(xEvent *event) } #ifdef DEBUG - fprintf(stderr, "%s: property is [%d][%s].\n", __func__, - event->u.selectionNotify.property, - NameForAtom(event->u.selectionNotify.property)); - fprintf(stderr, "%s: selection is [%d][%s].\n", __func__, - event->u.selectionNotify.selection, - NameForAtom(event->u.selectionNotify.selection)); - fprintf(stderr, "%s: requestor is [0x%x].\n", __func__, event->u.selectionNotify.requestor); + fprintf(stderr, "%s: Received SendNotify by client: property [%d][%s] target [%d][%s] selection [%d][%s] requestor [0x%x] time [%u].\n", __func__, + event->u.selectionNotify.property, NameForAtom(event->u.selectionNotify.property), + event->u.selectionNotify.target, NameForAtom(event->u.selectionNotify.target), + event->u.selectionNotify.selection, NameForAtom(event->u.selectionNotify.selection), + event->u.selectionNotify.requestor, event->u.selectionNotify.time); #endif int index = nxagentFindCurrentSelectionIndex(event->u.selectionNotify.selection); @@ -2403,7 +2398,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) /* * Server side properties to hold pasted data. - * see nxagentSendNotify for an explanation + * see nxagentSendNotificationToSelfViaXServer for an explanation */ serverTransFromAgentProperty = nxagentAtoms[15]; /* NX_SELTRANS_FROM_AGENT */ serverTransToAgentProperty = nxagentAtoms[5]; /* NX_CUT_BUFFER_SERVER */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h index f902bb50b..aca8d94af 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h @@ -76,7 +76,7 @@ extern Bool nxagentCollectPropertyEventFromXServer(int resource); extern WindowPtr nxagentGetClipboardWindow(Atom property); -extern int nxagentSendNotify(xEvent *event); +extern int nxagentSendNotificationToSelfViaXServer(xEvent *event); extern void nxagentDumpClipboardStat(void); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index fccc718b0..50ecef09b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -433,8 +433,8 @@ ProcSendEvent(ClientPtr client) if (stuff -> event.u.u.type == SelectionNotify) { - if (nxagentSendNotify(&stuff->event) == 1) - return Success; + if (nxagentSendNotificationToSelfViaXServer(&stuff->event) == 1) + return Success; } #endif return xorg_ProcSendEvent(client); -- 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 3.6.x in repository nx-libs. commit 3682be5941c549c9fc215575d01261fae6c1fa63 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Sep 23 16:51:37 2020 +0200 Clipboard.c: mark self-initiated event --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index e53b454da..605716e9d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1439,6 +1439,11 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) char * p = XGetAtomName(nxagentDisplay, e->property); char * t = XGetAtomName(nxagentDisplay, e->target); char * s = XGetAtomName(nxagentDisplay, e->selection); + if (e->requestor == serverWindow) + { + fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; + } + fprintf(stderr, "%s: SelectionNotify event from real X server, property " \ "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", __func__, e->property, validateString(p), e->requestor, -- 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 3.6.x in repository nx-libs. commit 6753eb5928cf8a70317f0b1304bf4705309548ef Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Oct 11 18:03:53 2020 +0200 Clipboard.c: use for loops everywhere. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 74ed61d7f..cd3a890d0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -665,6 +665,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) * Only for PRIMARY and CLIPBOARD selections. */ + /* FIXME: there's almost identical code in nxagentClipboardInit */ for (int index = 0; index < nxagentMaxSelections; index++) { if (matchSelectionOwner(index, pClient, pWindow)) @@ -694,13 +695,14 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) */ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) { - int index = 0; - while (index < nxagentMaxSelections && - lastSelectionOwner[index].remSelection != sel) + for (int index = 0; index < nxagentMaxSelections; index++) { - index++; + if (lastSelectionOwner[index].remSelection == sel) + { + return index; + } } - return index; + return nxagentMaxSelections; } /* @@ -709,13 +711,14 @@ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) */ int nxagentFindCurrentSelectionIndex(Atom sel) { - int index = 0; - while (index < NumCurrentSelections && - CurrentSelections[index].selection != sel) + for (int index = 0; index < NumCurrentSelections; index++) { - index++; + if (CurrentSelections[index].selection == sel) + { + return index; + } } - return index; + return NumCurrentSelections; } /* -- 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 3.6.x in repository nx-libs. commit d32b4f5b1a55e0bbca79701d2b89bede331fed75 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Oct 3 01:57:58 2020 +0200 Clipboard.c: fix memleaks in DEBUG mode --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 202eb1baa..74ed61d7f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2136,10 +2136,16 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * by a real time. The reply also contains time "0" which is * unexpected (for me) */ #ifdef DEBUG + char *t = XGetAtomName(nxagentDisplay, remTarget); + char *p = XGetAtomName(nxagentDisplay, remProperty); + char *s = XGetAtomName(nxagentDisplay, remSelection); fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, - serverWindow, remTarget, XGetAtomName(nxagentDisplay, remTarget), - remProperty, XGetAtomName(nxagentDisplay, remProperty), - remSelection, XGetAtomName(nxagentDisplay, remSelection)); + serverWindow, remTarget, validateString(t), + remProperty, validateString(p), + remSelection, validateString(s)); + SAFE_XFree(t); + SAFE_XFree(p); + SAFE_XFree(s); #endif XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime); @@ -2193,8 +2199,10 @@ XlibAtom translateLocalToRemoteSelection(Atom local) } #ifdef DEBUG + char *r = XGetAtomName(nxagentDisplay, remote); fprintf(stderr, "%s: mapping local to remote selection: [%d][%s] -> [%ld] [%s]\n", __func__, - local, NameForAtom(local), remote, XGetAtomName(nxagentDisplay, remote)); + local, NameForAtom(local), remote, validateString(r)); + SAFE_XFree(r); #endif return remote; @@ -2235,8 +2243,10 @@ XlibAtom translateLocalToRemoteTarget(Atom local) } #ifdef DEBUG + char *r = XGetAtomName(nxagentDisplay, remote); fprintf(stderr, "%s: mapping local to remote target: [%d][%s] -> [%ld] [%s]\n", __func__, - local, NameForAtom(local), remote, XGetAtomName(nxagentDisplay, remote)); + local, NameForAtom(local), remote, validateString(r)); + SAFE_XFree(r); #endif return remote; -- 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 3.6.x in repository nx-libs. commit 278ebeb70d7183ba62c6bbbcfce08ff08e205117 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Oct 3 01:24:11 2020 +0200 Clipboard.c: split if clause this allows better error messages --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index da07cad40..202eb1baa 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1003,15 +1003,24 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) else #endif { + if (!(nxagentOption(Clipboard) == ClipboardServer || + nxagentOption(Clipboard) == ClipboardBoth)) + { + #ifdef DEBUG + fprintf (stderr, "%s: clipboard (partly) disabled - denying request.\n", __func__); + #endif + + /* deny the request */ + replyRequestSelectionToXServer(X, False); + } + /* * if one of our clients owns the selection we ask it to copy * the selection to the clientCutProperty on nxagent's root * window in the first step. We then later push that property's * content to the real X server. */ - if (IS_INTERNAL_OWNER(index) && - (nxagentOption(Clipboard) == ClipboardServer || - nxagentOption(Clipboard) == ClipboardBoth)) + if (IS_INTERNAL_OWNER(index)) { /* * store who on the real X server requested the data and how @@ -1061,9 +1070,18 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) x.u.selectionRequest.requestor, x.u.selectionRequest.selection, NameForAtom(x.u.selectionRequest.selection)); #endif + /* no reply to Xserver yet - we will do that once the answer of + the above sendEventToClient arrives */ } else { + #ifdef DEBUG + char *s = XGetAtomName(nxagentDisplay, X->xselectionrequest.selection); + fprintf (stderr, "%s: no internal owner for selection [%ld][%s] - denying request.\n", __func__, + X->xselectionrequest.selection, s); + SAFE_XFree(s); + #endif + /* deny the request */ replyRequestSelectionToXServer(X, 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 3.6.x in repository nx-libs. commit bf0e05fd166012b5fb38eb7533c27359b8d954f3 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Oct 12 20:12:28 2020 +0200 Clipboard.c: restructure request accumulation code --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 39 +++++++++++++++----------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index cd3a890d0..30b781590 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2080,27 +2080,32 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, return 1; } - if (lastClients[index].clientPtr == client && (GetTimeInMillis() - lastClients[index].reqTime < ACCUM_TIME)) + if (lastClients[index].clientPtr == client) { - /* - * The same client made consecutive requests of clipboard content - * with less than 5 seconds time interval between them. - */ - #ifdef DEBUG - fprintf(stderr, "%s: Consecutives request from client %s selection [%u] " - "elapsed time [%u] clientAccum [%d]\n", __func__, nxagentClientInfoString(client), - selection, GetTimeInMillis() - lastClients[index].reqTime, clientAccum); - #endif - - clientAccum++; + if (GetTimeInMillis() - lastClients[index].reqTime < ACCUM_TIME) + { + /* + * The same client made consecutive requests of clipboard content + * with less than 5 seconds time interval between them. + */ + #ifdef DEBUG + fprintf(stderr, "%s: Consecutives request from client %s selection [%u] " + "elapsed time [%u] clientAccum [%d]\n", __func__, + nxagentClientInfoString(client), + selection, GetTimeInMillis() - lastClients[index].reqTime, + clientAccum); + #endif + + clientAccum++; + } } else { - /* reset clientAccum as now another client requested the clipboard content */ - if (lastClients[index].clientPtr != client) - { - clientAccum = 0; - } + /* + * reset clientAccum as now another client requested the clipboard + * content + */ + clientAccum = 0; } if (target == clientTEXT || -- 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 3.6.x in repository nx-libs. commit bff23cb94bc2fc3befe8d375c761b7e96b16984c Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Oct 12 20:14:16 2020 +0200 Clipboard.c: rephrase FIXME --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 30b781590..3e396d2c4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2533,13 +2533,19 @@ Bool nxagentInitClipboard(WindowPtr pWin) * claim the ownership. Note that we report our serverWindow as * owner, not the real window! */ - if (IS_INTERNAL_OWNER(index) && lastSelectionOwner[index].window) - { - XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[index].remSelection, serverWindow, CurrentTime); - } + if (IS_INTERNAL_OWNER(index) && lastSelectionOwner[index].window) + { + /* remSelection has already be adjusted above */ + XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[index].remSelection, serverWindow, CurrentTime); + } + /* + * FIXME: Shouldn't we reset lastServers[index].* and + * lastClients[index].* here? Problem is that (internal) + * clients might still be waiting for answers. Should reply + * with failure then + */ } } - /* FIXME: Shouldn't we reset lastServers[index].* and lastClients[index].* here? */ } else { -- 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 3.6.x in repository nx-libs. commit 9d3683896885a43e693c0fd3c7165992633e5b7f Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Oct 12 21:09:31 2020 +0200 Clipboard.c: move selection Atoms into separate arrays They really only change on startup and reconnect. Also with this change we now only have internal Atoms in the LastSelectionOwner array. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 88 ++++++++++++++------------ 1 file changed, 49 insertions(+), 39 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 3e396d2c4..a92573f9d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -77,11 +77,13 @@ const int nxagentPrimarySelection = 0; const int nxagentClipboardSelection = 1; const int nxagentMaxSelections = 2; +/* store the remote atom for all selections */ +static XlibAtom *remSelAtoms = NULL; +static Atom *intSelAtoms = NULL; + typedef struct _SelectionOwner { ClientPtr client; /* internal client */ - Atom intSelection; /* internal Atom */ - XlibAtom remSelection; /* _external_ Atom */ Window window; /* internal window id */ WindowPtr windowPtr; /* internal window struct */ Time lastTimeChanged; /* internal time */ @@ -90,8 +92,7 @@ typedef struct _SelectionOwner /* * this contains the last selection owner in nxagent. The * lastTimeChanged is always an internal time. If .client is NULL the - * owner is outside nxagent. .selection will _always_ contain the - * external atom of the selection + * owner is outside nxagent. */ /* FIXME: these should also be stored per selection */ @@ -121,13 +122,12 @@ typedef struct _lastClient ClientPtr clientPtr; Window requestor; Atom property; - Atom intSelection; Atom target; Time time; Time reqTime; unsigned long propertySize; ClientSelectionStage stage; - int resource; /* nxcompext resource where collected proeprty data is stored */ + int resource; /* nxcompext resource where collected property data is stored */ } lastClient; static lastClient *lastClients; @@ -248,7 +248,7 @@ static void transferSelectionFromXServer(int resource, int index); #if 0 static void resetSelectionOwnerOnXServer(void); #endif -static void initSelectionOwnerData(int index, Atom intSelection, XlibAtom remSelection); +static void initSelectionOwnerData(int index); static void clearSelectionOwnerData(int index); static void storeSelectionOwnerData(int index, Selection *sel); static Bool matchSelectionOwner(int index, ClientPtr pClient, WindowPtr pWindow); @@ -282,6 +282,8 @@ static void printSelectionStat(int index) char *s = NULL; fprintf(stderr, " owner is inside nxagent? %s\n", IS_INTERNAL_OWNER(index) ? "yes" : "no"); + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, remSelAtoms[index]); + fprintf(stderr, " selection Atom internal [%d][%s] remote [%ld][%s]\n", intSelAtoms[index], NameForAtom(intSelAtoms[index]), remSelAtoms[index], s); fprintf(stderr, " lastSelectionOwner[].client %s\n", nxagentClientInfoString(lOwner.client)); fprintf(stderr, " lastSelectionOwner[].window [0x%x]\n", lOwner.window); if (lOwner.windowPtr) @@ -290,9 +292,6 @@ static void printSelectionStat(int index) fprintf(stderr, " lastSelectionOwner[].windowPtr -\n"); fprintf(stderr, " lastSelectionOwner[].lastTimeChanged [%u]\n", lOwner.lastTimeChanged); - fprintf(stderr, " lastSelectionOwner[].intSelection [% 4d][%s] (%s)\n", lOwner.intSelection, validateString(NameForAtom(lOwner.intSelection)), "inside nxagent"); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, lOwner.remSelection); - fprintf(stderr, " lastSelectionOwner[].remSelection [% 4ld][%s] (%s)\n", lOwner.remSelection, validateString(s), "remote X server"); SAFE_XFree(s); #ifdef CLIENTIDS fprintf(stderr, " CurrentSelections[].client [%p] index [%d] PID [%d] Cmd [%s]\n", @@ -319,7 +318,6 @@ static void printLastClientStat(int index) fprintf(stderr, " lastClients[].clientPtr (ClientPtr) %s\n", nxagentClientInfoString(lc.clientPtr)); fprintf(stderr, " lastClients[].requestor (Window) [0x%x]\n", lc.requestor); fprintf(stderr, " lastClients[].property (Atom) [% 4d][%s]\n", lc.property, NameForAtom(lc.property)); - fprintf(stderr, " lastClients[].intSelection (Atom) [% 4d][%s]\n", lc.intSelection, NameForAtom(lc.intSelection)); fprintf(stderr, " lastClients[].target (Atom) [% 4d][%s]\n", lc.target, NameForAtom(lc.target)); if (lc.time > 0) fprintf(stderr, " lastClients[].time (Time) [%u] ([%u]ms ago)\n", lc.time, GetTimeInMillis() - lc.time); @@ -427,9 +425,6 @@ static void resetClientSelectionStage(int index) lastClients[index].clientPtr = NULL; lastClients[index].requestor = 0; lastClients[index].property = 0; - /* NX_PRIMARY or clipboard atom */ - /* FIXME: we should only set the once on init and then never touch it again */ - lastClients[index].intSelection = lastSelectionOwner[index].intSelection; lastClients[index].target = 0; lastClients[index].time = 0; lastClients[index].reqTime = 0; @@ -615,10 +610,8 @@ static Bool validServerTargets(XlibAtom target) return False; } -static void initSelectionOwnerData(int index, Atom intSelection, XlibAtom remSelection) +static void initSelectionOwnerData(int index) { - lastSelectionOwner[index].intSelection = intSelection; - lastSelectionOwner[index].remSelection = remSelection; lastSelectionOwner[index].client = NullClient; lastSelectionOwner[index].window = screenInfo.screens[0]->root->drawable.id; lastSelectionOwner[index].windowPtr = NULL; @@ -697,7 +690,7 @@ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) { for (int index = 0; index < nxagentMaxSelections; index++) { - if (lastSelectionOwner[index].remSelection == sel) + if (remSelAtoms[index] == sel) { return index; } @@ -1120,7 +1113,7 @@ static void endTransfer(Bool success, int index) sendSelectionNotifyEventToClient(lastClients[index].clientPtr, lastClients[index].time, lastClients[index].requestor, - lastClients[index].intSelection, + intSelAtoms[index], lastClients[index].target, success == SELECTION_SUCCESS ? lastClients[index].property : None); } @@ -1486,10 +1479,11 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) { #ifdef DEBUG fprintf (stderr, "%s: lastClients[%d].intSelection [%d] selection [%d] .\n", - __func__, index, lastClients[index].intSelection, + __func__, index, intSelAtoms[index], nxagentRemoteToLocalAtom(e->selection)); #endif - if (lastClients[index].intSelection == nxagentRemoteToLocalAtom(e->selection)) + /* FIXME: take remSelAtoms[index]? */ + if (intSelAtoms[index] == nxagentRemoteToLocalAtom(e->selection)) { break; } @@ -1716,7 +1710,7 @@ static void resetSelectionOwnerOnXServer(void) for (int index = 0; index < nxagentMaxSelections; index++) { - XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[index].remSelection, serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, remSelAtoms[index], serverWindow, CurrentTime); #ifdef DEBUG fprintf(stderr, "%s: Reset selection state for selection [%d].\n", __func__, index); @@ -1871,7 +1865,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) * inform the real X server that our serverWindow is the * clipboard owner. */ - XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[index].remSelection, serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, remSelAtoms[index], serverWindow, CurrentTime); /* * The real owner window (inside nxagent) is stored in @@ -1981,7 +1975,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #endif #ifdef DEBUG - fprintf(stderr, "%s: lastClients[%d].intSelection [%d] - selection [%d]\n", __func__, index, lastClients[index].intSelection, selection); + fprintf(stderr, "%s: intSelAtoms[%d] [%d] - selection [%d]\n", __func__, index, intSelAtoms[index], selection); #endif if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) @@ -2124,7 +2118,6 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, lastClients[index].clientPtr = client; lastClients[index].time = time; lastClients[index].property = property; - lastClients[index].intSelection = selection; lastClients[index].target = target; /* if the last client request time is more than 5s ago update it. Why? */ if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) @@ -2186,7 +2179,7 @@ XlibAtom translateLocalToRemoteSelection(Atom local) /* * On the real server, the right CLIPBOARD atom is * XInternAtom(nxagentDisplay, "CLIPBOARD", 1), which is stored in - * lastSelectionOwner[nxagentClipboardSelection].remSelection. For + * remSelAtoms[nxagentClipboardSelection]. For * PRIMARY there's nothing to map because that is identical on all * X servers (defined in Xatom.h). */ @@ -2199,7 +2192,7 @@ XlibAtom translateLocalToRemoteSelection(Atom local) } else if (local == clientCLIPBOARD) { - remote = lastSelectionOwner[nxagentClipboardSelection].remSelection; + remote = remSelAtoms[nxagentClipboardSelection]; } else { @@ -2367,7 +2360,7 @@ WindowPtr nxagentGetClipboardWindow(Atom property) { #ifdef DEBUG fprintf(stderr, "%s: Returning last [%d] selection owner window [%p] (0x%x).\n", __func__, - lastSelectionOwner[index].intSelection, + intSelAtoms[index], (void *)lastSelectionOwner[index].windowPtr, WINDOWID(lastSelectionOwner[index].windowPtr)); #endif @@ -2417,8 +2410,8 @@ Bool nxagentInitClipboard(WindowPtr pWin) { FatalError("nxagentInitClipboard: Failed to allocate memory for the clipboard selections.\n"); } - initSelectionOwnerData(nxagentPrimarySelection, XA_PRIMARY, XA_PRIMARY); - initSelectionOwnerData(nxagentClipboardSelection, clientCLIPBOARD, nxagentAtoms[10]); /* CLIPBOARD */ + initSelectionOwnerData(nxagentPrimarySelection); + initSelectionOwnerData(nxagentClipboardSelection); SAFE_free(lastClients); lastClients = (lastClient *) calloc(nxagentMaxSelections, sizeof(lastClient)); @@ -2433,13 +2426,30 @@ Bool nxagentInitClipboard(WindowPtr pWin) { FatalError("nxagentInitClipboard: Failed to allocate memory for the last servers array.\n"); } + + SAFE_free(intSelAtoms); + intSelAtoms = (Atom *) calloc(nxagentMaxSelections, sizeof(Atom)); + if (intSelAtoms == NULL) + { + FatalError("nxagentInitClipboard: Failed to allocate memory for the internal selection Atoms array.\n"); + } + intSelAtoms[nxagentPrimarySelection] = XA_PRIMARY; + intSelAtoms[nxagentClipboardSelection] = clientCLIPBOARD; + + SAFE_free(remSelAtoms); + remSelAtoms = (XlibAtom *) calloc(nxagentMaxSelections, sizeof(XlibAtom)); + if (remSelAtoms == NULL) + { + FatalError("nxagentInitClipboard: Failed to allocate memory for the remote selection Atoms array.\n"); + } } - else - { - /* the clipboard selection atom might have changed on a new X - server. Primary is constant. */ - lastSelectionOwner[nxagentClipboardSelection].remSelection = nxagentAtoms[10]; /* CLIPBOARD */ - } + + /* + * the clipboard selection atom might have changed on a new X + * server. Primary is constant. + */ + remSelAtoms[nxagentPrimarySelection] = XA_PRIMARY; + remSelAtoms[nxagentClipboardSelection] = nxagentAtoms[10]; /* CLIPBOARD */ serverTARGETS = nxagentAtoms[6]; /* TARGETS */ serverTEXT = nxagentAtoms[7]; /* TEXT */ @@ -2487,7 +2497,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) for (int index = 0; index < nxagentMaxSelections; index++) { XFixesSelectSelectionInput(nxagentDisplay, serverWindow, - lastSelectionOwner[index].remSelection, + remSelAtoms[index], XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask); @@ -2535,8 +2545,8 @@ Bool nxagentInitClipboard(WindowPtr pWin) */ if (IS_INTERNAL_OWNER(index) && lastSelectionOwner[index].window) { - /* remSelection has already be adjusted above */ - XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[index].remSelection, serverWindow, CurrentTime); + /* remSelAtoms have already been adjusted above */ + XSetSelectionOwner(nxagentDisplay, remSelAtoms[index], serverWindow, CurrentTime); } /* * FIXME: Shouldn't we reset lastServers[index].* and -- 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 3.6.x in repository nx-libs. commit 59ee58ee79d948223e74c2a8a745565da95c64aa Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Oct 13 00:14:49 2020 +0200 Clipboard.c: drop clientCLIPBOARD read the value from the intSelAtoms array instead --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index a92573f9d..3d33cb931 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -152,7 +152,6 @@ static Atom clientTIMESTAMP; static Atom clientTEXT; static Atom clientCOMPOUND_TEXT; static Atom clientUTF8_STRING; -static Atom clientCLIPBOARD; static char szAgentTARGETS[] = "TARGETS"; static char szAgentTEXT[] = "TEXT"; @@ -1792,8 +1791,8 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, if (pCurSel->pWin != NULL && nxagentOption(Clipboard) != ClipboardNone && /* FIXME: shouldn't we also check for != ClipboardClient? */ - (pCurSel->selection == XA_PRIMARY || - pCurSel->selection == clientCLIPBOARD)) + (pCurSel->selection == intSelAtoms[nxagentPrimarySelection] || + pCurSel->selection == intSelAtoms[nxagentClipboardSelection])) { #ifdef DEBUG fprintf(stderr, "%s: calling setSelectionOwnerOnXServer\n", __func__); @@ -2181,20 +2180,22 @@ XlibAtom translateLocalToRemoteSelection(Atom local) * XInternAtom(nxagentDisplay, "CLIPBOARD", 1), which is stored in * remSelAtoms[nxagentClipboardSelection]. For * PRIMARY there's nothing to map because that is identical on all - * X servers (defined in Xatom.h). + * X servers (defined in Xatom.h). We do it anyway so we do not + * require a special treatment. */ - XlibAtom remote; + XlibAtom remote = -1; - if (local == XA_PRIMARY) - { - remote = XA_PRIMARY; - } - else if (local == clientCLIPBOARD) + for (int index = 0; index < nxagentMaxSelections; index++) { - remote = remSelAtoms[nxagentClipboardSelection]; + if (local == intSelAtoms[index]) + { + remote = remSelAtoms[index]; + break; + } } - else + + if (remote == -1) { remote = nxagentLocalToRemoteAtom(local); } @@ -2396,7 +2397,6 @@ Bool nxagentInitClipboard(WindowPtr pWin) { /* cannot move that down to others - we need it for * initSelectionOwnerData ! */ - clientCLIPBOARD = MakeAtom(szAgentCLIPBOARD, strlen(szAgentCLIPBOARD), True); clientTARGETS = MakeAtom(szAgentTARGETS, strlen(szAgentTARGETS), True); clientTEXT = MakeAtom(szAgentTEXT, strlen(szAgentTEXT), True); clientCOMPOUND_TEXT = MakeAtom(szAgentCOMPOUND_TEXT, strlen(szAgentCOMPOUND_TEXT), True); @@ -2434,7 +2434,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) FatalError("nxagentInitClipboard: Failed to allocate memory for the internal selection Atoms array.\n"); } intSelAtoms[nxagentPrimarySelection] = XA_PRIMARY; - intSelAtoms[nxagentClipboardSelection] = clientCLIPBOARD; + intSelAtoms[nxagentClipboardSelection] = MakeAtom(szAgentCLIPBOARD, strlen(szAgentCLIPBOARD), True); SAFE_free(remSelAtoms); remSelAtoms = (XlibAtom *) calloc(nxagentMaxSelections, sizeof(XlibAtom)); -- 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 3.6.x in repository nx-libs. commit 29413b32a2b9e7abacefe812f427366c6cc61210 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Oct 13 00:17:27 2020 +0200 Clipboard.c: fix comment position and init array pointer --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 3d33cb931..e316b9bbf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -95,8 +95,9 @@ typedef struct _SelectionOwner * owner is outside nxagent. */ -/* FIXME: these should also be stored per selection */ -static SelectionOwner *lastSelectionOwner; +static SelectionOwner *lastSelectionOwner = NULL; + +/* FIXME: can this also be stored per selection? */ static XlibAtom serverLastRequestedSelection; #define IS_INTERNAL_OWNER(lsoindex) (lastSelectionOwner[lsoindex].client != NULL) -- 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 3.6.x in repository nx-libs. commit a31353bdd2023cec7453b94438b98fac7e5fae6a Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Oct 13 00:18:32 2020 +0200 Clipboard.c: compact clipboard status output require less lines --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 93 +++++++++++++------------- 1 file changed, 48 insertions(+), 45 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index e316b9bbf..1aa2c050a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -281,29 +281,21 @@ static void printSelectionStat(int index) Selection curSel = CurrentSelections[index]; char *s = NULL; - fprintf(stderr, " owner is inside nxagent? %s\n", IS_INTERNAL_OWNER(index) ? "yes" : "no"); + fprintf(stderr, "selection [%d]:\n", index); + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, remSelAtoms[index]); fprintf(stderr, " selection Atom internal [%d][%s] remote [%ld][%s]\n", intSelAtoms[index], NameForAtom(intSelAtoms[index]), remSelAtoms[index], s); + fprintf(stderr, " owner side %s\n", IS_INTERNAL_OWNER(index) ? "nxagent" : "real X server/none"); fprintf(stderr, " lastSelectionOwner[].client %s\n", nxagentClientInfoString(lOwner.client)); fprintf(stderr, " lastSelectionOwner[].window [0x%x]\n", lOwner.window); if (lOwner.windowPtr) - fprintf(stderr, " lastSelectionOwner[].windowPtr [%p] ([0x%x]\n", (void *)lOwner.windowPtr, WINDOWID(lOwner.windowPtr)); + fprintf(stderr, " lastSelectionOwner[].windowPtr [%p] (-> [0x%x]\n", (void *)lOwner.windowPtr, WINDOWID(lOwner.windowPtr)); else fprintf(stderr, " lastSelectionOwner[].windowPtr -\n"); fprintf(stderr, " lastSelectionOwner[].lastTimeChanged [%u]\n", lOwner.lastTimeChanged); SAFE_XFree(s); -#ifdef CLIENTIDS - fprintf(stderr, " CurrentSelections[].client [%p] index [%d] PID [%d] Cmd [%s]\n", - (void *)curSel.client, - CLINDEX(curSel.client), - GetClientPid(curSel.client), - GetClientCmdName(curSel.client)); -#else - fprintf(stderr, " CurrentSelections[].client [%p] index [%d]\n", - (void *)curSel.client, - CLINDEX(curSel.client)); -#endif + fprintf(stderr, " CurrentSelections[].client %s\n", nxagentClientInfoString(curSel.client)); fprintf(stderr, " CurrentSelections[].window [0x%x]\n", curSel.window); return; } @@ -370,41 +362,52 @@ void nxagentDumpClipboardStat(void) } fprintf(stderr, "\n"); - fprintf(stderr, "PRIMARY\n"); - printSelectionStat(nxagentPrimarySelection); - printLastClientStat(nxagentPrimarySelection); - printLastServerStat(nxagentPrimarySelection); - fprintf(stderr, "CLIPBOARD\n"); - printSelectionStat(nxagentClipboardSelection); - printLastClientStat(nxagentClipboardSelection); - printLastServerStat(nxagentClipboardSelection); - - fprintf(stderr, "Atoms (remote X server)\n"); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverTARGETS); - fprintf(stderr, " serverTARGETS [% 4ld][%s]\n", serverTARGETS, validateString(s)); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverTIMESTAMP); - fprintf(stderr, " serverTIMESTAMP [% 4ld][%s]\n", serverTIMESTAMP, validateString(s)); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverTEXT); - fprintf(stderr, " serverTEXT [% 4ld][%s]\n", serverTEXT, validateString(s)); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverCOMPOUND_TEXT); - fprintf(stderr, " serverCOMPOUND_TEXT [% 4ld][%s]\n", serverCOMPOUND_TEXT, validateString(s)); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverUTF8_STRING); - fprintf(stderr, " serverUTF8_STRING [% 4ld][%s]\n", serverUTF8_STRING, validateString(s)); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverTransToAgentProperty); - fprintf(stderr, " serverTransToAgentProperty [% 4ld][%s]\n", serverTransFromAgentProperty, validateString(s)); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverTransFromAgentProperty); - fprintf(stderr, " serverTransFromAgentProperty [% 4ld][%s]\n", serverTransToAgentProperty, validateString(s)); SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverLastRequestedSelection); fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, validateString(s)); - fprintf(stderr, "Atoms (inside nxagent)\n"); - fprintf(stderr, " clientTARGETS [% 4d][%s]\n", clientTARGETS, NameForAtom(clientTARGETS)); - fprintf(stderr, " clientTIMESTAMP [% 4d][%s]\n", clientTIMESTAMP, NameForAtom(clientTIMESTAMP)); - fprintf(stderr, " clientTEXT [% 4d][%s]\n", clientTEXT, NameForAtom(clientTEXT)); - fprintf(stderr, " clientCOMPOUND_TEXT [% 4d][%s]\n", clientCOMPOUND_TEXT, NameForAtom(clientCOMPOUND_TEXT)); - fprintf(stderr, " clientUTF8_STRING [% 4d][%s]\n", clientUTF8_STRING, NameForAtom(clientUTF8_STRING)); - fprintf(stderr, " clientCLIPBOARD [% 4d][%s]\n", clientCLIPBOARD, NameForAtom(clientCLIPBOARD)); - fprintf(stderr, " clientCutProperty [% 4d][%s]\n", clientCutProperty, NameForAtom(clientCutProperty)); +#define WIDTH 32 + Atom cl = 0; + XlibAtom sv = 0; + int len = WIDTH; + + fprintf(stderr, "Atoms internal%*sremote\n", WIDTH - 8, ""); + cl = clientTARGETS; sv = serverTARGETS; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); + fprintf(stderr, " TARGETS [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(s)); + + cl = clientTIMESTAMP; sv = serverTIMESTAMP; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); + fprintf(stderr, " TIMESTAMP [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(s)); + + cl = clientTEXT; sv = serverTEXT; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); + fprintf(stderr, " TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(s)); + + cl = clientCOMPOUND_TEXT; sv = serverCOMPOUND_TEXT; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); + fprintf(stderr, " COMPOUND_TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(s)); + + cl = clientUTF8_STRING; sv = serverUTF8_STRING; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); + fprintf(stderr, " UTF8_STRING [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(s)); + + sv = serverTransToAgentProperty; + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); + fprintf(stderr, " serverTransToAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, validateString(s)); + + sv = serverTransFromAgentProperty; + SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); + fprintf(stderr, " serverTransFromAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, validateString(s)); + + cl = clientCutProperty; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); + fprintf(stderr, " clientCutProperty [% 4d][%s]%*s\n", cl, NameForAtom(cl), len + 2, "-" ); + + for (int index = 0; index < nxagentMaxSelections; index++) + { + printSelectionStat(index); + printLastClientStat(index); + printLastServerStat(index); + } fprintf(stderr, "\\------------------------------------------------------------------------------\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 3.6.x in repository nx-libs. commit 204bbef0431933dce9eb0b8d4074d723a9f7345b Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Oct 13 20:48:23 2020 +0200 Clipboard.c: make use of the new helpers from Atoms.c This saves us from having to create intermediate strings and Xfreeing them again. Which can easily be forgotten, producing memleaks. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 163 ++++++++----------------- 1 file changed, 50 insertions(+), 113 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 1aa2c050a..2d000a4f7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -279,12 +279,12 @@ static void printSelectionStat(int index) { SelectionOwner lOwner = lastSelectionOwner[index]; Selection curSel = CurrentSelections[index]; - char *s = NULL; fprintf(stderr, "selection [%d]:\n", index); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, remSelAtoms[index]); - fprintf(stderr, " selection Atom internal [%d][%s] remote [%ld][%s]\n", intSelAtoms[index], NameForAtom(intSelAtoms[index]), remSelAtoms[index], s); + fprintf(stderr, " selection Atom internal [%d][%s] remote [%ld][%s]\n", + intSelAtoms[index], NameForAtom(intSelAtoms[index]), + remSelAtoms[index], NameForRemAtom(remSelAtoms[index])); fprintf(stderr, " owner side %s\n", IS_INTERNAL_OWNER(index) ? "nxagent" : "real X server/none"); fprintf(stderr, " lastSelectionOwner[].client %s\n", nxagentClientInfoString(lOwner.client)); fprintf(stderr, " lastSelectionOwner[].window [0x%x]\n", lOwner.window); @@ -294,7 +294,6 @@ static void printSelectionStat(int index) fprintf(stderr, " lastSelectionOwner[].windowPtr -\n"); fprintf(stderr, " lastSelectionOwner[].lastTimeChanged [%u]\n", lOwner.lastTimeChanged); - SAFE_XFree(s); fprintf(stderr, " CurrentSelections[].client %s\n", nxagentClientInfoString(curSel.client)); fprintf(stderr, " CurrentSelections[].window [0x%x]\n", curSel.window); return; @@ -327,21 +326,14 @@ static void printLastClientStat(int index) static void printLastServerStat(int index) { lastServer ls = lastServers[index]; - char *s = NULL; - fprintf(stderr, " lastServer[].requestor (Window) [0x%x]\n", ls.requestor); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, ls.property); - fprintf(stderr, " lastServer[].property (Atom) [% 4ld][%s]\n", ls.property, validateString(s)); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, ls.target); - fprintf(stderr, " lastServer[].target (Atom) [% 4ld][%s]\n", ls.target, validateString(s)); + fprintf(stderr, " lastServer[].property (Atom) [% 4ld][%s]\n", ls.property, validateString(NameForRemAtom(ls.property))); + fprintf(stderr, " lastServer[].target (Atom) [% 4ld][%s]\n", ls.target, validateString(NameForRemAtom(ls.target))); fprintf(stderr, " lastServer[].time (Time) [%u]\n", ls.time); - SAFE_XFree(s); } void nxagentDumpClipboardStat(void) { - char *s = NULL; - fprintf(stderr, "/----- Clipboard internal status -----\n"); fprintf(stderr, " current time (Time) [%u]\n", GetTimeInMillis()); @@ -362,8 +354,7 @@ void nxagentDumpClipboardStat(void) } fprintf(stderr, "\n"); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, serverLastRequestedSelection); - fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, validateString(s)); + fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, validateString(NameForRemAtom(serverLastRequestedSelection))); #define WIDTH 32 Atom cl = 0; @@ -372,32 +363,25 @@ void nxagentDumpClipboardStat(void) fprintf(stderr, "Atoms internal%*sremote\n", WIDTH - 8, ""); cl = clientTARGETS; sv = serverTARGETS; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); - fprintf(stderr, " TARGETS [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(s)); + fprintf(stderr, " TARGETS [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(NameForRemAtom(sv))); cl = clientTIMESTAMP; sv = serverTIMESTAMP; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); - fprintf(stderr, " TIMESTAMP [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(s)); + fprintf(stderr, " TIMESTAMP [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(NameForRemAtom(sv))); cl = clientTEXT; sv = serverTEXT; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); - fprintf(stderr, " TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(s)); + fprintf(stderr, " TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(NameForRemAtom(sv))); cl = clientCOMPOUND_TEXT; sv = serverCOMPOUND_TEXT; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); - fprintf(stderr, " COMPOUND_TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(s)); + fprintf(stderr, " COMPOUND_TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(NameForRemAtom(sv))); cl = clientUTF8_STRING; sv = serverUTF8_STRING; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); - fprintf(stderr, " UTF8_STRING [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(s)); + fprintf(stderr, " UTF8_STRING [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(NameForRemAtom(sv))); sv = serverTransToAgentProperty; - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); - fprintf(stderr, " serverTransToAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, validateString(s)); + fprintf(stderr, " serverTransToAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, validateString(NameForRemAtom(sv))); sv = serverTransFromAgentProperty; - SAFE_XFree(s); s = XGetAtomName(nxagentDisplay, sv); - fprintf(stderr, " serverTransFromAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, validateString(s)); + fprintf(stderr, " serverTransFromAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, validateString(NameForRemAtom(sv))); cl = clientCutProperty; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); fprintf(stderr, " clientCutProperty [% 4d][%s]%*s\n", cl, NameForAtom(cl), len + 2, "-" ); @@ -410,8 +394,6 @@ void nxagentDumpClipboardStat(void) } fprintf(stderr, "\\------------------------------------------------------------------------------\n"); - - SAFE_XFree(s); } /* @@ -809,27 +791,17 @@ static void replyRequestSelectionToXServer(XEvent *X, Bool success) void nxagentHandleSelectionRequestFromXServer(XEvent *X) { #ifdef DEBUG + if (X->xselectionrequest.requestor == serverWindow) { - char *strTarget = XGetAtomName(nxagentDisplay, X->xselectionrequest.target); - char *strSelection = XGetAtomName(nxagentDisplay, X->xselectionrequest.selection); - char *strProperty = XGetAtomName(nxagentDisplay, X->xselectionrequest.property); - - if (X->xselectionrequest.requestor == serverWindow) - { - fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; - } - fprintf(stderr, "%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ - "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s]\n", - __func__, - X->xselectionrequest.selection, validateString(strSelection), - X->xselectionrequest.target, validateString(strTarget), - DisplayString(nxagentDisplay), X->xselectionrequest.requestor, - X->xselectionrequest.property, validateString(strProperty)); - - SAFE_XFree(strTarget); - SAFE_XFree(strSelection); - SAFE_XFree(strProperty); + fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; } + fprintf(stderr, "%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ + "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s]\n", + __func__, + X->xselectionrequest.selection, validateString(NameForRemAtom(X->xselectionrequest.selection)), + X->xselectionrequest.target, validateString(NameForRemAtom(X->xselectionrequest.target)), + DisplayString(nxagentDisplay), X->xselectionrequest.requestor, + X->xselectionrequest.property, validateString(NameForRemAtom(X->xselectionrequest.property)));; #endif if (!agentClipboardInitialized) @@ -894,9 +866,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) fprintf(stderr, "%s: Sending %d available targets:\n", __func__, numTargets); for (int i = 0; i < numTargets; i++) { - char *s = XGetAtomName(nxagentDisplay, targets[i]); - fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], s); - SAFE_XFree(s); + fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], NameForRemAtom(targets[i])); } fprintf(stderr, "\n"); #endif @@ -986,17 +956,11 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) serverWindow, lastClients[index].time); #ifdef DEBUG - char *strTarget = XGetAtomName(nxagentDisplay, X->xselectionrequest.target); - char *strSelection = XGetAtomName(nxagentDisplay, CurrentSelections[index].selection); - char *strProperty = XGetAtomName(nxagentDisplay, serverTransToAgentProperty); fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%x] time [%u] .\n", __func__, - CurrentSelections[index].selection, strSelection, - X->xselectionrequest.target, strTarget, - serverTransToAgentProperty, strProperty, + CurrentSelections[index].selection, NameForRemAtom(CurrentSelections[index].selection)), + X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target), + serverTransToAgentProperty, NameForRemAtom(serverTransToAgentProperty), serverWindow, lastClients[index].time); - SAFE_XFree(strTarget); - SAFE_XFree(strSelection); - SAFE_XFree(strProperty); #endif } else @@ -1075,10 +1039,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) else { #ifdef DEBUG - char *s = XGetAtomName(nxagentDisplay, X->xselectionrequest.selection); - fprintf (stderr, "%s: no internal owner for selection [%ld][%s] - denying request.\n", __func__, - X->xselectionrequest.selection, s); - SAFE_XFree(s); + fprintf(stderr, "%s: no internal owner for selection [%ld][%s] - denying request.\n", __func__, + X->xselectionrequest.selection, NameForRemAtom(X->xselectionrequest.selection)); #endif /* deny the request */ @@ -1456,24 +1418,15 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) #ifdef DEBUG XSelectionEvent * e = (XSelectionEvent *)X; + if (e->requestor == serverWindow) { - char * p = XGetAtomName(nxagentDisplay, e->property); - char * t = XGetAtomName(nxagentDisplay, e->target); - char * s = XGetAtomName(nxagentDisplay, e->selection); - if (e->requestor == serverWindow) - { - fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; - } - - fprintf(stderr, "%s: SelectionNotify event from real X server, property " \ - "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", - __func__, e->property, validateString(p), e->requestor, - validateString(s), e->target, - validateString(t), e->time, e->send_event); - SAFE_XFree(p); - SAFE_XFree(t); - SAFE_XFree(s); + fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; } + fprintf(stderr, "%s: SelectionNotify event from real X server, property " \ + "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", + __func__, e->property, validateString(NameForRemAtom(e->property)), e->requestor, + validateString(NameForRemAtom(e->selection)), e->target, + validateString(NameForRemAtom(e->target)), e->time, e->send_event); #endif /* determine the selection we are talking about here */ @@ -1552,10 +1505,8 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) else { #ifdef DEBUG - char *s = XGetAtomName(nxagentDisplay, X->xselection.property); fprintf(stderr, "%s: Unexpected property [%ld][%s] - reporting conversion failure.\n", - __func__, X->xselection.property, s); - SAFE_XFree(s); + __func__, X->xselection.property, validateString(NameForRemAtom(X->xselection.property))); #endif endTransfer(SELECTION_FAULT, index); } @@ -1633,18 +1584,14 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) ulReturnItems); #ifdef DEBUG - { - char *s = XGetAtomName(nxagentDisplay, lastServers[index].property); - fprintf(stderr, "%s: XChangeProperty sent to window [0x%x] for property [%ld][%s] value [\"%*.*s\"...]\n", - __func__, - lastServers[index].requestor, - lastServers[index].property, - s, - (int)(min(20, ulReturnItems * 8 / 8)), - (int)(min(20, ulReturnItems * 8 / 8)), - pszReturnData); - SAFE_XFree(s); - } + fprintf(stderr, "%s: XChangeProperty sent to window [0x%x] for property [%ld][%s] value [\"%*.*s\"...]\n", + __func__, + lastServers[index].requestor, + lastServers[index].property, + NameForRemAtom(lastServers[index].property), + (int)(min(20, ulReturnItems * 8 / 8)), + (int)(min(20, ulReturnItems * 8 / 8)), + pszReturnData); #endif } @@ -2140,16 +2087,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * by a real time. The reply also contains time "0" which is * unexpected (for me) */ #ifdef DEBUG - char *t = XGetAtomName(nxagentDisplay, remTarget); - char *p = XGetAtomName(nxagentDisplay, remProperty); - char *s = XGetAtomName(nxagentDisplay, remSelection); fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, - serverWindow, remTarget, validateString(t), - remProperty, validateString(p), - remSelection, validateString(s)); - SAFE_XFree(t); - SAFE_XFree(p); - SAFE_XFree(s); + serverWindow, remTarget, validateString(NameForRemAtom(remTarget)), + remProperty, validateString(NameForRemAtom(remProperty)), + remSelection, validateString(NameForRemAtom(remSelection))); #endif XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime); @@ -2205,10 +2146,8 @@ XlibAtom translateLocalToRemoteSelection(Atom local) } #ifdef DEBUG - char *r = XGetAtomName(nxagentDisplay, remote); fprintf(stderr, "%s: mapping local to remote selection: [%d][%s] -> [%ld] [%s]\n", __func__, - local, NameForAtom(local), remote, validateString(r)); - SAFE_XFree(r); + local, NameForAtom(local), remote, validateString(NameForRemAtom(remote))); #endif return remote; @@ -2249,10 +2188,8 @@ XlibAtom translateLocalToRemoteTarget(Atom local) } #ifdef DEBUG - char *r = XGetAtomName(nxagentDisplay, remote); fprintf(stderr, "%s: mapping local to remote target: [%d][%s] -> [%ld] [%s]\n", __func__, - local, NameForAtom(local), remote, validateString(r)); - SAFE_XFree(r); + local, NameForAtom(local), remote, validateString(NameForRemAtom(remote))); #endif return remote; @@ -2525,7 +2462,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) #ifdef TEST fprintf(stderr, "%s: setting the ownership of %s to %lx" " and registering for PropertyChangeMask events\n", __func__, - validateString(XGetAtomName(nxagentDisplay, nxagentAtoms[10])), serverWindow); + validateString(NameForRemAtom(nxagentAtoms[10])), serverWindow); #endif XSetSelectionOwner(nxagentDisplay, nxagentAtoms[10], serverWindow, CurrentTime); -- 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 3.6.x in repository nx-libs. commit 27ecb8959669207aaab2c8d5fae12e51b4708f57 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Oct 13 00:22:22 2020 +0200 Atoms.c: add helper to easily print Atom names in debugging --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 48 ++++++++++++++++++++++++++++++ nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 16 ++++++++-- 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index 2ddf87e55..d9ee678fa 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -750,6 +750,54 @@ XlibAtom nxagentLocalToRemoteAtom(Atom local) } } +/* + * This is mainly used to simplify debug prints. It returns + * the string for a remote atom or NULL if atom is unknown/invalid + * + * The string must NOT be freed by the caller. + */ +const char *nxagentRemoteAtomToString(XlibAtom remote) +{ + if (remote == None || remote == BAD_RESOURCE) + { + #ifdef DEBUG + fprintf(stderr, "%s: remote [%d] is None or BAD_RESOURCE\n", __func__, remote); + #endif + return NULL; + } + + /* no mapping required for built-in atoms */ + if (remote <= XA_LAST_PREDEFINED) + { + #ifdef DEBUG + fprintf(stderr, "%s: remote [%d] is <= XA_LAST_PREDEFINED [%d]\n", __func__, remote, XA_LAST_PREDEFINED); + #endif + + /* simply use the builtin string that is the same on every X server */ + return NameForAtom(remote); + } + + AtomMap *current = nxagentFindAtomByRemoteValue(remote); + if (current) + { + return current->string; + } + else + { + /* fill up the cache */ + Atom local = nxagentRemoteToLocalAtom(remote); + if (local != None) + { + current = nxagentFindAtomByRemoteValue(remote); + if (current) + { + return current->string; + } + } + } + return NULL; +} + Atom nxagentRemoteToLocalAtom(XlibAtom remote) { if (remote == None || remote == BAD_RESOURCE) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h index 9006b2253..8fe79883c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h @@ -71,12 +71,24 @@ void nxagentWMDetect(void); XlibAtom nxagentMakeAtom(char *, unsigned, Bool); /* - * Converts local atoms in remote atoms and viceversa. + * Converts local atoms to remote atoms and viceversa. */ Atom nxagentRemoteToLocalAtom(XlibAtom); XlibAtom nxagentLocalToRemoteAtom(Atom); -#endif +/* + * return the string belonging to an atom. String MUST NOT + * be freed by the caller! + */ +const char *nxagentRemoteAtomToString(XlibAtom remote); + +/* + * As nxagentRemoteAtomToString() is similar to NameForAtom() we + * supply a macro for calling it. + */ +#define NameForRemAtom(arg) nxagentRemoteAtomToString(arg) + +#endif /* XlibAtom */ #endif /* __Atoms_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 3.6.x in repository nx-libs. commit 9dd509c01020e2d4b05d4f963ff7eef00e4f9c42 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Oct 13 22:41:36 2020 +0200 Clipboard.c: fix: use XlibWindow instead of Window --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index e0ba9cf27..9a7e407db 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -71,7 +71,7 @@ static int clientAccum; XlibAtom serverTransToAgentProperty; Atom clientCutProperty; -static Window serverWindow; +static XlibWindow serverWindow; const int nxagentPrimarySelection = 0; const int nxagentClipboardSelection = 1; @@ -134,7 +134,7 @@ typedef struct _lastClient static lastClient *lastClients; typedef struct _lastServer { - Window requestor; + XlibWindow requestor; XlibAtom property; XlibAtom target; Time time; @@ -326,7 +326,7 @@ static void printLastClientStat(int index) static void printLastServerStat(int index) { lastServer ls = lastServers[index]; - fprintf(stderr, " lastServer[].requestor (Window) [0x%x]\n", ls.requestor); + fprintf(stderr, " lastServer[].requestor (XlibWindow) [0x%lx]\n", ls.requestor); fprintf(stderr, " lastServer[].property (XlibAtom) [% 4ld][%s]\n", ls.property, NameForRemAtom(ls.property)); fprintf(stderr, " lastServer[].target (XlibAtom) [% 4ld][%s]\n", ls.target, NameForRemAtom(ls.target)); fprintf(stderr, " lastServer[].time (Time) [%u]\n", ls.time); @@ -341,7 +341,7 @@ void nxagentDumpClipboardStat(void) fprintf(stderr, " clientAccum (int) [%d]\n", clientAccum); fprintf(stderr, " nxagentMaxSelections (int) [%d]\n", nxagentMaxSelections); fprintf(stderr, " NumCurrentSelections (int) [%d]\n", NumCurrentSelections); - fprintf(stderr, " serverWindow (Window) [0x%x]\n", serverWindow); + fprintf(stderr, " serverWindow (XlibWindow) [0x%lx]\n", serverWindow); fprintf(stderr, " Clipboard mode "); switch(nxagentOption(Clipboard)) @@ -458,7 +458,7 @@ int GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, long longL */ static Status sendSelectionNotifyEventToXServer(XSelectionEvent *event_to_send) { - Window w = event_to_send->requestor; + XlibWindow w = event_to_send->requestor; event_to_send->type = SelectionNotify; event_to_send->send_event = True; @@ -474,17 +474,17 @@ static Status sendSelectionNotifyEventToXServer(XSelectionEvent *event_to_send) */ if (result == 0) { - fprintf(stderr, "%s: XSendEvent to [0x%x] failed.\n", __func__, w); + fprintf(stderr, "%s: XSendEvent to [0x%lx] failed.\n", __func__, w); } else { if (result == BadValue || result == BadWindow) { - fprintf(stderr, "%s: WARNING! XSendEvent to [0x%x] failed: %s\n", __func__, w, getXErrorString(result)); + fprintf(stderr, "%s: WARNING! XSendEvent to [0x%lx] failed: %s\n", __func__, w, getXErrorString(result)); } else { - fprintf(stderr, "%s: XSendEvent() successfully sent to [0x%x]\n", __func__, w); + fprintf(stderr, "%s: XSendEvent() successfully sent to [0x%lx]\n", __func__, w); } } #endif @@ -825,7 +825,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } #ifdef DEBUG - fprintf(stderr, "%s: lastServers[%d].requestor [0x%x].\n", __func__, index, lastServers[index].requestor); + fprintf(stderr, "%s: lastServers[%d].requestor [0x%lx].\n", __func__, index, lastServers[index].requestor); #endif /* lastServers[index].requestor in non-NULL (= we are currently in the transfer phase) */ @@ -956,7 +956,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) serverWindow, lastClients[index].time); #ifdef DEBUG - fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%x] time [%u] .\n", __func__, + fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%lx] time [%u] .\n", __func__, CurrentSelections[index].selection, NameForRemAtom(CurrentSelections[index].selection)), X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target), serverTransToAgentProperty, NameForRemAtom(serverTransToAgentProperty), @@ -1582,7 +1582,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) ulReturnItems); #ifdef DEBUG - fprintf(stderr, "%s: XChangeProperty sent to window [0x%x] for property [%ld][%s] value [\"%*.*s\"...]\n", + fprintf(stderr, "%s: XChangeProperty sent to remote window [0x%lx] for property [%ld][%s] value [\"%*.*s\"...]\n", __func__, lastServers[index].requestor, lastServers[index].property, @@ -1776,7 +1776,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) } #ifdef DEBUG - fprintf(stderr, "%s: Setting selection owner to serverwindow ([0x%x]).\n", __func__, + fprintf(stderr, "%s: Setting selection owner to serverwindow ([0x%lx]).\n", __func__, serverWindow); #endif @@ -1789,7 +1789,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) nxagentClientInfoString(pSelection->client)); fprintf(stderr, "%s: lastSelectionOwner.window [0x%x] -> [0x%x]\n", __func__, lastSelectionOwner[index].window, pSelection->window); - fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%x])\n", __func__, + fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%lx] (serverWindow: [0x%lx])\n", __func__, (void *)lastSelectionOwner[index].windowPtr, (void *)pSelection->pWin, nxagentWindow(pSelection->pWin), serverWindow); fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%u]\n", __func__, @@ -1804,7 +1804,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) * real X server and nxagent's clients - let's not disturb * FIXME: by continuing after the warning were ARE disturbing! */ - fprintf (stderr, "%s: WARNING! lastServers[%d].requestor window [0x%x] already set.\n", + fprintf (stderr, "%s: WARNING! lastServers[%d].requestor window [0x%lx] already set.\n", __func__, index, lastServers[index].requestor); } #endif @@ -2084,7 +2084,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * by a real time. The reply also contains time "0" which is * unexpected (for me) */ #ifdef DEBUG - fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, + fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%lx] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, serverWindow, remTarget, NameForRemAtom(remTarget), remProperty, NameForRemAtom(remProperty), remSelection, NameForRemAtom(remSelection)); @@ -2239,7 +2239,7 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) } #ifdef DEBUG - fprintf(stderr, "%s: lastServers[index].requestor is [0x%x].\n", __func__, lastServers[index].requestor); + fprintf(stderr, "%s: lastServers[index].requestor is [0x%lx].\n", __func__, lastServers[index].requestor); #endif /* @@ -2412,7 +2412,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) } #ifdef TEST - fprintf(stderr, "%s: Setting owner of selection [%d][%s] to serverwindow [0x%x]\n", __func__, + fprintf(stderr, "%s: Setting owner of selection [%d][%s] to serverWindow [0x%lx]\n", __func__, (int) serverTransToAgentProperty, "NX_CUT_BUFFER_SERVER", serverWindow); #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 3.6.x in repository nx-libs. commit 87eb4236a9ecf9f7ea79b3bf9b3b72a162f4e807 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Oct 13 21:39:24 2020 +0200 Clipboard.c: fix type in status output --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 7fcf63a00..e0ba9cf27 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -327,8 +327,8 @@ static void printLastServerStat(int index) { lastServer ls = lastServers[index]; fprintf(stderr, " lastServer[].requestor (Window) [0x%x]\n", ls.requestor); - fprintf(stderr, " lastServer[].property (Atom) [% 4ld][%s]\n", ls.property, NameForRemAtom(ls.property)); - fprintf(stderr, " lastServer[].target (Atom) [% 4ld][%s]\n", ls.target, NameForRemAtom(ls.target)); + fprintf(stderr, " lastServer[].property (XlibAtom) [% 4ld][%s]\n", ls.property, NameForRemAtom(ls.property)); + fprintf(stderr, " lastServer[].target (XlibAtom) [% 4ld][%s]\n", ls.target, NameForRemAtom(ls.target)); fprintf(stderr, " lastServer[].time (Time) [%u]\n", ls.time); } -- 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 3.6.x in repository nx-libs. commit eba654ea77de62c4de288e5eb3eacaf0b2b938b4 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Sep 23 23:25:04 2020 +0200 Clipboard.c: target forwarding (Part 1/2) Clients on the real X server requesting the available targets for a selection will no longer get a predefined list but a the list of targets from the owning internal client. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 298 ++++++++++--------------- 1 file changed, 118 insertions(+), 180 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 9a7e407db..56cbf5eef 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -239,7 +239,6 @@ XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, False }; extern Display *nxagentDisplay; -static Bool validServerTargets(XlibAtom target); static void setClientSelectionStage(int stage, int index); static void endTransfer(Bool success, int index); #define SELECTION_SUCCESS True @@ -538,63 +537,6 @@ static void sendSelectionNotifyEventToClient(ClientPtr client, sendEventToClient(client, &x); } -/* - * Check if target is a valid content type target sent by the real X - * server, like .e.g XA_STRING or UTF8_STRING. Other, non content type - * targets like "TARGETS" or "TIMESTAMP" will return false. - */ -static Bool validServerTargets(XlibAtom target) -{ - if (target == XA_STRING) - { - #ifdef DEBUG - fprintf(stderr, "%s: valid target [XA_STRING].\n", __func__); - #endif - return True; - } - else if (target == serverTEXT) - { - #ifdef DEBUG - fprintf(stderr, "%s: valid target [TEXT].\n", __func__); - #endif - return True; - } - /* by dimbor */ - else if (target == serverUTF8_STRING) - { - #ifdef DEBUG - fprintf(stderr, "%s: valid target [UTF8_STRING].\n", __func__); - #endif - return True; - } - else if (target == serverCOMPOUND_TEXT) - { - #ifdef DEBUG - fprintf(stderr, "%s: valid target [COMPOUND_TEXT].\n", __func__); - #endif - return True; - } - else if (target == serverTARGETS) - { - #ifdef DEBUG - fprintf(stderr, "%s: special target [TARGETS].\n", __func__); - #endif - return False; - } - else if (target == serverTIMESTAMP) - { - #ifdef DEBUG - fprintf(stderr, "%s: special target [TIMESTAMP].\n", __func__); - #endif - return False; - } - - #ifdef DEBUG - fprintf(stderr, "%s: invalid target [%lu].\n", __func__, target); - #endif - return False; -} - static void initSelectionOwnerData(int index) { lastSelectionOwner[index].client = NullClient; @@ -839,93 +781,39 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) return; } - /* this is a special request like TARGETS or TIMESTAMP */ - if (!validServerTargets(X->xselectionrequest.target)) + if (X->xselectionrequest.target == serverTIMESTAMP) { - if (X->xselectionrequest.target == serverTARGETS) - { - /* - * the selection request target is TARGETS. The requestor is - * asking for a list of supported data formats. - * - * The selection does not matter here, we will return this for - * PRIMARY and CLIPBOARD. - * - * The list is aligned with the one in nxagentConvertSelection. - * - * FIXME: the perfect solution should not just answer with a - * hardcoded list but ask the real owner what format it - * supports. The result should then be sent to the original - * requestor. - */ - - long targets[] = {XA_STRING, serverUTF8_STRING, serverTEXT, serverCOMPOUND_TEXT, serverTARGETS, serverTIMESTAMP}; - int numTargets = sizeof(targets) / sizeof(targets[0]); - - #ifdef DEBUG - fprintf(stderr, "%s: Sending %d available targets:\n", __func__, numTargets); - for (int i = 0; i < numTargets; i++) - { - fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], NameForRemAtom(targets[i])); - } - fprintf(stderr, "\n"); - #endif - - /* - * pass on the requested list by setting the property provided - * by the requestor accordingly. - */ - XChangeProperty(nxagentDisplay, - X->xselectionrequest.requestor, - X->xselectionrequest.property, - XInternAtom(nxagentDisplay, "ATOM", 0), - 32, - PropModeReplace, - (unsigned char*)&targets, - numTargets); - - replyRequestSelectionToXServer(X, True); - } - else if (X->xselectionrequest.target == serverTIMESTAMP) - { - /* - * Section 2.6.2 of the ICCCM states: - * TIMESTAMP - To avoid some race conditions, it is important - * that requestors be able to discover the timestamp the owner - * used to acquire ownership. Until and unless the protocol is - * changed so that a GetSelectionOwner request returns the - * timestamp used to acquire ownership, selection owners must - * support conversion to TIMESTAMP, returning the timestamp they - * used to obtain the selection. - * - * FIXME: ensure we are reporting an _external_ timestamp - * FIXME: for a 32 bit property list we need to pass a "long" array, not "char"! - * FIXME: selection has already been checked above, so we do not need to check again here - */ + /* + * Section 2.6.2 of the ICCCM states: + * TIMESTAMP - To avoid some race conditions, it is important + * that requestors be able to discover the timestamp the owner + * used to acquire ownership. Until and unless the protocol is + * changed so that a GetSelectionOwner request returns the + * timestamp used to acquire ownership, selection owners must + * support conversion to TIMESTAMP, returning the timestamp they + * used to obtain the selection. + * + * FIXME: ensure we are reporting an _external_ timestamp + * FIXME: for a 32 bit property list we need to pass a "long" array, not "char"! + * FIXME: selection has already been checked above, so we do not need to check again here + */ - XChangeProperty(nxagentDisplay, - X->xselectionrequest.requestor, - X->xselectionrequest.property, - XA_INTEGER, - 32, - PropModeReplace, - (unsigned char *) &lastSelectionOwner[index].lastTimeChanged, - 1); - replyRequestSelectionToXServer(X, True); - } - else - { - /* - * unknown special request - probably bug! Check if this code handles all cases - * that are handled in validServerTargets! - */ - #ifdef DEBUG - fprintf(stderr, "%s: unknown special target [%ld] - denying request.\n", __func__, X->xselectionrequest.target); - #endif - replyRequestSelectionToXServer(X, False); - } + XChangeProperty(nxagentDisplay, + X->xselectionrequest.requestor, + X->xselectionrequest.property, + XA_INTEGER, + 32, + PropModeReplace, + (unsigned char *) &lastSelectionOwner[index].lastTimeChanged, + 1); + replyRequestSelectionToXServer(X, True); return; } + else + { + fprintf(stderr, "%s: target [%ld][%s].\n", __func__, X->xselectionrequest.target, + XGetAtomName(nxagentDisplay, X->xselectionrequest.target)); + } /* * reaching this means the request is a normal, valid request. We @@ -994,10 +882,6 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) lastServers[index].target = X->xselectionrequest.target; lastServers[index].time = X->xselectionrequest.time; - /* by dimbor */ - if (lastServers[index].target != XA_STRING) - lastServers[index].target = serverUTF8_STRING; - /* prepare the request (like XConvertSelection, but internally) */ xEvent x = {0}; x.u.u.type = SelectionRequest; @@ -1015,12 +899,6 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * x.u.selectionRequest.requestor = lastSelectionOwner[index].window; */ - /* by dimbor (idea from zahvatov) */ - if (X->xselectionrequest.target != XA_STRING) - x.u.selectionRequest.target = clientUTF8_STRING; - else - x.u.selectionRequest.target = XA_STRING; - x.u.selectionRequest.target = nxagentRemoteToLocalAtom(X->xselectionrequest.target); sendEventToClient(lastSelectionOwner[index].client, &x); @@ -1568,35 +1446,89 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) } else { - /* Fill the property on the initial requestor with the requested data */ - /* The XChangeProperty source code reveals it will always - return 1, no matter what, so no need to check the result */ - /* FIXME: better use the format returned by above request */ - XChangeProperty(nxagentDisplay, - lastServers[index].requestor, - lastServers[index].property, - lastServers[index].target, - 8, - PropModeReplace, - pszReturnData, - ulReturnItems); - - #ifdef DEBUG - fprintf(stderr, "%s: XChangeProperty sent to remote window [0x%lx] for property [%ld][%s] value [\"%*.*s\"...]\n", - __func__, - lastServers[index].requestor, - lastServers[index].property, - NameForRemAtom(lastServers[index].property), - (int)(min(20, ulReturnItems * 8 / 8)), - (int)(min(20, ulReturnItems * 8 / 8)), - pszReturnData); - #endif + if (lastServers[index].target == serverTARGETS) + { + #ifdef DEBUG + fprintf(stderr, "%s: ulReturnItems [%ld]\n", __func__, ulReturnItems); + fprintf(stderr, "%s: resultformat [%d]\n", __func__, resultFormat); + #endif + + XlibAtom * targets = calloc(sizeof(XlibAtom), ulReturnItems); + if (targets == NULL) + { + #ifdef WARNING + fprintf(stderr, "%s: WARNING! Could not alloc memory for clipboard targets transmission.\n", __func__); + #endif + /* this will effectively lead to the request being answered as failed */ + lastServers[index].property = None; + } + else + { + /* Convert the targets to remote atoms */ + XlibAtom *addr = targets; + unsigned int numTargets = ulReturnItems; + + for (int i = 0; i < numTargets; i++) + { + Atom local = *((Atom*)(pszReturnData + i*resultFormat/8)); + XlibAtom remote = nxagentLocalToRemoteAtom(local); + *(addr++) = remote; + + #ifdef DEBUG + char *s = XGetAtomName(nxagentDisplay, remote); + fprintf(stderr, "%s: converting atom: local [%d][%s] -> remote [%ld][%s]\n", __func__,local, NameForAtom(local), remote, s); + SAFE_XFree(s); + #endif + } + + /* FIXME: do we need to take care of swapping byte order here? */ + XChangeProperty(nxagentDisplay, + lastServers[index].requestor, + lastServers[index].property, + XInternAtom(nxagentDisplay, "ATOM", 0), + 32, + PropModeReplace, + (unsigned char*)targets, + numTargets); + + SAFE_free(targets); + } + } + else + { + /* Fill the property on the initial requestor with the requested data */ + /* The XChangeProperty source code reveals it will always + return 1, no matter what, so no need to check the result */ + /* FIXME: better use the format returned by above request */ + XChangeProperty(nxagentDisplay, + lastServers[index].requestor, + lastServers[index].property, + lastServers[index].target, + 8, + PropModeReplace, + pszReturnData, + ulReturnItems); + #ifdef DEBUG + { + char *s = XGetAtomName(nxagentDisplay, lastServers[index].property); + fprintf(stderr, "%s: XChangeProperty sent to window [0x%x] for property [%ld][%s] value [\"%*.*s\"...]\n", + __func__, + lastServers[index].requestor, + lastServers[index].property, + s, + (int)(min(20, ulReturnItems * 8 / 8)), + (int)(min(20, ulReturnItems * 8 / 8)), + pszReturnData); + SAFE_XFree(s); + } + #endif + } + + /* FIXME: free it or not? */ + /* + * SAFE_XFree(pszReturnData); + */ } - - /* FIXME: free it or not? */ - /* - * SAFE_XFree(pszReturnData); - */ } /* @@ -1656,6 +1588,7 @@ static void resetSelectionOwnerOnXServer(void) * Only for PRIMARY and CLIPBOARD selections. */ + for (int index = 0; index < nxagentMaxSelections; index++) { XSetSelectionOwner(nxagentDisplay, remSelAtoms[index], serverWindow, CurrentTime); @@ -2179,9 +2112,13 @@ XlibAtom translateLocalToRemoteTarget(Atom local) remote = serverCOMPOUND_TEXT; } #endif + else if (local == clientTARGETS) + { + remote = serverTARGETS; + } else { - remote = XA_STRING; + remote = nxagentLocalToRemoteAtom(local); } #ifdef DEBUG @@ -2411,6 +2348,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) return False; } + /* this is probably to communicate with nomachine nxclient */ #ifdef TEST fprintf(stderr, "%s: Setting owner of selection [%d][%s] to serverWindow [0x%lx]\n", __func__, (int) serverTransToAgentProperty, "NX_CUT_BUFFER_SERVER", serverWindow); -- 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 3.6.x in repository nx-libs. commit a470de00099d3b8f44797cec29cc5ce95eec4f33 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Oct 13 20:57:14 2020 +0200 Atoms.c: ensure to always return a valid string... ... by providing NameFor(Int|Rem)Atom() macros This way we do not have to validate it at various other places. --- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 6 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 99 +++++++++++++------------- 2 files changed, 52 insertions(+), 53 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h index 8fe79883c..4dcdf7055 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h @@ -84,10 +84,10 @@ XlibAtom nxagentLocalToRemoteAtom(Atom); const char *nxagentRemoteAtomToString(XlibAtom remote); /* - * As nxagentRemoteAtomToString() is similar to NameForAtom() we - * supply a macro for calling it. + * supply two macros that also validate the output. */ -#define NameForRemAtom(arg) nxagentRemoteAtomToString(arg) +#define NameForIntAtom(_atom) validateString(NameForAtom(_atom)) +#define NameForRemAtom(_xlibatom) validateString(nxagentRemoteAtomToString(_xlibatom)) #endif /* XlibAtom */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 2d000a4f7..f430a01d1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -283,7 +283,7 @@ static void printSelectionStat(int index) fprintf(stderr, "selection [%d]:\n", index); fprintf(stderr, " selection Atom internal [%d][%s] remote [%ld][%s]\n", - intSelAtoms[index], NameForAtom(intSelAtoms[index]), + intSelAtoms[index], NameForIntAtom(intSelAtoms[index]), remSelAtoms[index], NameForRemAtom(remSelAtoms[index])); fprintf(stderr, " owner side %s\n", IS_INTERNAL_OWNER(index) ? "nxagent" : "real X server/none"); fprintf(stderr, " lastSelectionOwner[].client %s\n", nxagentClientInfoString(lOwner.client)); @@ -308,8 +308,8 @@ static void printLastClientStat(int index) fprintf(stderr, " lastClients[].windowPtr (WindowPtr) -\n"); fprintf(stderr, " lastClients[].clientPtr (ClientPtr) %s\n", nxagentClientInfoString(lc.clientPtr)); fprintf(stderr, " lastClients[].requestor (Window) [0x%x]\n", lc.requestor); - fprintf(stderr, " lastClients[].property (Atom) [% 4d][%s]\n", lc.property, NameForAtom(lc.property)); - fprintf(stderr, " lastClients[].target (Atom) [% 4d][%s]\n", lc.target, NameForAtom(lc.target)); + fprintf(stderr, " lastClients[].property (Atom) [% 4d][%s]\n", lc.property, NameForIntAtom(lc.property)); + fprintf(stderr, " lastClients[].target (Atom) [% 4d][%s]\n", lc.target, NameForIntAtom(lc.target)); if (lc.time > 0) fprintf(stderr, " lastClients[].time (Time) [%u] ([%u]ms ago)\n", lc.time, GetTimeInMillis() - lc.time); else @@ -327,8 +327,8 @@ static void printLastServerStat(int index) { lastServer ls = lastServers[index]; fprintf(stderr, " lastServer[].requestor (Window) [0x%x]\n", ls.requestor); - fprintf(stderr, " lastServer[].property (Atom) [% 4ld][%s]\n", ls.property, validateString(NameForRemAtom(ls.property))); - fprintf(stderr, " lastServer[].target (Atom) [% 4ld][%s]\n", ls.target, validateString(NameForRemAtom(ls.target))); + fprintf(stderr, " lastServer[].property (Atom) [% 4ld][%s]\n", ls.property, NameForRemAtom(ls.property)); + fprintf(stderr, " lastServer[].target (Atom) [% 4ld][%s]\n", ls.target, NameForRemAtom(ls.target)); fprintf(stderr, " lastServer[].time (Time) [%u]\n", ls.time); } @@ -354,7 +354,7 @@ void nxagentDumpClipboardStat(void) } fprintf(stderr, "\n"); - fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, validateString(NameForRemAtom(serverLastRequestedSelection))); + fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, NameForRemAtom(serverLastRequestedSelection)); #define WIDTH 32 Atom cl = 0; @@ -362,29 +362,29 @@ void nxagentDumpClipboardStat(void) int len = WIDTH; fprintf(stderr, "Atoms internal%*sremote\n", WIDTH - 8, ""); - cl = clientTARGETS; sv = serverTARGETS; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - fprintf(stderr, " TARGETS [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(NameForRemAtom(sv))); + cl = clientTARGETS; sv = serverTARGETS; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); + fprintf(stderr, " TARGETS [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); - cl = clientTIMESTAMP; sv = serverTIMESTAMP; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - fprintf(stderr, " TIMESTAMP [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(NameForRemAtom(sv))); + cl = clientTIMESTAMP; sv = serverTIMESTAMP; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); + fprintf(stderr, " TIMESTAMP [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); - cl = clientTEXT; sv = serverTEXT; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - fprintf(stderr, " TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(NameForRemAtom(sv))); + cl = clientTEXT; sv = serverTEXT; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); + fprintf(stderr, " TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); - cl = clientCOMPOUND_TEXT; sv = serverCOMPOUND_TEXT; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - fprintf(stderr, " COMPOUND_TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(NameForRemAtom(sv))); + cl = clientCOMPOUND_TEXT; sv = serverCOMPOUND_TEXT; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); + fprintf(stderr, " COMPOUND_TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); - cl = clientUTF8_STRING; sv = serverUTF8_STRING; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - fprintf(stderr, " UTF8_STRING [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForAtom(cl), len, "", sv, validateString(NameForRemAtom(sv))); + cl = clientUTF8_STRING; sv = serverUTF8_STRING; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); + fprintf(stderr, " UTF8_STRING [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); sv = serverTransToAgentProperty; - fprintf(stderr, " serverTransToAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, validateString(NameForRemAtom(sv))); + fprintf(stderr, " serverTransToAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, NameForRemAtom(sv)); sv = serverTransFromAgentProperty; - fprintf(stderr, " serverTransFromAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, validateString(NameForRemAtom(sv))); + fprintf(stderr, " serverTransFromAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, NameForRemAtom(sv)); - cl = clientCutProperty; len = (int)(WIDTH - 9 - strlen(NameForAtom(cl))); - fprintf(stderr, " clientCutProperty [% 4d][%s]%*s\n", cl, NameForAtom(cl), len + 2, "-" ); + cl = clientCutProperty; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); + fprintf(stderr, " clientCutProperty [% 4d][%s]%*s\n", cl, NameForIntAtom(cl), len + 2, "-" ); for (int index = 0; index < nxagentMaxSelections; index++) { @@ -798,10 +798,10 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) fprintf(stderr, "%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s]\n", __func__, - X->xselectionrequest.selection, validateString(NameForRemAtom(X->xselectionrequest.selection)), - X->xselectionrequest.target, validateString(NameForRemAtom(X->xselectionrequest.target)), + X->xselectionrequest.selection, NameForRemAtom(X->xselectionrequest.selection), + X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target), DisplayString(nxagentDisplay), X->xselectionrequest.requestor, - X->xselectionrequest.property, validateString(NameForRemAtom(X->xselectionrequest.property)));; + X->xselectionrequest.property, NameForRemAtom(X->xselectionrequest.property)); #endif if (!agentClipboardInitialized) @@ -1028,10 +1028,10 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) fprintf(stderr, "%s: sent SelectionRequest event to client %s property [%d][%s] " \ "target [%d][%s] requestor [0x%x] selection [%d][%s].\n", __func__, nxagentClientInfoString(lastSelectionOwner[index].client), - x.u.selectionRequest.property, NameForAtom(x.u.selectionRequest.property), - x.u.selectionRequest.target, NameForAtom(x.u.selectionRequest.target), + x.u.selectionRequest.property, NameForIntAtom(x.u.selectionRequest.property), + x.u.selectionRequest.target, NameForIntAtom(x.u.selectionRequest.target), x.u.selectionRequest.requestor, - x.u.selectionRequest.selection, NameForAtom(x.u.selectionRequest.selection)); + x.u.selectionRequest.selection, NameForIntAtom(x.u.selectionRequest.selection)); #endif /* no reply to Xserver yet - we will do that once the answer of the above sendEventToClient arrives */ @@ -1069,7 +1069,7 @@ static void endTransfer(Bool success, int index) #ifdef DEBUG if (success == SELECTION_SUCCESS) fprintf(stderr, "%s: sending notification to client %s, property [%d][%s]\n", __func__, - nxagentClientInfoString(lastClients[index].clientPtr), lastClients[index].property, NameForAtom(lastClients[index].property)); + nxagentClientInfoString(lastClients[index].clientPtr), lastClients[index].property, NameForIntAtom(lastClients[index].property)); else fprintf(stderr, "%s: sending negative notification to client %s\n", __func__, nxagentClientInfoString(lastClients[index].clientPtr)); @@ -1375,7 +1375,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) #ifdef DEBUG fprintf(stderr, "%s: Selection property [%d][%s] changed to [\"%*.*s\"...]\n", __func__, lastClients[index].property, - validateString(NameForAtom(lastClients[index].property)), + NameForIntAtom(lastClients[index].property), (int)(min(20, ulReturnItems * resultFormat / 8)), (int)(min(20, ulReturnItems * resultFormat / 8)), pszReturnData); @@ -1424,9 +1424,9 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) } fprintf(stderr, "%s: SelectionNotify event from real X server, property " \ "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", - __func__, e->property, validateString(NameForRemAtom(e->property)), e->requestor, - validateString(NameForRemAtom(e->selection)), e->target, - validateString(NameForRemAtom(e->target)), e->time, e->send_event); + __func__, e->property, NameForRemAtom(e->property), e->requestor, + NameForRemAtom(e->selection), e->target, + NameForRemAtom(e->target), e->time, e->send_event); #endif /* determine the selection we are talking about here */ @@ -1506,7 +1506,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) { #ifdef DEBUG fprintf(stderr, "%s: Unexpected property [%ld][%s] - reporting conversion failure.\n", - __func__, X->xselection.property, validateString(NameForRemAtom(X->xselection.property))); + __func__, X->xselection.property, NameForRemAtom(X->xselection.property)); #endif endTransfer(SELECTION_FAULT, index); } @@ -1737,7 +1737,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, { #ifdef DEBUG fprintf(stderr, "%s: pCurSel->pWin [0x%x]\n", __func__, WINDOWID(pCurSel->pWin)); - fprintf(stderr, "%s: pCurSel->selection [%s]\n", __func__, NameForAtom(pCurSel->selection)); + fprintf(stderr, "%s: pCurSel->selection [%s]\n", __func__, NameForIntAtom(pCurSel->selection)); #endif if (pCurSel->pWin != NULL && @@ -1861,17 +1861,16 @@ FIXME int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, Window requestor, Atom property, Atom target, Time time) { - const char *strTarget = NameForAtom(target); - #ifdef DEBUG fprintf(stderr, "%s: client %s requests sel [%s] " "on window [0x%x] prop [%d][%s] target [%d][%s].\n", __func__, - nxagentClientInfoString(client), validateString(NameForAtom(selection)), requestor, - property, validateString(NameForAtom(property)), - target, validateString(strTarget)); + nxagentClientInfoString(client), NameForIntAtom(selection), requestor, + property, NameForIntAtom(property), + target, NameForIntAtom(target)); #endif - if (strTarget == NULL) + /* cannot use NameForIntAtom() here! */ + if (NameForAtom(target) == NULL) { #ifdef DEBUG fprintf(stderr, "%s: cannot find name for target Atom [%d] - returning\n", __func__, target); @@ -1975,7 +1974,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #ifdef DEBUG fprintf(stderr, "%s: available targets [%d]:\n", __func__, numTargets); for (int j = 0; j < numTargets; j++) - fprintf(stderr, "%s: %s\n", __func__, NameForAtom(targets[j])); + fprintf(stderr, "%s: %s\n", __func__, NameForIntAtom(targets[j])); fprintf(stderr, "\n"); #endif @@ -2079,7 +2078,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #ifdef DEBUG fprintf(stderr, "%s: replacing local by remote property: [%d][%s] -> [%ld][%s]\n", - __func__, property, NameForAtom(property), + __func__, property, NameForIntAtom(property), remProperty, "NX_CUT_BUFFER_SERVER"); #endif @@ -2088,9 +2087,9 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * unexpected (for me) */ #ifdef DEBUG fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, - serverWindow, remTarget, validateString(NameForRemAtom(remTarget)), - remProperty, validateString(NameForRemAtom(remProperty)), - remSelection, validateString(NameForRemAtom(remSelection))); + serverWindow, remTarget, NameForRemAtom(remTarget), + remProperty, NameForRemAtom(remProperty), + remSelection, NameForRemAtom(remSelection)); #endif XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime); @@ -2108,7 +2107,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, /* deny request */ #ifdef DEBUG fprintf(stderr, "%s: Unsupported target [%d][%s] - denying request\n", __func__, target, - validateString(NameForAtom(target))); + NameForIntAtom(target)); #endif sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); @@ -2147,7 +2146,7 @@ XlibAtom translateLocalToRemoteSelection(Atom local) #ifdef DEBUG fprintf(stderr, "%s: mapping local to remote selection: [%d][%s] -> [%ld] [%s]\n", __func__, - local, NameForAtom(local), remote, validateString(NameForRemAtom(remote))); + local, NameForIntAtom(local), remote, NameForRemAtom(remote)); #endif return remote; @@ -2189,7 +2188,7 @@ XlibAtom translateLocalToRemoteTarget(Atom local) #ifdef DEBUG fprintf(stderr, "%s: mapping local to remote target: [%d][%s] -> [%ld] [%s]\n", __func__, - local, NameForAtom(local), remote, validateString(NameForRemAtom(remote))); + local, NameForIntAtom(local), remote, NameForRemAtom(remote)); #endif return remote; @@ -2225,9 +2224,9 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) #ifdef DEBUG fprintf(stderr, "%s: Received SendNotify by client: property [%d][%s] target [%d][%s] selection [%d][%s] requestor [0x%x] time [%u].\n", __func__, - event->u.selectionNotify.property, NameForAtom(event->u.selectionNotify.property), - event->u.selectionNotify.target, NameForAtom(event->u.selectionNotify.target), - event->u.selectionNotify.selection, NameForAtom(event->u.selectionNotify.selection), + event->u.selectionNotify.property, NameForIntAtom(event->u.selectionNotify.property), + event->u.selectionNotify.target, NameForIntAtom(event->u.selectionNotify.target), + event->u.selectionNotify.selection, NameForIntAtom(event->u.selectionNotify.selection), event->u.selectionNotify.requestor, event->u.selectionNotify.time); #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 3.6.x in repository nx-libs. commit 855ddf2815b6eaeb92fb6c00de374b3b8226b5db Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Oct 13 21:31:01 2020 +0200 Clipboard.c: avoid superflous atom conversion --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index f430a01d1..7fcf63a00 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1416,8 +1416,8 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) return; } - #ifdef DEBUG XSelectionEvent * e = (XSelectionEvent *)X; + #ifdef DEBUG if (e->requestor == serverWindow) { fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; @@ -1434,12 +1434,10 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) for (index = 0; index < nxagentMaxSelections; index++) { #ifdef DEBUG - fprintf (stderr, "%s: lastClients[%d].intSelection [%d] selection [%d] .\n", - __func__, index, intSelAtoms[index], - nxagentRemoteToLocalAtom(e->selection)); + fprintf (stderr, "%s: index [%d] selAtom [%ld] remselection [%ld] .\n", + __func__, index, remSelAtoms[index], e->selection); #endif - /* FIXME: take remSelAtoms[index]? */ - if (intSelAtoms[index] == nxagentRemoteToLocalAtom(e->selection)) + if (remSelAtoms[index] == e->selection) { break; } -- 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 3.6.x in repository nx-libs. commit ba02ad3ad65eb353734aafd6e394683c57fbe070 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Sep 24 01:01:22 2020 +0200 Clipboard.c: add FIXMEs --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 072dd1a3d..9dc5f8ad7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2138,6 +2138,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, return 1; } +/* FIXME: do we still need this special treatment? Can't we just + call nxagentLocalToRemoteAtom() everywhere? */ XlibAtom translateLocalToRemoteSelection(Atom local) { /* @@ -2173,6 +2175,8 @@ XlibAtom translateLocalToRemoteSelection(Atom local) return remote; } +/* FIXME: do we still need this special treatment? Can't we just + call nxagentLocalToRemoteAtom() everywhere? */ XlibAtom translateLocalToRemoteTarget(Atom local) { /* -- 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 3.6.x in repository nx-libs. commit 8316d614a8d297d8b8c9d1a65346a325413b2a0d Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Sep 24 00:44:49 2020 +0200 Clipboard.c: add some more selection atoms we currently do not support them but as they require a special treatment we need to know them and report an error if they appear. --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 17 ++- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 141 ++++++++++++++++++++++--- 3 files changed, 145 insertions(+), 15 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index d9ee678fa..86022ee62 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -76,7 +76,7 @@ Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; * Careful! Do not change indices here! Some of those are referenced * at other places via nxagentAtoms[index]. */ -static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] = +static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 2] = { "NX_IDENTITY", /* 0 */ /* NX_IDENTITY was used in earlier nx versions to communicate @@ -135,6 +135,21 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] = "COMPOUND_TEXT", /* 16 */ /* one of the supported data formats for selections. Standard ICCCM Atom */ + "INCR", /* 17 */ + /* incremental clipboard transfers. Standard + ICCCM Atom */ + "MULTIPLE", /* 18 */ + /* request selection in multiple formats at once. Standard + ICCCM Atom */ + "DELETE", /* 19 */ + /* request to delete selection. Standard ICCCM Atom */ + "INSERT_SELECTION", /* 20 */ + /* request to insert other selection. Standard ICCCM Atom */ + "INSERT_PROPERTY", /* 21 */ + /* request to insert content of property into selection. Standard + ICCCM Atom */ + "SAVE_TARGETS", /* 22 */ + /* request tp save clipboard content to clipboard manager on exit */ NULL, NULL }; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h index 4dcdf7055..84da3ec8e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h @@ -30,7 +30,7 @@ #include "../../include/window.h" #include "screenint.h" -#define NXAGENT_NUMBER_OF_ATOMS 18 +#define NXAGENT_NUMBER_OF_ATOMS 23 extern Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 3721ace60..072dd1a3d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -142,25 +142,47 @@ typedef struct _lastServer { static lastServer *lastServers; +/* + * FIXME: use (additional) Atoms.c helpers to get rid of all these + * Atoms and strings + */ static XlibAtom serverTARGETS; static XlibAtom serverTIMESTAMP; +static XlibAtom serverINCR; +static XlibAtom serverMULTIPLE; +static XlibAtom serverDELETE; +static XlibAtom serverINSERT_SELECTION; +static XlibAtom serverINSERT_PROPERTY; +static XlibAtom serverSAVE_TARGETS; static XlibAtom serverTEXT; static XlibAtom serverCOMPOUND_TEXT; static XlibAtom serverUTF8_STRING; static XlibAtom serverTransFromAgentProperty; -static Atom clientTARGETS; -static Atom clientTIMESTAMP; -static Atom clientTEXT; -static Atom clientCOMPOUND_TEXT; -static Atom clientUTF8_STRING; - -static char szAgentTARGETS[] = "TARGETS"; -static char szAgentTEXT[] = "TEXT"; -static char szAgentTIMESTAMP[] = "TIMESTAMP"; -static char szAgentCOMPOUND_TEXT[] = "COMPOUND_TEXT"; -static char szAgentUTF8_STRING[] = "UTF8_STRING"; -static char szAgentNX_CUT_BUFFER_CLIENT[] = "NX_CUT_BUFFER_CLIENT"; -static char szAgentCLIPBOARD[] = "CLIPBOARD"; +static Atom clientTARGETS; +static Atom clientTIMESTAMP; +static Atom clientINCR; +static Atom clientMULTIPLE; +static Atom clientDELETE; +static Atom clientINSERT_SELECTION; +static Atom clientINSERT_PROPERTY; +static Atom clientSAVE_TARGETS; +static Atom clientTEXT; +static Atom clientCOMPOUND_TEXT; +static Atom clientUTF8_STRING; + +static char szAgentTARGETS[] = "TARGETS"; +static char szAgentTEXT[] = "TEXT"; +static char szAgentTIMESTAMP[] = "TIMESTAMP"; +static char szAgentINCR[] = "INCR"; +static char szAgentMULTIPLE[] = "MULTIPLE"; +static char szAgentDELETE[] = "DELETE"; +static char szAgentINSERT_SELECTION[] = "INSERT_SELECTION"; +static char szAgentINSERT_PROPERTY[] = "INSERT_PROPERTY"; +static char szAgentSAVE_TARGETS[] = "SAVE_TARGETS"; +static char szAgentCOMPOUND_TEXT[] = "COMPOUND_TEXT"; +static char szAgentUTF8_STRING[] = "UTF8_STRING"; +static char szAgentNX_CUT_BUFFER_CLIENT[] = "NX_CUT_BUFFER_CLIENT"; +static char szAgentCLIPBOARD[] = "CLIPBOARD"; /* number of milliseconds to wait for a conversion from the real X server. */ #define CONVERSION_TIMEOUT 5000 @@ -809,6 +831,46 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) replyRequestSelectionToXServer(X, True); return; } + else if (X->xselectionrequest.target == serverMULTIPLE) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [MULTIPLE] - denying request.\n", __func__); + #endif + replyRequestSelectionToXServer(X, False); + return; + } + else if (X->xselectionrequest.target == serverDELETE) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [DELETE] - denying request.\n", __func__); + #endif + replyRequestSelectionToXServer(X, False); + return; + } + else if (X->xselectionrequest.target == serverINSERT_SELECTION) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [INSERT_SELECTION] - denying request.\n", __func__); + #endif + replyRequestSelectionToXServer(X, False); + return; + } + else if (X->xselectionrequest.target == serverINSERT_PROPERTY) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [INSERT_PROPERTY] - denying request.\n", __func__); + #endif + replyRequestSelectionToXServer(X, False); + return; + } + else if (X->xselectionrequest.target == serverSAVE_TARGETS) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [SAVE_TARGETS] - denying request.\n", __func__); + #endif + replyRequestSelectionToXServer(X, False); + return; + } else { fprintf(stderr, "%s: target [%ld][%s].\n", __func__, X->xselectionrequest.target, @@ -1960,6 +2022,46 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, sendSelectionNotifyEventToClient(client, time, requestor, selection, target, property); return 1; } + else if (target == clientMULTIPLE) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [MULTIPLE] - denying request.\n", __func__); + #endif + sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); + return 1; + } + else if (target == clientDELETE) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [DELETE] - denying request.\n", __func__); + #endif + sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); + return 1; + } + else if (target == clientINSERT_SELECTION) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [INSERT_SELECTION] - denying request.\n", __func__); + #endif + sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); + return 1; + } + else if (target == clientINSERT_PROPERTY) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [INSERT_PROPERTY] - denying request.\n", __func__); + #endif + sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); + return 1; + } + else if (target == clientSAVE_TARGETS) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [SAVE_TARGETS] - denying request.\n", __func__); + #endif + sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); + return 1; + } if (lastClients[index].clientPtr == client) { @@ -2260,11 +2362,18 @@ Bool nxagentInitClipboard(WindowPtr pWin) { /* cannot move that down to others - we need it for * initSelectionOwnerData ! */ + /* FIXME: it is probably better to re-use the strings from Atoms.c here */ clientTARGETS = MakeAtom(szAgentTARGETS, strlen(szAgentTARGETS), True); clientTEXT = MakeAtom(szAgentTEXT, strlen(szAgentTEXT), True); clientCOMPOUND_TEXT = MakeAtom(szAgentCOMPOUND_TEXT, strlen(szAgentCOMPOUND_TEXT), True); clientUTF8_STRING = MakeAtom(szAgentUTF8_STRING, strlen(szAgentUTF8_STRING), True); clientTIMESTAMP = MakeAtom(szAgentTIMESTAMP, strlen(szAgentTIMESTAMP), True); + clientINCR = MakeAtom(szAgentINCR, strlen(szAgentINCR), True); + clientMULTIPLE = MakeAtom(szAgentMULTIPLE, strlen(szAgentMULTIPLE), True); + clientDELETE = MakeAtom(szAgentDELETE, strlen(szAgentDELETE), True); + clientINSERT_SELECTION = MakeAtom(szAgentINSERT_SELECTION, strlen(szAgentINSERT_SELECTION), True); + clientINSERT_PROPERTY = MakeAtom(szAgentINSERT_PROPERTY, strlen(szAgentINSERT_PROPERTY), True); + clientSAVE_TARGETS = MakeAtom(szAgentSAVE_TARGETS, strlen(szAgentSAVE_TARGETS), True); SAFE_free(lastSelectionOwner); lastSelectionOwner = (SelectionOwner *) malloc(nxagentMaxSelections * sizeof(SelectionOwner)); @@ -2319,6 +2428,12 @@ Bool nxagentInitClipboard(WindowPtr pWin) serverCOMPOUND_TEXT = nxagentAtoms[16]; /* COMPOUND_TEXT */ serverUTF8_STRING = nxagentAtoms[12]; /* UTF8_STRING */ serverTIMESTAMP = nxagentAtoms[11]; /* TIMESTAMP */ + serverINCR = nxagentAtoms[17]; /* INCR */ + serverMULTIPLE = nxagentAtoms[18]; /* MULTIPLE */ + serverDELETE = nxagentAtoms[19]; /* DELETE */ + serverINSERT_SELECTION = nxagentAtoms[20]; /* INSERT_SELECTION */ + serverINSERT_PROPERTY = nxagentAtoms[21]; /* INSERT_PROPERTY */ + serverSAVE_TARGETS = nxagentAtoms[22]; /* SAVE_TARGETS */ /* * Server side properties to hold pasted data. -- 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 3.6.x in repository nx-libs. commit 533f08ddb9748c20bd736f356c3a7fe38f53a113 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Oct 26 23:18:27 2020 +0100 Clipboard.c: add TARGET_SIZES --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 8 +++++++- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index 86022ee62..6ce8b21e8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -149,7 +149,13 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 2] = /* request to insert content of property into selection. Standard ICCCM Atom */ "SAVE_TARGETS", /* 22 */ - /* request tp save clipboard content to clipboard manager on exit */ + /* request to save clipboard content to clipboard manager on + exit, see + https://www.freedesktop.org/wiki/ClipboardManager */ + "TARGET_SIZES", /* 23 */ + /* request to retrieve the sizes of the clipboard content in + various formats, see + https://www.freedesktop.org/wiki/ClipboardManager */ NULL, NULL }; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h index 84da3ec8e..4a73a817d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h @@ -30,7 +30,7 @@ #include "../../include/window.h" #include "screenint.h" -#define NXAGENT_NUMBER_OF_ATOMS 23 +#define NXAGENT_NUMBER_OF_ATOMS 24 extern Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 9dc5f8ad7..dd8b049db 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -154,6 +154,7 @@ static XlibAtom serverDELETE; static XlibAtom serverINSERT_SELECTION; static XlibAtom serverINSERT_PROPERTY; static XlibAtom serverSAVE_TARGETS; +static XlibAtom serverTARGET_SIZES; static XlibAtom serverTEXT; static XlibAtom serverCOMPOUND_TEXT; static XlibAtom serverUTF8_STRING; @@ -166,6 +167,7 @@ static Atom clientDELETE; static Atom clientINSERT_SELECTION; static Atom clientINSERT_PROPERTY; static Atom clientSAVE_TARGETS; +static Atom clientTARGET_SIZES; static Atom clientTEXT; static Atom clientCOMPOUND_TEXT; static Atom clientUTF8_STRING; @@ -179,6 +181,7 @@ static char szAgentDELETE[] = "DELETE"; static char szAgentINSERT_SELECTION[] = "INSERT_SELECTION"; static char szAgentINSERT_PROPERTY[] = "INSERT_PROPERTY"; static char szAgentSAVE_TARGETS[] = "SAVE_TARGETS"; +static char szAgentTARGET_SIZES[] = "TARGET_SIZES"; static char szAgentCOMPOUND_TEXT[] = "COMPOUND_TEXT"; static char szAgentUTF8_STRING[] = "UTF8_STRING"; static char szAgentNX_CUT_BUFFER_CLIENT[] = "NX_CUT_BUFFER_CLIENT"; @@ -871,6 +874,14 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) replyRequestSelectionToXServer(X, False); return; } + else if (X->xselectionrequest.target == serverTARGET_SIZES) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [TARGET_SIZES] - denying request.\n", __func__); + #endif + replyRequestSelectionToXServer(X, False); + return; + } else { fprintf(stderr, "%s: target [%ld][%s].\n", __func__, X->xselectionrequest.target, @@ -2062,6 +2073,14 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); return 1; } + else if (target == clientTARGET_SIZES) + { + #ifdef DEBUG + fprintf(stderr, "%s: (currently) unsupported target [TARGET_SIZES] - denying request.\n", __func__); + #endif + sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); + return 1; + } if (lastClients[index].clientPtr == client) { @@ -2378,6 +2397,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) clientINSERT_SELECTION = MakeAtom(szAgentINSERT_SELECTION, strlen(szAgentINSERT_SELECTION), True); clientINSERT_PROPERTY = MakeAtom(szAgentINSERT_PROPERTY, strlen(szAgentINSERT_PROPERTY), True); clientSAVE_TARGETS = MakeAtom(szAgentSAVE_TARGETS, strlen(szAgentSAVE_TARGETS), True); + clientTARGET_SIZES = MakeAtom(szAgentTARGET_SIZES, strlen(szAgentTARGET_SIZES), True); SAFE_free(lastSelectionOwner); lastSelectionOwner = (SelectionOwner *) malloc(nxagentMaxSelections * sizeof(SelectionOwner)); @@ -2438,6 +2458,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) serverINSERT_SELECTION = nxagentAtoms[20]; /* INSERT_SELECTION */ serverINSERT_PROPERTY = nxagentAtoms[21]; /* INSERT_PROPERTY */ serverSAVE_TARGETS = nxagentAtoms[22]; /* SAVE_TARGETS */ + serverTARGET_SIZES = nxagentAtoms[23]; /* TARGET_SIZES */ /* * Server side properties to hold pasted data. -- 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 3.6.x in repository nx-libs. commit a87ee1e8ff27e9592aa8ead83a443949f1c2fe46 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Sep 23 23:54:36 2020 +0200 Clipboard.c: target forwarding (Part 2/2) Internal clients asking for the available targets for a selection will no longer get a predefined list but a the list of targets from the owning client on the real X server. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 208 ++++++++++++------------- 1 file changed, 98 insertions(+), 110 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 56cbf5eef..3721ace60 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -812,7 +812,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) else { fprintf(stderr, "%s: target [%ld][%s].\n", __func__, X->xselectionrequest.target, - XGetAtomName(nxagentDisplay, X->xselectionrequest.target)); + NameForRemAtom(X->xselectionrequest.target)); } /* @@ -1244,22 +1244,64 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) fprintf(stderr, "%s: Got property content from remote server. size [%lu] bytes.\n", __func__, (ulReturnItems * resultFormat / 8)); #endif - ChangeWindowProperty(lastClients[index].windowPtr, - lastClients[index].property, - lastClients[index].target, - resultFormat, PropModeReplace, - ulReturnItems, pszReturnData, 1); + if (lastClients[index].target == clientTARGETS) + { + Atom * targets = calloc(sizeof(Atom), ulReturnItems); + if (targets == NULL) + { + #ifdef WARNING + fprintf(stderr, "%s: WARNING! Could not alloc memory for clipboard targets transmission.\n", __func__); + #endif - #ifdef DEBUG - fprintf(stderr, "%s: Selection property [%d][%s] changed to [\"%*.*s\"...]\n", __func__, - lastClients[index].property, - NameForIntAtom(lastClients[index].property), - (int)(min(20, ulReturnItems * resultFormat / 8)), - (int)(min(20, ulReturnItems * resultFormat / 8)), - pszReturnData); - #endif + /* operation failed */ + endTransfer(SELECTION_FAULT, index); + } + else + { + /* fprintf(stderr, "sizeof(Atom) [%lu], sizeof(XlibAtom) [%lu], sizeof(long) [%lu], sizeof(CARD32) [%lu] sizeof(INT32) [%lu]\n", sizeof(Atom), sizeof(XlibAtom), sizeof(long), sizeof(CARD32), sizeof(INT32)); */ + + Atom *addr = targets; + unsigned int numTargets = ulReturnItems; + + for (int i = 0; i < numTargets; i++) + { + XlibAtom remote = *((XlibAtom*)(pszReturnData + i*resultFormat/8)); + Atom local = nxagentRemoteToLocalAtom(remote); + *(addr++) = local; + + #ifdef DEBUG + fprintf(stderr, "%s: converting atom: remote [%u][%s] -> local [%u][%s]\n", __func__, + (unsigned int)remote, NameForRemAtom(remote), local, NameForIntAtom(local)); + #endif + } + ChangeWindowProperty(lastClients[index].windowPtr, + lastClients[index].property, + MakeAtom("ATOM", 4, 1), + 32, PropModeReplace, + ulReturnItems, (unsigned char*)targets, 1); - endTransfer(SELECTION_SUCCESS, index); + endTransfer(SELECTION_SUCCESS, index); + } + } + else + { + ChangeWindowProperty(lastClients[index].windowPtr, + lastClients[index].property, + lastClients[index].target, + resultFormat, PropModeReplace, + ulReturnItems, pszReturnData, 1); + + #ifdef DEBUG + fprintf(stderr, "%s: Selection property [%d][%s] changed to [\"%*.*s\"...]\n", __func__, + lastClients[index].property, + validateString(NameForIntAtom(lastClients[index].property)), + (int)(min(20, ulReturnItems * resultFormat / 8)), + (int)(min(20, ulReturnItems * resultFormat / 8)), + pszReturnData); + #endif + + endTransfer(SELECTION_SUCCESS, index); + } } break; } @@ -1475,9 +1517,8 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) *(addr++) = remote; #ifdef DEBUG - char *s = XGetAtomName(nxagentDisplay, remote); - fprintf(stderr, "%s: converting atom: local [%d][%s] -> remote [%ld][%s]\n", __func__,local, NameForAtom(local), remote, s); - SAFE_XFree(s); + fprintf(stderr, "%s: converting atom: local [%d][%s] -> remote [%ld][%s]\n", __func__, + local, NameForIntAtom(local), remote, NameForRemAtom(remote)); #endif } @@ -1510,16 +1551,14 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) ulReturnItems); #ifdef DEBUG { - char *s = XGetAtomName(nxagentDisplay, lastServers[index].property); fprintf(stderr, "%s: XChangeProperty sent to window [0x%x] for property [%ld][%s] value [\"%*.*s\"...]\n", __func__, lastServers[index].requestor, lastServers[index].property, - s, + NameForRemAtom(lastServers[index].property), (int)(min(20, ulReturnItems * 8 / 8)), (int)(min(20, ulReturnItems * 8 / 8)), pszReturnData); - SAFE_XFree(s); } #endif } @@ -1891,38 +1930,6 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, } } - /* - * The selection request target is TARGETS. The requestor is asking - * for a list of supported data formats. - * - * The list is aligned with the one in nxagentHandleSelectionRequestFromXServer. - */ - if (target == clientTARGETS) - { - Atom targets[] = {XA_STRING, clientUTF8_STRING, clientTEXT, clientCOMPOUND_TEXT, clientTARGETS, clientTIMESTAMP}; - int numTargets = sizeof(targets) / sizeof(targets[0]); - - #ifdef DEBUG - fprintf(stderr, "%s: available targets [%d]:\n", __func__, numTargets); - for (int j = 0; j < numTargets; j++) - fprintf(stderr, "%s: %s\n", __func__, NameForIntAtom(targets[j])); - fprintf(stderr, "\n"); - #endif - - ChangeWindowProperty(pWin, - property, - MakeAtom("ATOM", 4, 1), - sizeof(Atom)*8, - PropModeReplace, - numTargets, - &targets, - 1); - - sendSelectionNotifyEventToClient(client, time, requestor, selection, target, property); - - return 1; - } - /* * Section 2.6.2 of the ICCCM states: * "TIMESTAMP - To avoid some race conditions, it is important @@ -1982,70 +1989,51 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, clientAccum = 0; } - if (target == clientTEXT || - target == XA_STRING || - target == clientCOMPOUND_TEXT || - target == clientUTF8_STRING) - { - setClientSelectionStage(SelectionStageNone, index); - - /* - * store the original requestor, we need that later after - * serverTransToAgentProperty contains the desired selection content - */ - lastClients[index].requestor = requestor; - lastClients[index].windowPtr = pWin; - lastClients[index].clientPtr = client; - lastClients[index].time = time; - lastClients[index].property = property; - lastClients[index].target = target; - /* if the last client request time is more than 5s ago update it. Why? */ - if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) - lastClients[index].reqTime = GetTimeInMillis(); - - XlibAtom remSelection = translateLocalToRemoteSelection(selection); - XlibAtom remTarget = translateLocalToRemoteTarget(target); - XlibAtom remProperty = serverTransToAgentProperty; - - #ifdef DEBUG - fprintf(stderr, "%s: replacing local by remote property: [%d][%s] -> [%ld][%s]\n", - __func__, property, NameForIntAtom(property), - remProperty, "NX_CUT_BUFFER_SERVER"); - #endif + setClientSelectionStage(SelectionStageNone, index); - /* FIXME: check why using CurrentTime will not replace the value - * by a real time. The reply also contains time "0" which is - * unexpected (for me) */ - #ifdef DEBUG - fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%lx] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, - serverWindow, remTarget, NameForRemAtom(remTarget), - remProperty, NameForRemAtom(remProperty), - remSelection, NameForRemAtom(remSelection)); - #endif + /* + * store the original requestor, we need that later after + * serverTransToAgentProperty contains the desired selection content + */ + lastClients[index].requestor = requestor; + lastClients[index].windowPtr = pWin; + lastClients[index].clientPtr = client; + lastClients[index].time = time; + lastClients[index].property = property; + lastClients[index].target = target; + /* if the last client request time is more than 5s ago update it. Why? */ + if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) + lastClients[index].reqTime = GetTimeInMillis(); + + XlibAtom remSelection = translateLocalToRemoteSelection(selection); + XlibAtom remTarget = translateLocalToRemoteTarget(target); + XlibAtom remProperty = serverTransToAgentProperty; - XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime); + #ifdef DEBUG + fprintf(stderr, "%s: replacing local by remote property: [%d][%s] -> [%ld][%s]\n", + __func__, property, NameForIntAtom(property), + remProperty, "NX_CUT_BUFFER_SERVER"); + #endif - /* XConvertSelection will always return (check the source!), so no need to check */ + #ifdef DEBUG + fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, + serverWindow, remTarget, NameForRemAtom(remTarget), + remProperty, NameForRemAtom(remProperty), + remSelection, NameForRemAtom(remSelection)); + #endif - #ifdef DEBUG - fprintf(stderr, "%s: Sent XConvertSelection\n", __func__); - #endif + UpdateCurrentTime(); + XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, + serverWindow, CurrentTime); - return 1; - } - else - { - /* deny request */ - #ifdef DEBUG - fprintf(stderr, "%s: Unsupported target [%d][%s] - denying request\n", __func__, target, - NameForIntAtom(target)); - #endif - sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); + /* XConvertSelection will always return 1 (check the source!), so no + need to check */ - return 1; - } + #ifdef DEBUG + fprintf(stderr, "%s: Sent XConvertSelection\n", __func__); + #endif - return 0; + return 1; } XlibAtom translateLocalToRemoteSelection(Atom local) -- 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 3.6.x in repository nx-libs. commit 710d5c5f9c354e16f6c36eeca599e579c1819b0c Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Oct 29 20:25:08 2020 +0100 Clipboard.c: disable TEXT and COMPOUND_TEXT They are ancient and their use is discouraged by ICCCM --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 89 ++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 12 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index fb2595e68..8872291fd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -59,6 +59,15 @@ #undef TEST #undef DEBUG +/* + * Define these to also support special targets TEXT and COMPOUND_TEXT + * in text-only mode. We do not have a special handling for these. See + * https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#text... + * for details. + */ +#undef SUPPORT_TEXT_TARGET +#undef SUPPORT_COMPOUND_TEXT_TARGET + /* * These are defined in the dispatcher. */ @@ -155,8 +164,12 @@ static XlibAtom serverINSERT_SELECTION; static XlibAtom serverINSERT_PROPERTY; static XlibAtom serverSAVE_TARGETS; static XlibAtom serverTARGET_SIZES; +#ifdef SUPPORT_TEXT_TARGET static XlibAtom serverTEXT; +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET static XlibAtom serverCOMPOUND_TEXT; +#endif static XlibAtom serverUTF8_STRING; static XlibAtom serverTransFromAgentProperty; static Atom clientTARGETS; @@ -168,12 +181,21 @@ static Atom clientINSERT_SELECTION; static Atom clientINSERT_PROPERTY; static Atom clientSAVE_TARGETS; static Atom clientTARGET_SIZES; +#ifdef SUPPORT_TEXT_TARGET static Atom clientTEXT; +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET static Atom clientCOMPOUND_TEXT; +#endif static Atom clientUTF8_STRING; static char szAgentTARGETS[] = "TARGETS"; +#ifdef SUPPORT_TEXT_TARGET static char szAgentTEXT[] = "TEXT"; +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET +static char szAgentCOMPOUND_TEXT[] = "COMPOUND_TEXT"; +#endif static char szAgentTIMESTAMP[] = "TIMESTAMP"; static char szAgentINCR[] = "INCR"; static char szAgentMULTIPLE[] = "MULTIPLE"; @@ -182,7 +204,6 @@ static char szAgentINSERT_SELECTION[] = "INSERT_SELECTION"; static char szAgentINSERT_PROPERTY[] = "INSERT_PROPERTY"; static char szAgentSAVE_TARGETS[] = "SAVE_TARGETS"; static char szAgentTARGET_SIZES[] = "TARGET_SIZES"; -static char szAgentCOMPOUND_TEXT[] = "COMPOUND_TEXT"; static char szAgentUTF8_STRING[] = "UTF8_STRING"; static char szAgentNX_CUT_BUFFER_CLIENT[] = "NX_CUT_BUFFER_CLIENT"; static char szAgentCLIPBOARD[] = "CLIPBOARD"; @@ -381,6 +402,18 @@ void nxagentDumpClipboardStat(void) fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, NameForRemAtom(serverLastRequestedSelection)); + fprintf(stderr, "Compile time settings\n"); +#ifdef SUPPORT_TEXT_TARGET + fprintf(stderr, " SUPPORT_TEXT_TARGET [enabled]\n"); +#else + fprintf(stderr, " SUPPORT_TEXT_TARGET [disabled]\n"); +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET + fprintf(stderr, " SUPPORT_COMPOUND_TEXT_TARGET [enabled]\n"); +#else + fprintf(stderr, " SUPPORT_COMPOUND_TEXT_TARGET [disabled]\n"); +#endif + #define WIDTH 32 Atom cl = 0; XlibAtom sv = 0; @@ -393,11 +426,14 @@ void nxagentDumpClipboardStat(void) cl = clientTIMESTAMP; sv = serverTIMESTAMP; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); fprintf(stderr, " TIMESTAMP [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); +#ifdef SUPPORT_TEXT_TARGET cl = clientTEXT; sv = serverTEXT; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); fprintf(stderr, " TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); - +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET cl = clientCOMPOUND_TEXT; sv = serverCOMPOUND_TEXT; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); fprintf(stderr, " COMPOUND_TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); +#endif cl = clientUTF8_STRING; sv = serverUTF8_STRING; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); fprintf(stderr, " UTF8_STRING [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); @@ -576,6 +612,7 @@ static Bool isTextTarget(XlibAtom target) #endif return True; } +#ifdef SUPPORT_TEXT_TARGET else if (target == serverTEXT) { #ifdef DEBUG @@ -583,17 +620,20 @@ static Bool isTextTarget(XlibAtom target) #endif return True; } - else if (target == serverUTF8_STRING) +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET + else if (target == serverCOMPOUND_TEXT) { #ifdef DEBUG - fprintf(stderr, "%s: valid target [UTF8_STRING].\n", __func__); + fprintf(stderr, "%s: valid target [COMPOUND_TEXT].\n", __func__); #endif return True; } - else if (target == serverCOMPOUND_TEXT) +#endif + else if (target == serverUTF8_STRING) { #ifdef DEBUG - fprintf(stderr, "%s: valid target [COMPOUND_TEXT].\n", __func__); + fprintf(stderr, "%s: valid target [UTF8_STRING].\n", __func__); #endif return True; } @@ -869,8 +909,16 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * and in isTextTarget(). */ - XlibAtom targets[] = {XA_STRING, serverUTF8_STRING, serverTEXT, serverCOMPOUND_TEXT, - serverTARGETS, serverTIMESTAMP}; + XlibAtom targets[] = {XA_STRING, + serverUTF8_STRING, +#ifdef SUPPORT_TEXT_TARGET + serverTEXT, +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET + serverCOMPOUND_TEXT, +#endif + serverTARGETS, + serverTIMESTAMP}; int numTargets = sizeof(targets) / sizeof(targets[0]); #ifdef DEBUG @@ -2162,8 +2210,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, */ Atom targets[] = {XA_STRING, clientUTF8_STRING, -#if 0 +#ifdef SUPPORT_TEXT_TARGET clientTEXT, +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET clientCOMPOUND_TEXT, #endif clientTARGETS, @@ -2426,19 +2476,26 @@ XlibAtom translateLocalToRemoteTarget(Atom local) XlibAtom remote; /* - * we only convert to either UTF8 or XA_STRING, despite accepting - * TEXT and COMPOUND_TEXT. + * we only convert to either UTF8 or XA_STRING +#ifdef SUPPORT_TEXT_TARGET + * despite accepting TEXT +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET + * and COMPOUND_TEXT. +#endif */ if (local == clientUTF8_STRING) { remote = serverUTF8_STRING; } -#if 0 +#ifdef SUPPORT_TEXT_TARGET else if (local == clientTEXT) { remote = serverTEXT; } +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET else if (local == clientCOMPOUND_TEXT) { remote = serverCOMPOUND_TEXT; @@ -2606,8 +2663,12 @@ Bool nxagentInitClipboard(WindowPtr pWin) * initSelectionOwnerData ! */ /* FIXME: it is probably better to re-use the strings from Atoms.c here */ clientTARGETS = MakeAtom(szAgentTARGETS, strlen(szAgentTARGETS), True); +#ifdef SUPPORT_TEXT_TARGET clientTEXT = MakeAtom(szAgentTEXT, strlen(szAgentTEXT), True); +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET clientCOMPOUND_TEXT = MakeAtom(szAgentCOMPOUND_TEXT, strlen(szAgentCOMPOUND_TEXT), True); +#endif clientUTF8_STRING = MakeAtom(szAgentUTF8_STRING, strlen(szAgentUTF8_STRING), True); clientTIMESTAMP = MakeAtom(szAgentTIMESTAMP, strlen(szAgentTIMESTAMP), True); clientINCR = MakeAtom(szAgentINCR, strlen(szAgentINCR), True); @@ -2667,8 +2728,12 @@ Bool nxagentInitClipboard(WindowPtr pWin) remSelAtoms[nxagentClipboardSelection] = nxagentAtoms[10]; /* CLIPBOARD */ serverTARGETS = nxagentAtoms[6]; /* TARGETS */ +#ifdef SUPPORT_TEXT_TARGET serverTEXT = nxagentAtoms[7]; /* TEXT */ +#endif +#ifdef SUPPORT_COMPOUND_TEXT_TARGET serverCOMPOUND_TEXT = nxagentAtoms[16]; /* COMPOUND_TEXT */ +#endif serverUTF8_STRING = nxagentAtoms[12]; /* UTF8_STRING */ serverTIMESTAMP = nxagentAtoms[11]; /* TIMESTAMP */ serverINCR = nxagentAtoms[17]; /* INCR */ -- 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 3.6.x in repository nx-libs. commit 90947c1f7c5b345447a8b991e513a60c4f70fbdd Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Oct 26 23:52:30 2020 +0100 nxagent: add option -textclipboard textclipboard=<bool> in the options file --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 19 ++ nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 228 ++++++++++++++++++++++- nx-X11/programs/Xserver/hw/nxagent/Options.c | 1 + nx-X11/programs/Xserver/hw/nxagent/Options.h | 7 + nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 13 ++ 5 files changed, 261 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index be13efacd..ea17e4813 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -972,6 +972,12 @@ int ddxProcessArgument(int argc, char *argv[], int i) return 2; } + if (!strcmp(argv[i], "-textclipboard")) + { + nxagentChangeOption(TextClipboard, True); + return 1; + } + if (!strcmp(argv[i], "-bs")) { nxagentChangeOption(BackingStore, BackingStoreNever); @@ -1487,6 +1493,18 @@ static void nxagentParseSingleOption(char *name, char *value) } return; } + else if (!strcmp(name, "textclipboard")) + { + if (!strcmp(value, "0")) + { + nxagentChangeOption(TextClipboard, False); + } + else + { + nxagentChangeOption(TextClipboard, True); + } + return; + } else { #ifdef DEBUG @@ -2129,6 +2147,7 @@ void ddxUseMsg(void) ErrorF("-nokbreset don't reset keyboard device if the session is resumed\n"); ErrorF("-noxkblock always allow applications to change layout through XKEYBOARD\n"); ErrorF("-autograb enable autograb\n"); + ErrorF("-textclipboard limit clipboard data to text only\n"); ErrorF("-irlimit maximum image data rate to the encoder input in kB/s.\n"); ErrorF("-tile WxH maximum size of image tiles (minimum allowed: 32x32)\n"); ErrorF("-keystrokefile file file with keyboard shortcut definitions\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 28d56b758..fb2595e68 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -264,6 +264,7 @@ XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, False }; extern Display *nxagentDisplay; +static Bool isTextTarget(XlibAtom target); static void setClientSelectionStage(int stage, int index); static void endTransfer(Bool success, int index); #define SELECTION_SUCCESS True @@ -562,6 +563,48 @@ static void sendSelectionNotifyEventToClient(ClientPtr client, sendEventToClient(client, &x); } +/* + * Check if target is a valid text content type target sent by the real X + * server, like .e.g XA_STRING or UTF8_STRING. + */ +static Bool isTextTarget(XlibAtom target) +{ + if (target == XA_STRING) + { + #ifdef DEBUG + fprintf(stderr, "%s: valid target [XA_STRING].\n", __func__); + #endif + return True; + } + else if (target == serverTEXT) + { + #ifdef DEBUG + fprintf(stderr, "%s: valid target [TEXT].\n", __func__); + #endif + return True; + } + else if (target == serverUTF8_STRING) + { + #ifdef DEBUG + fprintf(stderr, "%s: valid target [UTF8_STRING].\n", __func__); + #endif + return True; + } + else if (target == serverCOMPOUND_TEXT) + { + #ifdef DEBUG + fprintf(stderr, "%s: valid target [COMPOUND_TEXT].\n", __func__); + #endif + return True; + } + /* FIXME: add text/plain */ + + #ifdef DEBUG + fprintf(stderr, "%s: not a text target [%lu].\n", __func__, target); + #endif + return False; +} + static void initSelectionOwnerData(int index) { lastSelectionOwner[index].client = NullClient; @@ -806,7 +849,61 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) return; } - if (X->xselectionrequest.target == serverTIMESTAMP) + if (X->xselectionrequest.target == serverTARGETS) + { + /* + * In TextClipboard mode answer with a predefined list of + * targets. This is just the previous implementation of handling + * the clipboard. + */ + if (nxagentOption(TextClipboard)) + { + /* + * the selection request target is TARGETS. The requestor is + * asking for a list of supported data formats. + * + * The selection does not matter here, we will return this for + * PRIMARY and CLIPBOARD. + * + * The list is aligned with the one in nxagentConvertSelection() + * and in isTextTarget(). + */ + + XlibAtom targets[] = {XA_STRING, serverUTF8_STRING, serverTEXT, serverCOMPOUND_TEXT, + serverTARGETS, serverTIMESTAMP}; + int numTargets = sizeof(targets) / sizeof(targets[0]); + + #ifdef DEBUG + fprintf(stderr, "%s: Sending %d available targets:\n", __func__, numTargets); + for (int i = 0; i < numTargets; i++) + { + fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], NameForRemAtom(targets[i])); + } + fprintf(stderr, "\n"); + #endif + + /* + * pass on the requested list by setting the property provided + * by the requestor accordingly. + */ + XChangeProperty(nxagentDisplay, + X->xselectionrequest.requestor, + X->xselectionrequest.property, + XInternAtom(nxagentDisplay, "ATOM", 0), + 32, + PropModeReplace, + (unsigned char*)targets, + numTargets); + + replyRequestSelectionToXServer(X, True); + return; + } + else + { + /* do nothing, let TARGETS be passed on to the owner later */ + } + } + else if (X->xselectionrequest.target == serverTIMESTAMP) { /* * Section 2.6.2 of the ICCCM states: @@ -882,12 +979,28 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) replyRequestSelectionToXServer(X, False); return; } - else + + if (nxagentOption(TextClipboard)) { - fprintf(stderr, "%s: target [%ld][%s].\n", __func__, X->xselectionrequest.target, - NameForRemAtom(X->xselectionrequest.target)); + if (!isTextTarget(X->xselectionrequest.target)) + { + #ifdef DEBUG + fprintf(stderr, "%s: denying request for non-text target [%ld][%s].\n", __func__, + X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target)); + #endif + + replyRequestSelectionToXServer(X, False); + + return; + } + /* go on, target is acceptable */ } + #ifdef DEBUG + fprintf(stderr, "%s: target [%ld][%s].\n", __func__, X->xselectionrequest.target, + NameForRemAtom(X->xselectionrequest.target)); + #endif + /* * reaching this means the request is a normal, valid request. We * can process it now. @@ -967,12 +1080,34 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) /* * Don't send the same window, some programs are clever and * verify cut and paste operations inside the same window and - * don't Notify at all. + * don't notify at all. * * x.u.selectionRequest.requestor = lastSelectionOwner[index].window; */ - x.u.selectionRequest.target = nxagentRemoteToLocalAtom(X->xselectionrequest.target); + /* + * if textclipboard is requested simply use the previous clipboard + * handling code + */ + if (nxagentOption(TextClipboard)) + { + /* by dimbor */ + if (X->xselectionrequest.target != XA_STRING) + { + lastServers[index].target = serverUTF8_STRING; + /* by dimbor (idea from zahvatov) */ + x.u.selectionRequest.target = clientUTF8_STRING; + } + else + { + x.u.selectionRequest.target = XA_STRING; + } + } + else + { + x.u.selectionRequest.target = nxagentRemoteToLocalAtom(X->xselectionrequest.target); + } + sendEventToClient(lastSelectionOwner[index].client, &x); #ifdef DEBUG @@ -2008,6 +2143,64 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, } } + /* + * The selection request target is TARGETS. The requestor is asking + * for a list of supported data formats. + */ + + if (target == clientTARGETS) + { + /* + * In TextClipboard mode answer with a predefined list that was used + * in in previous versions. + */ + if (nxagentOption(TextClipboard)) + { + /* + * The list is aligned with the one in + * nxagentHandleSelectionRequestFromXServer. + */ + Atom targets[] = {XA_STRING, + clientUTF8_STRING, +#if 0 + clientTEXT, + clientCOMPOUND_TEXT, +#endif + clientTARGETS, + clientTIMESTAMP}; + int numTargets = sizeof(targets) / sizeof(targets[0]); + + #ifdef DEBUG + fprintf(stderr, "%s: Sending %d available targets:\n", __func__, numTargets); + for (int i = 0; i < numTargets; i++) + { + fprintf(stderr, "%s: %d %s\n", __func__, targets[i], NameForIntAtom(targets[i])); + } + #endif + + ChangeWindowProperty(pWin, + property, + MakeAtom("ATOM", 4, 1), + sizeof(Atom)*8, + PropModeReplace, + numTargets, + targets, + 1); + + sendSelectionNotifyEventToClient(client, time, requestor, selection, + target, property); + + return 1; + } + else + { + /* + * do nothing - TARGETS will be handled like any other target + * and passed on to the owner on the remote side. + */ + } + } + /* * Section 2.6.2 of the ICCCM states: * "TIMESTAMP - To avoid some race conditions, it is important @@ -2018,7 +2211,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * support conversion to TIMESTAMP, returning the timestamp they * used to obtain the selection." */ - if (target == clientTIMESTAMP) + else if (target == clientTIMESTAMP) { /* * "If the specified property is not None, the owner should place @@ -2087,6 +2280,27 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, return 1; } + /* in TextClipboard mode reject all non-text targets */ + if (nxagentOption(TextClipboard)) + { + if (!isTextTarget(translateLocalToRemoteTarget(target))) + { + #ifdef DEBUG + fprintf(stderr, "%s: denying request for non-text target [%d][%s].\n", __func__, + target, NameForIntAtom(target)); + #endif + + sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); + return 1; + } + /* go on, target is acceptable */ + } + + #ifdef DEBUG + fprintf(stderr, "%s: target [%d][%s].\n", __func__, target, + NameForIntAtom(target)); + #endif + if (lastClients[index].clientPtr == client) { if (GetTimeInMillis() - lastClients[index].reqTime < ACCUM_TIME) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index be6e5d5e1..8e6249e4c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -88,6 +88,7 @@ void nxagentInitOptions(void) nxagentOptions.BackingStore = BackingStoreUndefined; nxagentOptions.Clipboard = ClipboardBoth; + nxagentOptions.TextClipboard = False; nxagentOptions.SharedMemory = True; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h index a99f4aee2..d3c8c7150 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -194,6 +194,13 @@ typedef struct _AgentOptions */ ClipboardMode Clipboard; + /* + * transfer TARGETS to remote side or answer with a limited + * hardcoded text target list + * Should be Bool but we'd have to include Xlib.h for that + */ + int TextClipboard; + /* * Enable agent to use the MITSHM extension in path from remote * proxy to the real X server. diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 index 74349cda7..f373cb239 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 +++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 @@ -465,6 +465,10 @@ The session id. .B \-autograb enable autograb mode on \fBnxagent\fR startup. The autograb feature can be toggled via nxagent keystrokes .TP 8 +.B \-textclipboard +force text-only clipboard \fBnxagent\fR startup. See option file +option \fBtextclipboard=<bool>\fR for an explanation. +.TP 8 .B \-nxrealwindowprop set property NX_REAL_WINDOW for each X11 client inside \fBnxagent\fR, providing the window XID of the corresponding window object on the X @@ -721,6 +725,15 @@ Limit clipboard data exchange to work only in one direction: from nxagent to rea Disable any clipboard data exchange. Clipboard will still work inside the nxagent and on the real X server, but no data exchange will be possible. .RE .TP 8 +.B textclipboard=<bool> +enable (set to \fI1\fR) or disable (set to \fI0\fR) text-only +clipboard. Text-only clipboard is the old (<= 3.5.99.26) clipboard +behaviour where you could only copy and paste text strings (no +graphics, no rich text, ...). Using this mode been seen as a security feature +as it effectively prevents transferring dangerous binary data, +e.g. manipulated graphics by accident. On the other hand it's also +less comfortable. (default: disabled) +.TP 8 .B streaming=<bool> enable (set to \fI1\fR) or disable (set to \fI0\fR) streaming support for images, not fully implemented yet and thus non-functional. (default: disabled) .TP 8 -- 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 3.6.x in repository nx-libs. commit 9ec41748484c5e00460a93432141a179bc158fa2 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Oct 26 23:18:55 2020 +0100 Clipboard.c: extend comments --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index dd8b049db..28d56b758 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1857,14 +1857,19 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) /* * inform the real X server that our serverWindow is the * clipboard owner. + * https://www.freedesktop.org/wiki/ClipboardManager/ states + * "In order to support peers who use the XFIXES extension to + * watch clipboard ownership changes, clipboard owners should + * reacquire the clipboard whenever the content or metadata (e.g + * the list of supported targets) changes." */ XSetSelectionOwner(nxagentDisplay, remSelAtoms[index], serverWindow, CurrentTime); /* * The real owner window (inside nxagent) is stored in - * lastSelectionOwner.window. lastSelectionOwner.windowPtr - * points to the struct that contains all information about the - * owner window. + * lastSelectionOwner[index].window. + * lastSelectionOwner[index].windowPtr points to the struct that + * contains all information about the owner window. */ storeSelectionOwnerData(index, pSelection); -- 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 3.6.x in repository nx-libs. commit 6b659fe4a8750aaef5ae74e86cafda02ac47afa9 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Oct 29 23:15:06 2020 +0100 Clipboard.c: another round of debug improvements --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 52 ++++++++++++++++---------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 4baec7273..d58707b2d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -335,7 +335,7 @@ static void printSelectionStat(int index) fprintf(stderr, " lastSelectionOwner[].client %s\n", nxagentClientInfoString(lOwner.client)); fprintf(stderr, " lastSelectionOwner[].window [0x%x]\n", lOwner.window); if (lOwner.windowPtr) - fprintf(stderr, " lastSelectionOwner[].windowPtr [%p] (-> [0x%x]\n", (void *)lOwner.windowPtr, WINDOWID(lOwner.windowPtr)); + fprintf(stderr, " lastSelectionOwner[].windowPtr [%p] (-> [0x%x])\n", (void *)lOwner.windowPtr, WINDOWID(lOwner.windowPtr)); else fprintf(stderr, " lastSelectionOwner[].windowPtr -\n"); fprintf(stderr, " lastSelectionOwner[].lastTimeChanged [%u]\n", lOwner.lastTimeChanged); @@ -727,9 +727,15 @@ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) { if (remSelAtoms[index] == sel) { + #ifdef DEBUG + fprintf(stderr, "%s: selection [%ld] belongs to index [%d]\n", __func__, sel, index); + #endif return index; } } + #ifdef DEBUG + fprintf(stderr, "%s: selection [%ld] does not belong to any index!\n", __func__, sel); + #endif return nxagentMaxSelections; } @@ -743,9 +749,15 @@ int nxagentFindCurrentSelectionIndex(Atom sel) { if (CurrentSelections[index].selection == sel) { + #ifdef DEBUG + fprintf(stderr, "%s: selection [%d] belongs to index [%d]\n", __func__, sel, index); + #endif return index; } } + #ifdef DEBUG + fprintf(stderr, "%s: selection [%d] does not belong to any index!\n", __func__, sel); + #endif return NumCurrentSelections; } @@ -841,10 +853,6 @@ static void replyRequestSelectionToXServer(XEvent *X, Bool success) void nxagentHandleSelectionRequestFromXServer(XEvent *X) { #ifdef DEBUG - if (X->xselectionrequest.requestor == serverWindow) - { - fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; - } fprintf(stderr, "%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s]\n", __func__, @@ -852,6 +860,10 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target), DisplayString(nxagentDisplay), X->xselectionrequest.requestor, X->xselectionrequest.property, NameForRemAtom(X->xselectionrequest.property)); + if (X->xselectionrequest.requestor == serverWindow) + { + fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; + } #endif if (!agentClipboardInitialized) @@ -927,7 +939,6 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) { fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], NameForRemAtom(targets[i])); } - fprintf(stderr, "\n"); #endif /* @@ -1594,15 +1605,16 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) XSelectionEvent * e = (XSelectionEvent *)X; #ifdef DEBUG - if (e->requestor == serverWindow) - { - fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; - } fprintf(stderr, "%s: SelectionNotify event from real X server, property " \ "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", __func__, e->property, NameForRemAtom(e->property), e->requestor, NameForRemAtom(e->selection), e->target, NameForRemAtom(e->target), e->time, e->send_event); + + if (e->requestor == serverWindow) + { + fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; + } #endif /* determine the selection we are talking about here */ @@ -1705,8 +1717,9 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) &ulReturnItems, &ulReturnBytesLeft, &pszReturnData); #ifdef DEBUG - fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d] returned [%s]\n", __func__, - lastSelectionOwner[index].window, clientCutProperty, getXErrorString(result)); + fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d][%s] returned [%s]\n", __func__, + lastSelectionOwner[index].window, clientCutProperty, NameForIntAtom(clientCutProperty), + getXErrorString(result)); #endif if (result == BadAlloc || result == BadAtom || result == BadWindow || result == BadValue) @@ -1721,8 +1734,9 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) &resultFormat, &ulReturnItems, &ulReturnBytesLeft, &pszReturnData); #ifdef DEBUG - fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d] returned [%s]\n", __func__, - lastSelectionOwner[index].window, clientCutProperty, getXErrorString(result)); + fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d][%s] returned [%s]\n", __func__, + lastSelectionOwner[index].window, clientCutProperty, NameForIntAtom(clientCutProperty), + getXErrorString(result)); #endif if (result == BadAlloc || result == BadAtom || @@ -1795,7 +1809,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) ulReturnItems); #ifdef DEBUG { - fprintf(stderr, "%s: XChangeProperty sent to window [0x%x] for property [%ld][%s] value [\"%*.*s\"...]\n", + fprintf(stderr, "%s: XChangeProperty sent to window [0x%lx] for property [%ld][%s] value [\"%*.*s\"...]\n", __func__, lastServers[index].requestor, lastServers[index].property, @@ -2005,7 +2019,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) nxagentClientInfoString(pSelection->client)); fprintf(stderr, "%s: lastSelectionOwner.window [0x%x] -> [0x%x]\n", __func__, lastSelectionOwner[index].window, pSelection->window); - fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%lx] (serverWindow: [0x%lx])\n", __func__, + fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%lx])\n", __func__, (void *)lastSelectionOwner[index].windowPtr, (void *)pSelection->pWin, nxagentWindow(pSelection->pWin), serverWindow); fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%u]\n", __func__, @@ -2394,7 +2408,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #endif #ifdef DEBUG - fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, + fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%lx] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, serverWindow, remTarget, NameForRemAtom(remTarget), remProperty, NameForRemAtom(remProperty), remSelection, NameForRemAtom(remSelection)); @@ -2444,7 +2458,7 @@ XlibAtom translateLocalToRemoteSelection(Atom local) } #ifdef DEBUG - fprintf(stderr, "%s: mapping local to remote selection: [%d][%s] -> [%ld] [%s]\n", __func__, + fprintf(stderr, "%s: mapping local to remote selection: [%d][%s] -> [%ld][%s]\n", __func__, local, NameForIntAtom(local), remote, NameForRemAtom(remote)); #endif @@ -2499,7 +2513,7 @@ XlibAtom translateLocalToRemoteTarget(Atom local) } #ifdef DEBUG - fprintf(stderr, "%s: mapping local to remote target: [%d][%s] -> [%ld] [%s]\n", __func__, + fprintf(stderr, "%s: mapping local to remote target: [%d][%s] -> [%ld][%s]\n", __func__, local, NameForIntAtom(local), remote, NameForRemAtom(remote)); #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 3.6.x in repository nx-libs. commit a296b437d943529ebe3363490a84f8d640bade7a Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Oct 29 23:07:59 2020 +0100 Clipboard.c: replace loop by helper --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 8872291fd..4baec7273 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1606,19 +1606,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) #endif /* determine the selection we are talking about here */ - int index = 0; - for (index = 0; index < nxagentMaxSelections; index++) - { - #ifdef DEBUG - fprintf (stderr, "%s: index [%d] selAtom [%ld] remselection [%ld] .\n", - __func__, index, remSelAtoms[index], e->selection); - #endif - if (remSelAtoms[index] == e->selection) - { - break; - } - } - + int index = nxagentFindLastSelectionOwnerIndex(e->selection); if (index == nxagentMaxSelections) { #ifdef DEBUG -- 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 3.6.x in repository nx-libs. commit a8b375079af4601f3d42ff28bd57a2818a202d99 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Oct 29 23:17:23 2020 +0100 Clipboard: init variable --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 6a7ce5d15..03f9d2554 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -107,7 +107,7 @@ typedef struct _SelectionOwner static SelectionOwner *lastSelectionOwner = NULL; /* FIXME: can this also be stored per selection? */ -static XlibAtom serverLastRequestedSelection; +static XlibAtom serverLastRequestedSelection = -1; #define IS_INTERNAL_OWNER(lsoindex) (lastSelectionOwner[lsoindex].client != NULL) @@ -2620,6 +2620,11 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) */ WindowPtr nxagentGetClipboardWindow(Atom property) { + if (serverLastRequestedSelection == -1) + { + return NULL; + } + int index = nxagentFindLastSelectionOwnerIndex(serverLastRequestedSelection); if (index < nxagentMaxSelections && property == clientCutProperty && -- 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 3.6.x in repository nx-libs. commit a4f2dd3febe01bc31a4076ca46efff03a3b6b5b0 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Oct 29 23:16:10 2020 +0100 Clipboard.c: print separator when receiving events/requests in debug mode This helps reading the debug output a lot! --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index d58707b2d..6a7ce5d15 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -769,7 +769,7 @@ int nxagentFindCurrentSelectionIndex(Atom sel) void nxagentHandleSelectionClearFromXServer(XEvent *X) { #ifdef DEBUG - fprintf(stderr, "%s: SelectionClear event for selection [%lu].\n", __func__, X->xselectionclear.selection); + fprintf(stderr, "---------\n%s: SelectionClear event for selection [%lu].\n", __func__, X->xselectionclear.selection); #endif if (!agentClipboardInitialized) @@ -853,7 +853,7 @@ static void replyRequestSelectionToXServer(XEvent *X, Bool success) void nxagentHandleSelectionRequestFromXServer(XEvent *X) { #ifdef DEBUG - fprintf(stderr, "%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ + fprintf(stderr, "---------\n%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s]\n", __func__, X->xselectionrequest.selection, NameForRemAtom(X->xselectionrequest.selection), @@ -1605,7 +1605,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) XSelectionEvent * e = (XSelectionEvent *)X; #ifdef DEBUG - fprintf(stderr, "%s: SelectionNotify event from real X server, property " \ + fprintf(stderr, "---------\n%s: Received SelectionNotify event from real X server, property " \ "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", __func__, e->property, NameForRemAtom(e->property), e->requestor, NameForRemAtom(e->selection), e->target, @@ -2095,7 +2095,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, Window requestor, Atom property, Atom target, Time time) { #ifdef DEBUG - fprintf(stderr, "%s: client %s requests sel [%s] " + fprintf(stderr, "---------\n%s: client %s requests sel [%s] " "on window [0x%x] prop [%d][%s] target [%d][%s].\n", __func__, nxagentClientInfoString(client), NameForIntAtom(selection), requestor, property, NameForIntAtom(property), @@ -2549,7 +2549,7 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) } #ifdef DEBUG - fprintf(stderr, "%s: Received SendNotify by client: property [%d][%s] target [%d][%s] selection [%d][%s] requestor [0x%x] time [%u].\n", __func__, + fprintf(stderr, "---------\n%s: Received SendNotify by client: property [%d][%s] target [%d][%s] selection [%d][%s] requestor [0x%x] time [%u].\n", __func__, event->u.selectionNotify.property, NameForIntAtom(event->u.selectionNotify.property), event->u.selectionNotify.target, NameForIntAtom(event->u.selectionNotify.target), event->u.selectionNotify.selection, NameForIntAtom(event->u.selectionNotify.selection), -- 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 3.6.x in repository nx-libs. commit e42ab9831beae06e0a3a08b6c12a58b6e71e4380 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Oct 29 23:18:12 2020 +0100 Clipboard.c: fix some whitepace, comments and FIXMEs --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 03f9d2554..3842df30e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1100,7 +1100,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) #endif { if (!(nxagentOption(Clipboard) == ClipboardServer || - nxagentOption(Clipboard) == ClipboardBoth)) + nxagentOption(Clipboard) == ClipboardBoth)) { #ifdef DEBUG fprintf (stderr, "%s: clipboard (partly) disabled - denying request.\n", __func__); @@ -1164,7 +1164,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } else { - x.u.selectionRequest.target = nxagentRemoteToLocalAtom(X->xselectionrequest.target); + x.u.selectionRequest.target = nxagentRemoteToLocalAtom(X->xselectionrequest.target); } sendEventToClient(lastSelectionOwner[index].client, &x); @@ -1179,7 +1179,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) x.u.selectionRequest.selection, NameForIntAtom(x.u.selectionRequest.selection)); #endif /* no reply to Xserver yet - we will do that once the answer of - the above sendEventToClient arrives */ + the above sendEventToClient arrives */ } else { @@ -2086,7 +2086,7 @@ FIXME /* * This is called from dix (ProcConvertSelection) if an nxagent client - * issues a ConvertSelection request. So all the Atoms are internal + * issues a ConvertSelection request. So all the Atoms are internal. * return codes: * 0: let dix process the request * 1: don't let dix process the request @@ -2417,7 +2417,6 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, UpdateCurrentTime(); XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime); - /* XConvertSelection will always return 1 (check the source!), so no need to check */ -- 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 3.6.x in repository nx-libs. commit 9ca97270568e72fc19db5a28ac03cfd3b85ada91 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Oct 30 19:37:16 2020 +0100 Events.c: use index instead of i we do that everywhere when handling clipboard stuff --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 4e45e0d24..617c7243b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2849,13 +2849,13 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) { Atom local = nxagentRemoteToLocalAtom(xfixesEvent -> xfixesselection.selection); - int i = nxagentFindCurrentSelectionIndex(local); - if (i < NumCurrentSelections) + int index = nxagentFindCurrentSelectionIndex(local); + if (index < NumCurrentSelections) { - if (CurrentSelections[i].client != 0) + if (CurrentSelections[index].client != 0) { #ifdef TEST - fprintf(stderr, "%s: Do nothing.\n", __func__); + fprintf(stderr, "%s: Doing nothing.\n", __func__); #endif return 1; @@ -2863,11 +2863,11 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) #ifdef TEST fprintf(stderr, "%s: Calling callbacks for %d [%s] selection.\n", __func__, - CurrentSelections[i].selection, NameForAtom(CurrentSelections[i].selection)); + CurrentSelections[index].selection, NameForAtom(CurrentSelections[index].selection)); #endif #ifdef DEBUG - fprintf(stderr, "%s: CurrentSelections[%d].lastTimeChanged [%u]\n", __func__, i, CurrentSelections[i].lastTimeChanged.milliseconds); + fprintf(stderr, "%s: CurrentSelections[%d].lastTimeChanged [%u]\n", __func__, index, CurrentSelections[index].lastTimeChanged.milliseconds); fprintf(stderr, "%s: Event timestamp [%ld]\n", __func__, xfixesEvent->xfixesselection.timestamp); fprintf(stderr, "%s: Event selection timestamp [%ld]\n", __func__, xfixesEvent->xfixesselection.selection_timestamp); fprintf(stderr, "%s: Event selection window [0x%lx]\n", __func__, xfixesEvent->xfixesselection.window); @@ -2886,7 +2886,7 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) #endif SelectionInfoRec info = { - .selection = &CurrentSelections[i], + .selection = &CurrentSelections[index], .kind = xfixesEvent->xfixesselection.subtype }; -- 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 3.6.x in repository nx-libs. commit b66b99a8310d312c53007e124a0924f5795b1b2c Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Nov 2 23:10:52 2020 +0100 Clipboard.c: use NullClient instead of NULL where appropriate --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 86b960a42..f57459882 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -109,7 +109,7 @@ static SelectionOwner *lastSelectionOwner = NULL; /* FIXME: can this also be stored per selection? */ static XlibAtom serverLastRequestedSelection = -1; -#define IS_INTERNAL_OWNER(lsoindex) (lastSelectionOwner[lsoindex].client != NULL) +#define IS_INTERNAL_OWNER(lsoindex) (lastSelectionOwner[lsoindex].client != NullClient) /* * Needed to handle the notify selection event to @@ -656,7 +656,7 @@ static void initSelectionOwnerData(int index) /* there's no owner on nxagent side anymore */ static void clearSelectionOwnerData(int index) { - lastSelectionOwner[index].client = NULL; + lastSelectionOwner[index].client = NullClient; lastSelectionOwner[index].window = None; lastSelectionOwner[index].windowPtr = NULL; lastSelectionOwner[index].lastTimeChanged = GetTimeInMillis(); -- 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 3.6.x in repository nx-libs. commit 2d4b0f8464cd2b34e2ae0a8009715fcf027f9738 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Oct 29 23:19:39 2020 +0100 Clipboard.c: fix transfer from agent to X server The code took the wrong path because of an insufficent check --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 3842df30e..86b960a42 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1629,7 +1629,12 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) printClientSelectionStage(index); - if (lastClients[index].windowPtr != NULL) + /* + * if the property is serverTransFromAgentProperty this means we are + * transferring data FROM the agent TO the server. + */ + + if (X->xselection.property != serverTransFromAgentProperty && lastClients[index].windowPtr != NULL) { /* * We reach here after a paste inside the nxagent, triggered by -- 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 3.6.x in repository nx-libs. commit 177d761797b36fdadb246c0129cfb14bcc1c0c19 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Nov 12 23:22:39 2020 +0100 Clipboard.c: fix: remove wrong optimization In the "none" case we must ensure the clipboard data is reset. This "optimization" skipped the reset part which made the code think it is waiting for an answer. Which (of course) never arrived. So any further request was rejected... Also reduce debugging output for the "none" case because resetClientSelectionStage will print it anyway. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index f57459882..2856026f2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -480,26 +480,16 @@ static void resetClientSelectionStage(int index) static void setClientSelectionStage(int stage, int index) { - if (lastClients[index].stage == stage) - { - #ifdef DEBUG - fprintf(stderr, "%s: lastClient [%d] selection stage already set to [%s] - doing nothing\n", __func__, - index, getClientSelectionStageString(lastClients[index].stage)); - #endif - return; - } - - #ifdef DEBUG - fprintf(stderr, "%s: Changing selection stage for [%d] from [%s] to [%s]\n", __func__, index, - getClientSelectionStageString(lastClients[index].stage), getClientSelectionStageString(stage)); - #endif - if (stage == SelectionStageNone) { resetClientSelectionStage(index); } else { + #ifdef DEBUG + fprintf(stderr, "%s: Changing selection stage for [%d] from [%s] to [%s]\n", __func__, index, + getClientSelectionStageString(lastClients[index].stage), getClientSelectionStageString(stage)); + #endif lastClients[index].stage = stage; } } -- 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 3.6.x in repository nx-libs. commit 6a1ee6c0b0ff7be509ca61966873644de2d7ccb1 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Nov 13 18:24:26 2020 +0100 Clipboard.c: once again improved DEBUG output Also reduce number of certain DEBUG lines: These PropertyEvents tend to appear quite often and most of the times they have nothing to do with the clipboard. So instead of printing them everytime we turn that around and print something only if it is a clipboard related event.. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 47 +++++++++++++++++++------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 2856026f2..ae9bb0f1d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -718,13 +718,13 @@ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) if (remSelAtoms[index] == sel) { #ifdef DEBUG - fprintf(stderr, "%s: selection [%ld] belongs to index [%d]\n", __func__, sel, index); + fprintf(stderr, "%s: remote selection [%ld][%s] belongs to index [%d]\n", __func__, sel, NameForRemAtom(sel), index); #endif return index; } } #ifdef DEBUG - fprintf(stderr, "%s: selection [%ld] does not belong to any index!\n", __func__, sel); + fprintf(stderr, "%s: remote selection [%ld][%s] does not belong to any index!\n", __func__, sel, NameForRemAtom(sel)); #endif return nxagentMaxSelections; } @@ -740,13 +740,13 @@ int nxagentFindCurrentSelectionIndex(Atom sel) if (CurrentSelections[index].selection == sel) { #ifdef DEBUG - fprintf(stderr, "%s: selection [%d] belongs to index [%d]\n", __func__, sel, index); + fprintf(stderr, "%s: selection [%d][%s] belongs to index [%d]\n", __func__, sel, NameForIntAtom(sel), index); #endif return index; } } #ifdef DEBUG - fprintf(stderr, "%s: selection [%d] does not belong to any index!\n", __func__, sel); + fprintf(stderr, "%s: selection [%d][%s] does not belong to any index!\n", __func__, sel, NameForIntAtom(sel)); #endif return NumCurrentSelections; } @@ -759,7 +759,9 @@ int nxagentFindCurrentSelectionIndex(Atom sel) void nxagentHandleSelectionClearFromXServer(XEvent *X) { #ifdef DEBUG - fprintf(stderr, "---------\n%s: SelectionClear event for selection [%lu].\n", __func__, X->xselectionclear.selection); + fprintf(stderr, "---------\n%s: SelectionClear event for selection [%lu][%s] window [0x%lx] time [%lu].\n", + __func__, X->xselectionclear.selection, NameForRemAtom(X->xselectionclear.selection), + X->xselectionclear.window, X->xselectionclear.time); #endif if (!agentClipboardInitialized) @@ -844,12 +846,13 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) { #ifdef DEBUG fprintf(stderr, "---------\n%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ - "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s]\n", + "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s] time [%lu]\n", __func__, X->xselectionrequest.selection, NameForRemAtom(X->xselectionrequest.selection), X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target), DisplayString(nxagentDisplay), X->xselectionrequest.requestor, - X->xselectionrequest.property, NameForRemAtom(X->xselectionrequest.property)); + X->xselectionrequest.property, NameForRemAtom(X->xselectionrequest.property), + X->xselectionrequest.time); if (X->xselectionrequest.requestor == serverWindow) { fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; @@ -1395,20 +1398,27 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) /* determine the selection we are talking about here */ for (index = 0; index < nxagentMaxSelections; index++) { + /* #ifdef DEBUG fprintf(stderr, "%s: lastClients[%d].resource [%d] resource [%d]\n", __func__, index, lastClients[index].resource, resource); #endif + */ if (lastClients[index].resource == resource) { + #ifdef DEBUG + fprintf (stderr, "%s: resource [%d] belongs to selection [%d].\n", __func__, resource, index); + #endif break; } } if (index == nxagentMaxSelections) { + /* #ifdef DEBUG - fprintf (stderr, "%s: resource does not belong to any selection we handle.\n", __func__); + fprintf (stderr, "%s: resource [%d] does not belong to any selection we handle.\n", __func__, resource); #endif + */ return False; } @@ -1601,9 +1611,10 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) NameForRemAtom(e->selection), e->target, NameForRemAtom(e->target), e->time, e->send_event); + /* this has not been SENT by nxagent but is the answer to a request of nxagent */ if (e->requestor == serverWindow) { - fprintf(stderr, "%s: this event has been sent by nxagent!\n", __func__);; + fprintf(stderr, "%s: requestor is nxagent's serverWindow!\n", __func__);; } #endif @@ -1804,11 +1815,12 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) ulReturnItems); #ifdef DEBUG { - fprintf(stderr, "%s: XChangeProperty sent to window [0x%lx] for property [%ld][%s] value [\"%*.*s\"...]\n", + fprintf(stderr, "%s: XChangeProperty sent to window [0x%lx] for property [%ld][%s] len [%d] value [\"%*.*s\"...]\n", __func__, lastServers[index].requestor, lastServers[index].property, NameForRemAtom(lastServers[index].property), + (int)ulReturnItems * 8 / 8, (int)(min(20, ulReturnItems * 8 / 8)), (int)(min(20, ulReturnItems * 8 / 8)), pszReturnData); @@ -1924,6 +1936,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, SelectionInfoRec *info = (SelectionInfoRec *)args; #ifdef DEBUG + fprintf(stderr, "---------\n"); if (info->kind == SelectionSetOwner) { fprintf(stderr, "%s: SelectionCallbackKind [SelectionSetOwner]\n", __func__); @@ -2091,10 +2104,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, { #ifdef DEBUG fprintf(stderr, "---------\n%s: client %s requests sel [%s] " - "on window [0x%x] prop [%d][%s] target [%d][%s].\n", __func__, + "on window [0x%x] prop [%d][%s] target [%d][%s] time [%u].\n", __func__, nxagentClientInfoString(client), NameForIntAtom(selection), requestor, property, NameForIntAtom(property), - target, NameForIntAtom(target)); + target, NameForIntAtom(target), time); #endif /* cannot use NameForIntAtom() here! */ @@ -2136,6 +2149,9 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, /* * There is a client owner on the agent side, let normal dix stuff happen. */ + #ifdef DEBUG + fprintf(stderr, "%s: clipboard is owned by internal client - let dix process the request\n", __func__); + #endif return 0; } @@ -2543,7 +2559,7 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) } #ifdef DEBUG - fprintf(stderr, "---------\n%s: Received SendNotify by client: property [%d][%s] target [%d][%s] selection [%d][%s] requestor [0x%x] time [%u].\n", __func__, + fprintf(stderr, "---------\n%s: Received SendNotify from client: property [%d][%s] target [%d][%s] selection [%d][%s] requestor [0x%x] time [%u].\n", __func__, event->u.selectionNotify.property, NameForIntAtom(event->u.selectionNotify.property), event->u.selectionNotify.target, NameForIntAtom(event->u.selectionNotify.target), event->u.selectionNotify.selection, NameForIntAtom(event->u.selectionNotify.selection), @@ -2601,6 +2617,11 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) .time = CurrentTime, }; + #ifdef DEBUG + fprintf(stderr, "%s: remote property [%ld][%s].\n", __func__, + serverTransFromAgentProperty, NameForRemAtom(serverTransFromAgentProperty)); + #endif + sendSelectionNotifyEventToXServer(&eventSelection); return 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 3.6.x in repository nx-libs. commit 53c03eaf3bfe06c445e9353c97663553afb1a3f7 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Nov 17 00:14:07 2020 +0100 Clipboard.c: fix: return after denying request --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index b0cd1bef3..10dafcda6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1096,6 +1096,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) /* deny the request */ replyRequestSelectionToXServer(X, False); + return; } /* -- 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 3.6.x in repository nx-libs. commit 99a2d6e292a56ad3756348e5b8d997a2b75c7539 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Nov 18 22:41:32 2020 +0100 Clipboard.c: implement target caching Some applications (e.g. Chrome, Firefox) send multiple TARGETS requests when they want to paste a selection (reason currently unknown). If such an application runs in an NX session and the current clipboard owner is on the real X server this triggers many (superflous) roundtrips. By caching the first answer to those requests and answering subsequent requests from the cache we can eliminate all this communication. The implemention resulted from attempting to fix ArcticaProject/nx-libs/issues/#969 (solution 1a) but it turned out that the speedup this brings does not help in reducing the number of requests by firefox. It must be a bug in the firefox code. Nevertheless I kept the code as it should speed up the whole pasting process considerably while reducing communication over the wire. This also eliminates a memory leak in the target forwarding code which was unnoticed before. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 118 +++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index f8d1a5d18..18bd44099 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -106,6 +106,19 @@ typedef struct _SelectionOwner static SelectionOwner *lastSelectionOwner = NULL; +/* + * cache for targets the current selection owner + * on the real X server has to offer. We are storing the targets + * after they have been converted from XlibAtom to Atom. +*/ +typedef struct _Targets +{ + Atom *targets; + int numTargets; +} Targets; + +static Targets *targetCache = NULL; + /* FIXME: can this also be stored per selection? */ static XlibAtom serverLastRequestedSelection = -1; @@ -378,6 +391,12 @@ static void printLastServerStat(int index) fprintf(stderr, " lastServer[].time (Time) [%u]\n", ls.time); } +static void printTargetCacheStat(int index) +{ + fprintf(stderr, " targetCache[].targets (Atom *) [%p]\n", (void *)targetCache[index].targets); + fprintf(stderr, " targetCache[].numTargets (int) [%d]\n", targetCache[index].numTargets); +} + void nxagentDumpClipboardStat(void) { fprintf(stderr, "/----- Clipboard internal status -----\n"); @@ -452,6 +471,7 @@ void nxagentDumpClipboardStat(void) printSelectionStat(index); printLastClientStat(index); printLastServerStat(index); + printTargetCacheStat(index); } fprintf(stderr, "\\------------------------------------------------------------------------------\n"); @@ -747,6 +767,41 @@ int nxagentFindCurrentSelectionIndex(Atom sel) return NumCurrentSelections; } +void cacheTargets(int index, Atom* targets, int numTargets) +{ + #ifdef DEBUG + fprintf(stderr, "%s: caching [%d] targets\n", __func__, numTargets); + #endif + + SAFE_free(targetCache[index].targets); + targetCache[index].targets = targets; + targetCache[index].numTargets = numTargets; +} + +/* this is called on init, reconnect and SelectionClear */ +void invalidateTargetCache(int index) +{ + #ifdef DEBUG + fprintf(stderr, "%s: invalidating target cache [%d]\n", __func__, index); + #endif + + SAFE_free(targetCache[index].targets); + targetCache[index].numTargets = 0; +} + +void invalidateTargetCaches(void) +{ + #ifdef DEBUG + fprintf(stderr, "%s: invalidating all target caches\n", __func__); + #endif + + for (int index = 0; index < nxagentMaxSelections; index++) + { + SAFE_free(targetCache[index].targets); + targetCache[index].numTargets = 0; + } +} + /* * This is called from Events.c dispatch loop on reception of a * SelectionClear event. We receive this event if someone on the real @@ -802,6 +857,8 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) clearSelectionOwnerData(index); setClientSelectionStage(SelectionStageNone, index); + + invalidateTargetCache(index); } } @@ -1543,6 +1600,8 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) 32, PropModeReplace, ulReturnItems, (unsigned char*)targets, 1); + cacheTargets(index, targets, numTargets); + endTransfer(SELECTION_SUCCESS, index); } } @@ -1951,6 +2010,12 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, } #endif + /* + * We do not know index here so for now let's invalidate the + * complete cache on every owner change regardless of the selection. + */ + invalidateTargetCaches(); + if (nxagentExternalClipboardEventTrap) { #ifdef DEBUG @@ -2063,6 +2128,13 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) storeSelectionOwnerData(index, pSelection); setClientSelectionStage(SelectionStageNone, index); + + /* + * this will be repeated on reception of the SelectionOwner callback + * but we cannot be sure if there are any intermediate requests in the queue + * already so better do it here, too + */ + invalidateTargetCache(index); } /* FIXME: commented because index is invalid here! */ @@ -2253,6 +2325,42 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, } else { + /* + * Shortcut: Some applications tend to post multiple + * SelectionRequests. Further it can happen that multiple + * clients are interested in clipboard content. If we already + * know the answer and no intermediate SelectionOwner event + * occured we can answer with the cached list of targets. + */ + + if (targetCache[index].targets) + { + Atom *targets = targetCache[index].targets; + int numTargets = targetCache[index].numTargets; + + #ifdef DEBUG + fprintf(stderr, "%s: Sending %d cached targets:\n", __func__, numTargets); + for (int i = 0; i < numTargets; i++) + { + fprintf(stderr, "%s: %d %s\n", __func__, targets[i], NameForIntAtom(targets[i])); + } + #endif + + ChangeWindowProperty(pWin, + property, + MakeAtom("ATOM", 4, 1), + sizeof(Atom)*8, + PropModeReplace, + numTargets, + targets, + 1); + + sendSelectionNotifyEventToClient(client, time, requestor, selection, + target, property); + + return 1; + } + /* * do nothing - TARGETS will be handled like any other target * and passed on to the owner on the remote side. @@ -2760,6 +2868,13 @@ Bool nxagentInitClipboard(WindowPtr pWin) { FatalError("nxagentInitClipboard: Failed to allocate memory for the remote selection Atoms array.\n"); } + + SAFE_free(targetCache); + targetCache = (Targets *) calloc(nxagentMaxSelections, sizeof(Targets)); + if (targetCache == NULL) + { + FatalError("nxagentInitClipboard: Failed to allocate memory for target cache.\n"); + } } /* @@ -2884,6 +2999,8 @@ Bool nxagentInitClipboard(WindowPtr pWin) * clients might still be waiting for answers. Should reply * with failure then */ + + invalidateTargetCache(index); } } } @@ -2896,6 +3013,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) /* FIXME: required? move to setSelectionStage? */ lastClients[index].reqTime = GetTimeInMillis(); lastServers[index].requestor = None; + invalidateTargetCache(index); } clientCutProperty = MakeAtom(szAgentNX_CUT_BUFFER_CLIENT, -- 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 3.6.x in repository nx-libs. commit 7e548faa268410be607603ee36bc23fd856e7553 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Nov 16 23:51:52 2020 +0100 Clipboard.c: remove obsolete FIXME comment --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index ae9bb0f1d..b0cd1bef3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -679,10 +679,6 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) (void *) pClient, CLINDEX(pClient), (void *) pWindow, WINDOWID(pWindow)); #endif - /* - * Only for PRIMARY and CLIPBOARD selections. - */ - /* FIXME: there's almost identical code in nxagentClipboardInit */ for (int index = 0; index < nxagentMaxSelections; index++) { @@ -969,7 +965,6 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * * FIXME: ensure we are reporting an _external_ timestamp * FIXME: for a 32 bit property list we need to pass a "long" array, not "char"! - * FIXME: selection has already been checked above, so we do not need to check again here */ XChangeProperty(nxagentDisplay, -- 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 3.6.x in repository nx-libs. commit 41ea3b68425f45bdcd90a21baa84506f48332782 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Nov 17 16:20:20 2020 +0100 Clipboard.c: correctly pass back failure to real X server --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 68 +++++++++++++++++--------- 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 10dafcda6..ceed43aa9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2594,33 +2594,57 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) else { /* - * Setup selection notify event to real server. - * - * .property must be a server-side Atom. As this property is only - * set on our serverWindow and normally there are few other - * properties except serverTransToAgentProperty, the only thing - * we need to ensure is that the internal Atom clientCutProperty - * differs from the server-side serverTransToAgentProperty - * Atom. The actual name is not important. To be clean here we use - * a separate serverTransFromAgentProperty. + * if the property is 0 (reporting failure) we can directly + * answer to the lastServer about the failure! */ + if (lastServers[index].requestor != None && event->u.selectionNotify.property == 0) + { + #ifdef DEBUG + fprintf(stderr, "%s: passing on failure to lastServers[%d].requestor [%ld].\n", __func__, + index, lastServers[index].requestor); + #endif - XSelectionEvent eventSelection = { - .requestor = serverWindow, - .selection = translateLocalToRemoteSelection(event->u.selectionNotify.selection), - .target = translateLocalToRemoteTarget(event->u.selectionNotify.target), - .property = serverTransFromAgentProperty, - .time = CurrentTime, - }; + XSelectionEvent eventSelection = { + .requestor = lastServers[index].requestor, + .selection = remSelAtoms[index], + .target = lastServers[index].target, + .property = 0, + .time = lastServers[index].time, + }; + sendSelectionNotifyEventToXServer(&eventSelection); - #ifdef DEBUG - fprintf(stderr, "%s: remote property [%ld][%s].\n", __func__, - serverTransFromAgentProperty, NameForRemAtom(serverTransFromAgentProperty)); - #endif + lastServers[index].requestor = None; + return 1; + } + else + { + /* + * Setup selection notify event to real server. + * + * .property must be a server-side Atom. As this property is only + * set on our serverWindow and normally there are few other + * properties except serverTransToAgentProperty, the only thing + * we need to ensure is that the internal Atom clientCutProperty + * differs from the server-side serverTransToAgentProperty + * Atom. The actual name is not important. To be clean here we use + * a separate serverTransFromAgentProperty. + */ - sendSelectionNotifyEventToXServer(&eventSelection); + XSelectionEvent eventSelection = { + .requestor = serverWindow, + .selection = translateLocalToRemoteSelection(event->u.selectionNotify.selection), + .target = translateLocalToRemoteTarget(event->u.selectionNotify.target), + .property = serverTransFromAgentProperty, + .time = CurrentTime, + }; - return 1; + #ifdef DEBUG + fprintf(stderr, "%s: remote property [%ld][%s].\n", __func__, + serverTransFromAgentProperty, NameForRemAtom(serverTransFromAgentProperty)); + #endif + sendSelectionNotifyEventToXServer(&eventSelection); + return 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 3.6.x in repository nx-libs. commit 63ef52c63ab376c6db068397edbc2cd295f205b7 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Nov 18 22:38:44 2020 +0100 Clipboard.c: fix indentation --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index ceed43aa9..f8d1a5d18 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2022,12 +2022,12 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) nxagentClientInfoString(lastSelectionOwner[index].client), nxagentClientInfoString(pSelection->client)); fprintf(stderr, "%s: lastSelectionOwner.window [0x%x] -> [0x%x]\n", __func__, - lastSelectionOwner[index].window, pSelection->window); + lastSelectionOwner[index].window, pSelection->window); fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%lx])\n", __func__, - (void *)lastSelectionOwner[index].windowPtr, (void *)pSelection->pWin, - nxagentWindow(pSelection->pWin), serverWindow); + (void *)lastSelectionOwner[index].windowPtr, (void *)pSelection->pWin, + nxagentWindow(pSelection->pWin), serverWindow); fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%u]\n", __func__, - lastSelectionOwner[index].lastTimeChanged); + lastSelectionOwner[index].lastTimeChanged); #endif #if defined(TEST) || defined(DEBUG) -- 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 3.6.x in repository nx-libs. commit 55f9c94b2b7672e1c4edc2bdcd14a8b892bb61eb Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Nov 18 23:12:53 2020 +0100 Clipboard.c: improve some comments --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 18bd44099..af6f16032 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1943,11 +1943,6 @@ static void resetSelectionOwnerOnXServer(void) return; } - /* - * Only for PRIMARY and CLIPBOARD selections. - */ - - for (int index = 0; index < nxagentMaxSelections; index++) { XSetSelectionOwner(nxagentDisplay, remSelAtoms[index], serverWindow, CurrentTime); @@ -1960,7 +1955,7 @@ static void resetSelectionOwnerOnXServer(void) setClientSelectionStage(SelectionStageNone, index); - /* Hmm, this is already None when reaching this */ + /* Hmm, this is already None when reaching here */ lastServers[index].requestor = None; } } @@ -2102,6 +2097,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) * we are in the process of communicating back and forth between * real X server and nxagent's clients - let's not disturb * FIXME: by continuing after the warning were ARE disturbing! + * We should cancel that communication here. */ fprintf (stderr, "%s: WARNING! lastServers[%d].requestor window [0x%lx] already set.\n", __func__, index, lastServers[index].requestor); @@ -2178,7 +2174,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, target, NameForIntAtom(target), time); #endif - /* cannot use NameForIntAtom() here! */ + /* We cannot use NameForIntAtom() here! FIXME: Why not? */ if (NameForAtom(target) == NULL) { #ifdef DEBUG @@ -2281,7 +2277,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, { /* * In TextClipboard mode answer with a predefined list that was used - * in in previous versions. + * in previous versions. */ if (nxagentOption(TextClipboard)) { @@ -2533,7 +2529,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime); /* XConvertSelection will always return 1 (check the source!), so no - need to check */ + need to check the return code. */ #ifdef DEBUG fprintf(stderr, "%s: Sent XConvertSelection\n", __func__); -- 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 3.6.x in repository nx-libs. commit 8f182cd74b2e1217624ed80de8f62220c09dad2e Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Nov 25 00:29:37 2020 +0100 Clipboard.c: introduce replyPendingRequestSelectionToXServer helper --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 70 ++++++++++++++------------ 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 7598f9916..6e2337a4d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -320,6 +320,7 @@ static void sendSelectionNotifyEventToClient(ClientPtr client, Atom target, Atom property); static Status sendSelectionNotifyEventToXServer(XSelectionEvent *event_to_send); +static void replyPendingRequestSelectionToXServer(int index, Bool success); #ifdef DEBUG static void printSelectionStat(int sel); #endif @@ -1898,24 +1899,45 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) * effectively will send a "Request denied" to the initial * requestor. */ - XSelectionEvent eventSelection = { - .requestor = lastServers[index].requestor, - .selection = X->xselection.selection, - /* .target = X->xselection.target, */ - .target = lastServers[index].target, - .property = lastServers[index].property, - .time = lastServers[index].time, - /* .time = CurrentTime */ - }; - #ifdef DEBUG - fprintf(stderr, "%s: Sending SelectionNotify event to requestor [%p].\n", __func__, - (void *)eventSelection.requestor); - #endif + replyPendingRequestSelectionToXServer(index, True); + } + } +} - sendSelectionNotifyEventToXServer(&eventSelection); +/* + * This is similar to replyRequestSelectionToXServer(), but gets the + * required values from a stored request instead of an XEvent + * structure. + */ +void replyPendingRequestSelectionToXServer(int index, Bool success) +{ + if (lastServers[index].requestor == None) + { + #ifdef DEBUG + fprintf(stderr, "%s: no pending request for index [%d] - doing nothing\n", __func__, index); + #endif + } + else + { + XSelectionEvent eventSelection = { + .requestor = lastServers[index].requestor, + .selection = remSelAtoms[index], + .target = lastServers[index].target, + .time = lastServers[index].time, + .property = success ? lastServers[index].property : None, + }; - lastServers[index].requestor = None; /* allow further request */ - } + #ifdef DEBUG + fprintf(stderr, "%s: Sending %s SelectionNotify event to requestor [%p].\n", __func__, + success ? "positive" : "negative", (void *)eventSelection.requestor); + #endif + + sendSelectionNotifyEventToXServer(&eventSelection); + + lastServers[index].requestor = None; /* allow further request */ + lastServers[index].property = 0; + lastServers[index].target = 0; + lastServers[index].time = 0; } } @@ -2703,21 +2725,7 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) */ if (lastServers[index].requestor != None && event->u.selectionNotify.property == 0) { - #ifdef DEBUG - fprintf(stderr, "%s: passing on failure to lastServers[%d].requestor [%ld].\n", __func__, - index, lastServers[index].requestor); - #endif - - XSelectionEvent eventSelection = { - .requestor = lastServers[index].requestor, - .selection = remSelAtoms[index], - .target = lastServers[index].target, - .property = 0, - .time = lastServers[index].time, - }; - sendSelectionNotifyEventToXServer(&eventSelection); - - lastServers[index].requestor = None; + replyPendingRequestSelectionToXServer(index, False); return 1; } else -- 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 3.6.x in repository nx-libs. commit b7021c6754c0d4f44d81d12763c095c15c0bc882 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Nov 24 22:40:24 2020 +0100 Events.c: use already available variable instead of repeating conversion --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 617c7243b..2ec17c328 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2872,7 +2872,7 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) fprintf(stderr, "%s: Event selection timestamp [%ld]\n", __func__, xfixesEvent->xfixesselection.selection_timestamp); fprintf(stderr, "%s: Event selection window [0x%lx]\n", __func__, xfixesEvent->xfixesselection.window); fprintf(stderr, "%s: Event selection owner [0x%lx]\n", __func__, xfixesEvent->xfixesselection.owner); - fprintf(stderr, "%s: Event selection [%s]\n", __func__, NameForAtom(nxagentRemoteToLocalAtom(xfixesEvent->xfixesselection.selection))); + fprintf(stderr, "%s: Event selection [%s]\n", __func__, NameForAtom(local)); fprintf(stderr, "%s: Subtype ", __func__); -- 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 3.6.x in repository nx-libs. commit cf85c725889c92ba1aa0d506649362bbfcc111b6 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Nov 24 22:23:38 2020 +0100 Clipboard.c: reset lastServer[].requestor on reconnect --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index af6f16032..eeeb28bab 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2989,11 +2989,17 @@ Bool nxagentInitClipboard(WindowPtr pWin) /* remSelAtoms have already been adjusted above */ XSetSelectionOwner(nxagentDisplay, remSelAtoms[index], serverWindow, CurrentTime); } + + /* + * On reconnect there cannot be any external requestor + * waiting for a reply so clean this + */ + lastServers[index].requestor = None; + /* - * FIXME: Shouldn't we reset lastServers[index].* and - * lastClients[index].* here? Problem is that (internal) - * clients might still be waiting for answers. Should reply - * with failure then + * FIXME: We should reset lastClients[index].* here! Problem + * is that internal clients might still be waiting for + * answers. Should reply with failure then. */ invalidateTargetCache(index); -- 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 3.6.x in repository nx-libs. commit 7746358b6536289fab9e89b525cf8329a64b731a Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Nov 25 00:23:47 2020 +0100 Clipboard.c: move some (currently commented) code to inner scope --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index eeeb28bab..7598f9916 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2131,10 +2131,9 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) * already so better do it here, too */ invalidateTargetCache(index); - } - /* FIXME: commented because index is invalid here! */ - /* lastServers[index].requestor = None; */ + /* FIXME: commented because index is invalid here! */ + /* lastServers[index].requestor = None; */ /* FIXME @@ -2154,6 +2153,7 @@ FIXME } else fprintf (stderr, "%s: SetSelectionOwner failed\n", __func__); */ + } } /* -- 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 3.6.x in repository nx-libs. commit 1fd98b193c3f4cadb227017bb3434d1fd2c37a13 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Nov 25 00:26:16 2020 +0100 Clipboard.c: add another FIXME --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index d46d4c7fc..682dfbab0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2163,7 +2163,11 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) /* FIXME - if (XGetSelectionOwner(nxagentDisplay,pSelection->selection) == serverWindow) +FIXME2: instead of XGetSelectionOwner we could check if the Xfixes + SetSelectionOwner event has arrived in the event queue; + possibly saving one roundtrip. + + if (XGetSelectionOwner(nxagentDisplay, pSelection->selection) == serverWindow) { fprintf (stderr, "%s: SetSelectionOwner OK\n", __func__); -- 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 3.6.x in repository nx-libs. commit 51dae621fcfd6e6453657591205e673f16c2df04 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 2 23:43:53 2020 +0100 Clipboard.c: extend target caching for the other direction This may seem unneccessary at first sight because we are only talking to our own clients which generally is quick. But if you are using nested nx sessions or clients from remote machines (e.g. via ssh X forwarding) this still can save some lenghty communication. Plus: it helps in debugging because there are fewer messages being sent around. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 93 +++++++++++++++++++++----- 1 file changed, 76 insertions(+), 17 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 682dfbab0..f88d7588b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -108,15 +108,21 @@ static SelectionOwner *lastSelectionOwner = NULL; /* * cache for targets the current selection owner - * on the real X server has to offer. We are storing the targets - * after they have been converted from XlibAtom to Atom. + * has to offer. We are storing the targets + * after they have been converted */ typedef struct _Targets { - Atom *targets; - int numTargets; + Bool type; /* EMPTY, FORINT, FORREM */ + unsigned int numTargets; + Atom *forInt; /* Atoms converted for internal -> type Atom, not XlibAtom */ + XlibAtom *forRem; /* Atoms converted for remote -> type XlibAtom, not Atom */ } Targets; +#define EMPTY 0 +#define FORREM 1 +#define FORINT 2 + static Targets *targetCache = NULL; /* FIXME: can this also be stored per selection? */ @@ -394,7 +400,9 @@ static void printLastServerStat(int index) static void printTargetCacheStat(int index) { - fprintf(stderr, " targetCache[].targets (Atom *) [%p]\n", (void *)targetCache[index].targets); + fprintf(stderr, " targetCache[].type (int) [%d]\n", targetCache[index].type); + fprintf(stderr, " targetCache[].forInt (Atom *) [%p]\n", (void *)targetCache[index].forInt); + fprintf(stderr, " targetCache[].forRem (XlibAtom *) [%p]\n", (void *)targetCache[index].forRem); fprintf(stderr, " targetCache[].numTargets (int) [%d]\n", targetCache[index].numTargets); } @@ -768,14 +776,29 @@ int nxagentFindCurrentSelectionIndex(Atom sel) return NumCurrentSelections; } -void cacheTargets(int index, Atom* targets, int numTargets) +void cacheTargetsForInt(int index, Atom* targets, int numTargets) +{ + #ifdef DEBUG + fprintf(stderr, "%s: caching [%d] targets for internal requests\n", __func__, numTargets); + #endif + + SAFE_free(targetCache[index].forInt); + SAFE_free(targetCache[index].forRem); + targetCache[index].type = FORINT; + targetCache[index].forInt = targets; + targetCache[index].numTargets = numTargets; +} + +void cacheTargetsForRem(int index, XlibAtom* targets, int numTargets) { #ifdef DEBUG - fprintf(stderr, "%s: caching [%d] targets\n", __func__, numTargets); + fprintf(stderr, "%s: caching [%d] targets for remote requests\n", __func__, numTargets); #endif - SAFE_free(targetCache[index].targets); - targetCache[index].targets = targets; + SAFE_free(targetCache[index].forInt); + SAFE_free(targetCache[index].forRem); + targetCache[index].type = FORREM; + targetCache[index].forRem = targets; targetCache[index].numTargets = numTargets; } @@ -786,7 +809,9 @@ void invalidateTargetCache(int index) fprintf(stderr, "%s: invalidating target cache [%d]\n", __func__, index); #endif - SAFE_free(targetCache[index].targets); + SAFE_free(targetCache[index].forInt); + SAFE_free(targetCache[index].forRem); + targetCache[index].type = EMPTY; targetCache[index].numTargets = 0; } @@ -798,7 +823,9 @@ void invalidateTargetCaches(void) for (int index = 0; index < nxagentMaxSelections; index++) { - SAFE_free(targetCache[index].targets); + SAFE_free(targetCache[index].forInt); + SAFE_free(targetCache[index].forRem); + targetCache[index].type = EMPTY; targetCache[index].numTargets = 0; } } @@ -1006,7 +1033,39 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } else { - /* do nothing, let TARGETS be passed on to the owner later */ + /* + * Shortcut: Some applications tend to post multiple + * SelectionRequests. Further it can happen that multiple + * clients are interested in clipboard content. If we already + * know the answer and no intermediate SelectionOwner event + * occured we can answer with the cached list of targets. + */ + + if (targetCache[index].type == FORREM && targetCache[index].forRem) + { + XlibAtom *targets = targetCache[index].forRem; + unsigned int numTargets = targetCache[index].numTargets; + + #ifdef DEBUG + fprintf(stderr, "%s: Sending %d cached targets to remote requestor:\n", __func__, numTargets); + for (int i = 0; i < numTargets; i++) + { + fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], NameForRemAtom(targets[i])); + } + #endif + + XChangeProperty(nxagentDisplay, + X->xselectionrequest.requestor, + X->xselectionrequest.property, + XInternAtom(nxagentDisplay, "ATOM", 0), + 32, + PropModeReplace, + (unsigned char *)targets, + numTargets); + + replyRequestSelectionToXServer(X, True); + return; + } } } else if (X->xselectionrequest.target == serverTIMESTAMP) @@ -1601,7 +1660,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) 32, PropModeReplace, ulReturnItems, (unsigned char*)targets, 1); - cacheTargets(index, targets, numTargets); + cacheTargetsForInt(index, targets, numTargets); endTransfer(SELECTION_SUCCESS, index); } @@ -1852,7 +1911,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) (unsigned char*)targets, numTargets); - SAFE_free(targets); + cacheTargetsForRem(index, targets, numTargets); } } else @@ -2358,13 +2417,13 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * occured we can answer with the cached list of targets. */ - if (targetCache[index].targets) + if (targetCache[index].type == FORINT && targetCache[index].forInt) { - Atom *targets = targetCache[index].targets; + Atom *targets = targetCache[index].forInt; int numTargets = targetCache[index].numTargets; #ifdef DEBUG - fprintf(stderr, "%s: Sending %d cached targets:\n", __func__, numTargets); + fprintf(stderr, "%s: Sending %d cached targets to internal client:\n", __func__, numTargets); for (int i = 0; i < numTargets; i++) { fprintf(stderr, "%s: %d %s\n", __func__, targets[i], NameForIntAtom(targets[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 3.6.x in repository nx-libs. commit ff4a1967c0f98db79611d1bbf426fd7cebff0abd Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Nov 25 00:30:03 2020 +0100 Clipboard.c: cancel pending requests in certain situations --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 6e2337a4d..d46d4c7fc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -714,7 +714,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) setClientSelectionStage(SelectionStageNone, index); - lastServers[index].requestor = None; + replyPendingRequestSelectionToXServer(index, False); } if (pWindow && pWindow == lastClients[index].windowPtr) @@ -2116,13 +2116,16 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) if (lastServers[index].requestor != None) { /* - * we are in the process of communicating back and forth between - * real X server and nxagent's clients - let's not disturb - * FIXME: by continuing after the warning were ARE disturbing! - * We should cancel that communication here. + * There's an X client on the real X server waiting for a + * reply. That reply will never come because now we are the + * owner so let's be fair and cancel that request. */ - fprintf (stderr, "%s: WARNING! lastServers[%d].requestor window [0x%lx] already set.\n", + fprintf(stderr, "%s: WARNING! lastServers[%d].requestor window [0x%lx] already set. Cancelling pending request.\n", __func__, index, lastServers[index].requestor); + + replyPendingRequestSelectionToXServer(index, False); + + /* now we can go on */ } #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 3.6.x in repository nx-libs. commit 7a2c743ac4d8578ddfc5baa5c6256060fe3c93c6 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Dec 14 22:16:58 2020 +0100 Clipboard.c: move property transfer to separate function --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 230 +++++++++++++------------ 1 file changed, 118 insertions(+), 112 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index f88d7588b..8a5e3606c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -331,6 +331,7 @@ static void replyPendingRequestSelectionToXServer(int index, Bool success); static void printSelectionStat(int sel); #endif static void replyRequestSelectionToXServer(XEvent *X, Bool success); +void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property); void nxagentPrintClipboardStat(char *); @@ -1818,30 +1819,54 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) } else { - /* if the last owner was an internal one, read the - * clientCutProperty and push the contents to the - * lastServers[index].requestor on the real X server. - */ - if (IS_INTERNAL_OWNER(index) && - lastSelectionOwner[index].windowPtr != NULL && - X->xselection.property == serverTransFromAgentProperty) - { - Atom atomReturnType; - int resultFormat; - unsigned long ulReturnItems; - unsigned long ulReturnBytesLeft; - unsigned char *pszReturnData = NULL; + handlePropertyTransferFromAgentToXserver(index, X->xselection.property); + } +} - /* first get size values ... */ - int result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, 0, False, - AnyPropertyType, &atomReturnType, &resultFormat, - &ulReturnItems, &ulReturnBytesLeft, &pszReturnData); +void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) +{ + /* if the last owner was an internal one, read the + * clientCutProperty and push the contents to the + * lastServers[index].requestor on the real X server. + */ + if (IS_INTERNAL_OWNER(index) && + lastSelectionOwner[index].windowPtr != NULL && + property == serverTransFromAgentProperty) + { + Atom atomReturnType; + int resultFormat; + unsigned long ulReturnItems; + unsigned long ulReturnBytesLeft; + unsigned char *pszReturnData = NULL; + /* first get size values ... */ + int result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, 0, False, + AnyPropertyType, &atomReturnType, &resultFormat, + &ulReturnItems, &ulReturnBytesLeft, &pszReturnData); + + #ifdef DEBUG + fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d][%s] returned [%s]\n", __func__, + lastSelectionOwner[index].window, clientCutProperty, NameForIntAtom(clientCutProperty), + getXErrorString(result)); + #endif + if (result == BadAlloc || result == BadAtom || + result == BadWindow || result == BadValue) + { + lastServers[index].property = None; + } + else + { + /* ... then use the size values for the actual request */ + result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, + ulReturnBytesLeft, False, AnyPropertyType, &atomReturnType, + &resultFormat, &ulReturnItems, &ulReturnBytesLeft, + &pszReturnData); #ifdef DEBUG fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d][%s] returned [%s]\n", __func__, lastSelectionOwner[index].window, clientCutProperty, NameForIntAtom(clientCutProperty), getXErrorString(result)); #endif + if (result == BadAlloc || result == BadAtom || result == BadWindow || result == BadValue) { @@ -1849,117 +1874,98 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) } else { - /* ... then use the size values for the actual request */ - result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, - ulReturnBytesLeft, False, AnyPropertyType, &atomReturnType, - &resultFormat, &ulReturnItems, &ulReturnBytesLeft, - &pszReturnData); - #ifdef DEBUG - fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d][%s] returned [%s]\n", __func__, - lastSelectionOwner[index].window, clientCutProperty, NameForIntAtom(clientCutProperty), - getXErrorString(result)); - #endif - - if (result == BadAlloc || result == BadAtom || - result == BadWindow || result == BadValue) + if (lastServers[index].target == serverTARGETS) { - lastServers[index].property = None; - } - else - { - if (lastServers[index].target == serverTARGETS) + #ifdef DEBUG + fprintf(stderr, "%s: ulReturnItems [%ld]\n", __func__, ulReturnItems); + fprintf(stderr, "%s: resultformat [%d]\n", __func__, resultFormat); + #endif + + XlibAtom * targets = calloc(sizeof(XlibAtom), ulReturnItems); + if (targets == NULL) { - #ifdef DEBUG - fprintf(stderr, "%s: ulReturnItems [%ld]\n", __func__, ulReturnItems); - fprintf(stderr, "%s: resultformat [%d]\n", __func__, resultFormat); + #ifdef WARNING + fprintf(stderr, "%s: WARNING! Could not alloc memory for clipboard targets transmission.\n", __func__); #endif + /* this will effectively lead to the request being answered as failed */ + lastServers[index].property = None; + } + else + { + /* Convert the targets to remote atoms */ + XlibAtom *addr = targets; + unsigned int numTargets = ulReturnItems; - XlibAtom * targets = calloc(sizeof(XlibAtom), ulReturnItems); - if (targets == NULL) + for (int i = 0; i < numTargets; i++) { - #ifdef WARNING - fprintf(stderr, "%s: WARNING! Could not alloc memory for clipboard targets transmission.\n", __func__); + Atom local = *((Atom*)(pszReturnData + i*resultFormat/8)); + XlibAtom remote = nxagentLocalToRemoteAtom(local); + *(addr++) = remote; + + #ifdef DEBUG + fprintf(stderr, "%s: converting atom: local [%d][%s] -> remote [%ld][%s]\n", __func__, + local, NameForIntAtom(local), remote, NameForRemAtom(remote)); #endif - /* this will effectively lead to the request being answered as failed */ - lastServers[index].property = None; } - else - { - /* Convert the targets to remote atoms */ - XlibAtom *addr = targets; - unsigned int numTargets = ulReturnItems; - for (int i = 0; i < numTargets; i++) - { - Atom local = *((Atom*)(pszReturnData + i*resultFormat/8)); - XlibAtom remote = nxagentLocalToRemoteAtom(local); - *(addr++) = remote; - - #ifdef DEBUG - fprintf(stderr, "%s: converting atom: local [%d][%s] -> remote [%ld][%s]\n", __func__, - local, NameForIntAtom(local), remote, NameForRemAtom(remote)); - #endif - } - - /* FIXME: do we need to take care of swapping byte order here? */ - XChangeProperty(nxagentDisplay, - lastServers[index].requestor, - lastServers[index].property, - XInternAtom(nxagentDisplay, "ATOM", 0), - 32, - PropModeReplace, - (unsigned char*)targets, - numTargets); - - cacheTargetsForRem(index, targets, numTargets); - } - } - else - { - /* Fill the property on the initial requestor with the requested data */ - /* The XChangeProperty source code reveals it will always - return 1, no matter what, so no need to check the result */ - /* FIXME: better use the format returned by above request */ + /* FIXME: do we need to take care of swapping byte order here? */ XChangeProperty(nxagentDisplay, lastServers[index].requestor, lastServers[index].property, - lastServers[index].target, - 8, + XInternAtom(nxagentDisplay, "ATOM", 0), + 32, PropModeReplace, - pszReturnData, - ulReturnItems); - #ifdef DEBUG - { - fprintf(stderr, "%s: XChangeProperty sent to window [0x%lx] for property [%ld][%s] len [%d] value [\"%*.*s\"...]\n", - __func__, - lastServers[index].requestor, - lastServers[index].property, - NameForRemAtom(lastServers[index].property), - (int)ulReturnItems * 8 / 8, - (int)(min(20, ulReturnItems * 8 / 8)), - (int)(min(20, ulReturnItems * 8 / 8)), - pszReturnData); - } - #endif - } + (unsigned char*)targets, + numTargets); - /* FIXME: free it or not? */ - /* - * SAFE_XFree(pszReturnData); - */ + cacheTargetsForRem(index, targets, numTargets); + } + } + else + { + /* Fill the property on the requestor with the requested data */ + /* The XChangeProperty source code reveals it will always + return 1, no matter what, so no need to check the result */ + /* FIXME: better use the format returned by above request */ + XChangeProperty(nxagentDisplay, + lastServers[index].requestor, + lastServers[index].property, + lastServers[index].target, + 8, + PropModeReplace, + pszReturnData, + ulReturnItems); + #ifdef DEBUG + { + fprintf(stderr, "%s: XChangeProperty sent to window [0x%lx] for property [%ld][%s] len [%d] value [\"%*.*s\"...]\n", + __func__, + lastServers[index].requestor, + lastServers[index].property, + NameForRemAtom(lastServers[index].property), + (int)ulReturnItems * 8 / 8, + (int)(min(20, ulReturnItems * 8 / 8)), + (int)(min(20, ulReturnItems * 8 / 8)), + pszReturnData); + } + #endif } - } - /* - * inform the initial requestor that the requested data has - * arrived in the desired property. If we have been unable to - * get the data from the owner XChangeProperty will not have - * been called and lastServers[index].property will be None which - * effectively will send a "Request denied" to the initial - * requestor. - */ - replyPendingRequestSelectionToXServer(index, True); + /* FIXME: free it or not? */ + /* + * SAFE_XFree(pszReturnData); + */ + } } + + /* + * inform the initial requestor that the requested data has + * arrived in the desired property. If we have been unable to + * get the data from the owner XChangeProperty will not have + * been called and lastServers[index].property will be None which + * effectively will send a "Request denied" to the initial + * requestor. + */ + replyPendingRequestSelectionToXServer(index, True); } } -- 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 3.6.x in repository nx-libs. commit 6ba18093742f222363bae29b9675f8016a50d033 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Feb 12 22:29:01 2021 +0100 Clipboard.c: delete property before/after certain operations for ICCCM conformity Fixes ArcticaProject/nx-libs#969 --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 508ae5699..ef4315e41 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1206,6 +1206,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * - vcxsrv request is for _primary_ and takes this path as the _clipboard_ transfer * has set lastClients[index].windowPtr */ + XDeleteProperty(nxagentDisplay, serverWindow, serverTransToAgentProperty); XConvertSelection(nxagentDisplay, CurrentSelections[index].selection, X->xselectionrequest.target, serverTransToAgentProperty, serverWindow, lastClients[index].time); @@ -1290,6 +1291,12 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) x.u.selectionRequest.target = nxagentRemoteToLocalAtom(X->xselectionrequest.target); } + /* + * delete property before sending the request to the client - + * required by ICCCM + */ + DeleteProperty(lastSelectionOwner[index].windowPtr, clientCutProperty); + sendEventToClient(lastSelectionOwner[index].client, &x); #ifdef DEBUG @@ -1575,6 +1582,23 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) lastClients[index].resource = -1; + /* + * ICCCM states: "The requestor must delete the property named in + * the SelectionNotify once all the data has been retrieved. The + * requestor should invoke either DeleteProperty or GetProperty + * (delete==True) after it has successfully retrieved all the data + * in the selection." + * FIXME: this uses serverTransToAgentProperty which is shared between + * all the selections. Could be a problem with simultaneous transfers. + */ + if (result != 0 && ulReturnBytesLeft == 0) + { + #ifdef DEBUG + fprintf (stderr, "%s: Retrieved property data - deleting it for ICCCM conformity.\n", __func__); + #endif + XDeleteProperty(nxagentDisplay, serverWindow, serverTransToAgentProperty); + } + if (result == 0) { #ifdef DEBUG @@ -2658,7 +2682,19 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, remSelection, NameForRemAtom(remSelection)); #endif + /* + * ICCCM: "It is necessary for requestors to delete the property + * before issuing the request so that the target can later be + * extended to take parameters without introducing an + * incompatibility. Also note that the requestor of a selection need + * not know the client that owns the selection nor the window on + * which the selection was acquired." + */ + + XDeleteProperty(nxagentDisplay, serverWindow, remProperty); + UpdateCurrentTime(); + XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime); /* XConvertSelection will always return 1 (check the source!), so no -- 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 3.6.x in repository nx-libs. commit d335fc8fb04e1611352842b6f6d68f3fe43d44e9 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 19:07:43 2021 +0100 Clipboard.c: do not handle unknown selections in Callback handler --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index b3598eef8..b77cb181a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2108,11 +2108,23 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, } #endif + Selection * pCurSel = (Selection *)info->selection; + + int index = nxagentFindCurrentSelectionIndex(pCurSel->selection); + if (index == -1) + { + #ifdef DEBUG + fprintf(stderr, "%s: selection [%s] will not be handled by the clipboard code\n", __func__, NameForIntAtom(pCurSel->selection)); + #endif + return; + } + /* - * We do not know index here so for now let's invalidate the - * complete cache on every owner change regardless of the selection. + * always invalidate the target cache for the relevant selection, + * even if the trap is set. This ensures not having invalid data in + * the cache. */ - invalidateTargetCaches(); + invalidateTargetCache(index); if (nxagentExternalClipboardEventTrap) { @@ -2122,7 +2134,6 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, return; } - Selection * pCurSel = (Selection *)info->selection; #ifdef DEBUG fprintf(stderr, "%s: pCurSel->lastTimeChanged [%u]\n", __func__, pCurSel->lastTimeChanged.milliseconds); -- 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 3.6.x in repository nx-libs. commit 9d8771562c847e957250f7df7411b9ce92dd1143 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 18:39:14 2021 +0100 Clipboard.c: limit selection nxagentFindCurrentSelectionIndex can return Normally you'd expect the loop going up to NumCurrentSelections. But the dix code will increase that number (but not nxagentMaxSelections) when drag and drop comes into play. In that case this helper will report a match for other selections than the ones the clipboard code knows about. The subsequent code will then use a higher index which will lead to out of range data reads (and writes!). Therefore we take nxagentMaxSelections here. The startup code ensures that both arrays will refer to the same selection for the first nxagentMaxSelections selection atoms. This way the clipboard code will not kick in for drag and drop resources. Fixes ArcticaProject/nx-libs#986 --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 3098ebb49..b3598eef8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -763,7 +763,21 @@ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) */ int nxagentFindCurrentSelectionIndex(Atom sel) { - for (int index = 0; index < NumCurrentSelections; index++) + /* + * Normally you'd expect the loop going up to + * NumCurrentSelections. But the dix code will increase that number + * (but not nxagentMaxSelections) when drag and drop comes into + * play. In that case this helper will report a match for other + * selections than the ones the clipboard code knows about. The + * subsequent code will then use a higher index which will be used + * by the clipboard code and will lead to out of range data reads + * (and writes!). Therefore we take nxagentMaxSelections here. The + * startup code ensures that both arrays will refer to the same + * selection for the first nxagentMaxSelections selection atoms. + */ + + // for (int index = 0; index < NumCurrentSelections; index++) + for (int index = 0; index < nxagentMaxSelections; index++) { if (CurrentSelections[index].selection == sel) { -- 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 3.6.x in repository nx-libs. commit 65c260edf9a02d71dbc840b867ab64a62fefedc5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Feb 12 22:21:39 2021 +0100 Clipboard.c: improve debugging output once more --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index b77cb181a..508ae5699 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1565,6 +1565,14 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) &ulReturnBytesLeft, &pszReturnData); + #ifdef DEBUG + fprintf(stderr, "%s: NXGetCollectedProperty: result [%d]\n", __func__, result); + fprintf(stderr, "%s: atomReturnType [%ld]\n", __func__, atomReturnType); + fprintf(stderr, "%s: resultFormat [%d]\n", __func__, resultFormat); + fprintf(stderr, "%s: ulReturnItems [%lu]\n", __func__, ulReturnItems); + fprintf(stderr, "%s: ulReturnBytesLeft [%lu]\n", __func__, ulReturnBytesLeft); + #endif + lastClients[index].resource = -1; if (result == 0) @@ -1578,7 +1586,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) else if (resultFormat != 8 && resultFormat != 16 && resultFormat != 32) { #ifdef DEBUG - fprintf(stderr, "%s: WARNING! Invalid property format.\n", __func__); + fprintf(stderr, "%s: WARNING! Invalid property format [%d].\n", __func__, resultFormat); #endif endTransfer(index, SELECTION_FAULT); @@ -1638,7 +1646,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) else { #ifdef DEBUG - fprintf(stderr, "%s: Got property content from remote server. size [%lu] bytes.\n", __func__, (ulReturnItems * resultFormat / 8)); + fprintf(stderr, "%s: Got property content from remote server. [%lu] items with format [%d] = [%lu] bytes.\n", __func__, ulReturnItems, resultFormat, (ulReturnItems * resultFormat/8)); #endif if (lastClients[index].target == clientTARGETS) @@ -2587,6 +2595,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, if (lastClients[index].clientPtr == client) { + #ifdef DEBUG + fprintf(stderr, "%s: same client as previous request\n", __func__); + #endif + if (GetTimeInMillis() - lastClients[index].reqTime < ACCUM_TIME) { /* -- 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 3.6.x in repository nx-libs. commit f578b86d34f5858fa215f6eebc12fec82f16792e Author: Ulrich Sibiller <uli42@gmx.de> Date: Sat Jan 30 18:38:25 2021 +0100 Clipboard.c: rework nxagentFind*SelectionIndex() helpers Let them return -1 which makes it easier to check for successful execution. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 24 +++++++++++++----------- nx-X11/programs/Xserver/hw/nxagent/Events.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index d54171a0d..3098ebb49 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -735,7 +735,8 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) /* * Find the index of the lastSelectionOwner with the selection - * sel. sel is an atom on the real X server. + * sel. sel is an atom on the real X server. If the index cannot be + * determined it will return -1. */ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) { @@ -752,12 +753,13 @@ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) #ifdef DEBUG fprintf(stderr, "%s: remote selection [%ld][%s] does not belong to any index!\n", __func__, sel, NameForRemAtom(sel)); #endif - return nxagentMaxSelections; + return -1; } /* * Find the index of CurrentSelection with the selection - * sel. sel is an internal atom. + * sel. sel is an internal atom. If the index cannot be + * determined it will return -1. */ int nxagentFindCurrentSelectionIndex(Atom sel) { @@ -774,7 +776,7 @@ int nxagentFindCurrentSelectionIndex(Atom sel) #ifdef DEBUG fprintf(stderr, "%s: selection [%d][%s] does not belong to any index!\n", __func__, sel, NameForIntAtom(sel)); #endif - return NumCurrentSelections; + return -1; } void cacheTargetsForInt(int index, Atom* targets, int numTargets) @@ -861,7 +863,7 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) } int index = nxagentFindLastSelectionOwnerIndex(X->xselectionclear.selection); - if (index < nxagentMaxSelections) + if (index != -1) { if (IS_INTERNAL_OWNER(index)) { @@ -951,7 +953,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) /* the selection in this request is none we own. */ int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); - if (index == nxagentMaxSelections) + if (index == -1) { #ifdef DEBUG fprintf(stderr, "%s: not owning selection [%ld] - denying request.\n", __func__, X->xselectionrequest.selection); @@ -1736,7 +1738,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) /* determine the selection we are talking about here */ int index = nxagentFindLastSelectionOwnerIndex(e->selection); - if (index == nxagentMaxSelections) + if (index == -1) { #ifdef DEBUG fprintf (stderr, "%s: unknown selection [%ld] .\n", __func__, e->selection); @@ -2162,7 +2164,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) #endif int index = nxagentFindCurrentSelectionIndex(pSelection->selection); - if (index < NumCurrentSelections) + if (index != -1) { #ifdef DEBUG fprintf(stderr, "%s: lastSelectionOwner.client %s -> %s\n", __func__, @@ -2294,7 +2296,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, } int index = nxagentFindCurrentSelectionIndex(selection); - if (index == NumCurrentSelections) + if (index == -1) { #ifdef DEBUG fprintf(stderr, "%s: cannot find index for selection [%u]\n", __func__, selection); @@ -2761,7 +2763,7 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) #endif int index = nxagentFindCurrentSelectionIndex(event->u.selectionNotify.selection); - if (index == nxagentMaxSelections) + if (index == -1) { #ifdef DEBUG fprintf(stderr, "%s: unknown selection [%d]\n", __func__, @@ -2845,7 +2847,7 @@ WindowPtr nxagentGetClipboardWindow(Atom property) } int index = nxagentFindLastSelectionOwnerIndex(serverLastRequestedSelection); - if (index < nxagentMaxSelections && + if (index != -1 && property == clientCutProperty && lastSelectionOwner[index].windowPtr != NULL) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 2ec17c328..d29ed9bcd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2850,7 +2850,7 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) Atom local = nxagentRemoteToLocalAtom(xfixesEvent -> xfixesselection.selection); int index = nxagentFindCurrentSelectionIndex(local); - if (index < NumCurrentSelections) + if (index != -1) { if (CurrentSelections[index].client != 0) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index a8739fa3f..ff8330cc7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -722,8 +722,8 @@ ProcConvertSelection(register ClientPtr client) (stuff->selection == MakeAtom("CLIPBOARD", 9, 0))) && nxagentOption(Clipboard) != ClipboardNone) { - int i = nxagentFindCurrentSelectionIndex(stuff->selection); - if ((i < NumCurrentSelections) && (CurrentSelections[i].window != None)) + int index = nxagentFindCurrentSelectionIndex(stuff->selection); + if ((index != -1) && (CurrentSelections[index].window != None)) { if (nxagentConvertSelection(client, pWin, stuff->selection, stuff->requestor, stuff->property, stuff->target, stuff->time)) -- 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 3.6.x in repository nx-libs. commit 75acbbf299b57aeae993b73927fd8b727be94c81 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Dec 23 19:49:19 2020 +0100 Clipboard.c: make index the first argument everywhere --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 68 +++++++++++++------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 8a5e3606c..d54171a0d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -305,11 +305,11 @@ XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, False }; extern Display *nxagentDisplay; static Bool isTextTarget(XlibAtom target); -static void setClientSelectionStage(int stage, int index); -static void endTransfer(Bool success, int index); +static void setClientSelectionStage(int index, int stage); +static void endTransfer(int index, Bool success); #define SELECTION_SUCCESS True #define SELECTION_FAULT False -static void transferSelectionFromXServer(int resource, int index); +static void transferSelectionFromXServer(int index, int resource); #if 0 static void resetSelectionOwnerOnXServer(void); #endif @@ -508,7 +508,7 @@ static void resetClientSelectionStage(int index) lastClients[index].resource = -1; } -static void setClientSelectionStage(int stage, int index) +static void setClientSelectionStage(int index, int stage) { if (stage == SelectionStageNone) { @@ -721,14 +721,14 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) clearSelectionOwnerData(index); - setClientSelectionStage(SelectionStageNone, index); + setClientSelectionStage(index, SelectionStageNone); replyPendingRequestSelectionToXServer(index, False); } if (pWindow && pWindow == lastClients[index].windowPtr) { - setClientSelectionStage(SelectionStageNone, index); + setClientSelectionStage(index, SelectionStageNone); } } } @@ -885,7 +885,7 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) clearSelectionOwnerData(index); - setClientSelectionStage(SelectionStageNone, index); + setClientSelectionStage(index, SelectionStageNone); invalidateTargetCache(index); } @@ -1308,7 +1308,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * denied/failed" * Use SELECTION_SUCCESS and SELECTION_FAULT macros for success. */ -static void endTransfer(Bool success, int index) +static void endTransfer(int index, Bool success) { if (lastClients[index].clientPtr == NULL) { @@ -1338,10 +1338,10 @@ static void endTransfer(Bool success, int index) /* * Enable further requests from clients. */ - setClientSelectionStage(SelectionStageNone, index); + setClientSelectionStage(index, SelectionStageNone); } -static void transferSelectionFromXServer(int resource, int index) +static void transferSelectionFromXServer(int index, int resource) { #ifdef DEBUG fprintf(stderr, "%s: resource [%d] lastClients[%d].clientPtr->index [%d].\n", __func__, @@ -1355,7 +1355,7 @@ static void transferSelectionFromXServer(int resource, int index) resource, nxagentClientInfoString(lastClients[index].clientPtr)); #endif - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); return; } @@ -1406,12 +1406,12 @@ static void transferSelectionFromXServer(int resource, int index) nxagentClientInfoString(lastClients[index].clientPtr)); #endif - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); return; } - setClientSelectionStage(SelectionStageWaitSize, index); + setClientSelectionStage(index, SelectionStageWaitSize); NXFlushDisplay(nxagentDisplay, NXFlushLink); @@ -1463,12 +1463,12 @@ static void transferSelectionFromXServer(int resource, int index) nxagentClientInfoString(lastClients[index].clientPtr)); #endif - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); return; } - setClientSelectionStage(SelectionStageWaitData, index); + setClientSelectionStage(index, SelectionStageWaitData); /* we've seen situations where you had to move the mouse or press a key to let the transfer complete. Flushing here fixed it */ @@ -1557,7 +1557,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) fprintf (stderr, "%s: Failed to get reply data.\n", __func__); #endif - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); } else if (resultFormat != 8 && resultFormat != 16 && resultFormat != 32) { @@ -1565,7 +1565,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) fprintf(stderr, "%s: WARNING! Invalid property format.\n", __func__); #endif - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); } else { @@ -1585,7 +1585,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) fprintf (stderr, "%s: data size is [0] - aborting selection notify procedure.\n", __func__); #endif - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); } else { @@ -1597,9 +1597,9 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) * Request the selection data now. */ lastClients[index].propertySize = ulReturnBytesLeft; - setClientSelectionStage(SelectionStageQueryData, index); + setClientSelectionStage(index, SelectionStageQueryData); - transferSelectionFromXServer(resource, index); + transferSelectionFromXServer(index, resource); } break; } @@ -1617,7 +1617,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) fprintf (stderr, "%s: not all content could be retrieved - [%lu] bytes left - aborting selection notify procedure.\n", __func__, ulReturnBytesLeft); #endif - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); } else { @@ -1635,7 +1635,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) #endif /* operation failed */ - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); } else { @@ -1663,7 +1663,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) cacheTargetsForInt(index, targets, numTargets); - endTransfer(SELECTION_SUCCESS, index); + endTransfer(index, SELECTION_SUCCESS); } } else @@ -1683,7 +1683,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) pszReturnData); #endif - endTransfer(SELECTION_SUCCESS, index); + endTransfer(index, SELECTION_SUCCESS); } } break; @@ -1785,10 +1785,10 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) * tions. */ - setClientSelectionStage(SelectionStageQueryData, index); + setClientSelectionStage(index, SelectionStageQueryData); lastClients[index].propertySize = 262144; - transferSelectionFromXServer(lastClients[index].clientPtr -> index, index); + transferSelectionFromXServer(index, lastClients[index].clientPtr -> index); } else if (X->xselection.property == 0) { @@ -1796,7 +1796,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) fprintf(stderr, "%s: WARNING! Resetting selection transferral for client [%d] because of failure notification from real X server.\n", __func__, CLINDEX(lastClients[index].clientPtr)); #endif - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); } else { @@ -1804,7 +1804,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) fprintf(stderr, "%s: Unexpected property [%ld][%s] - reporting conversion failure.\n", __func__, X->xselection.property, NameForRemAtom(X->xselection.property)); #endif - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); } } else @@ -1814,7 +1814,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) CLINDEX(lastClients[index].clientPtr)); #endif - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); } } else @@ -2040,7 +2040,7 @@ static void resetSelectionOwnerOnXServer(void) clearSelectionOwnerData(index); - setClientSelectionStage(SelectionStageNone, index); + setClientSelectionStage(index, SelectionStageNone); /* Hmm, this is already None when reaching here */ lastServers[index].requestor = None; @@ -2213,7 +2213,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) */ storeSelectionOwnerData(index, pSelection); - setClientSelectionStage(SelectionStageNone, index); + setClientSelectionStage(index, SelectionStageNone); /* * this will be repeated on reception of the SelectionOwner callback @@ -2241,7 +2241,7 @@ FIXME2: instead of XGetSelectionOwner we could check if the Xfixes lastSelectionOwnerWindow = pSelection->window; lastSelectionOwnerWindowPtr = pSelection->pWin; - setClientSelectionStage(SelectionStageNone); + setClientSelectionStage(index, SelectionStageNone); lastServers[index].requestor = None; } @@ -2337,7 +2337,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #endif /* notify the waiting client of failure */ - endTransfer(SELECTION_FAULT, index); + endTransfer(index, SELECTION_FAULT); /* do NOT return here but process the new request instead! */ } @@ -2586,7 +2586,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, clientAccum = 0; } - setClientSelectionStage(SelectionStageNone, index); + setClientSelectionStage(index, SelectionStageNone); /* * store the original requestor, we need that later after -- 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 3.6.x in repository nx-libs. commit d97e5022e8e04f5316908dc772a491e5fe422b4c Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Feb 12 23:26:16 2021 +0100 Clipboard.c: check target cache for valid targets Instead of passing the target to the remote side and then receiving an "invalid target" reply we can do that check directly (if the target cache is filled). This way we can save some more roundtrips due to the target cache. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 98 ++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 4c0c6d320..c85e61298 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1187,6 +1187,55 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * can process it now. */ + if (!nxagentOption(TextClipboard)) + { + /* Optimization: if we have a current target cache check if the + * requested target is supported by the owner. If not we can take + * a shortcut and deny the request immediately without doing any + * further communication */ + if (targetCache[index].type == FORREM && targetCache[index].forRem) + { + XlibAtom *targets = targetCache[index].forRem; + + #ifdef DEBUG + fprintf(stderr, "%s: Checking target validity\n", __func__); + #endif + Bool match = False; + for (int i = 0; i < targetCache[index].numTargets; i++) + { + if (targets[i] == X->xselectionrequest.target) + { + match = True; + break; + } + } + if (!match) + { + #ifdef DEBUG + fprintf(stderr, "%s: target [%ld][%s] is not supported by the owner - denying request.\n", + __func__, X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target)); + #endif + replyRequestSelectionToXServer(X, False); + return; + } + } + else + { + /* + * at this stage we know a remote client has asked for a selection + * target without having retrieved the list of supported targets + * first. + */ + #ifdef DEBUG + if (X->xselectionrequest.target != serverTARGETS) + { + fprintf(stderr, "%s: WARNING: remote client has not retrieved TARGETS before asking for selection!\n", + __func__); + } + #endif + } + } + /* * This is required for nxagentGetClipboardWindow. */ @@ -2620,6 +2669,55 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, NameForIntAtom(target)); #endif + if (!nxagentOption(TextClipboard)) + { + /* Optimization: if we have a current target cache check if the + * requested target is supported by the owner. If not we can take + * a shortcut and deny the request immediately without doing any + * further communication */ + if (targetCache[index].type == FORINT && targetCache[index].forInt) + { + Atom *targets = targetCache[index].forInt; + + #ifdef DEBUG + fprintf(stderr, "%s: Checking target validity\n", __func__); + #endif + Bool match = False; + for (int i = 0; i < targetCache[index].numTargets; i++) + { + if (targets[i] == target) + { + match = True; + break; + } + } + if (!match) + { + #ifdef DEBUG + fprintf(stderr, "%s: target [%d][%s] is not supported by the owner - denying request.\n", + __func__, target, NameForIntAtom(target)); + #endif + sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); + return 1; + } + } + else + { + /* + * at this stage we know a client has asked for a selection + * target without having retrieved the list of supported targets + * first. + */ + #ifdef DEBUG + if (target != clientTARGETS) + { + fprintf(stderr, "%s: WARNING: client has not retrieved TARGETS before asking for selection!\n", + __func__); + } + #endif + } + } + if (lastClients[index].clientPtr == client) { #ifdef DEBUG -- 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 3.6.x in repository nx-libs. commit 03502b36edbd2390c8b93edcc6b5f57299977578 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 2 22:14:52 2021 +0100 Clipboard.c: print clipboard content only on explicit request This helps making people aware that their debug logs might contain sensible information. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 46 ++++++++++++++++++++------ 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 4bdd32e8f..27aa49578 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -59,6 +59,13 @@ #undef TEST #undef DEBUG +/* + * define this to see the clipboard content in the debug output. As + * this can lead to information leaking it must be activated + * explicitly! + */ +#undef PRINT_CLIPBOARD_CONTENT_ON_DEBUG + /* * Define these to also support special targets TEXT and COMPOUND_TEXT * in text-only mode. We do not have a special handling for these. See @@ -432,6 +439,11 @@ void nxagentDumpClipboardStat(void) fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, NameForRemAtom(serverLastRequestedSelection)); fprintf(stderr, "Compile time settings\n"); +#ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG + fprintf(stderr, " PRINT_CLIPBOARD_CONTENT_ON_DEBUG [enabled]\n"); +#else + fprintf(stderr, " PRINT_CLIPBOARD_CONTENT_ON_DEBUG [disabled]\n"); +#endif #ifdef SUPPORT_TEXT_TARGET fprintf(stderr, " SUPPORT_TEXT_TARGET [enabled]\n"); #else @@ -1771,12 +1783,19 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) ulReturnItems, pszReturnData, 1); #ifdef DEBUG - fprintf(stderr, "%s: Selection property [%d][%s] changed to [\"%*.*s\"...]\n", __func__, - lastClients[index].property, - validateString(NameForIntAtom(lastClients[index].property)), - (int)(min(20, ulReturnItems * resultFormat / 8)), - (int)(min(20, ulReturnItems * resultFormat / 8)), - pszReturnData); + fprintf(stderr, "%s: Selection property [%d][%s] changed to" + #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG + "[\"%*.*s\"...]" + #endif + "\n", __func__, + lastClients[index].property, + validateString(NameForIntAtom(lastClients[index].property)) + #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG + ,(int)(min(20, ulReturnItems * resultFormat / 8)), + (int)(min(20, ulReturnItems * resultFormat / 8)), + pszReturnData + #endif + ); #endif endTransfer(index, SELECTION_SUCCESS); @@ -2033,15 +2052,22 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) ulReturnItems); #ifdef DEBUG { - fprintf(stderr, "%s: XChangeProperty sent to window [0x%lx] for property [%ld][%s] len [%d] value [\"%*.*s\"...]\n", + fprintf(stderr, "%s: XChangeProperty sent to window [0x%lx] for property [%ld][%s] len [%d]" + #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG + "value [\"%*.*s\"...]" + #endif + "\n", __func__, lastServers[index].requestor, lastServers[index].property, NameForRemAtom(lastServers[index].property), - (int)ulReturnItems * 8 / 8, - (int)(min(20, ulReturnItems * 8 / 8)), + (int)ulReturnItems * 8 / 8 + #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG + ,(int)(min(20, ulReturnItems * 8 / 8)), (int)(min(20, ulReturnItems * 8 / 8)), - pszReturnData); + pszReturnData + #endif + ); } #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 3.6.x in repository nx-libs. commit 9eb76cf5d545c3b823626423c832986af4c4ac38 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Feb 12 22:45:05 2021 +0100 Clipboard.c: move comment to correct location --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index ef4315e41..ed46f3d6a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -130,12 +130,6 @@ static XlibAtom serverLastRequestedSelection = -1; #define IS_INTERNAL_OWNER(lsoindex) (lastSelectionOwner[lsoindex].client != NullClient) -/* - * Needed to handle the notify selection event to - * be sent to client once the selection property - * has been retrieved from the real X server. - */ - typedef enum { SelectionStageNone, @@ -145,6 +139,12 @@ typedef enum SelectionStageWaitData } ClientSelectionStage; +/* + * Needed to handle the notify selection event to be sent to the + * waiting client once the selection property has been retrieved from + * the real X server. + */ + typedef struct _lastClient { WindowPtr windowPtr; -- 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 3.6.x in repository nx-libs. commit 04ca25eb1af9b3ea3eb94ceb851e0eda2a08b535 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Feb 12 22:50:47 2021 +0100 Clipboard.c: fix some comments, add FIXME --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index ed46f3d6a..4c0c6d320 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1521,7 +1521,6 @@ static void transferSelectionFromXServer(int index, int resource) True: processed False: not processed, resource is not ours */ - Bool nxagentCollectPropertyEventFromXServer(int resource) { XlibAtom atomReturnType; @@ -2378,6 +2377,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * consider the conversion failed and tell our client about that. * The new request that lead us here is then processed. */ + #ifdef TEST + fprintf(stderr, "%s: lastClients[%d].windowPtr [0x%lx].\n", __func__, index, (unsigned long)lastClients[index].windowPtr); + #endif + if (lastClients[index].windowPtr != NULL) { #ifdef TEST @@ -2693,6 +2696,13 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, XDeleteProperty(nxagentDisplay, serverWindow, remProperty); + /* + * FIXME: ICCCM states: "Clients should not use CurrentTime for the + * time argument of a ConvertSelection request. Instead, they should + * use the timestamp of the event that caused the request to be + * made." + */ + UpdateCurrentTime(); XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, -- 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 3.6.x in repository nx-libs. commit 5c205f57a76e99063f29dbe20e58019d6b39fb7e Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 2 21:31:07 2021 +0100 Clipboard.c: fix wrong debug message printing the wrong client makes the debug output very confusing ;-) --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index c85e61298..4bdd32e8f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2443,8 +2443,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) { #ifdef DEBUG - fprintf(stderr, "%s: timeout expired on previous request, " - "notifying failure to client %s\n", __func__, nxagentClientInfoString(client)); + fprintf(stderr, "%s: timeout expired on previous request - " + "notifying failure to waiting client\n", __func__); #endif /* notify the waiting client of 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 3.6.x in repository nx-libs. commit 9293348c821f4939e38615853b47b8601d8e5d46 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 2 23:11:11 2021 +0100 Clipboard.c: print more debug details for reply --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 27aa49578..8844c88df 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -621,11 +621,11 @@ static void sendSelectionNotifyEventToClient(ClientPtr client, #ifdef DEBUG if (property == None) - fprintf(stderr, "%s: Denying request to client %s.\n", __func__, - nxagentClientInfoString(client)); + fprintf(stderr, "%s: Denying request to client %s - event time [%u].\n", __func__, + nxagentClientInfoString(client), time); else - fprintf(stderr, "%s: Sending event to client %s.\n", __func__, - nxagentClientInfoString(client)); + fprintf(stderr, "%s: Sending event to client %s - event time [%u].\n", __func__, + nxagentClientInfoString(client), time); #endif sendEventToClient(client, &x); -- 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 3.6.x in repository nx-libs. commit ba898dfcde038052c9eb9be043e9d48b18652cca Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Mar 10 10:04:50 2021 +0100 Clipboard.c: improve debug output in special case This avoids an error message in a special case: nxagentRemoteToLocalAtom: WARNING failed to get name from remote atom. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 17b14f728..dde5506fa 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -436,7 +436,10 @@ void nxagentDumpClipboardStat(void) } fprintf(stderr, "\n"); - fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, NameForRemAtom(serverLastRequestedSelection)); + if (serverLastRequestedSelection == -1) + fprintf(stderr, " serverLastRequestedSelection [-1](uninitialized)\n"); + else + fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, NameForRemAtom(serverLastRequestedSelection)); fprintf(stderr, "Compile time settings\n"); #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG -- 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 3.6.x in repository nx-libs. commit 0631eece96650afb3715a5c5009005914f90a9b4 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Mar 10 10:06:29 2021 +0100 Clipboard.c: add FIXMEs Also improve code to better match the situation described in the FIXME --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index dde5506fa..87473b221 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1670,11 +1670,16 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) * in the selection." * FIXME: this uses serverTransToAgentProperty which is shared between * all the selections. Could be a problem with simultaneous transfers. + * FIXME: NXGetCollectedProperty can return 0 and True. Some other + * functions in this field return False as well. Clean up that + * mess... */ - if (result != 0 && ulReturnBytesLeft == 0) + if (result == True && ulReturnBytesLeft == 0) { #ifdef DEBUG - fprintf (stderr, "%s: Retrieved property data - deleting it for ICCCM conformity.\n", __func__); + fprintf (stderr, "%s: Retrieved property data - deleting property [%ld][%s] " + "for ICCCM conformity.\n", __func__, serverTransToAgentProperty, + NameForRemAtom(serverTransToAgentProperty)); #endif XDeleteProperty(nxagentDisplay, serverWindow, serverTransToAgentProperty); } -- 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 3.6.x in repository nx-libs. commit 124f5a5c6e4f37880c482d1037636ccfd7b6fca0 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 2 23:12:03 2021 +0100 Clipboard.c: sanity check for invalid resource --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 8844c88df..7fefd5ee1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1592,6 +1592,14 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) int index = 0; + if (resource < 0) + { + #ifdef DEBUG + fprintf (stderr, "%s: resource [%d] is invalid.\n", __func__, resource); + #endif + return False; + } + /* determine the selection we are talking about here */ for (index = 0; index < nxagentMaxSelections; index++) { -- 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 3.6.x in repository nx-libs. commit 6fe8bf8fbaf955a4bffb98507a1ebeed00aff593 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 2 23:14:48 2021 +0100 Clipboard.c: always flush after XConvertSelection() call This ensures the convert will be sent out immediately. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 7fefd5ee1..d96a9946a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1272,6 +1272,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) X->xselectionrequest.target, serverTransToAgentProperty, serverWindow, lastClients[index].time); + NXFlushDisplay(nxagentDisplay, NXFlushLink); + #ifdef DEBUG fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%lx] time [%u] .\n", __func__, CurrentSelections[index].selection, NameForRemAtom(CurrentSelections[index].selection)), @@ -2839,6 +2841,9 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime); + + NXFlushDisplay(nxagentDisplay, NXFlushLink); + /* XConvertSelection will always return 1 (check the source!), so no need to check the return code. */ -- 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 3.6.x in repository nx-libs. commit 1723afb64696c41bdecdbe5c3330eb5e378c24ab Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Mar 2 23:11:44 2021 +0100 Clipboard.c: improve comments --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index d96a9946a..17b14f728 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1517,7 +1517,7 @@ static void transferSelectionFromXServer(int index, int resource) fprintf(stderr, "%s: Getting property content from remote server.\n", __func__); #endif - /* get next free resouce index */ + /* get next free resource slot */ resource = NXGetCollectPropertyResource(nxagentDisplay); lastClients[index].resource = resource; @@ -1532,6 +1532,13 @@ static void transferSelectionFromXServer(int index, int resource) } else { + /* + * now initiate kind of an asynchronuos GetProperty() + * call. Once the property has been retrieved we will + * receive an NXCollectPropertyNotify event which will then + * be handled in + * nxagentCollectPropertyEventFromXServer(). + */ result = NXCollectProperty(nxagentDisplay, resource, serverWindow, -- 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 3.6.x in repository nx-libs. commit 55af71edcf66556869f5f2b8c843818874399551 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Jun 10 23:01:37 2021 +0200 Clipboard.c: harmonize naming regarding internal/local Use "local" everywhere instead of a mixture of "local" and "internal". Also replace abbreviations "rem" and "int" by "remote" and "local" because they are confusing readers. --- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 320 ++++++++++++------------- 2 files changed, 162 insertions(+), 162 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h index 4a73a817d..a9f730d76 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h @@ -86,8 +86,8 @@ const char *nxagentRemoteAtomToString(XlibAtom remote); /* * supply two macros that also validate the output. */ -#define NameForIntAtom(_atom) validateString(NameForAtom(_atom)) -#define NameForRemAtom(_xlibatom) validateString(nxagentRemoteAtomToString(_xlibatom)) +#define NameForLocalAtom(_atom) validateString(NameForAtom(_atom)) +#define NameForRemoteAtom(_xlibatom) validateString(nxagentRemoteAtomToString(_xlibatom)) #endif /* XlibAtom */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 68ad68345..3a210ac5f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -94,20 +94,20 @@ const int nxagentClipboardSelection = 1; const int nxagentMaxSelections = 2; /* store the remote atom for all selections */ -static XlibAtom *remSelAtoms = NULL; -static Atom *intSelAtoms = NULL; +static XlibAtom *remoteSelectionAtoms = NULL; +static Atom *localSelelectionAtoms = NULL; typedef struct _SelectionOwner { - ClientPtr client; /* internal client */ - Window window; /* internal window id */ - WindowPtr windowPtr; /* internal window struct */ - Time lastTimeChanged; /* internal time */ + ClientPtr client; /* local client */ + Window window; /* local window id */ + WindowPtr windowPtr; /* local window struct */ + Time lastTimeChanged; /* local time (server time) */ } SelectionOwner; /* * This contains the last selection owner in nxagent. The - * lastTimeChanged is always an internal time. If .client is NULL the + * lastTimeChanged is always a local time. If .client is NULL the * owner is outside nxagent. */ @@ -120,22 +120,22 @@ static SelectionOwner *lastSelectionOwner = NULL; */ typedef struct _Targets { - Bool type; /* EMPTY, FORINT, FORREM */ + Bool type; /* EMPTY, FOR_LOCAL, FOR_REMOTE */ unsigned int numTargets; - Atom *forInt; /* Atoms converted for internal -> type Atom, not XlibAtom */ - XlibAtom *forRem; /* Atoms converted for remote -> type XlibAtom, not Atom */ + Atom *forLocal; /* Atoms converted for local -> type Atom, not XlibAtom */ + XlibAtom *forRemote; /* Atoms converted for remote -> type XlibAtom, not Atom */ } Targets; #define EMPTY 0 -#define FORREM 1 -#define FORINT 2 +#define FOR_REMOTE 1 +#define FOR_LOCAL 2 static Targets *targetCache = NULL; /* FIXME: can this also be stored per selection? */ static XlibAtom serverLastRequestedSelection = -1; -#define IS_INTERNAL_OWNER(lsoindex) (lastSelectionOwner[lsoindex].client != NullClient) +#define IS_LOCAL_OWNER(lsoindex) (lastSelectionOwner[lsoindex].client != NullClient) typedef enum { @@ -357,10 +357,10 @@ static void printSelectionStat(int index) fprintf(stderr, "selection [%d]:\n", index); - fprintf(stderr, " selection Atom internal [%d][%s] remote [%ld][%s]\n", - intSelAtoms[index], NameForIntAtom(intSelAtoms[index]), - remSelAtoms[index], NameForRemAtom(remSelAtoms[index])); - fprintf(stderr, " owner side %s\n", IS_INTERNAL_OWNER(index) ? "nxagent" : "real X server/none"); + fprintf(stderr, " selection Atom local [%d][%s] remote [%ld][%s]\n", + localSelelectionAtoms[index], NameForLocalAtom(localSelelectionAtoms[index]), + remoteSelectionAtoms[index], NameForRemoteAtom(remoteSelectionAtoms[index])); + fprintf(stderr, " owner side %s\n", IS_LOCAL_OWNER(index) ? "nxagent" : "real X server/none"); fprintf(stderr, " lastSelectionOwner[].client %s\n", nxagentClientInfoString(lOwner.client)); fprintf(stderr, " lastSelectionOwner[].window [0x%x]\n", lOwner.window); if (lOwner.windowPtr) @@ -383,8 +383,8 @@ static void printLastClientStat(int index) fprintf(stderr, " lastClients[].windowPtr (WindowPtr) -\n"); fprintf(stderr, " lastClients[].clientPtr (ClientPtr) %s\n", nxagentClientInfoString(lc.clientPtr)); fprintf(stderr, " lastClients[].requestor (Window) [0x%x]\n", lc.requestor); - fprintf(stderr, " lastClients[].property (Atom) [% 4d][%s]\n", lc.property, NameForIntAtom(lc.property)); - fprintf(stderr, " lastClients[].target (Atom) [% 4d][%s]\n", lc.target, NameForIntAtom(lc.target)); + fprintf(stderr, " lastClients[].property (Atom) [% 4d][%s]\n", lc.property, NameForLocalAtom(lc.property)); + fprintf(stderr, " lastClients[].target (Atom) [% 4d][%s]\n", lc.target, NameForLocalAtom(lc.target)); if (lc.time > 0) fprintf(stderr, " lastClients[].time (Time) [%u] ([%u]ms ago)\n", lc.time, GetTimeInMillis() - lc.time); else @@ -402,16 +402,16 @@ static void printLastServerStat(int index) { lastServer ls = lastServers[index]; fprintf(stderr, " lastServer[].requestor (XlibWindow) [0x%lx]\n", ls.requestor); - fprintf(stderr, " lastServer[].property (XlibAtom) [% 4ld][%s]\n", ls.property, NameForRemAtom(ls.property)); - fprintf(stderr, " lastServer[].target (XlibAtom) [% 4ld][%s]\n", ls.target, NameForRemAtom(ls.target)); + fprintf(stderr, " lastServer[].property (XlibAtom) [% 4ld][%s]\n", ls.property, NameForRemoteAtom(ls.property)); + fprintf(stderr, " lastServer[].target (XlibAtom) [% 4ld][%s]\n", ls.target, NameForRemoteAtom(ls.target)); fprintf(stderr, " lastServer[].time (Time) [%u]\n", ls.time); } static void printTargetCacheStat(int index) { fprintf(stderr, " targetCache[].type (int) [%d]\n", targetCache[index].type); - fprintf(stderr, " targetCache[].forInt (Atom *) [%p]\n", (void *)targetCache[index].forInt); - fprintf(stderr, " targetCache[].forRem (XlibAtom *) [%p]\n", (void *)targetCache[index].forRem); + fprintf(stderr, " targetCache[].forLocal (Atom *) [%p]\n", (void *)targetCache[index].forLocal); + fprintf(stderr, " targetCache[].forRemote (XlibAtom *) [%p]\n", (void *)targetCache[index].forRemote); fprintf(stderr, " targetCache[].numTargets (int) [%d]\n", targetCache[index].numTargets); } @@ -440,7 +440,7 @@ void nxagentDumpClipboardStat(void) if (serverLastRequestedSelection == -1) fprintf(stderr, " serverLastRequestedSelection [-1](uninitialized)\n"); else - fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, NameForRemAtom(serverLastRequestedSelection)); + fprintf(stderr, " serverLastRequestedSelection [% 4ld][%s]\n", serverLastRequestedSelection, NameForRemoteAtom(serverLastRequestedSelection)); fprintf(stderr, "Compile time settings\n"); #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG @@ -464,33 +464,33 @@ void nxagentDumpClipboardStat(void) XlibAtom sv = 0; int len = WIDTH; - fprintf(stderr, "Atoms internal%*sremote\n", WIDTH - 8, ""); - cl = clientTARGETS; sv = serverTARGETS; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); - fprintf(stderr, " TARGETS [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); + fprintf(stderr, "Atoms local%*sremote\n", WIDTH - 5, ""); + cl = clientTARGETS; sv = serverTARGETS; len = (int)(WIDTH - 9 - strlen(NameForLocalAtom(cl))); + fprintf(stderr, " TARGETS [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForLocalAtom(cl), len, "", sv, NameForRemoteAtom(sv)); - cl = clientTIMESTAMP; sv = serverTIMESTAMP; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); - fprintf(stderr, " TIMESTAMP [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); + cl = clientTIMESTAMP; sv = serverTIMESTAMP; len = (int)(WIDTH - 9 - strlen(NameForLocalAtom(cl))); + fprintf(stderr, " TIMESTAMP [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForLocalAtom(cl), len, "", sv, NameForRemoteAtom(sv)); #ifdef SUPPORT_TEXT_TARGET - cl = clientTEXT; sv = serverTEXT; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); - fprintf(stderr, " TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); + cl = clientTEXT; sv = serverTEXT; len = (int)(WIDTH - 9 - strlen(NameForLocalAtom(cl))); + fprintf(stderr, " TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForLocalAtom(cl), len, "", sv, NameForRemoteAtom(sv)); #endif #ifdef SUPPORT_COMPOUND_TEXT_TARGET - cl = clientCOMPOUND_TEXT; sv = serverCOMPOUND_TEXT; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); - fprintf(stderr, " COMPOUND_TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); + cl = clientCOMPOUND_TEXT; sv = serverCOMPOUND_TEXT; len = (int)(WIDTH - 9 - strlen(NameForLocalAtom(cl))); + fprintf(stderr, " COMPOUND_TEXT [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForLocalAtom(cl), len, "", sv, NameForRemoteAtom(sv)); #endif - cl = clientUTF8_STRING; sv = serverUTF8_STRING; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); - fprintf(stderr, " UTF8_STRING [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForIntAtom(cl), len, "", sv, NameForRemAtom(sv)); + cl = clientUTF8_STRING; sv = serverUTF8_STRING; len = (int)(WIDTH - 9 - strlen(NameForLocalAtom(cl))); + fprintf(stderr, " UTF8_STRING [% 4d][%s]%*s [% 4ld][%s]\n", cl, NameForLocalAtom(cl), len, "", sv, NameForRemoteAtom(sv)); sv = serverTransToAgentProperty; - fprintf(stderr, " serverTransToAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, NameForRemAtom(sv)); + fprintf(stderr, " serverTransToAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, NameForRemoteAtom(sv)); sv = serverTransFromAgentProperty; - fprintf(stderr, " serverTransFromAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, NameForRemAtom(sv)); + fprintf(stderr, " serverTransFromAgentProperty - %*s[% 4ld][%s]\n", WIDTH - 2, "", sv, NameForRemoteAtom(sv)); - cl = clientCutProperty; len = (int)(WIDTH - 9 - strlen(NameForIntAtom(cl))); - fprintf(stderr, " clientCutProperty [% 4d][%s]%*s\n", cl, NameForIntAtom(cl), len + 2, "-" ); + cl = clientCutProperty; len = (int)(WIDTH - 9 - strlen(NameForLocalAtom(cl))); + fprintf(stderr, " clientCutProperty [% 4d][%s]%*s\n", cl, NameForLocalAtom(cl), len + 2, "-" ); for (int index = 0; index < nxagentMaxSelections; index++) { @@ -758,23 +758,23 @@ int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) { for (int index = 0; index < nxagentMaxSelections; index++) { - if (remSelAtoms[index] == sel) + if (remoteSelectionAtoms[index] == sel) { #ifdef DEBUG - fprintf(stderr, "%s: remote selection [%ld][%s] belongs to index [%d]\n", __func__, sel, NameForRemAtom(sel), index); + fprintf(stderr, "%s: remote selection [%ld][%s] belongs to index [%d]\n", __func__, sel, NameForRemoteAtom(sel), index); #endif return index; } } #ifdef DEBUG - fprintf(stderr, "%s: remote selection [%ld][%s] does not belong to any index!\n", __func__, sel, NameForRemAtom(sel)); + fprintf(stderr, "%s: remote selection [%ld][%s] does not belong to any index!\n", __func__, sel, NameForRemoteAtom(sel)); #endif return -1; } /* * Find the index of CurrentSelection with the selection - * sel. sel is an internal atom. If the index cannot be + * sel. sel is a local atom. If the index cannot be * determined it will return -1. */ int nxagentFindCurrentSelectionIndex(Atom sel) @@ -798,40 +798,40 @@ int nxagentFindCurrentSelectionIndex(Atom sel) if (CurrentSelections[index].selection == sel) { #ifdef DEBUG - fprintf(stderr, "%s: selection [%d][%s] belongs to index [%d]\n", __func__, sel, NameForIntAtom(sel), index); + fprintf(stderr, "%s: selection [%d][%s] belongs to index [%d]\n", __func__, sel, NameForLocalAtom(sel), index); #endif return index; } } #ifdef DEBUG - fprintf(stderr, "%s: selection [%d][%s] does not belong to any index!\n", __func__, sel, NameForIntAtom(sel)); + fprintf(stderr, "%s: selection [%d][%s] does not belong to any index!\n", __func__, sel, NameForLocalAtom(sel)); #endif return -1; } -void cacheTargetsForInt(int index, Atom* targets, int numTargets) +void cacheTargetsForLocal(int index, Atom* targets, int numTargets) { #ifdef DEBUG - fprintf(stderr, "%s: caching [%d] targets for internal requests\n", __func__, numTargets); + fprintf(stderr, "%s: caching [%d] targets for local requests\n", __func__, numTargets); #endif - SAFE_free(targetCache[index].forInt); - SAFE_free(targetCache[index].forRem); - targetCache[index].type = FORINT; - targetCache[index].forInt = targets; + SAFE_free(targetCache[index].forLocal); + SAFE_free(targetCache[index].forRemote); + targetCache[index].type = FOR_LOCAL; + targetCache[index].forLocal = targets; targetCache[index].numTargets = numTargets; } -void cacheTargetsForRem(int index, XlibAtom* targets, int numTargets) +void cacheTargetsForRemote(int index, XlibAtom* targets, int numTargets) { #ifdef DEBUG fprintf(stderr, "%s: caching [%d] targets for remote requests\n", __func__, numTargets); #endif - SAFE_free(targetCache[index].forInt); - SAFE_free(targetCache[index].forRem); - targetCache[index].type = FORREM; - targetCache[index].forRem = targets; + SAFE_free(targetCache[index].forLocal); + SAFE_free(targetCache[index].forRemote); + targetCache[index].type = FOR_REMOTE; + targetCache[index].forRemote = targets; targetCache[index].numTargets = numTargets; } @@ -842,8 +842,8 @@ void invalidateTargetCache(int index) fprintf(stderr, "%s: invalidating target cache [%d]\n", __func__, index); #endif - SAFE_free(targetCache[index].forInt); - SAFE_free(targetCache[index].forRem); + SAFE_free(targetCache[index].forLocal); + SAFE_free(targetCache[index].forRemote); targetCache[index].type = EMPTY; targetCache[index].numTargets = 0; } @@ -856,8 +856,8 @@ void invalidateTargetCaches(void) for (int index = 0; index < nxagentMaxSelections; index++) { - SAFE_free(targetCache[index].forInt); - SAFE_free(targetCache[index].forRem); + SAFE_free(targetCache[index].forLocal); + SAFE_free(targetCache[index].forRemote); targetCache[index].type = EMPTY; targetCache[index].numTargets = 0; } @@ -872,7 +872,7 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) { #ifdef DEBUG fprintf(stderr, "---------\n%s: SelectionClear event for selection [%lu][%s] window [0x%lx] time [%lu].\n", - __func__, X->xselectionclear.selection, NameForRemAtom(X->xselectionclear.selection), + __func__, X->xselectionclear.selection, NameForRemoteAtom(X->xselectionclear.selection), X->xselectionclear.window, X->xselectionclear.time); #endif @@ -895,7 +895,7 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) int index = nxagentFindLastSelectionOwnerIndex(X->xselectionclear.selection); if (index != -1) { - if (IS_INTERNAL_OWNER(index)) + if (IS_LOCAL_OWNER(index)) { /* Send a SelectionClear event to (our) previous owner. */ xEvent x = {0}; @@ -962,10 +962,10 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) fprintf(stderr, "---------\n%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s] time [%lu]\n", __func__, - X->xselectionrequest.selection, NameForRemAtom(X->xselectionrequest.selection), - X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target), + X->xselectionrequest.selection, NameForRemoteAtom(X->xselectionrequest.selection), + X->xselectionrequest.target, NameForRemoteAtom(X->xselectionrequest.target), DisplayString(nxagentDisplay), X->xselectionrequest.requestor, - X->xselectionrequest.property, NameForRemAtom(X->xselectionrequest.property), + X->xselectionrequest.property, NameForRemoteAtom(X->xselectionrequest.property), X->xselectionrequest.time); if (X->xselectionrequest.requestor == serverWindow) { @@ -1044,7 +1044,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) fprintf(stderr, "%s: Sending %d available targets:\n", __func__, numTargets); for (int i = 0; i < numTargets; i++) { - fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], NameForRemAtom(targets[i])); + fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], NameForRemoteAtom(targets[i])); } #endif @@ -1074,16 +1074,16 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * occured we can answer with the cached list of targets. */ - if (targetCache[index].type == FORREM && targetCache[index].forRem) + if (targetCache[index].type == FOR_REMOTE && targetCache[index].forRemote) { - XlibAtom *targets = targetCache[index].forRem; + XlibAtom *targets = targetCache[index].forRemote; unsigned int numTargets = targetCache[index].numTargets; #ifdef DEBUG fprintf(stderr, "%s: Sending %d cached targets to remote requestor:\n", __func__, numTargets); for (int i = 0; i < numTargets; i++) { - fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], NameForRemAtom(targets[i])); + fprintf(stderr, "%s: %ld %s\n", __func__, targets[i], NameForRemoteAtom(targets[i])); } #endif @@ -1183,7 +1183,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) { #ifdef DEBUG fprintf(stderr, "%s: denying request for non-text target [%ld][%s].\n", __func__, - X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target)); + X->xselectionrequest.target, NameForRemoteAtom(X->xselectionrequest.target)); #endif replyRequestSelectionToXServer(X, False); @@ -1195,7 +1195,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) #ifdef DEBUG fprintf(stderr, "%s: target [%ld][%s].\n", __func__, X->xselectionrequest.target, - NameForRemAtom(X->xselectionrequest.target)); + NameForRemoteAtom(X->xselectionrequest.target)); #endif /* @@ -1209,9 +1209,9 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * requested target is supported by the owner. If not we can take * a shortcut and deny the request immediately without doing any * further communication. */ - if (targetCache[index].type == FORREM && targetCache[index].forRem) + if (targetCache[index].type == FOR_REMOTE && targetCache[index].forRemote) { - XlibAtom *targets = targetCache[index].forRem; + XlibAtom *targets = targetCache[index].forRemote; #ifdef DEBUG fprintf(stderr, "%s: Checking target validity\n", __func__); @@ -1229,7 +1229,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) { #ifdef DEBUG fprintf(stderr, "%s: target [%ld][%s] is not supported by the owner - denying request.\n", - __func__, X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target)); + __func__, X->xselectionrequest.target, NameForRemoteAtom(X->xselectionrequest.target)); #endif replyRequestSelectionToXServer(X, False); return; @@ -1258,7 +1258,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) serverLastRequestedSelection = X->xselectionrequest.selection; #if 0 - if (lastClients[index].windowPtr != NULL && IS_INTERNAL_OWNER(index)) + if (lastClients[index].windowPtr != NULL && IS_LOCAL_OWNER(index)) { /* * Request the real X server to transfer the selection content @@ -1280,9 +1280,9 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) #ifdef DEBUG fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%lx] time [%u] .\n", __func__, - CurrentSelections[index].selection, NameForRemAtom(CurrentSelections[index].selection)), - X->xselectionrequest.target, NameForRemAtom(X->xselectionrequest.target), - serverTransToAgentProperty, NameForRemAtom(serverTransToAgentProperty), + CurrentSelections[index].selection, NameForRemoteAtom(CurrentSelections[index].selection)), + X->xselectionrequest.target, NameForRemoteAtom(X->xselectionrequest.target), + serverTransToAgentProperty, NameForRemoteAtom(serverTransToAgentProperty), serverWindow, lastClients[index].time); #endif } @@ -1307,7 +1307,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * window in the first step. We then later push that property's * content to the real X server. */ - if (IS_INTERNAL_OWNER(index)) + if (IS_LOCAL_OWNER(index)) { /* * Store who on the real X server requested the data and how @@ -1318,7 +1318,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) lastServers[index].target = X->xselectionrequest.target; lastServers[index].time = X->xselectionrequest.time; - /* Prepare the request (like XConvertSelection, but internally). */ + /* Prepare the request (like XConvertSelection, but locally). */ xEvent x = {0}; x.u.u.type = SelectionRequest; x.u.selectionRequest.time = GetTimeInMillis(); @@ -1370,10 +1370,10 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) fprintf(stderr, "%s: sent SelectionRequest event to client %s property [%d][%s] " \ "target [%d][%s] requestor [0x%x] selection [%d][%s].\n", __func__, nxagentClientInfoString(lastSelectionOwner[index].client), - x.u.selectionRequest.property, NameForIntAtom(x.u.selectionRequest.property), - x.u.selectionRequest.target, NameForIntAtom(x.u.selectionRequest.target), + x.u.selectionRequest.property, NameForLocalAtom(x.u.selectionRequest.property), + x.u.selectionRequest.target, NameForLocalAtom(x.u.selectionRequest.target), x.u.selectionRequest.requestor, - x.u.selectionRequest.selection, NameForIntAtom(x.u.selectionRequest.selection)); + x.u.selectionRequest.selection, NameForLocalAtom(x.u.selectionRequest.selection)); #endif /* No reply to the Xserver yet - we will do that once the answer of the above sendEventToClient arrives. */ @@ -1381,8 +1381,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) else { #ifdef DEBUG - fprintf(stderr, "%s: no internal owner for selection [%ld][%s] - denying request.\n", __func__, - X->xselectionrequest.selection, NameForRemAtom(X->xselectionrequest.selection)); + fprintf(stderr, "%s: no local owner for selection [%ld][%s] - denying request.\n", __func__, + X->xselectionrequest.selection, NameForRemoteAtom(X->xselectionrequest.selection)); #endif /* deny the request */ @@ -1412,7 +1412,7 @@ static void endTransfer(int index, Bool success) #ifdef DEBUG if (success == SELECTION_SUCCESS) fprintf(stderr, "%s: sending notification to client %s, property [%d][%s]\n", __func__, - nxagentClientInfoString(lastClients[index].clientPtr), lastClients[index].property, NameForIntAtom(lastClients[index].property)); + nxagentClientInfoString(lastClients[index].clientPtr), lastClients[index].property, NameForLocalAtom(lastClients[index].property)); else fprintf(stderr, "%s: sending negative notification to client %s\n", __func__, nxagentClientInfoString(lastClients[index].clientPtr)); @@ -1421,7 +1421,7 @@ static void endTransfer(int index, Bool success) sendSelectionNotifyEventToClient(lastClients[index].clientPtr, lastClients[index].time, lastClients[index].requestor, - intSelAtoms[index], + localSelelectionAtoms[index], lastClients[index].target, success == SELECTION_SUCCESS ? lastClients[index].property : None); } @@ -1681,7 +1681,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) #ifdef DEBUG fprintf (stderr, "%s: Retrieved property data - deleting property [%ld][%s] " "for ICCCM conformity.\n", __func__, serverTransToAgentProperty, - NameForRemAtom(serverTransToAgentProperty)); + NameForRemoteAtom(serverTransToAgentProperty)); #endif XDeleteProperty(nxagentDisplay, serverWindow, serverTransToAgentProperty); } @@ -1787,7 +1787,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) #ifdef DEBUG fprintf(stderr, "%s: converting atom: remote [%u][%s] -> local [%u][%s]\n", __func__, - (unsigned int)remote, NameForRemAtom(remote), local, NameForIntAtom(local)); + (unsigned int)remote, NameForRemoteAtom(remote), local, NameForLocalAtom(local)); #endif } ChangeWindowProperty(lastClients[index].windowPtr, @@ -1796,7 +1796,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) 32, PropModeReplace, ulReturnItems, (unsigned char*)targets, 1); - cacheTargetsForInt(index, targets, numTargets); + cacheTargetsForLocal(index, targets, numTargets); endTransfer(index, SELECTION_SUCCESS); } @@ -1816,7 +1816,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) #endif "\n", __func__, lastClients[index].property, - validateString(NameForIntAtom(lastClients[index].property)) + validateString(NameForLocalAtom(lastClients[index].property)) #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG ,(int)(min(20, ulReturnItems * resultFormat / 8)), (int)(min(20, ulReturnItems * resultFormat / 8)), @@ -1865,9 +1865,9 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) #ifdef DEBUG fprintf(stderr, "---------\n%s: Received SelectionNotify event from real X server, property " \ "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", - __func__, e->property, NameForRemAtom(e->property), e->requestor, - NameForRemAtom(e->selection), e->target, - NameForRemAtom(e->target), e->time, e->send_event); + __func__, e->property, NameForRemoteAtom(e->property), e->requestor, + NameForRemoteAtom(e->selection), e->target, + NameForRemoteAtom(e->target), e->time, e->send_event); /* this has not been SENT by nxagent but is the answer to a request of nxagent */ if (e->requestor == serverWindow) @@ -1944,7 +1944,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) { #ifdef DEBUG fprintf(stderr, "%s: Unexpected property [%ld][%s] - reporting conversion failure.\n", - __func__, X->xselection.property, NameForRemAtom(X->xselection.property)); + __func__, X->xselection.property, NameForRemoteAtom(X->xselection.property)); #endif endTransfer(index, SELECTION_FAULT); } @@ -1968,11 +1968,11 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) { /* - * If the last owner was an internal one, read the + * If the last owner was a local one, read the * clientCutProperty and push the contents to the * lastServers[index].requestor on the real X server. */ - if (IS_INTERNAL_OWNER(index) && + if (IS_LOCAL_OWNER(index) && lastSelectionOwner[index].windowPtr != NULL && property == serverTransFromAgentProperty) { @@ -1989,7 +1989,7 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) #ifdef DEBUG fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d][%s] returned [%s]\n", __func__, - lastSelectionOwner[index].window, clientCutProperty, NameForIntAtom(clientCutProperty), + lastSelectionOwner[index].window, clientCutProperty, NameForLocalAtom(clientCutProperty), getXErrorString(result)); #endif if (result == BadAlloc || result == BadAtom || @@ -2006,7 +2006,7 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) &pszReturnData); #ifdef DEBUG fprintf(stderr, "%s: GetWindowProperty() window [0x%x] property [%d][%s] returned [%s]\n", __func__, - lastSelectionOwner[index].window, clientCutProperty, NameForIntAtom(clientCutProperty), + lastSelectionOwner[index].window, clientCutProperty, NameForLocalAtom(clientCutProperty), getXErrorString(result)); #endif @@ -2047,7 +2047,7 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) #ifdef DEBUG fprintf(stderr, "%s: converting atom: local [%d][%s] -> remote [%ld][%s]\n", __func__, - local, NameForIntAtom(local), remote, NameForRemAtom(remote)); + local, NameForLocalAtom(local), remote, NameForRemoteAtom(remote)); #endif } @@ -2061,7 +2061,7 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) (unsigned char*)targets, numTargets); - cacheTargetsForRem(index, targets, numTargets); + cacheTargetsForRemote(index, targets, numTargets); } } else @@ -2088,7 +2088,7 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) __func__, lastServers[index].requestor, lastServers[index].property, - NameForRemAtom(lastServers[index].property), + NameForRemoteAtom(lastServers[index].property), (int)ulReturnItems * 8 / 8 #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG ,(int)(min(20, ulReturnItems * 8 / 8)), @@ -2136,7 +2136,7 @@ void replyPendingRequestSelectionToXServer(int index, Bool success) { XSelectionEvent eventSelection = { .requestor = lastServers[index].requestor, - .selection = remSelAtoms[index], + .selection = remoteSelectionAtoms[index], .target = lastServers[index].target, .time = lastServers[index].time, .property = success ? lastServers[index].property : None, @@ -2182,7 +2182,7 @@ static void resetSelectionOwnerOnXServer(void) for (int index = 0; index < nxagentMaxSelections; index++) { - XSetSelectionOwner(nxagentDisplay, remSelAtoms[index], serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, remoteSelectionAtoms[index], serverWindow, CurrentTime); #ifdef DEBUG fprintf(stderr, "%s: Reset selection state for selection [%d].\n", __func__, index); @@ -2248,7 +2248,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, if (index == -1) { #ifdef DEBUG - fprintf(stderr, "%s: selection [%s] will not be handled by the clipboard code\n", __func__, NameForIntAtom(pCurSel->selection)); + fprintf(stderr, "%s: selection [%s] will not be handled by the clipboard code\n", __func__, NameForLocalAtom(pCurSel->selection)); #endif return; } @@ -2277,13 +2277,13 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, { #ifdef DEBUG fprintf(stderr, "%s: pCurSel->pWin [0x%x]\n", __func__, WINDOWID(pCurSel->pWin)); - fprintf(stderr, "%s: pCurSel->selection [%s]\n", __func__, NameForIntAtom(pCurSel->selection)); + fprintf(stderr, "%s: pCurSel->selection [%s]\n", __func__, NameForLocalAtom(pCurSel->selection)); #endif if (pCurSel->pWin != NULL && nxagentOption(Clipboard) != ClipboardNone && /* FIXME: shouldn't we also check for != ClipboardClient? */ - (pCurSel->selection == intSelAtoms[nxagentPrimarySelection] || - pCurSel->selection == intSelAtoms[nxagentClipboardSelection])) + (pCurSel->selection == localSelelectionAtoms[nxagentPrimarySelection] || + pCurSel->selection == localSelelectionAtoms[nxagentClipboardSelection])) { #ifdef DEBUG fprintf(stderr, "%s: calling setSelectionOwnerOnXServer\n", __func__); @@ -2305,7 +2305,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, /* * This is called from the nxagentSetSelectionCallback, so it is using - * internal Atoms. + * local Atoms. */ static void setSelectionOwnerOnXServer(Selection *pSelection) { @@ -2364,7 +2364,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) * reacquire the clipboard whenever the content or metadata (e.g * the list of supported targets) changes." */ - XSetSelectionOwner(nxagentDisplay, remSelAtoms[index], serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, remoteSelectionAtoms[index], serverWindow, CurrentTime); /* * The real owner window (inside nxagent) is stored in @@ -2413,7 +2413,7 @@ FIXME2: instead of XGetSelectionOwner we could check if the Xfixes /* * This is called from dix (ProcConvertSelection) if an nxagent client - * issues a ConvertSelection request. So all the Atoms are internal. + * issues a ConvertSelection request. So all the Atoms are local. * return codes: * 0: let dix process the request * 1: don't let dix process the request @@ -2424,12 +2424,12 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #ifdef DEBUG fprintf(stderr, "---------\n%s: client %s requests sel [%s] " "on window [0x%x] prop [%d][%s] target [%d][%s] time [%u].\n", __func__, - nxagentClientInfoString(client), NameForIntAtom(selection), requestor, - property, NameForIntAtom(property), - target, NameForIntAtom(target), time); + nxagentClientInfoString(client), NameForLocalAtom(selection), requestor, + property, NameForLocalAtom(property), + target, NameForLocalAtom(target), time); #endif - /* We cannot use NameForIntAtom() here! FIXME: Why not? */ + /* We cannot use NameForLocalAtom() here! FIXME: Why not? */ if (NameForAtom(target) == NULL) { #ifdef DEBUG @@ -2463,13 +2463,13 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, return 0; } - if (IS_INTERNAL_OWNER(index)) + if (IS_LOCAL_OWNER(index)) { /* * There is a client owner on the agent side, let normal dix stuff happen. */ #ifdef DEBUG - fprintf(stderr, "%s: clipboard is owned by internal client - let dix process the request\n", __func__); + fprintf(stderr, "%s: clipboard is owned by local client - let dix process the request\n", __func__); #endif return 0; } @@ -2491,7 +2491,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #endif #ifdef DEBUG - fprintf(stderr, "%s: intSelAtoms[%d] [%d] - selection [%d]\n", __func__, index, intSelAtoms[index], selection); + fprintf(stderr, "%s: localSelelectionAtoms[%d] [%d] - selection [%d]\n", __func__, index, localSelelectionAtoms[index], selection); #endif if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) @@ -2560,7 +2560,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, fprintf(stderr, "%s: Sending %d available targets:\n", __func__, numTargets); for (int i = 0; i < numTargets; i++) { - fprintf(stderr, "%s: %d %s\n", __func__, targets[i], NameForIntAtom(targets[i])); + fprintf(stderr, "%s: %d %s\n", __func__, targets[i], NameForLocalAtom(targets[i])); } #endif @@ -2588,16 +2588,16 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * occured we can answer with the cached list of targets. */ - if (targetCache[index].type == FORINT && targetCache[index].forInt) + if (targetCache[index].type == FOR_LOCAL && targetCache[index].forLocal) { - Atom *targets = targetCache[index].forInt; + Atom *targets = targetCache[index].forLocal; int numTargets = targetCache[index].numTargets; #ifdef DEBUG - fprintf(stderr, "%s: Sending %d cached targets to internal client:\n", __func__, numTargets); + fprintf(stderr, "%s: Sending %d cached targets to local client:\n", __func__, numTargets); for (int i = 0; i < numTargets; i++) { - fprintf(stderr, "%s: %d %s\n", __func__, targets[i], NameForIntAtom(targets[i])); + fprintf(stderr, "%s: %d %s\n", __func__, targets[i], NameForLocalAtom(targets[i])); } #endif @@ -2710,7 +2710,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, { #ifdef DEBUG fprintf(stderr, "%s: denying request for non-text target [%d][%s].\n", __func__, - target, NameForIntAtom(target)); + target, NameForLocalAtom(target)); #endif sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); @@ -2721,7 +2721,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #ifdef DEBUG fprintf(stderr, "%s: target [%d][%s].\n", __func__, target, - NameForIntAtom(target)); + NameForLocalAtom(target)); #endif if (!nxagentOption(TextClipboard)) @@ -2732,9 +2732,9 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * a shortcut and deny the request immediately without doing any * further communication */ - if (targetCache[index].type == FORINT && targetCache[index].forInt) + if (targetCache[index].type == FOR_LOCAL && targetCache[index].forLocal) { - Atom *targets = targetCache[index].forInt; + Atom *targets = targetCache[index].forLocal; #ifdef DEBUG fprintf(stderr, "%s: Checking target validity\n", __func__); @@ -2752,7 +2752,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, { #ifdef DEBUG fprintf(stderr, "%s: target [%d][%s] is not supported by the owner - denying request.\n", - __func__, target, NameForIntAtom(target)); + __func__, target, NameForLocalAtom(target)); #endif sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); return 1; @@ -2830,15 +2830,15 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, #ifdef DEBUG fprintf(stderr, "%s: replacing local by remote property: [%d][%s] -> [%ld][%s]\n", - __func__, property, NameForIntAtom(property), + __func__, property, NameForLocalAtom(property), remProperty, "NX_CUT_BUFFER_SERVER"); #endif #ifdef DEBUG fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%lx] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__, - serverWindow, remTarget, NameForRemAtom(remTarget), - remProperty, NameForRemAtom(remProperty), - remSelection, NameForRemAtom(remSelection)); + serverWindow, remTarget, NameForRemoteAtom(remTarget), + remProperty, NameForRemoteAtom(remProperty), + remSelection, NameForRemoteAtom(remSelection)); #endif /* @@ -2885,7 +2885,7 @@ XlibAtom translateLocalToRemoteSelection(Atom local) /* * On the real server, the right CLIPBOARD atom is * XInternAtom(nxagentDisplay, "CLIPBOARD", 1), which is stored in - * remSelAtoms[nxagentClipboardSelection]. For + * remoteSelectionAtoms[nxagentClipboardSelection]. For * PRIMARY there's nothing to map because that is identical on all * X servers (defined in Xatom.h). We do it anyway so we do not * require a special treatment. @@ -2895,9 +2895,9 @@ XlibAtom translateLocalToRemoteSelection(Atom local) for (int index = 0; index < nxagentMaxSelections; index++) { - if (local == intSelAtoms[index]) + if (local == localSelelectionAtoms[index]) { - remote = remSelAtoms[index]; + remote = remoteSelectionAtoms[index]; break; } } @@ -2909,7 +2909,7 @@ XlibAtom translateLocalToRemoteSelection(Atom local) #ifdef DEBUG fprintf(stderr, "%s: mapping local to remote selection: [%d][%s] -> [%ld][%s]\n", __func__, - local, NameForIntAtom(local), remote, NameForRemAtom(remote)); + local, NameForLocalAtom(local), remote, NameForRemoteAtom(remote)); #endif return remote; @@ -2964,7 +2964,7 @@ XlibAtom translateLocalToRemoteTarget(Atom local) #ifdef DEBUG fprintf(stderr, "%s: mapping local to remote target: [%d][%s] -> [%ld][%s]\n", __func__, - local, NameForIntAtom(local), remote, NameForRemAtom(remote)); + local, NameForLocalAtom(local), remote, NameForRemoteAtom(remote)); #endif return remote; @@ -3000,9 +3000,9 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) #ifdef DEBUG fprintf(stderr, "---------\n%s: Received SendNotify from client: property [%d][%s] target [%d][%s] selection [%d][%s] requestor [0x%x] time [%u].\n", __func__, - event->u.selectionNotify.property, NameForIntAtom(event->u.selectionNotify.property), - event->u.selectionNotify.target, NameForIntAtom(event->u.selectionNotify.target), - event->u.selectionNotify.selection, NameForIntAtom(event->u.selectionNotify.selection), + event->u.selectionNotify.property, NameForLocalAtom(event->u.selectionNotify.property), + event->u.selectionNotify.target, NameForLocalAtom(event->u.selectionNotify.target), + event->u.selectionNotify.selection, NameForLocalAtom(event->u.selectionNotify.selection), event->u.selectionNotify.requestor, event->u.selectionNotify.time); #endif @@ -3054,7 +3054,7 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) * .property must be a server-side Atom. As this property is only * set on our serverWindow and normally there are few other * properties except serverTransToAgentProperty, the only thing - * we need to ensure is that the internal Atom clientCutProperty + * we need to ensure is that the local Atom clientCutProperty * differs from the server-side serverTransToAgentProperty * Atom. The actual name is not important. To be clean here we use * a separate serverTransFromAgentProperty. @@ -3070,7 +3070,7 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) #ifdef DEBUG fprintf(stderr, "%s: remote property [%ld][%s].\n", __func__, - serverTransFromAgentProperty, NameForRemAtom(serverTransFromAgentProperty)); + serverTransFromAgentProperty, NameForRemoteAtom(serverTransFromAgentProperty)); #endif sendSelectionNotifyEventToXServer(&eventSelection); return 1; @@ -3097,7 +3097,7 @@ WindowPtr nxagentGetClipboardWindow(Atom property) { #ifdef DEBUG fprintf(stderr, "%s: Returning last [%d] selection owner window [%p] (0x%x).\n", __func__, - intSelAtoms[index], + localSelelectionAtoms[index], (void *)lastSelectionOwner[index].windowPtr, WINDOWID(lastSelectionOwner[index].windowPtr)); #endif @@ -3175,18 +3175,18 @@ Bool nxagentInitClipboard(WindowPtr pWin) FatalError("nxagentInitClipboard: Failed to allocate memory for the last servers array.\n"); } - SAFE_free(intSelAtoms); - intSelAtoms = (Atom *) calloc(nxagentMaxSelections, sizeof(Atom)); - if (intSelAtoms == NULL) + SAFE_free(localSelelectionAtoms); + localSelelectionAtoms = (Atom *) calloc(nxagentMaxSelections, sizeof(Atom)); + if (localSelelectionAtoms == NULL) { - FatalError("nxagentInitClipboard: Failed to allocate memory for the internal selection Atoms array.\n"); + FatalError("nxagentInitClipboard: Failed to allocate memory for the local selection Atoms array.\n"); } - intSelAtoms[nxagentPrimarySelection] = XA_PRIMARY; - intSelAtoms[nxagentClipboardSelection] = MakeAtom(szAgentCLIPBOARD, strlen(szAgentCLIPBOARD), True); + localSelelectionAtoms[nxagentPrimarySelection] = XA_PRIMARY; + localSelelectionAtoms[nxagentClipboardSelection] = MakeAtom(szAgentCLIPBOARD, strlen(szAgentCLIPBOARD), True); - SAFE_free(remSelAtoms); - remSelAtoms = (XlibAtom *) calloc(nxagentMaxSelections, sizeof(XlibAtom)); - if (remSelAtoms == NULL) + SAFE_free(remoteSelectionAtoms); + remoteSelectionAtoms = (XlibAtom *) calloc(nxagentMaxSelections, sizeof(XlibAtom)); + if (remoteSelectionAtoms == NULL) { FatalError("nxagentInitClipboard: Failed to allocate memory for the remote selection Atoms array.\n"); } @@ -3203,8 +3203,8 @@ Bool nxagentInitClipboard(WindowPtr pWin) * The clipboard selection atom can change with a new X * server while Primary is constant. */ - remSelAtoms[nxagentPrimarySelection] = XA_PRIMARY; - remSelAtoms[nxagentClipboardSelection] = nxagentAtoms[10]; /* CLIPBOARD */ + remoteSelectionAtoms[nxagentPrimarySelection] = XA_PRIMARY; + remoteSelectionAtoms[nxagentClipboardSelection] = nxagentAtoms[10]; /* CLIPBOARD */ serverTARGETS = nxagentAtoms[6]; /* TARGETS */ #ifdef SUPPORT_TEXT_TARGET @@ -3266,7 +3266,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) for (int index = 0; index < nxagentMaxSelections; index++) { XFixesSelectSelectionInput(nxagentDisplay, serverWindow, - remSelAtoms[index], + remoteSelectionAtoms[index], XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask); @@ -3289,7 +3289,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) #ifdef TEST fprintf(stderr, "%s: setting the ownership of %s to %lx" " and registering for PropertyChangeMask events\n", __func__, - validateString(NameForRemAtom(nxagentAtoms[10])), serverWindow); + validateString(NameForRemoteAtom(nxagentAtoms[10])), serverWindow); #endif XSetSelectionOwner(nxagentDisplay, nxagentAtoms[10], serverWindow, CurrentTime); // nxagentAtoms[10] is the CLIPBOARD atom @@ -3311,10 +3311,10 @@ Bool nxagentInitClipboard(WindowPtr pWin) * claim the ownership. Note that we report our serverWindow as * owner, not the real window! */ - if (IS_INTERNAL_OWNER(index) && lastSelectionOwner[index].window) + if (IS_LOCAL_OWNER(index) && lastSelectionOwner[index].window) { - /* remSelAtoms have already been adjusted above */ - XSetSelectionOwner(nxagentDisplay, remSelAtoms[index], serverWindow, CurrentTime); + /* remoteSelectionAtoms have already been adjusted above */ + XSetSelectionOwner(nxagentDisplay, remoteSelectionAtoms[index], serverWindow, CurrentTime); } /* @@ -3325,7 +3325,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) /* * FIXME: We should reset lastClients[index].* here! Problem - * is that internal clients might still be waiting for + * is that local clients might still be waiting for * answers. Should reply with failure then. */ -- 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 3.6.x in repository nx-libs. commit 9fb5949b017b50e55a93dcd200cafffb7602ef21 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jun 11 00:15:20 2021 +0200 Clipboard.c: remove old code This block has been unused for a long time now. The comment describing how to reach that path does not make sense anymore because primary and clipboard are not sharing variables anymore. So drop it. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 31 -------------------------- 1 file changed, 31 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 3a210ac5f..503f42add 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1257,37 +1257,6 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) */ serverLastRequestedSelection = X->xselectionrequest.selection; -#if 0 - if (lastClients[index].windowPtr != NULL && IS_LOCAL_OWNER(index)) - { - /* - * Request the real X server to transfer the selection content - * to the NX_CUT_BUFFER_SERVER property of the serverWindow. - * We reach here as follows: - * - mark someting in the nx session - * -> nxagent claims ownership of PRIMARY on real X server - * - at the same time paste _clipboard_ to the client (now) owning primary - * ->vcxsrv will ask for primary contents to store them to Windows clipboard - * - vcxsrv request is for _primary_ and takes this path as the _clipboard_ transfer - * has set lastClients[index].windowPtr - */ - XDeleteProperty(nxagentDisplay, serverWindow, serverTransToAgentProperty); - XConvertSelection(nxagentDisplay, CurrentSelections[index].selection, - X->xselectionrequest.target, serverTransToAgentProperty, - serverWindow, lastClients[index].time); - - NXFlushDisplay(nxagentDisplay, NXFlushLink); - - #ifdef DEBUG - fprintf(stderr, "%s: Sent XConvertSelection: selection [%d][%s] target [%ld][%s] property [%ld][%s] window [0x%lx] time [%u] .\n", __func__, - CurrentSelections[index].selection, NameForRemoteAtom(CurrentSelections[index].selection)), - X->xselectionrequest.target, NameForRemoteAtom(X->xselectionrequest.target), - serverTransToAgentProperty, NameForRemoteAtom(serverTransToAgentProperty), - serverWindow, lastClients[index].time); - #endif - } - else -#endif { if (!(nxagentOption(Clipboard) == ClipboardServer || nxagentOption(Clipboard) == ClipboardBoth)) -- 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 3.6.x in repository nx-libs. commit 34e1413cda0c4475d9cfa45730eaf8e1cb843cb0 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Jun 10 20:54:27 2021 +0200 Clipboard.c: improve some comments as requested by reviewer --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 200 +++++++++++++------------ 1 file changed, 104 insertions(+), 96 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 87473b221..49c10a947 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -60,7 +60,7 @@ #undef DEBUG /* - * define this to see the clipboard content in the debug output. As + * Define this to see the clipboard content in the debug output. As * this can lead to information leaking it must be activated * explicitly! */ @@ -106,7 +106,7 @@ typedef struct _SelectionOwner } SelectionOwner; /* - * this contains the last selection owner in nxagent. The + * This contains the last selection owner in nxagent. The * lastTimeChanged is always an internal time. If .client is NULL the * owner is outside nxagent. */ @@ -114,9 +114,9 @@ typedef struct _SelectionOwner static SelectionOwner *lastSelectionOwner = NULL; /* - * cache for targets the current selection owner + * Cache for targets the current selection owner * has to offer. We are storing the targets - * after they have been converted + * after they have been converted. */ typedef struct _Targets { @@ -234,7 +234,7 @@ static char szAgentUTF8_STRING[] = "UTF8_STRING"; static char szAgentNX_CUT_BUFFER_CLIENT[] = "NX_CUT_BUFFER_CLIENT"; static char szAgentCLIPBOARD[] = "CLIPBOARD"; -/* number of milliseconds to wait for a conversion from the real X server. */ +/* Number of milliseconds to wait for a conversion from the real X server. */ #define CONVERSION_TIMEOUT 5000 /* @@ -244,7 +244,7 @@ static char szAgentCLIPBOARD[] = "CLIPBOARD"; #define ACCUM_TIME 5000 /* - * some helpers for debugging output + * Some helpers for debugging output */ static const char * getClientSelectionStageString(int stage) @@ -271,10 +271,11 @@ static const char * getClientSelectionStageString(int stage) #ifdef DEBUG /* - * see also nx-X11/lib/src/ErrDes.c + * See also nx-X11/lib/src/ErrDes.c * * We use our own version to avoid Xlib doing expensive calls. * FIXME: Must check if XGetErrorText() is really causing traffic over the wire. + * FIXME: move this to a Utils.c or similar */ const char * getXErrorString(int code) { @@ -550,7 +551,7 @@ int GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, long longL /* * Send a SelectionNotify event to the real X server and do some error - * handling (in DEBUG mode) + * handling (in DEBUG mode). */ static Status sendSelectionNotifyEventToXServer(XSelectionEvent *event_to_send) { @@ -791,7 +792,7 @@ int nxagentFindCurrentSelectionIndex(Atom sel) * selection for the first nxagentMaxSelections selection atoms. */ - // for (int index = 0; index < NumCurrentSelections; index++) + /* for (int index = 0; index < NumCurrentSelections; index++) */ for (int index = 0; index < nxagentMaxSelections; index++) { if (CurrentSelections[index].selection == sel) @@ -834,7 +835,7 @@ void cacheTargetsForRem(int index, XlibAtom* targets, int numTargets) targetCache[index].numTargets = numTargets; } -/* this is called on init, reconnect and SelectionClear */ +/* This is called on init, reconnect and SelectionClear. */ void invalidateTargetCache(int index) { #ifdef DEBUG @@ -896,7 +897,7 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) { if (IS_INTERNAL_OWNER(index)) { - /* send a SelectionClear event to (our) previous owner */ + /* Send a SelectionClear event to (our) previous owner. */ xEvent x = {0}; x.u.u.type = SelectionClear; x.u.selectionClear.time = GetTimeInMillis(); @@ -907,9 +908,9 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) } /* - * set the root window with the NullClient as selection owner. Our + * Set the root window with the NullClient as selection owner. Our * clients asking for the owner via XGetSelectionOwner() will get - * these for an answer + * these for an answer. */ CurrentSelections[index].window = screenInfo.screens[0]->root->drawable.id; CurrentSelections[index].client = NullClient; @@ -980,7 +981,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) return; } - /* the selection in this request is none we own. */ + /* The selection in this request is none we own. */ int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); if (index == -1) { @@ -996,7 +997,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) fprintf(stderr, "%s: lastServers[%d].requestor [0x%lx].\n", __func__, index, lastServers[index].requestor); #endif - /* lastServers[index].requestor in non-NULL (= we are currently in the transfer phase) */ + /* lastServers[index].requestor is non-NULL (= we are currently in the transfer phase) */ if (lastServers[index].requestor != None) { #ifdef DEBUG @@ -1017,7 +1018,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) if (nxagentOption(TextClipboard)) { /* - * the selection request target is TARGETS. The requestor is + * The selection request target is TARGETS. The requestor is * asking for a list of supported data formats. * * The selection does not matter here, we will return this for @@ -1048,7 +1049,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) #endif /* - * pass on the requested list by setting the property provided + * Pass on the requested list by setting the property provided * by the requestor accordingly. */ XChangeProperty(nxagentDisplay, @@ -1198,8 +1199,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) #endif /* - * reaching this means the request is a normal, valid request. We - * can process it now. + * Reaching this line means the request is a normal, valid + * request. We can process it now. */ if (!nxagentOption(TextClipboard)) @@ -1207,7 +1208,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) /* Optimization: if we have a current target cache check if the * requested target is supported by the owner. If not we can take * a shortcut and deny the request immediately without doing any - * further communication */ + * further communication. */ if (targetCache[index].type == FORREM && targetCache[index].forRem) { XlibAtom *targets = targetCache[index].forRem; @@ -1237,9 +1238,9 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) else { /* - * at this stage we know a remote client has asked for a selection - * target without having retrieved the list of supported targets - * first. + * At this stage we know a remote client has requested a + * selection target without having retrieved the list of + * supported targets first. */ #ifdef DEBUG if (X->xselectionrequest.target != serverTARGETS) @@ -1301,7 +1302,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } /* - * if one of our clients owns the selection we ask it to copy + * If one of our clients owns the selection we ask it to copy * the selection to the clientCutProperty on nxagent's root * window in the first step. We then later push that property's * content to the real X server. @@ -1309,15 +1310,15 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) if (IS_INTERNAL_OWNER(index)) { /* - * store who on the real X server requested the data and how - * and where it wants to have it + * Store who on the real X server requested the data and how + * and where it wants to have it. */ lastServers[index].property = X->xselectionrequest.property; lastServers[index].requestor = X->xselectionrequest.requestor; lastServers[index].target = X->xselectionrequest.target; lastServers[index].time = X->xselectionrequest.time; - /* prepare the request (like XConvertSelection, but internally) */ + /* Prepare the request (like XConvertSelection, but internally). */ xEvent x = {0}; x.u.u.type = SelectionRequest; x.u.selectionRequest.time = GetTimeInMillis(); @@ -1335,8 +1336,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) */ /* - * if textclipboard is requested simply use the previous clipboard - * handling code + * In TextClipboard mode simply use the previous clipboard + * handling code. */ if (nxagentOption(TextClipboard)) { @@ -1358,8 +1359,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } /* - * delete property before sending the request to the client - - * required by ICCCM + * Selete property before sending the request to the client as + * required by ICCCM. */ DeleteProperty(lastSelectionOwner[index].windowPtr, clientCutProperty); @@ -1374,8 +1375,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) x.u.selectionRequest.requestor, x.u.selectionRequest.selection, NameForIntAtom(x.u.selectionRequest.selection)); #endif - /* no reply to Xserver yet - we will do that once the answer of - the above sendEventToClient arrives */ + /* No reply to the Xserver yet - we will do that once the answer + of the above sendEventToClient arrives. */ } else { @@ -1391,11 +1392,12 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } /* - * end current selection transfer by sending a notification to the + * End the current selection transfer by sending a notification to the * client and resetting the corresponding variables and the state * machine. If success is False send a None reply, meaning "request - * denied/failed" - * Use SELECTION_SUCCESS and SELECTION_FAULT macros for success. + * denied/failed". + * Use SELECTION_SUCCESS and SELECTION_FAULT macros for the success + * value. */ static void endTransfer(int index, Bool success) { @@ -1462,7 +1464,7 @@ static void transferSelectionFromXServer(int index, int resource) * current implementation and go straight to the data. */ - /* get next free resource index */ + /* Get next free resource slot. */ int free_resource = NXGetCollectPropertyResource(nxagentDisplay); lastClients[index].resource = free_resource; @@ -1477,7 +1479,7 @@ static void transferSelectionFromXServer(int index, int resource) } else { - /* collect property and store with index "resource" */ + /* Collect the property and store ist with index "resource" d */ result = NXCollectProperty(nxagentDisplay, free_resource, serverWindow, @@ -1520,7 +1522,7 @@ static void transferSelectionFromXServer(int index, int resource) fprintf(stderr, "%s: Getting property content from remote server.\n", __func__); #endif - /* get next free resource slot */ + /* Get next free resource slot. */ resource = NXGetCollectPropertyResource(nxagentDisplay); lastClients[index].resource = resource; @@ -1536,7 +1538,7 @@ static void transferSelectionFromXServer(int index, int resource) else { /* - * now initiate kind of an asynchronuos GetProperty() + * Now initiate kind of an asynchronuos GetProperty() * call. Once the property has been retrieved we will * receive an NXCollectPropertyNotify event which will then * be handled in @@ -1566,7 +1568,7 @@ static void transferSelectionFromXServer(int index, int resource) setClientSelectionStage(index, SelectionStageWaitData); - /* we've seen situations where you had to move the mouse or press a + /* We've seen situations where you had to move the mouse or press a key to let the transfer complete. Flushing here fixed it */ NXFlushDisplay(nxagentDisplay, NXFlushLink); @@ -1588,7 +1590,7 @@ static void transferSelectionFromXServer(int index, int resource) /* Called from Events.c/nxagentHandleCollectPropertyEvent This event is generated after XChangeProperty(), XDeleteProperty() or - XGetWindowProperty(delete=True) + XGetWindowProperty(delete=True). Returncode: True: processed @@ -1612,7 +1614,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) return False; } - /* determine the selection we are talking about here */ + /* Determine the selection we are talking about here. */ for (index = 0; index < nxagentMaxSelections; index++) { /* @@ -1887,7 +1889,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) printClientSelectionStage(index); /* - * if the property is serverTransFromAgentProperty this means we are + * If the property is serverTransFromAgentProperty this means we are * transferring data FROM the agent TO the server. */ @@ -1965,7 +1967,8 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) { - /* if the last owner was an internal one, read the + /* + * If the last owner was an internal one, read the * clientCutProperty and push the contents to the * lastServers[index].requestor on the real X server. */ @@ -1979,7 +1982,7 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) unsigned long ulReturnBytesLeft; unsigned char *pszReturnData = NULL; - /* first get size values ... */ + /* First get size values ... */ int result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, 0, False, AnyPropertyType, &atomReturnType, &resultFormat, &ulReturnItems, &ulReturnBytesLeft, &pszReturnData); @@ -1996,7 +1999,7 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) } else { - /* ... then use the size values for the actual request */ + /* ... then use the size values for the actual request data. */ result = GetWindowProperty(lastSelectionOwner[index].windowPtr, clientCutProperty, 0, ulReturnBytesLeft, False, AnyPropertyType, &atomReturnType, &resultFormat, &ulReturnItems, &ulReturnBytesLeft, @@ -2027,12 +2030,12 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) #ifdef WARNING fprintf(stderr, "%s: WARNING! Could not alloc memory for clipboard targets transmission.\n", __func__); #endif - /* this will effectively lead to the request being answered as failed */ + /* This will effectively lead to the request being answered as failed. */ lastServers[index].property = None; } else { - /* Convert the targets to remote atoms */ + /* Convert the targets to remote atoms. */ XlibAtom *addr = targets; unsigned int numTargets = ulReturnItems; @@ -2063,10 +2066,10 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) } else { - /* Fill the property on the requestor with the requested data */ + /* Fill the property on the requestor with the requested data. */ /* The XChangeProperty source code reveals it will always return 1, no matter what, so no need to check the result */ - /* FIXME: better use the format returned by above request */ + /* FIXME: better use the format returned by above request. */ XChangeProperty(nxagentDisplay, lastServers[index].requestor, lastServers[index].property, @@ -2105,7 +2108,7 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) } /* - * inform the initial requestor that the requested data has + * Inform the initial requestor that the requested data has * arrived in the desired property. If we have been unable to * get the data from the owner XChangeProperty will not have * been called and lastServers[index].property will be None which @@ -2165,7 +2168,7 @@ static void resetSelectionOwnerOnXServer(void) if (lastServers[index].requestor != None) { /* - * we are in the process of communicating back and forth between + * We are in the process of communicating back and forth between * real X server and nxagent's clients - let's not disturb. */ #if defined(TEST) || defined(DEBUG) @@ -2189,7 +2192,7 @@ static void resetSelectionOwnerOnXServer(void) setClientSelectionStage(index, SelectionStageNone); - /* Hmm, this is already None when reaching here */ + /* Hmm, this is already None when reaching here. */ lastServers[index].requestor = None; } } @@ -2251,7 +2254,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, } /* - * always invalidate the target cache for the relevant selection, + * Always invalidate the target cache for the relevant selection, * even if the trap is set. This ensures not having invalid data in * the cache. */ @@ -2302,7 +2305,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, /* * This is called from the nxagentSetSelectionCallback, so it is using - * internal Atoms + * internal Atoms. */ static void setSelectionOwnerOnXServer(Selection *pSelection) { @@ -2348,12 +2351,12 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) replyPendingRequestSelectionToXServer(index, False); - /* now we can go on */ + /* Now we can go on. */ } #endif /* - * inform the real X server that our serverWindow is the + * Inform the real X server that our serverWindow is the * clipboard owner. * https://www.freedesktop.org/wiki/ClipboardManager/ states * "In order to support peers who use the XFIXES extension to @@ -2374,9 +2377,9 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) setClientSelectionStage(index, SelectionStageNone); /* - * this will be repeated on reception of the SelectionOwner callback - * but we cannot be sure if there are any intermediate requests in the queue - * already so better do it here, too + * This will be repeated on reception of the SelectionOwner + * callback but we cannot be sure if there are any intermediate + * requests in the queue already so better do it here, too. */ invalidateTargetCache(index); @@ -2472,10 +2475,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, } /* - * if lastClients[index].windowPtr is set we are waiting for an answer from - * the real X server. If that answer takes more than 5 seconds we - * consider the conversion failed and tell our client about that. - * The new request that lead us here is then processed. + * If lastClients[index].windowPtr is set we are waiting for an + * answer from the real X server. If that answer takes more than 5 + * seconds we consider the conversion failed and tell our client + * about that. The new request that lead us here is then processed. */ #ifdef TEST fprintf(stderr, "%s: lastClients[%d].windowPtr [0x%lx].\n", __func__, index, (unsigned long)lastClients[index].windowPtr); @@ -2498,15 +2501,15 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, "notifying failure to waiting client\n", __func__); #endif - /* notify the waiting client of failure */ + /* Notify the waiting client of the failure. */ endTransfer(index, SELECTION_FAULT); - /* do NOT return here but process the new request instead! */ + /* Do NOT return here but process the new request instead! */ } else { /* - * we got another convert request while already waiting for an + * We got another convert request while already waiting for an * answer from the real X server to a previous convert request * for this selection, which we cannot handle (yet). So return * an error for the new request. @@ -2517,7 +2520,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, __func__, nxagentClientInfoString(client)); #endif - /* notify the sender of the new request of failure */ + /* Notify the sender of the new request of the failure. */ sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); return 1; @@ -2614,7 +2617,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, } /* - * do nothing - TARGETS will be handled like any other target + * Do nothing - TARGETS will be handled like any other target * and passed on to the owner on the remote side. */ } @@ -2633,6 +2636,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, else if (target == clientTIMESTAMP) { /* + * From ICCCM: * "If the specified property is not None, the owner should place * the data resulting from converting the selection into the * specified property on the requestor window and should set the @@ -2699,7 +2703,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, return 1; } - /* in TextClipboard mode reject all non-text targets */ + /* In TextClipboard mode we reject all non-text targets. */ if (nxagentOption(TextClipboard)) { if (!isTextTarget(translateLocalToRemoteTarget(target))) @@ -2712,7 +2716,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, sendSelectionNotifyEventToClient(client, time, requestor, selection, target, None); return 1; } - /* go on, target is acceptable */ + /* Go on, target is acceptable! */ } #ifdef DEBUG @@ -2722,10 +2726,12 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, if (!nxagentOption(TextClipboard)) { - /* Optimization: if we have a current target cache check if the + /* + * Optimization: if we have a current target cache check if the * requested target is supported by the owner. If not we can take * a shortcut and deny the request immediately without doing any - * further communication */ + * further communication + */ if (targetCache[index].type == FORINT && targetCache[index].forInt) { Atom *targets = targetCache[index].forInt; @@ -2755,7 +2761,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, else { /* - * at this stage we know a client has asked for a selection + * At this stage we know a client has asked for a selection * target without having retrieved the list of supported targets * first. */ @@ -2795,8 +2801,8 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, else { /* - * reset clientAccum as now another client requested the clipboard - * content + * Reset clientAccum as now another client requested the clipboard + * content. */ clientAccum = 0; } @@ -2804,8 +2810,9 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, setClientSelectionStage(index, SelectionStageNone); /* - * store the original requestor, we need that later after - * serverTransToAgentProperty contains the desired selection content + * Store the original requestor, we need that later after + * serverTransToAgentProperty has been filled with the desired + * selection content. */ lastClients[index].requestor = requestor; lastClients[index].windowPtr = pWin; @@ -2813,7 +2820,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, lastClients[index].time = time; lastClients[index].property = property; lastClients[index].target = target; - /* if the last client request time is more than 5s ago update it. Why? */ + /* If the last client request time is more than 5s ago update it. Why? */ if ((GetTimeInMillis() - lastClients[index].reqTime) >= CONVERSION_TIMEOUT) lastClients[index].reqTime = GetTimeInMillis(); @@ -2869,8 +2876,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, return 1; } -/* FIXME: do we still need this special treatment? Can't we just - call nxagentLocalToRemoteAtom() everywhere? */ +/* + * FIXME: do we still need this special treatment? Can't we just + * call nxagentLocalToRemoteAtom() everywhere? + */ XlibAtom translateLocalToRemoteSelection(Atom local) { /* @@ -3017,7 +3026,7 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) * communication happens completely between our own clients (some of * which can be nxagents themselves). In that case we return 0 (tell * dix to go on) and do nothing! - * Be sure to not let this trigger for the failure answer (property 0) + * Be sure to not let this trigger for the failure answer (property 0). */ if (!(event->u.selectionNotify.property == clientCutProperty || event->u.selectionNotify.property == 0) || lastServers[index].requestor == None) { @@ -3029,7 +3038,7 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) else { /* - * if the property is 0 (reporting failure) we can directly + * If the property is 0 (reporting failure) we can directly * answer to the lastServer about the failure! */ if (lastServers[index].requestor != None && event->u.selectionNotify.property == 0) @@ -3072,7 +3081,7 @@ int nxagentSendNotificationToSelfViaXServer(xEvent *event) /* * This is called from NXproperty.c to determine if a client sets the * property we are waiting for. - * FIXME: in addition we should check if the client is the one we expect + * FIXME: in addition we should check if the client is the one we expect. */ WindowPtr nxagentGetClipboardWindow(Atom property) { @@ -3101,7 +3110,7 @@ WindowPtr nxagentGetClipboardWindow(Atom property) } /* - * Initialize the clipboard + * Initialize the clipboard. * Returns: True for success else False */ Bool nxagentInitClipboard(WindowPtr pWin) @@ -3122,8 +3131,8 @@ Bool nxagentInitClipboard(WindowPtr pWin) if (!nxagentReconnectTrap) { - /* cannot move that down to others - we need it for - * initSelectionOwnerData ! */ + /* Cannot move that down to others - we need it for + * initSelectionOwnerData! */ /* FIXME: it is probably better to re-use the strings from Atoms.c here */ clientTARGETS = MakeAtom(szAgentTARGETS, strlen(szAgentTARGETS), True); #ifdef SUPPORT_TEXT_TARGET @@ -3191,8 +3200,8 @@ Bool nxagentInitClipboard(WindowPtr pWin) } /* - * the clipboard selection atom might have changed on a new X - * server. Primary is constant. + * The clipboard selection atom can change with a new X + * server while Primary is constant. */ remSelAtoms[nxagentPrimarySelection] = XA_PRIMARY; remSelAtoms[nxagentClipboardSelection] = nxagentAtoms[10]; /* CLIPBOARD */ @@ -3216,7 +3225,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) /* * Server side properties to hold pasted data. - * see nxagentSendNotificationToSelfViaXServer for an explanation + * See nxagentSendNotificationToSelfViaXServer for an explanation */ serverTransFromAgentProperty = nxagentAtoms[15]; /* NX_SELTRANS_FROM_AGENT */ serverTransToAgentProperty = nxagentAtoms[5]; /* NX_CUT_BUFFER_SERVER */ @@ -3230,7 +3239,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) return False; } - /* this is probably to communicate with nomachine nxclient */ + /* This is probably to communicate with nomachine nxclient. */ #ifdef TEST fprintf(stderr, "%s: Setting owner of selection [%d][%s] to serverWindow [0x%lx]\n", __func__, (int) serverTransToAgentProperty, "NX_CUT_BUFFER_SERVER", serverWindow); @@ -3275,14 +3284,13 @@ Bool nxagentInitClipboard(WindowPtr pWin) if (nxagentSessionId[0]) { - // nxagentAtoms[10] is the CLIPBOARD atom #ifdef TEST fprintf(stderr, "%s: setting the ownership of %s to %lx" " and registering for PropertyChangeMask events\n", __func__, validateString(NameForRemAtom(nxagentAtoms[10])), serverWindow); #endif - XSetSelectionOwner(nxagentDisplay, nxagentAtoms[10], serverWindow, CurrentTime); + XSetSelectionOwner(nxagentDisplay, nxagentAtoms[10], serverWindow, CurrentTime); // nxagentAtoms[10] is the CLIPBOARD atom pWin -> eventMask |= PropertyChangeMask; nxagentChangeWindowAttributes(pWin, CWEventMask); } @@ -3297,7 +3305,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) for (int index = 0; index < nxagentMaxSelections; index++) { /* - * if we have a selection inform the (new) real Xserver and + * If we have a selection inform the (new) real Xserver and * claim the ownership. Note that we report our serverWindow as * owner, not the real window! */ @@ -3309,7 +3317,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) /* * On reconnect there cannot be any external requestor - * waiting for a reply so clean this + * waiting for a reply so clean this. */ lastServers[index].requestor = None; -- 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 3.6.x in repository nx-libs. commit f03c589ab01dfb43a01e0111877a6a6f6be5ab16 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jun 11 00:19:09 2021 +0200 Clipboard.c: remove superfluous brackets --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 166 ++++++++++++------------- 1 file changed, 82 insertions(+), 84 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 503f42add..0f94fac46 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1257,106 +1257,104 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) */ serverLastRequestedSelection = X->xselectionrequest.selection; + if (!(nxagentOption(Clipboard) == ClipboardServer || + nxagentOption(Clipboard) == ClipboardBoth)) { - if (!(nxagentOption(Clipboard) == ClipboardServer || - nxagentOption(Clipboard) == ClipboardBoth)) - { - #ifdef DEBUG - fprintf (stderr, "%s: clipboard (partly) disabled - denying request.\n", __func__); - #endif + #ifdef DEBUG + fprintf (stderr, "%s: clipboard (partly) disabled - denying request.\n", __func__); + #endif - /* deny the request */ - replyRequestSelectionToXServer(X, False); - return; - } + /* deny the request */ + replyRequestSelectionToXServer(X, False); + return; + } + /* + * If one of our clients owns the selection we ask it to copy + * the selection to the clientCutProperty on nxagent's root + * window in the first step. We then later push that property's + * content to the real X server. + */ + if (IS_LOCAL_OWNER(index)) + { /* - * If one of our clients owns the selection we ask it to copy - * the selection to the clientCutProperty on nxagent's root - * window in the first step. We then later push that property's - * content to the real X server. + * Store who on the real X server requested the data and how + * and where it wants to have it. */ - if (IS_LOCAL_OWNER(index)) - { - /* - * Store who on the real X server requested the data and how - * and where it wants to have it. - */ - lastServers[index].property = X->xselectionrequest.property; - lastServers[index].requestor = X->xselectionrequest.requestor; - lastServers[index].target = X->xselectionrequest.target; - lastServers[index].time = X->xselectionrequest.time; - - /* Prepare the request (like XConvertSelection, but locally). */ - xEvent x = {0}; - x.u.u.type = SelectionRequest; - x.u.selectionRequest.time = GetTimeInMillis(); - x.u.selectionRequest.owner = lastSelectionOwner[index].window; - x.u.selectionRequest.selection = CurrentSelections[index].selection; - x.u.selectionRequest.property = clientCutProperty; - x.u.selectionRequest.requestor = screenInfo.screens[0]->root->drawable.id; /* Fictitious window.*/ + lastServers[index].property = X->xselectionrequest.property; + lastServers[index].requestor = X->xselectionrequest.requestor; + lastServers[index].target = X->xselectionrequest.target; + lastServers[index].time = X->xselectionrequest.time; + + /* Prepare the request (like XConvertSelection, but locally). */ + xEvent x = {0}; + x.u.u.type = SelectionRequest; + x.u.selectionRequest.time = GetTimeInMillis(); + x.u.selectionRequest.owner = lastSelectionOwner[index].window; + x.u.selectionRequest.selection = CurrentSelections[index].selection; + x.u.selectionRequest.property = clientCutProperty; + x.u.selectionRequest.requestor = screenInfo.screens[0]->root->drawable.id; /* Fictitious window.*/ - /* - * Don't send the same window, some programs are clever and - * verify cut and paste operations inside the same window and - * don't notify at all. - * - * x.u.selectionRequest.requestor = lastSelectionOwner[index].window; - */ + /* + * Don't send the same window, some programs are clever and + * verify cut and paste operations inside the same window and + * don't notify at all. + * + * x.u.selectionRequest.requestor = lastSelectionOwner[index].window; + */ - /* - * In TextClipboard mode simply use the previous clipboard - * handling code. - */ - if (nxagentOption(TextClipboard)) + /* + * In TextClipboard mode simply use the previous clipboard + * handling code. + */ + if (nxagentOption(TextClipboard)) + { + /* by dimbor */ + if (X->xselectionrequest.target != XA_STRING) { - /* by dimbor */ - if (X->xselectionrequest.target != XA_STRING) - { - lastServers[index].target = serverUTF8_STRING; - /* by dimbor (idea from zahvatov) */ - x.u.selectionRequest.target = clientUTF8_STRING; - } - else - { - x.u.selectionRequest.target = XA_STRING; - } + lastServers[index].target = serverUTF8_STRING; + /* by dimbor (idea from zahvatov) */ + x.u.selectionRequest.target = clientUTF8_STRING; } else { - x.u.selectionRequest.target = nxagentRemoteToLocalAtom(X->xselectionrequest.target); + x.u.selectionRequest.target = XA_STRING; } - - /* - * Selete property before sending the request to the client as - * required by ICCCM. - */ - DeleteProperty(lastSelectionOwner[index].windowPtr, clientCutProperty); - - sendEventToClient(lastSelectionOwner[index].client, &x); - - #ifdef DEBUG - fprintf(stderr, "%s: sent SelectionRequest event to client %s property [%d][%s] " \ - "target [%d][%s] requestor [0x%x] selection [%d][%s].\n", __func__, - nxagentClientInfoString(lastSelectionOwner[index].client), - x.u.selectionRequest.property, NameForLocalAtom(x.u.selectionRequest.property), - x.u.selectionRequest.target, NameForLocalAtom(x.u.selectionRequest.target), - x.u.selectionRequest.requestor, - x.u.selectionRequest.selection, NameForLocalAtom(x.u.selectionRequest.selection)); - #endif - /* No reply to the Xserver yet - we will do that once the answer - of the above sendEventToClient arrives. */ } else { - #ifdef DEBUG - fprintf(stderr, "%s: no local owner for selection [%ld][%s] - denying request.\n", __func__, - X->xselectionrequest.selection, NameForRemoteAtom(X->xselectionrequest.selection)); - #endif - - /* deny the request */ - replyRequestSelectionToXServer(X, False); + x.u.selectionRequest.target = nxagentRemoteToLocalAtom(X->xselectionrequest.target); } + + /* + * Selete property before sending the request to the client as + * required by ICCCM. + */ + DeleteProperty(lastSelectionOwner[index].windowPtr, clientCutProperty); + + sendEventToClient(lastSelectionOwner[index].client, &x); + + #ifdef DEBUG + fprintf(stderr, "%s: sent SelectionRequest event to client %s property [%d][%s] " \ + "target [%d][%s] requestor [0x%x] selection [%d][%s].\n", __func__, + nxagentClientInfoString(lastSelectionOwner[index].client), + x.u.selectionRequest.property, NameForLocalAtom(x.u.selectionRequest.property), + x.u.selectionRequest.target, NameForLocalAtom(x.u.selectionRequest.target), + x.u.selectionRequest.requestor, + x.u.selectionRequest.selection, NameForLocalAtom(x.u.selectionRequest.selection)); + #endif + /* No reply to the Xserver yet - we will do that once the answer + of the above sendEventToClient arrives. */ + } + else + { + #ifdef DEBUG + fprintf(stderr, "%s: no local owner for selection [%ld][%s] - denying request.\n", __func__, + X->xselectionrequest.selection, NameForRemoteAtom(X->xselectionrequest.selection)); + #endif + + /* deny the request */ + replyRequestSelectionToXServer(X, 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 3.6.x in repository nx-libs. commit 535104db2709504bf54766cefe172bc2e306f325 Author: Ulrich Sibiller <uli42@gmx.de> Date: Thu Jun 10 20:55:14 2021 +0200 Clipboard.c: use NXAGENT_ONSTART macro on one more location --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 49c10a947..68ad68345 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -3239,6 +3239,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) return False; } +#ifdef NXAGENT_ONSTART /* This is probably to communicate with nomachine nxclient. */ #ifdef TEST fprintf(stderr, "%s: Setting owner of selection [%d][%s] to serverWindow [0x%lx]\n", __func__, @@ -3246,6 +3247,7 @@ Bool nxagentInitClipboard(WindowPtr pWin) #endif XSetSelectionOwner(nxagentDisplay, serverTransToAgentProperty, serverWindow, CurrentTime); +#endif if (XQueryExtension(nxagentDisplay, "XFIXES", -- 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 3.6.x in repository nx-libs. commit bee3d3205655b5e624c1fd25816f078d0850c74c Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Mar 17 22:44:35 2021 +0100 NXEvents.c: improve debugging --- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index 50ecef09b..0249fc0a8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -433,6 +433,9 @@ ProcSendEvent(ClientPtr client) if (stuff -> event.u.u.type == SelectionNotify) { + #ifdef DEBUG + fprintf(stderr, "%s: sending SelectionNotify to ourselves"\n, __func__); + #endif if (nxagentSendNotificationToSelfViaXServer(&stuff->event) == 1) 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 3.6.x in repository nx-libs. commit 15a60b1c129707e0b8280de0ef0a2234fd50010d Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 16 19:16:21 2021 +0200 Clipboard.c: fix typos in comment --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index ba26f0915..bb4907393 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1448,7 +1448,7 @@ static void transferSelectionFromXServer(int index, int resource) } else { - /* Collect the property and store ist with index "resource" d */ + /* Collect the property and store it with index "resource" */ result = NXCollectProperty(nxagentDisplay, free_resource, serverWindow, -- 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 3.6.x in repository nx-libs. commit e65e715129ddbefaf2ebb4b14a803b312632705e Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jun 14 23:59:05 2021 +0200 Clipboard.c: Fix: forward the correct type and format now stuff like xclip -o -t LENGTH works (if the owner offers that) --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index bb1656d7f..ba26f0915 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1774,7 +1774,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) { ChangeWindowProperty(lastClients[index].windowPtr, lastClients[index].property, - lastClients[index].target, + nxagentRemoteToLocalAtom(atomReturnType), resultFormat, PropModeReplace, ulReturnItems, pszReturnData, 1); @@ -2043,12 +2043,11 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) /* Fill the property on the requestor with the requested data. */ /* The XChangeProperty source code reveals it will always return 1, no matter what, so no need to check the result */ - /* FIXME: better use the format returned by above request. */ XChangeProperty(nxagentDisplay, lastServers[index].requestor, lastServers[index].property, - lastServers[index].target, - 8, + nxagentLocalToRemoteAtom(atomReturnType), + resultFormat, PropModeReplace, pszReturnData, ulReturnItems); -- 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 3.6.x in repository nx-libs. commit ad69d4a0ec5bd1a26942a938d0d902d643b70b4e Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jun 14 23:01:28 2021 +0200 Clipboard.c: improve output for PRINT_CLIPBOARD_CONTENT_ON_DEBUG --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 29 +++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index a891af52d..bb1656d7f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1779,17 +1779,22 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) ulReturnItems, pszReturnData, 1); #ifdef DEBUG - fprintf(stderr, "%s: Selection property [%d][%s] changed to" + fprintf(stderr, "%s: Selection property [%d][%s] changed to resultFormat [%d] returnType [%d][%s] len [%d]" #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG - "[\"%*.*s\"...]" + /* FIXME: only print the string if the resultFormat is 8 */ + " value [\"%*.*s\"...] hex [0x%2.2x%2.2x%2.2x%2.2x]" #endif "\n", __func__, lastClients[index].property, - validateString(NameForLocalAtom(lastClients[index].property)) + validateString(NameForLocalAtom(lastClients[index].property)), + resultFormat, + atomReturnType, NameForRemoteAtom(atomReturnType), + (int)ulReturnItems * resultFormat / 8 #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG ,(int)(min(20, ulReturnItems * resultFormat / 8)), (int)(min(20, ulReturnItems * resultFormat / 8)), - pszReturnData + pszReturnData, + pszReturnData[0], pszReturnData[1], pszReturnData[2], pszReturnData[3] #endif ); #endif @@ -2049,22 +2054,26 @@ void handlePropertyTransferFromAgentToXserver(int index, XlibAtom property) ulReturnItems); #ifdef DEBUG { - fprintf(stderr, "%s: XChangeProperty sent to window [0x%lx] for property [%ld][%s] len [%d]" + fprintf(stderr, "%s: XChangeProperty sent to window [0x%lx] for property [%ld][%s] resultFormat [%d] returnType [%ld][%s] len [%d]" #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG - "value [\"%*.*s\"...]" + /* FIXME: only print the string if the resultFormat is 8 */ + " value [\"%*.*s\"...] hex [0x%2.2x%2.2x%2.2x%2.2x]" #endif - "\n", + "\n", __func__, lastServers[index].requestor, lastServers[index].property, NameForRemoteAtom(lastServers[index].property), - (int)ulReturnItems * 8 / 8 + resultFormat, + nxagentLocalToRemoteAtom(atomReturnType), NameForLocalAtom(atomReturnType), + (int)ulReturnItems * resultFormat / 8 #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG ,(int)(min(20, ulReturnItems * 8 / 8)), (int)(min(20, ulReturnItems * 8 / 8)), - pszReturnData + pszReturnData, + pszReturnData[0], pszReturnData[1], pszReturnData[2], pszReturnData[3] #endif - ); + ); } #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 3.6.x in repository nx-libs. commit 4eba9d6b1c2b6fb6229aebe6406de3b4564e869c Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jun 14 22:05:29 2021 +0200 Clipboard.c: extend comment --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index a5d74415e..a891af52d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2825,7 +2825,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, * FIXME: ICCCM states: "Clients should not use CurrentTime for the * time argument of a ConvertSelection request. Instead, they should * use the timestamp of the event that caused the request to be - * made." + * made." Well, the event that that caused this came from an + * nxagent _client_ but we are a client to the real X server, which + * has an own time., we cannot use its time there. So what time + * would be correct here? */ UpdateCurrentTime(); -- 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 3.6.x in repository nx-libs. commit 62775ed673e4c3008b48dad2a4659271d5e02b02 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 16 20:44:16 2021 +0200 Clipboard.c: rename intermediate variable Using a capital letter here better reflects that this is an event from the real X server. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 00a2dd1fd..326f62ca7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1835,27 +1835,27 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) return; } - XSelectionEvent * e = (XSelectionEvent *)X; + XSelectionEvent *E = (XSelectionEvent *)X; #ifdef DEBUG fprintf(stderr, "---------\n%s: Received SelectionNotify event from real X server, property " \ "[%ld][%s] requestor [0x%lx] selection [%s] target [%ld][%s] time [%lu] send_event [%d].\n", - __func__, e->property, NameForRemoteAtom(e->property), e->requestor, - NameForRemoteAtom(e->selection), e->target, - NameForRemoteAtom(e->target), e->time, e->send_event); + __func__, E->property, NameForRemoteAtom(E->property), E->requestor, + NameForRemoteAtom(E->selection), E->target, + NameForRemoteAtom(E->target), E->time, E->send_event); /* this has not been SENT by nxagent but is the answer to a request of nxagent */ - if (e->requestor == serverWindow) + if (E->requestor == serverWindow) { fprintf(stderr, "%s: requestor is nxagent's serverWindow!\n", __func__);; } #endif /* determine the selection we are talking about here */ - int index = nxagentFindLastSelectionOwnerIndex(e->selection); + int index = nxagentFindLastSelectionOwnerIndex(E->selection); if (index == -1) { #ifdef DEBUG - fprintf (stderr, "%s: unknown selection [%ld] .\n", __func__, e->selection); + fprintf (stderr, "%s: unknown selection [%ld] .\n", __func__, E->selection); #endif return; } -- 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 3.6.x in repository nx-libs. commit d42ebd2aeca80efa926fedd49d2aef75bd4e28ea Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 16 20:20:41 2021 +0200 Clipboard.c: fix format specifier --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index bb4907393..00a2dd1fd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1779,7 +1779,7 @@ Bool nxagentCollectPropertyEventFromXServer(int resource) ulReturnItems, pszReturnData, 1); #ifdef DEBUG - fprintf(stderr, "%s: Selection property [%d][%s] changed to resultFormat [%d] returnType [%d][%s] len [%d]" + fprintf(stderr, "%s: Selection property [%d][%s] changed to resultFormat [%d] returnType [%ld][%s] len [%d]" #ifdef PRINT_CLIPBOARD_CONTENT_ON_DEBUG /* FIXME: only print the string if the resultFormat is 8 */ " value [\"%*.*s\"...] hex [0x%2.2x%2.2x%2.2x%2.2x]" -- 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 3.6.x in repository nx-libs. commit e8217798d513dc86008195546ed4a06f6e54a95f Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jun 14 22:02:55 2021 +0200 Clipboard.c: add helper variable --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 38 ++++++++++++++------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 0f94fac46..a5d74415e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -958,12 +958,14 @@ static void replyRequestSelectionToXServer(XEvent *X, Bool success) */ void nxagentHandleSelectionRequestFromXServer(XEvent *X) { + XlibAtom target = X->xselectionrequest.target; + #ifdef DEBUG fprintf(stderr, "---------\n%s: Received SelectionRequestEvent from real server: selection [%ld][%s] " \ "target [%ld][%s] requestor [display[%s]/0x%lx] destination [%ld][%s] time [%lu]\n", __func__, X->xselectionrequest.selection, NameForRemoteAtom(X->xselectionrequest.selection), - X->xselectionrequest.target, NameForRemoteAtom(X->xselectionrequest.target), + target, NameForRemoteAtom(target), DisplayString(nxagentDisplay), X->xselectionrequest.requestor, X->xselectionrequest.property, NameForRemoteAtom(X->xselectionrequest.property), X->xselectionrequest.time); @@ -1008,7 +1010,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) return; } - if (X->xselectionrequest.target == serverTARGETS) + if (target == serverTARGETS) { /* * In TextClipboard mode answer with a predefined list of @@ -1101,7 +1103,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } } } - else if (X->xselectionrequest.target == serverTIMESTAMP) + else if (target == serverTIMESTAMP) { /* * Section 2.6.2 of the ICCCM states: @@ -1128,7 +1130,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) replyRequestSelectionToXServer(X, True); return; } - else if (X->xselectionrequest.target == serverMULTIPLE) + else if (target == serverMULTIPLE) { #ifdef DEBUG fprintf(stderr, "%s: (currently) unsupported target [MULTIPLE] - denying request.\n", __func__); @@ -1136,7 +1138,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) replyRequestSelectionToXServer(X, False); return; } - else if (X->xselectionrequest.target == serverDELETE) + else if (target == serverDELETE) { #ifdef DEBUG fprintf(stderr, "%s: (currently) unsupported target [DELETE] - denying request.\n", __func__); @@ -1144,7 +1146,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) replyRequestSelectionToXServer(X, False); return; } - else if (X->xselectionrequest.target == serverINSERT_SELECTION) + else if (target == serverINSERT_SELECTION) { #ifdef DEBUG fprintf(stderr, "%s: (currently) unsupported target [INSERT_SELECTION] - denying request.\n", __func__); @@ -1152,7 +1154,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) replyRequestSelectionToXServer(X, False); return; } - else if (X->xselectionrequest.target == serverINSERT_PROPERTY) + else if (target == serverINSERT_PROPERTY) { #ifdef DEBUG fprintf(stderr, "%s: (currently) unsupported target [INSERT_PROPERTY] - denying request.\n", __func__); @@ -1160,7 +1162,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) replyRequestSelectionToXServer(X, False); return; } - else if (X->xselectionrequest.target == serverSAVE_TARGETS) + else if (target == serverSAVE_TARGETS) { #ifdef DEBUG fprintf(stderr, "%s: (currently) unsupported target [SAVE_TARGETS] - denying request.\n", __func__); @@ -1168,7 +1170,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) replyRequestSelectionToXServer(X, False); return; } - else if (X->xselectionrequest.target == serverTARGET_SIZES) + else if (target == serverTARGET_SIZES) { #ifdef DEBUG fprintf(stderr, "%s: (currently) unsupported target [TARGET_SIZES] - denying request.\n", __func__); @@ -1179,11 +1181,11 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) if (nxagentOption(TextClipboard)) { - if (!isTextTarget(X->xselectionrequest.target)) + if (!isTextTarget(target)) { #ifdef DEBUG fprintf(stderr, "%s: denying request for non-text target [%ld][%s].\n", __func__, - X->xselectionrequest.target, NameForRemoteAtom(X->xselectionrequest.target)); + target, NameForRemoteAtom(target)); #endif replyRequestSelectionToXServer(X, False); @@ -1194,8 +1196,8 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } #ifdef DEBUG - fprintf(stderr, "%s: target [%ld][%s].\n", __func__, X->xselectionrequest.target, - NameForRemoteAtom(X->xselectionrequest.target)); + fprintf(stderr, "%s: target [%ld][%s].\n", __func__, target, + NameForRemoteAtom(target)); #endif /* @@ -1219,7 +1221,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) Bool match = False; for (int i = 0; i < targetCache[index].numTargets; i++) { - if (targets[i] == X->xselectionrequest.target) + if (targets[i] == target) { match = True; break; @@ -1243,7 +1245,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) * supported targets first. */ #ifdef DEBUG - if (X->xselectionrequest.target != serverTARGETS) + if (target != serverTARGETS) { fprintf(stderr, "%s: WARNING: remote client has not retrieved TARGETS before asking for selection!\n", __func__); @@ -1283,7 +1285,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) */ lastServers[index].property = X->xselectionrequest.property; lastServers[index].requestor = X->xselectionrequest.requestor; - lastServers[index].target = X->xselectionrequest.target; + lastServers[index].target = target; lastServers[index].time = X->xselectionrequest.time; /* Prepare the request (like XConvertSelection, but locally). */ @@ -1310,7 +1312,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) if (nxagentOption(TextClipboard)) { /* by dimbor */ - if (X->xselectionrequest.target != XA_STRING) + if (target != XA_STRING) { lastServers[index].target = serverUTF8_STRING; /* by dimbor (idea from zahvatov) */ @@ -1323,7 +1325,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } else { - x.u.selectionRequest.target = nxagentRemoteToLocalAtom(X->xselectionrequest.target); + x.u.selectionRequest.target = nxagentRemoteToLocalAtom(target); } /* -- 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 3.6.x in repository nx-libs. commit 1c8869b92f4e46b608636c2f6839b317cd7ef150 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 16 23:43:33 2021 +0200 Clipboard.c: remove obsolete (disabled) code Either replyPendingRequest a few lines before will set this to None or it will already be None. Also drop the wrong comment line... --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index b29ed3ec7..4e95c024d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2362,9 +2362,6 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) */ invalidateTargetCache(index); - /* FIXME: commented because index is invalid here! */ - /* lastServers[index].requestor = None; */ - /* FIXME -- 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 3.6.x in repository nx-libs. commit 5e017044f69ffb821be678964764a4bfb19afe8b Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jun 18 00:06:57 2021 +0200 Clipboard.c: do not process requests if we do not have a local owner This can happen after having processed a SelectionClear event while the real X server still knows the nxagent serverWindow as the selection owner. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index c200ad64c..018827a0a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -995,6 +995,15 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) return; } + if (!IS_LOCAL_OWNER(index)) + { + #ifdef DEBUG + fprintf(stderr, "%s: no local owner for selection [%ld] - denying request.\n", __func__, X->xselectionrequest.selection); + #endif + replyRequestSelectionToXServer(X, False); + return; + } + #ifdef DEBUG fprintf(stderr, "%s: lastServers[%d].requestor [0x%lx].\n", __func__, index, lastServers[index].requestor); #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 3.6.x in repository nx-libs. commit 2b156c39769609022476e9707d286e46844b6787 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 16 20:50:04 2021 +0200 Events.c: fix unused variable --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index d29ed9bcd..906915ad0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -4553,7 +4553,10 @@ void ForwardClientMessage(ClientPtr client, xSendEventReq *stuff) XlibWindow dest; dest = DefaultRootWindow(nxagentDisplay); - Status stat = XSendEvent(nxagentDisplay, dest, stuff->propagate, stuff->eventMask, &X); + #ifdef DEBUG + Status stat = + #endif + XSendEvent(nxagentDisplay, dest, stuff->propagate, stuff->eventMask, &X); XFlush(nxagentDisplay); #ifdef DEBUG fprintf(stderr, "%s: send to window [0x%lx]\n", __func__, dest); -- 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 3.6.x in repository nx-libs. commit 9b4602847ec98f695d044bef59704b5344c8869b Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 16 22:09:02 2021 +0200 Clipboard.c: add missing target cache invalidation to some (currently unused) code --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index c38c4b584..b29ed3ec7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2169,6 +2169,8 @@ static void resetSelectionOwnerOnXServer(void) setClientSelectionStage(index, SelectionStageNone); + invalidateTargetCache(index); + /* Hmm, this is already None when reaching here. */ lastServers[index].requestor = None; } -- 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 3.6.x in repository nx-libs. commit c775bedbcb6ead00548783b362de165b3f6968a2 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 16 20:47:55 2021 +0200 Clipboard.c: rename nxagentFindLastSelectionOwnerIndex() Did not refer to LastSelectionOwner at all... --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 326f62ca7..c38c4b584 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -754,7 +754,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) * sel. sel is an atom on the real X server. If the index cannot be * determined it will return -1. */ -int nxagentFindLastSelectionOwnerIndex(XlibAtom sel) +int nxagentFindRemoteSelectionIndex(XlibAtom sel) { for (int index = 0; index < nxagentMaxSelections; index++) { @@ -892,7 +892,7 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) return; } - int index = nxagentFindLastSelectionOwnerIndex(X->xselectionclear.selection); + int index = nxagentFindRemoteSelectionIndex(X->xselectionclear.selection); if (index != -1) { if (IS_LOCAL_OWNER(index)) @@ -984,7 +984,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } /* The selection in this request is none we own. */ - int index = nxagentFindLastSelectionOwnerIndex(X->xselectionrequest.selection); + int index = nxagentFindRemoteSelectionIndex(X->xselectionrequest.selection); if (index == -1) { #ifdef DEBUG @@ -1851,7 +1851,7 @@ void nxagentHandleSelectionNotifyFromXServer(XEvent *X) #endif /* determine the selection we are talking about here */ - int index = nxagentFindLastSelectionOwnerIndex(E->selection); + int index = nxagentFindRemoteSelectionIndex(E->selection); if (index == -1) { #ifdef DEBUG @@ -3070,7 +3070,7 @@ WindowPtr nxagentGetClipboardWindow(Atom property) return NULL; } - int index = nxagentFindLastSelectionOwnerIndex(serverLastRequestedSelection); + int index = nxagentFindRemoteSelectionIndex(serverLastRequestedSelection); if (index != -1 && property == clientCutProperty && lastSelectionOwner[index].windowPtr != NULL) -- 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 3.6.x in repository nx-libs. commit 423caaf0ff8826449734a04dc9038b552e6c15e5 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 16 23:48:32 2021 +0200 Clipboard.c: extend setSelectionOwnerOnXServer() to let it handle a SelectionClear automatically. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 4e95c024d..c200ad64c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2296,11 +2296,6 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) return; } - #ifdef DEBUG - fprintf(stderr, "%s: Setting selection owner to serverwindow ([0x%lx]).\n", __func__, - serverWindow); - #endif - int index = nxagentFindCurrentSelectionIndex(pSelection->selection); if (index != -1) { @@ -2312,7 +2307,7 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) lastSelectionOwner[index].window, pSelection->window); fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%lx])\n", __func__, (void *)lastSelectionOwner[index].windowPtr, (void *)pSelection->pWin, - nxagentWindow(pSelection->pWin), serverWindow); + pSelection->pWin ? nxagentWindow(pSelection->pWin) : 0, serverWindow); fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%u]\n", __func__, lastSelectionOwner[index].lastTimeChanged); #endif @@ -2342,8 +2337,16 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) * watch clipboard ownership changes, clipboard owners should * reacquire the clipboard whenever the content or metadata (e.g * the list of supported targets) changes." + * If pWin is NULL this is a SelectionClear. */ - XSetSelectionOwner(nxagentDisplay, remoteSelectionAtoms[index], serverWindow, CurrentTime); + #ifdef DEBUG + if (pSelection->pWin) + { + fprintf(stderr, "%s: Setting selection owner to serverwindow ([0x%lx]).\n", __func__, + serverWindow); + } + #endif + XSetSelectionOwner(nxagentDisplay, remoteSelectionAtoms[index], pSelection->pWin ? serverWindow : 0, CurrentTime); /* * The real owner window (inside nxagent) is stored in -- 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 3.6.x in repository nx-libs. commit bbf9d74c40354974cdb6023ade47bf7d8be26330 Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jun 21 22:26:12 2021 +0200 Clipboard.c: print debug message if selection is already cleared --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 09c7eb2c2..20a380817 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -927,6 +927,12 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) invalidateTargetCache(index); } + #ifdef DEBUG + else + { + fprintf(stderr, "%s: selection already cleared - doing nothing.\n", __func__); + } + #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 3.6.x in repository nx-libs. commit 30e9b82cef50c55e64db5ad656dbdf4a5056467c Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jun 18 00:19:52 2021 +0200 Clipboard.c: restruct setSelectionOwnerOnXServer Immediately abort if the selection index cannot be determined. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 145 +++++++++++++------------ 1 file changed, 76 insertions(+), 69 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 018827a0a..392943066 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2306,73 +2306,78 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) } int index = nxagentFindCurrentSelectionIndex(pSelection->selection); - if (index != -1) + if (index == -1) { #ifdef DEBUG - fprintf(stderr, "%s: lastSelectionOwner.client %s -> %s\n", __func__, - nxagentClientInfoString(lastSelectionOwner[index].client), - nxagentClientInfoString(pSelection->client)); - fprintf(stderr, "%s: lastSelectionOwner.window [0x%x] -> [0x%x]\n", __func__, - lastSelectionOwner[index].window, pSelection->window); - fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%lx])\n", __func__, - (void *)lastSelectionOwner[index].windowPtr, (void *)pSelection->pWin, - pSelection->pWin ? nxagentWindow(pSelection->pWin) : 0, serverWindow); - fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%u]\n", __func__, - lastSelectionOwner[index].lastTimeChanged); + fprintf(stderr, "%s: selection [%s] can/will not be handled by the clipboard code\n", __func__, NameForLocalAtom(pSelection->selection)); #endif + return; + } - #if defined(TEST) || defined(DEBUG) - if (lastServers[index].requestor != None) - { - /* - * There's an X client on the real X server waiting for a - * reply. That reply will never come because now we are the - * owner so let's be fair and cancel that request. - */ - fprintf(stderr, "%s: WARNING! lastServers[%d].requestor window [0x%lx] already set. Cancelling pending request.\n", - __func__, index, lastServers[index].requestor); - - replyPendingRequestSelectionToXServer(index, False); - - /* Now we can go on. */ - } - #endif + #ifdef DEBUG + fprintf(stderr, "%s: lastSelectionOwner.client %s -> %s\n", __func__, + nxagentClientInfoString(lastSelectionOwner[index].client), + nxagentClientInfoString(pSelection->client)); + fprintf(stderr, "%s: lastSelectionOwner.window [0x%x] -> [0x%x]\n", __func__, + lastSelectionOwner[index].window, pSelection->window); + fprintf(stderr, "%s: lastSelectionOwner.windowPtr [%p] -> [%p] [0x%x] (serverWindow: [0x%lx])\n", __func__, + (void *)lastSelectionOwner[index].windowPtr, (void *)pSelection->pWin, + pSelection->pWin ? nxagentWindow(pSelection->pWin) : 0, serverWindow); + fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%u]\n", __func__, + lastSelectionOwner[index].lastTimeChanged); + #endif + #if defined(TEST) || defined(DEBUG) + if (lastServers[index].requestor != None) + { /* - * Inform the real X server that our serverWindow is the - * clipboard owner. - * https://www.freedesktop.org/wiki/ClipboardManager/ states - * "In order to support peers who use the XFIXES extension to - * watch clipboard ownership changes, clipboard owners should - * reacquire the clipboard whenever the content or metadata (e.g - * the list of supported targets) changes." - * If pWin is NULL this is a SelectionClear. + * There's an X client on the real X server waiting for a + * reply. That reply will never come because now we are the + * owner so let's be fair and cancel that request. */ - #ifdef DEBUG - if (pSelection->pWin) - { - fprintf(stderr, "%s: Setting selection owner to serverwindow ([0x%lx]).\n", __func__, - serverWindow); - } - #endif - XSetSelectionOwner(nxagentDisplay, remoteSelectionAtoms[index], pSelection->pWin ? serverWindow : 0, CurrentTime); + fprintf(stderr, "%s: WARNING! lastServers[%d].requestor window [0x%lx] already set. Cancelling pending request.\n", + __func__, index, lastServers[index].requestor); + replyPendingRequestSelectionToXServer(index, False); - /* - * The real owner window (inside nxagent) is stored in - * lastSelectionOwner[index].window. - * lastSelectionOwner[index].windowPtr points to the struct that - * contains all information about the owner window. - */ - storeSelectionOwnerData(index, pSelection); + /* Now we can go on. */ + } + #endif - setClientSelectionStage(index, SelectionStageNone); + /* + * Inform the real X server that our serverWindow is the + * clipboard owner. + * https://www.freedesktop.org/wiki/ClipboardManager/ states + * "In order to support peers who use the XFIXES extension to + * watch clipboard ownership changes, clipboard owners should + * reacquire the clipboard whenever the content or metadata (e.g + * the list of supported targets) changes." + * If pWin is NULL this is a SelectionClear. + */ + #ifdef DEBUG + if (pSelection->pWin) + { + fprintf(stderr, "%s: Setting selection owner to serverwindow ([0x%lx]).\n", __func__, + serverWindow); + } + #endif + XSetSelectionOwner(nxagentDisplay, remoteSelectionAtoms[index], pSelection->pWin ? serverWindow : 0, CurrentTime); - /* - * This will be repeated on reception of the SelectionOwner - * callback but we cannot be sure if there are any intermediate - * requests in the queue already so better do it here, too. - */ - invalidateTargetCache(index); + /* + * The real owner window (inside nxagent) is stored in + * lastSelectionOwner[index].window. + * lastSelectionOwner[index].windowPtr points to the struct that + * contains all information about the owner window. + */ + storeSelectionOwnerData(index, pSelection); + + setClientSelectionStage(index, SelectionStageNone); + + /* + * This will be repeated on reception of the SelectionOwner + * callback but we cannot be sure if there are any intermediate + * requests in the queue already so better do it here, too. + */ + invalidateTargetCache(index); /* FIXME @@ -2381,22 +2386,24 @@ FIXME2: instead of XGetSelectionOwner we could check if the Xfixes SetSelectionOwner event has arrived in the event queue; possibly saving one roundtrip. - if (XGetSelectionOwner(nxagentDisplay, pSelection->selection) == serverWindow) - { - fprintf (stderr, "%s: SetSelectionOwner OK\n", __func__); + if (XGetSelectionOwner(nxagentDisplay, pSelection->selection) == serverWindow) + { + fprintf (stderr, "%s: SetSelectionOwner OK\n", __func__); - lastSelectionOwnerSelection = pSelection; - lastSelectionOwnerClient = pSelection->client; - lastSelectionOwnerWindow = pSelection->window; - lastSelectionOwnerWindowPtr = pSelection->pWin; + lastSelectionOwnerSelection = pSelection; + lastSelectionOwnerClient = pSelection->client; + lastSelectionOwnerWindow = pSelection->window; + lastSelectionOwnerWindowPtr = pSelection->pWin; - setClientSelectionStage(index, SelectionStageNone); + setClientSelectionStage(index, SelectionStageNone); - lastServers[index].requestor = None; - } - else fprintf (stderr, "%s: SetSelectionOwner failed\n", __func__); -*/ + lastServers[index].requestor = None; + } + else + { + fprintf (stderr, "%s: SetSelectionOwner failed\n", __func__); } +*/ } /* -- 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 3.6.x in repository nx-libs. commit eae0eff3aa5c8e3601677e8395fea72be231b554 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jun 18 00:23:30 2021 +0200 Clipboard.c: improve some comments --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 735a9379a..85ef1ae16 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -97,6 +97,13 @@ const int nxagentMaxSelections = 2; static XlibAtom *remoteSelectionAtoms = NULL; static Atom *localSelelectionAtoms = NULL; +/* + * The real owner window (inside nxagent) is stored in + * lastSelectionOwner[index].window. + * lastSelectionOwner[index].windowPtr points to the struct that + * contains all information about the owner window. + * lastTimeChanged is always a local time. + */ typedef struct _SelectionOwner { ClientPtr client; /* local client */ @@ -106,9 +113,8 @@ typedef struct _SelectionOwner } SelectionOwner; /* - * This contains the last selection owner in nxagent. The - * lastTimeChanged is always a local time. If .client is NULL the - * owner is outside nxagent. + * This contains the last selection owner for each selection. If + * .client is NULL the owner is outside nxagent or there is no owner. */ static SelectionOwner *lastSelectionOwner = NULL; @@ -717,6 +723,7 @@ static Bool matchSelectionOwner(int index, ClientPtr pClient, WindowPtr pWindow) * Attention: does not work properly when both client AND window * are passed as setClientSelectionStage(None) will also clear * the lastClientWindowPtr! + * This is only called from Client.c and Window.c */ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow) { -- 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 3.6.x in repository nx-libs. commit 65d29df13fc4c955ddf60a200d41d8be7283c505 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Jun 20 12:58:04 2021 +0200 Clipboard.c: Only take full clipboard clearing action if non-empty --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 85ef1ae16..09c7eb2c2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -912,21 +912,21 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) x.u.selectionClear.atom = CurrentSelections[index].selection; sendEventToClient(lastSelectionOwner[index].client, &x); - } - /* - * Set the root window with the NullClient as selection owner. Our - * clients asking for the owner via XGetSelectionOwner() will get - * these for an answer. - */ - CurrentSelections[index].window = screenInfo.screens[0]->root->drawable.id; - CurrentSelections[index].client = NullClient; + /* + * Set the root window with the NullClient as selection owner. Our + * clients asking for the owner via XGetSelectionOwner() will get + * this for an answer. + */ + CurrentSelections[index].window = screenInfo.screens[0]->root->drawable.id; + CurrentSelections[index].client = NullClient; - clearSelectionOwnerData(index); + clearSelectionOwnerData(index); - setClientSelectionStage(index, SelectionStageNone); + setClientSelectionStage(index, SelectionStageNone); - invalidateTargetCache(index); + invalidateTargetCache(index); + } } } -- 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 3.6.x in repository nx-libs. commit 289ac3dfd3b0f9bcefff15eb80dd04dccb0a1051 Author: Ulrich Sibiller <uli42@gmx.de> Date: Fri Jun 18 00:21:41 2021 +0200 Clipboard.c: remove superflous check replyPendingRequestSelectionToXServer already checks for None --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 392943066..735a9379a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -2327,21 +2327,13 @@ static void setSelectionOwnerOnXServer(Selection *pSelection) lastSelectionOwner[index].lastTimeChanged); #endif - #if defined(TEST) || defined(DEBUG) - if (lastServers[index].requestor != None) - { - /* - * There's an X client on the real X server waiting for a - * reply. That reply will never come because now we are the - * owner so let's be fair and cancel that request. - */ - fprintf(stderr, "%s: WARNING! lastServers[%d].requestor window [0x%lx] already set. Cancelling pending request.\n", - __func__, index, lastServers[index].requestor); - replyPendingRequestSelectionToXServer(index, False); - /* Now we can go on. */ - } - #endif + /* + * There's an X client on the real X server waiting for a + * reply. That reply will never come because now we are the + * owner so let's be fair and cancel that request. + */ + replyPendingRequestSelectionToXServer(index, False); /* * Inform the real X server that our serverWindow is the -- 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 3.6.x in repository nx-libs. commit 7aa969cd4ee5fe6ecf74f82442e4a0a7491191c1 Author: Ulrich Sibiller <uli42@gmx.de> Date: Wed Jun 16 20:16:20 2021 +0200 Fix Xfixes event handling Calling the callback on receptions of an EXTERNAL xfixes event was a weird idea from the start. However, since adding the protection trap around it it made no sense at all because it effectivly made the callback a noop for that case. So let's drop all the trap nonsense and implement it properly. The callback will only be used for actions by internal clients. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 166 +++++++++++++------------ nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 3 + nx-X11/programs/Xserver/hw/nxagent/Events.c | 101 +++++++-------- nx-X11/programs/Xserver/hw/nxagent/Trap.c | 8 -- nx-X11/programs/Xserver/hw/nxagent/Trap.h | 7 -- 5 files changed, 137 insertions(+), 148 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 20a380817..4a0bf9cb5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -873,14 +873,13 @@ void invalidateTargetCaches(void) /* * This is called from Events.c dispatch loop on reception of a * SelectionClear event. We receive this event if someone on the real - * X server claims the selection ownership. + * X server claims the selection ownership we have/had. + * Three versions of this routine with different parameter types. */ -void nxagentHandleSelectionClearFromXServer(XEvent *X) +void nxagentHandleSelectionClearFromXServerByIndex(int index) { #ifdef DEBUG - fprintf(stderr, "---------\n%s: SelectionClear event for selection [%lu][%s] window [0x%lx] time [%lu].\n", - __func__, X->xselectionclear.selection, NameForRemoteAtom(X->xselectionclear.selection), - X->xselectionclear.window, X->xselectionclear.time); + fprintf(stderr, "%s: SelectionClear event for selection index [%u].\n", __func__, index); #endif if (!agentClipboardInitialized) @@ -899,43 +898,56 @@ void nxagentHandleSelectionClearFromXServer(XEvent *X) return; } - int index = nxagentFindRemoteSelectionIndex(X->xselectionclear.selection); - if (index != -1) + if (IS_LOCAL_OWNER(index)) { - if (IS_LOCAL_OWNER(index)) - { - /* Send a SelectionClear event to (our) previous owner. */ - xEvent x = {0}; - x.u.u.type = SelectionClear; - x.u.selectionClear.time = GetTimeInMillis(); - x.u.selectionClear.window = lastSelectionOwner[index].window; - x.u.selectionClear.atom = CurrentSelections[index].selection; + /* Send a SelectionClear event to (our) previous owner. */ + xEvent x = {0}; + x.u.u.type = SelectionClear; + x.u.selectionClear.time = GetTimeInMillis(); + x.u.selectionClear.window = lastSelectionOwner[index].window; + x.u.selectionClear.atom = CurrentSelections[index].selection; - sendEventToClient(lastSelectionOwner[index].client, &x); + sendEventToClient(lastSelectionOwner[index].client, &x); - /* - * Set the root window with the NullClient as selection owner. Our - * clients asking for the owner via XGetSelectionOwner() will get - * this for an answer. - */ - CurrentSelections[index].window = screenInfo.screens[0]->root->drawable.id; - CurrentSelections[index].client = NullClient; + /* + * Set the root window with the NullClient as selection owner. Our + * clients asking for the owner via XGetSelectionOwner() will get + * this for an answer. + */ + CurrentSelections[index].window = screenInfo.screens[0]->root->drawable.id; + CurrentSelections[index].client = NullClient; - clearSelectionOwnerData(index); + clearSelectionOwnerData(index); - setClientSelectionStage(index, SelectionStageNone); + setClientSelectionStage(index, SelectionStageNone); - invalidateTargetCache(index); - } - #ifdef DEBUG - else - { - fprintf(stderr, "%s: selection already cleared - doing nothing.\n", __func__); - } - #endif + invalidateTargetCache(index); + } +} + +void nxagentHandleSelectionClearFromXServerByAtom(XlibAtom sel) +{ + #ifdef DEBUG + fprintf(stderr, "---------\n%s: SelectionClear event for remote selection atom [%lu][%s].\n", __func__, sel, NameForRemoteAtom(sel)); + #endif + + int index = nxagentFindRemoteSelectionIndex(sel); + if (index != -1) + { + nxagentHandleSelectionClearFromXServerByIndex(index); } } +void nxagentHandleSelectionClearFromXServer(XEvent *X) +{ + #ifdef DEBUG + fprintf(stderr, "---------\n%s: SelectionClear event for selection [%lu][%s] window [0x%lx] time [%lu].\n", + __func__, X->xselectionclear.selection, NameForRemoteAtom(X->xselectionclear.selection), + X->xselectionclear.window, X->xselectionclear.time); + #endif + nxagentHandleSelectionClearFromXServerByAtom(X->xselectionclear.selection); +} + /* * Send a SelectionNotify event as reply to the RequestSelection * event X. If success is True take the property from the event, else @@ -2202,25 +2214,11 @@ static void resetSelectionOwnerOnXServer(void) #ifdef NXAGENT_CLIPBOARD /* - * The callback is called from dix. This is the normal operation - * mode. The callback is also called when nxagent gets XFixes events - * from the real X server. In that case the Trap is set and the - * callback will do nothing. + * The callback is called from dix. */ - void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, void *args) { - /* - * Only act if the trap is unset. The trap indicates that we are - * triggered by an XFixes clipboard event originating from the real - * X server. In that case we do not want to propagate back changes - * to the real X server, because it already knows about them and we - * would end up in an infinite loop of events. If there was a better - * way to identify that situation during callback processing we - * could get rid of the Trap... - */ - SelectionInfoRec *info = (SelectionInfoRec *)args; #ifdef DEBUG @@ -2249,58 +2247,66 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, if (index == -1) { #ifdef DEBUG - fprintf(stderr, "%s: selection [%s] will not be handled by the clipboard code\n", __func__, NameForLocalAtom(pCurSel->selection)); + fprintf(stderr, "%s: selection [%s] can/will not be handled by the clipboard code\n", __func__, NameForLocalAtom(pCurSel->selection)); #endif return; } /* - * Always invalidate the target cache for the relevant selection, - * even if the trap is set. This ensures not having invalid data in - * the cache. + * Always invalidate the target cache for the relevant selection. + * This ensures not having invalid data in the cache. */ invalidateTargetCache(index); - if (nxagentExternalClipboardEventTrap) - { - #ifdef DEBUG - fprintf(stderr, "%s: Trap is set, doing nothing\n", __func__); - #endif - return; - } - - #ifdef DEBUG + fprintf(stderr, "%s: pCurSel->window [0x%x]\n", __func__, pCurSel->window); + fprintf(stderr, "%s: pCurSel->pWin [0x%x]\n", __func__, WINDOWID(pCurSel->pWin)); + fprintf(stderr, "%s: pCurSel->selection [%s]\n", __func__, NameForLocalAtom(pCurSel->selection)); fprintf(stderr, "%s: pCurSel->lastTimeChanged [%u]\n", __func__, pCurSel->lastTimeChanged.milliseconds); + fprintf(stderr, "%s: pCurSel->client [%s]\n", __func__, nxagentClientInfoString(pCurSel->client)); #endif - if (info->kind == SelectionSetOwner) + if (nxagentOption(Clipboard) != ClipboardNone) /* FIXME: shouldn't we also check for != ClipboardClient? */ { - #ifdef DEBUG - fprintf(stderr, "%s: pCurSel->pWin [0x%x]\n", __func__, WINDOWID(pCurSel->pWin)); - fprintf(stderr, "%s: pCurSel->selection [%s]\n", __func__, NameForLocalAtom(pCurSel->selection)); - #endif + Selection *pSel = NULL; + Selection nullSel = { + .client = NullClient, + .window = None, + .pWin = NULL, + .selection = pCurSel->selection, + .lastTimeChanged = pCurSel->lastTimeChanged + }; + + if (info->kind == SelectionSetOwner) + { + pSel = pCurSel; + } + else if (info->kind == SelectionWindowDestroy) + { + if (pCurSel->window == lastSelectionOwner[index].window) + { + pSel = &nullSel; + } + } + else if (info->kind == SelectionClientClose) + { + if (pCurSel->client == lastSelectionOwner[index].client) + { + pSel = &nullSel; + } + } + else + { + } - if (pCurSel->pWin != NULL && - nxagentOption(Clipboard) != ClipboardNone && /* FIXME: shouldn't we also check for != ClipboardClient? */ - (pCurSel->selection == localSelelectionAtoms[nxagentPrimarySelection] || - pCurSel->selection == localSelelectionAtoms[nxagentClipboardSelection])) + if (pSel) { #ifdef DEBUG fprintf(stderr, "%s: calling setSelectionOwnerOnXServer\n", __func__); #endif - setSelectionOwnerOnXServer(pCurSel); + setSelectionOwnerOnXServer(pSel); } } - else if (info->kind == SelectionWindowDestroy) - { - } - else if (info->kind == SelectionClientClose) - { - } - else - { - } } #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h index aca8d94af..4518595d1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h @@ -57,11 +57,14 @@ extern void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow); extern int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, Window requestor, Atom property, Atom target, Time time); +extern void nxagentHandleSelectionClearFromXServerByIndex(int index); #ifdef XEvent +extern void nxagentHandleSelectionClearFromXServerByAtom(XlibAtom sel); extern void nxagentHandleSelectionClearFromXServer(XEvent *X); extern void nxagentHandleSelectionRequestFromXServer(XEvent *X); extern void nxagentHandleSelectionNotifyFromXServer(XEvent *X); #else +extern void nxagentHandleSelectionClearFromXServerByAtom(); extern void nxagentHandleSelectionClearFromXServer(); extern void nxagentHandleSelectionRequestFromXServer(); extern void nxagentHandleSelectionNotifyFromXServer(); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 906915ad0..a678e3841 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2841,69 +2841,64 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) return 0; } + #ifdef DEBUG + fprintf(stderr, "---------\n"); + #endif + #ifdef TEST fprintf(stderr, "%s: Handling event.\n", __func__); #endif - if (SelectionCallback) - { - Atom local = nxagentRemoteToLocalAtom(xfixesEvent -> xfixesselection.selection); - - int index = nxagentFindCurrentSelectionIndex(local); - if (index != -1) - { - if (CurrentSelections[index].client != 0) - { - #ifdef TEST - fprintf(stderr, "%s: Doing nothing.\n", __func__); - #endif - - return 1; - } - - #ifdef TEST - fprintf(stderr, "%s: Calling callbacks for %d [%s] selection.\n", __func__, - CurrentSelections[index].selection, NameForAtom(CurrentSelections[index].selection)); - #endif + #ifdef DEBUG + fprintf(stderr, "%s: Event timestamp [%ld]\n", __func__, xfixesEvent->xfixesselection.timestamp); + fprintf(stderr, "%s: Event selection timestamp [%ld]\n", __func__, xfixesEvent->xfixesselection.selection_timestamp); + fprintf(stderr, "%s: Event selection window [0x%lx]\n", __func__, xfixesEvent->xfixesselection.window); + fprintf(stderr, "%s: Event selection owner [0x%lx]\n", __func__, xfixesEvent->xfixesselection.owner); + fprintf(stderr, "%s: Event selection [%s]\n", __func__, NameForAtom(nxagentRemoteToLocalAtom(xfixesEvent->xfixesselection.selection))); - #ifdef DEBUG - fprintf(stderr, "%s: CurrentSelections[%d].lastTimeChanged [%u]\n", __func__, index, CurrentSelections[index].lastTimeChanged.milliseconds); - fprintf(stderr, "%s: Event timestamp [%ld]\n", __func__, xfixesEvent->xfixesselection.timestamp); - fprintf(stderr, "%s: Event selection timestamp [%ld]\n", __func__, xfixesEvent->xfixesselection.selection_timestamp); - fprintf(stderr, "%s: Event selection window [0x%lx]\n", __func__, xfixesEvent->xfixesselection.window); - fprintf(stderr, "%s: Event selection owner [0x%lx]\n", __func__, xfixesEvent->xfixesselection.owner); - fprintf(stderr, "%s: Event selection [%s]\n", __func__, NameForAtom(local)); + fprintf(stderr, "%s: Subtype ", __func__); - fprintf(stderr, "%s: Subtype ", __func__); + switch (xfixesEvent -> xfixesselection.subtype) + { + case SelectionSetOwner: fprintf(stderr, "SelectionSetOwner.\n"); break; + case SelectionWindowDestroy: fprintf(stderr, "SelectionWindowDestroy.\n"); break; + case SelectionClientClose: fprintf(stderr, "SelectionClientClose.\n"); break; + default: fprintf(stderr, ".\n"); break; + } + #endif - switch (xfixesEvent -> xfixesselection.subtype) - { - case SelectionSetOwner: fprintf(stderr, "SelectionSetOwner.\n"); break; - case SelectionWindowDestroy: fprintf(stderr, "SelectionWindowDestroy.\n"); break; - case SelectionClientClose: fprintf(stderr, "SelectionClientClose.\n"); break; - default: fprintf(stderr, ".\n"); break; - } - #endif + if (xfixesEvent->xfixesselection.owner && xfixesEvent->xfixesselection.owner == nxagentWindow(screenInfo.screens[0]->root)) + { + /* + * This is an event that must have been triggered by nxagent itself + * - by calling XSetSelectionOwner(). As this is no news for us we + * can ignore the event. + */ - SelectionInfoRec info = { - .selection = &CurrentSelections[index], - .kind = xfixesEvent->xfixesselection.subtype - }; + #ifdef DEBUG + fprintf(stderr, "%s: (new) owner is nxagent (window is [0x%lx]) - ignoring it.\n", __func__, xfixesEvent->xfixesselection.window); + #endif + return 0; + } - /* - * The trap indicates that we are triggered by a clipboard event - * originating from the real X server. In that case we do not - * want to propagate back changes to the real X server, because - * it already knows about them and we would end up in an - * infinite loop of events. If there was a better way to - * identify that situation during Callback processing we could - * get rid of the Trap... - */ - nxagentExternalClipboardEventTrap = True; - CallCallbacks(&SelectionCallback, &info); - nxagentExternalClipboardEventTrap = False; - } + if (xfixesEvent -> xfixesselection.subtype == SelectionSetOwner|| + xfixesEvent -> xfixesselection.subtype == SelectionWindowDestroy || + xfixesEvent -> xfixesselection.subtype == SelectionClientClose) + { + /* + * Reception of an owner change on the real X server is - for nxagent - the same as + * receiving a SelectionClear event. We just need to tell a (possible) internal + * owner that is no longer owning the selection. + */ + nxagentHandleSelectionClearFromXServerByAtom(xfixesEvent -> xfixesselection.selection); + } + else + { + #ifdef DEBUG + fprintf(stderr, "%s: WARNING unexpected xfixesselection subtype [%d]\n", __func__, xfixesEvent -> xfixesselection.subtype); + #endif } + return 1; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.c b/nx-X11/programs/Xserver/hw/nxagent/Trap.c index 6eade2073..c0a1fdde0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.c @@ -103,11 +103,3 @@ Bool nxagentXkbCapsTrap = False; */ Bool nxagentXkbNumTrap = False; - -/* - * Set to indicate we are processing a clipboard event triggered by - * the real X server. This is used to avoid endless loops if callbacks - * would trigger another event by the real X server - */ - -Bool nxagentExternalClipboardEventTrap = False; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.h b/nx-X11/programs/Xserver/hw/nxagent/Trap.h index 1c10f00ea..02ad48f99 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.h @@ -101,11 +101,4 @@ extern Bool nxagentXkbCapsTrap; */ extern Bool nxagentXkbNumTrap; -/* - * Set to indicate we are processing a clipboard event triggered by - * the real X server. This is used to avoid endless loops if callbacks - * would trigger another event by the real X server - */ -extern Bool nxagentExternalClipboardEventTrap; - #endif /* __Trap_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 3.6.x in repository nx-libs. commit 9874023096b1940ef3df0756a0ec81d5d57e09c2 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Jun 20 13:16:29 2021 +0200 Clipboard.c: check for invalid index We only need to check this in nxagentHandleSelectionClearFromXServerByIndex, so we can simplify nxagentHandleSelectionClearFromXServerByAtom. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 4a0bf9cb5..3b08c1133 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -882,6 +882,14 @@ void nxagentHandleSelectionClearFromXServerByIndex(int index) fprintf(stderr, "%s: SelectionClear event for selection index [%u].\n", __func__, index); #endif + if (index == -1) + { + #ifdef DEBUG + fprintf(stderr, "%s: ignoring index -1 - doing nothing.\n", __func__); + #endif + return; + } + if (!agentClipboardInitialized) { #ifdef DEBUG @@ -931,11 +939,7 @@ void nxagentHandleSelectionClearFromXServerByAtom(XlibAtom sel) fprintf(stderr, "---------\n%s: SelectionClear event for remote selection atom [%lu][%s].\n", __func__, sel, NameForRemoteAtom(sel)); #endif - int index = nxagentFindRemoteSelectionIndex(sel); - if (index != -1) - { - nxagentHandleSelectionClearFromXServerByIndex(index); - } + nxagentHandleSelectionClearFromXServerByIndex(nxagentFindRemoteSelectionIndex(sel)); } void nxagentHandleSelectionClearFromXServer(XEvent *X) -- 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 3.6.x in repository nx-libs. commit 15ee25b7dd259793b335723c5f66ff14054c72d0 Author: Ulrich Sibiller <uli42@gmx.de> Date: Tue Jun 22 21:41:10 2021 +0200 NXdispatch.c: add an explaining comment and restructure a bit. --- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index ff8330cc7..5df008bbb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -745,10 +745,15 @@ ProcConvertSelection(register ClientPtr client) while ((i < NumCurrentSelections) && CurrentSelections[i].selection != stuff->selection) i++; if ((i < NumCurrentSelections) && -#ifdef NXAGENT_SERVER - (CurrentSelections[i].window != None) && (CurrentSelections[i].client != NullClient) -#else (CurrentSelections[i].window != None) +#ifdef NXAGENT_SERVER + /* + * .window can be set and pointing to our server window to + * signal the clipboard owner being on the real X + * server. Therefore we need to check .client in addition + * to ensure having a local owner. + */ + && (CurrentSelections[i].client != NullClient) #endif #ifdef XCSECURITY && (!client->CheckAccess || -- 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 3.6.x in repository nx-libs. commit 5da2be394a3961c7a6d96a3e117ffc434fe34827 Author: Ulrich Sibiller <uli42@gmx.de> Date: Sun Jun 20 13:15:12 2021 +0200 Events.c: add another comment --- nx-X11/programs/Xserver/hw/nxagent/Events.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index a678e3841..0340e0b57 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2881,6 +2881,11 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) return 0; } + /* + * Realistically the only situation where we can receive + * WindowDestroy or ClientClose will also end nxagent, so we do not + * need to handle them. But the code is here, so let's keep it. + */ if (xfixesEvent -> xfixesselection.subtype == SelectionSetOwner|| xfixesEvent -> xfixesselection.subtype == SelectionWindowDestroy || xfixesEvent -> xfixesselection.subtype == SelectionClientClose) -- 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 3.6.x in repository nx-libs. commit 6be4f87c63fe8c816dac4dbd0ed53727ecad0f4d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 11 20:43:55 2021 +0000 debian/control: Add B-D: libtirpc-dev. --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 00527d63e..d74f9e175 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,7 @@ Build-Depends: libjpeg-dev, libpixman-1-dev (>= 0.13.2), libpng-dev, + libtirpc-dev | hello, libtool, libxcomposite-dev, libxdamage-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 3.6.x in repository nx-libs. commit 8264b03e8df725c475e43faf34a681a199f6fa7e Author: Ulrich Sibiller <uli42@gmx.de> Date: Mon Jun 21 23:14:25 2021 +0200 Clipboard.c: Add debug output when selection is already cleared --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 3b08c1133..72ca6ac64 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -931,6 +931,12 @@ void nxagentHandleSelectionClearFromXServerByIndex(int index) invalidateTargetCache(index); } + else + { + #ifdef DEBUG + fprintf(stderr, "%s: selection already cleared - doing nothing.\n", __func__); + #endif + } } void nxagentHandleSelectionClearFromXServerByAtom(XlibAtom sel) -- 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 3.6.x in repository nx-libs. commit 46b75d81879d9b0c769230e4c3757698ad5de8b5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 11 20:43:55 2021 +0000 debian/control: Add B-D: libtirpc-dev. --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 00527d63e..d74f9e175 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,7 @@ Build-Depends: libjpeg-dev, libpixman-1-dev (>= 0.13.2), libpng-dev, + libtirpc-dev | hello, libtool, libxcomposite-dev, libxdamage-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 3.6.x in repository nx-libs. commit 31057d00b8cdbe97837f508c3cb0f2c521a30266 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 11 20:45:16 2021 +0000 debian/rules: Define -DUseTIRPC=1 for nx-X11 build on Debian and Ubuntu versions that already have libtirpc. --- debian/rules | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 9bfee93fd..3ca425f76 100755 --- a/debian/rules +++ b/debian/rules @@ -12,6 +12,44 @@ export LIBDIR = "/usr/lib/$(DEB_HOST_MULTIARCH)" export LIBEXECDIR = "$(LIBDIR)/nx/bin" export INCLUDEDIR = "/usr/include/$(DEB_HOST_MULTIARCH)" +VENDOR_DEBIAN := 0 +RELEASE_VER := 0 + +# detect VENDOR_* variables and RELEASE_VER{,_MAJOR,_MINOR} +VENDOR_DEBIAN := $(shell { dpkg-vendor --is 'Debian' && echo 'yes'; } || { dpkg-vendor --is 'Raspbian' && echo 'yes'; }) + +ifeq ($(VENDOR_DEBIAN),yes) + RELEASE_VER := $(shell /usr/bin/lsb_release -r | cut -d ':' -f'2' | sed -e 's/\s*//g' | cut -d '.' -f'1') + # Let's fake testing's and unstable's "release version"... + ifeq ($(RELEASE_VER),testing) + RELEASE_VER := 999 + endif + ifeq ($(RELEASE_VER),unstable) + RELEASE_VER := 9999 + endif +else + VENDOR_UBUNTU := $(shell dpkg-vendor --is 'Ubuntu' && echo 'yes') + + ifeq ($(VENDOR_UBUNTU),yes) + RELEASE_VER_MAJOR := $(shell lsb_release -r | cut -d ':' -f '2' | sed -e 's/\s*//g' | cut -d '.' -f '1') + RELEASE_VER_MINOR := $(shell lsb_release -r | cut -d ':' -f '2' | sed -e 's/\s*//g' | cut -d '.' -f '2') + endif +endif + +# detect when to use libtirpc and when glibc still provides rpc/rpc.h +IMAKE_EXTRA_DEFINES := "" +ifeq ($(VENDOR_DEBIAN),yes) + ifeq ($(shell /bin/bash -c '(( $(RELEASE_VER) >= 10 )) && echo '"'"'yes'"'"),yes) + IMAKE_EXTRA_DEFINES+="-DUseTIRPC=1" + endif +else + ifeq ($(VENDOR_UBUNTU),yes) + ifeq ($(shell /bin/bash -c '(( $(RELEASE_VER_MAJOR) >= 18 )) && echo '"'"'yes'"'"),yes) + IMAKE_EXTRA_DEFINES+="-DUseTIRPC=1" + endif + endif +endif + %: CONFIGURE="./configure --disable-silent-rules \ --prefix=/usr \ @@ -59,8 +97,8 @@ override_dh_auto_install: override_dh_auto_build: debian/compat.sh - PREFIX='/usr' dh_auto_build --no-parallel -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))' || \ - PREFIX='/usr' dh_auto_build -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))' + PREFIX='/usr' dh_auto_build --no-parallel -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))' IMAKE_DEFINES="$(IMAKE_EXTRA_DEFINES)" || \ + PREFIX='/usr' dh_auto_build -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))' IMAKE_DEFINES="$(IMAKE_EXTRA_DEFINES)" override_dh_strip: dh_strip -plibnx-x11-6 --dbg-package=libnx-x11-6-dbg -- 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 3.6.x in repository nx-libs. commit b67b910a6adf3287fad10cc97cf9484b0057b0bd Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 11 20:45:16 2021 +0000 debian/rules: Define -DUseTIRPC=1 for nx-X11 build on Debian and Ubuntu versions that already have libtirpc. --- debian/rules | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 9bfee93fd..3ca425f76 100755 --- a/debian/rules +++ b/debian/rules @@ -12,6 +12,44 @@ export LIBDIR = "/usr/lib/$(DEB_HOST_MULTIARCH)" export LIBEXECDIR = "$(LIBDIR)/nx/bin" export INCLUDEDIR = "/usr/include/$(DEB_HOST_MULTIARCH)" +VENDOR_DEBIAN := 0 +RELEASE_VER := 0 + +# detect VENDOR_* variables and RELEASE_VER{,_MAJOR,_MINOR} +VENDOR_DEBIAN := $(shell { dpkg-vendor --is 'Debian' && echo 'yes'; } || { dpkg-vendor --is 'Raspbian' && echo 'yes'; }) + +ifeq ($(VENDOR_DEBIAN),yes) + RELEASE_VER := $(shell /usr/bin/lsb_release -r | cut -d ':' -f'2' | sed -e 's/\s*//g' | cut -d '.' -f'1') + # Let's fake testing's and unstable's "release version"... + ifeq ($(RELEASE_VER),testing) + RELEASE_VER := 999 + endif + ifeq ($(RELEASE_VER),unstable) + RELEASE_VER := 9999 + endif +else + VENDOR_UBUNTU := $(shell dpkg-vendor --is 'Ubuntu' && echo 'yes') + + ifeq ($(VENDOR_UBUNTU),yes) + RELEASE_VER_MAJOR := $(shell lsb_release -r | cut -d ':' -f '2' | sed -e 's/\s*//g' | cut -d '.' -f '1') + RELEASE_VER_MINOR := $(shell lsb_release -r | cut -d ':' -f '2' | sed -e 's/\s*//g' | cut -d '.' -f '2') + endif +endif + +# detect when to use libtirpc and when glibc still provides rpc/rpc.h +IMAKE_EXTRA_DEFINES := "" +ifeq ($(VENDOR_DEBIAN),yes) + ifeq ($(shell /bin/bash -c '(( $(RELEASE_VER) >= 10 )) && echo '"'"'yes'"'"),yes) + IMAKE_EXTRA_DEFINES+="-DUseTIRPC=1" + endif +else + ifeq ($(VENDOR_UBUNTU),yes) + ifeq ($(shell /bin/bash -c '(( $(RELEASE_VER_MAJOR) >= 18 )) && echo '"'"'yes'"'"),yes) + IMAKE_EXTRA_DEFINES+="-DUseTIRPC=1" + endif + endif +endif + %: CONFIGURE="./configure --disable-silent-rules \ --prefix=/usr \ @@ -59,8 +97,8 @@ override_dh_auto_install: override_dh_auto_build: debian/compat.sh - PREFIX='/usr' dh_auto_build --no-parallel -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))' || \ - PREFIX='/usr' dh_auto_build -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))' + PREFIX='/usr' dh_auto_build --no-parallel -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))' IMAKE_DEFINES="$(IMAKE_EXTRA_DEFINES)" || \ + PREFIX='/usr' dh_auto_build -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))' IMAKE_DEFINES="$(IMAKE_EXTRA_DEFINES)" override_dh_strip: dh_strip -plibnx-x11-6 --dbg-package=libnx-x11-6-dbg -- 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 3.6.x in repository nx-libs. commit b7034724abb859db36a3fa4312e4827141114f45 Merge: b67b910a6 31057d00b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Oct 18 09:28:50 2021 +0200 Merge branch 'uli42-pr/many_clipboard_fixes' into 3.6.x Attributes GH PR #1018: https://github.com/ArcticaProject/nx-libs/pull/1018 nx-X11/programs/Xserver/hw/nxagent/Args.c | 19 + nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 71 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 18 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 3099 +++++++++++++++------- nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 7 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 119 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 15 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 7 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 1 + nx-X11/programs/Xserver/hw/nxagent/Options.h | 7 + nx-X11/programs/Xserver/hw/nxagent/Trap.c | 8 - nx-X11/programs/Xserver/hw/nxagent/Trap.h | 7 - nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 13 + 13 files changed, 2284 insertions(+), 1107 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git