diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-10-30 21:20:21 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-10-30 21:20:21 +0200 |
commit | b06b6b1efe84f5759da3cf6f9dfaf1c2c173aeb6 (patch) | |
tree | 0e8497952ce92d8c3f271cd1d6a04832b35d1b36 | |
parent | 1ef24c379f8d142180f77ecfe2ab43093c3b7a64 (diff) | |
parent | 70fde4c748a0466343d308c79ecd4853499b58f1 (diff) | |
download | nx-libs-b06b6b1efe84f5759da3cf6f9dfaf1c2c173aeb6.tar.gz nx-libs-b06b6b1efe84f5759da3cf6f9dfaf1c2c173aeb6.tar.bz2 nx-libs-b06b6b1efe84f5759da3cf6f9dfaf1c2c173aeb6.zip |
Merge branch 'uli42-pr/various8' into 3.6.x
Attributes GH PR #1025: https://github.com/ArcticaProject/nx-libs/pull/1025
-rw-r--r-- | nx-X11/programs/Xserver/Imakefile | 12 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Args.c | 11 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 22 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Imakefile | 55 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Screen.c | 4 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Window.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/compext/Imakefile | 18 | ||||
-rwxr-xr-x | nxdialog/bin/nxdialog | 24 |
8 files changed, 71 insertions, 77 deletions
diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index 390ad538b..72ed8484c 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -31,10 +31,10 @@ NULL = #include <Server.tmpl> -/* On most systems the linker requires the libraries in dependency order. +/* On most systems the linker requires the libraries in dependency order. But we have no real order because there are cycles. We fix this by adding - some libraries twice on the commandline. dependLib will add the - dependency library to the commandline if the link order is important */ + some libraries twice on the commandline. dependLib will add the + dependency library to the commandline if the link order is important */ #if 1 /* This is currently enabled for all systems */ #define dependLib(x) x #else @@ -43,7 +43,7 @@ NULL = #if defined(XorgVersion) /* Do not strip server binaries */ -INSTPGMFLAGS = +INSTPGMFLAGS = #endif #define PreFbLibs $(DIX) $(OS) $(XPDDX) @@ -136,7 +136,7 @@ INSTPGMFLAGS = FB = fb/LibraryTargetName(fb) DAMAGE = miext/damage/LibraryTargetName(damage) SHADOW = miext/shadow/LibraryTargetName(shadow) - LAYER = miext/layer/LibraryTargetName(layer) + LAYER = miext/layer/LibraryTargetName(layer) #if !HasFfs && (defined(mingwArchitecture) || defined(cygwinArchitecture)) /* Order of libraries is important when linking in mingw or * cygwin. libmi.a requires ffs from libdix.a. So it is added @@ -147,7 +147,7 @@ INSTPGMFLAGS = #endif MIINITEXTOBJ = mi/miinitext.o DIX = dix/LibraryTargetName(dix) -#if UsbMouseSupport +#if UsbMouseSupport #if !HasLibUsb USB = $(XF86OSSRC)/bsd/libusb/LibraryTargetName(usb) #else diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index e2dc8c083..174873e51 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -187,9 +187,8 @@ int ddxProcessArgument(int argc, char *argv[], int i) /* * The flavour can never change, so only set it once. * - * FIXME: ddxProcessArgument() is called once for every command line - * argument, with argv[0] being the argument and not the program - * name! We should move this check somewhere else. + * ddxProcessArgument() is called once for every command line + * argument, with argv[i] being the argument, i > 0. argv[0] is the program name. */ if (nxagentProgName == NULL) { @@ -268,7 +267,6 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (envOptions != NULL) { nxagentParseOptionString(envOptions); - SAFE_free(envOptions); } @@ -699,8 +697,6 @@ int ddxProcessArgument(int argc, char *argv[], int i) #ifdef TEST fprintf(stderr, "%s: changing nxagentKeyboard from [null/null] to [clone].\n", __func__); #endif - - SAFE_free(nxagentKeyboard); nxagentKeyboard = strdup("clone"); } else @@ -1154,7 +1150,6 @@ static void nxagentParseSingleOption(char *name, char *value) fprintf(stderr, "Warning: Ignoring bad value '%s' for option 'fullscreen'.\n", validateString(value)); } - return; } else if (!strcmp(name, "shpix")) @@ -1189,7 +1184,6 @@ static void nxagentParseSingleOption(char *name, char *value) fprintf(stderr, "Warning: Ignoring bad value '%s' for option 'shmem'.\n", validateString(value)); } - return; } else if (!strcmp(name, "composite")) @@ -1531,7 +1525,6 @@ static void nxagentParseSingleOption(char *name, char *value) } *argv[0] = '-'; - memcpy(argv[0] + 1, name, size); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 72ca6ac64..f0cef595c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1251,10 +1251,12 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) 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 == FOR_REMOTE && targetCache[index].forRemote) { XlibAtom *targets = targetCache[index].forRemote; @@ -1373,7 +1375,7 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) } /* - * Selete property before sending the request to the client as + * Delete property before sending the request to the client as * required by ICCCM. */ DeleteProperty(lastSelectionOwner[index].windowPtr, clientCutProperty); @@ -1389,8 +1391,10 @@ void nxagentHandleSelectionRequestFromXServer(XEvent *X) 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. */ + /* + * No reply to the Xserver yet - we will do that once the answer + * of the above sendEventToClient arrives. + */ } else { @@ -1492,7 +1496,7 @@ static void transferSelectionFromXServer(int index, int resource) } else { - /* Collect the property and store it with index "resource" */ + /* Collect the property and store it with index "free_resource" */ result = NXCollectProperty(nxagentDisplay, free_resource, serverWindow, @@ -1581,8 +1585,10 @@ static void transferSelectionFromXServer(int index, int resource) 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 */ + /* + * 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); break; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 4e48f62f5..710bfba80 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -1,10 +1,9 @@ #include <Server.tmpl> - NULL = SUBDIRS = compext \ - $(NULL) + $(NULL) SRCS = \ NXwindow.c \ @@ -17,9 +16,9 @@ SRCS = \ NXglyph.c \ NXpicture.c \ NXshm.c \ - NXglxext.c \ - NXxvdisp.c \ - NXresource.c \ + NXglxext.c \ + NXxvdisp.c \ + NXresource.c \ NXmitrap.c \ Args.c \ Binder.c \ @@ -73,9 +72,9 @@ OBJS = \ NXglyph.o \ NXpicture.o \ NXshm.o \ - NXglxext.o \ - NXxvdisp.o \ - NXresource.o \ + NXglxext.o \ + NXxvdisp.o \ + NXresource.o \ NXmitrap.o \ Args.o \ Binder.o \ @@ -240,26 +239,26 @@ NX_DEFINES = \ #endif DEFINES = \ - -g $(OS_DEFINES) $(EXT_DEFINES) $(NX_DEFINES) \ - -UXF86VIDMODE -UXFreeXDGA -UXF86MISC -UXF86DRI \ - -DNXAGENT_SERVER \ - -DNXAGENT_RENDER_CLEANUP \ - -DNXAGENT_FIXKEYS \ - -DNXAGENT_CLIPBOARD \ - -DNXAGENT_WAKEUP=1000 \ - -DNXAGENT_ONSTART \ - -DNXAGENT_ARTSD \ - -UNX_DEBUG_INPUT \ - -DRANDR_10_INTERFACE=1 \ - -DRANDR_12_INTERFACE=1 \ - -DRANDR_13_INTERFACE=1 \ - -DRANDR_14_INTERFACE=1 \ - -DRANDR_15_INTERFACE=1 \ - -DPANORAMIX \ - -UDEBUG_TREE \ - -DX2GO \ - -DSYSTEMFONTDIR=\"$(SYSTEMFONTDIR)\" \ - $(NULL) + -g $(OS_DEFINES) $(EXT_DEFINES) $(NX_DEFINES) \ + -UXF86VIDMODE -UXFreeXDGA -UXF86MISC -UXF86DRI \ + -DNXAGENT_SERVER \ + -DNXAGENT_RENDER_CLEANUP \ + -DNXAGENT_FIXKEYS \ + -DNXAGENT_CLIPBOARD \ + -DNXAGENT_WAKEUP=1000 \ + -DNXAGENT_ONSTART \ + -DNXAGENT_ARTSD \ + -UNX_DEBUG_INPUT \ + -DRANDR_10_INTERFACE=1 \ + -DRANDR_12_INTERFACE=1 \ + -DRANDR_13_INTERFACE=1 \ + -DRANDR_14_INTERFACE=1 \ + -DRANDR_15_INTERFACE=1 \ + -DPANORAMIX \ + -UDEBUG_TREE \ + -DX2GO \ + -DSYSTEMFONTDIR=\"$(SYSTEMFONTDIR)\" \ + $(NULL) all:: $(OBJS) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 31b8b68a3..7998f35f0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -375,7 +375,7 @@ FIXME: We'll check for ReparentNotify and LeaveNotify events after XEvent e; #ifdef TEST - fprintf(stderr, "%d: WARNING! Going to wait for the ReparentNotify event [%d].\n", __func__, i); + fprintf(stderr, "%s: WARNING! Going to wait for the ReparentNotify event [%d].\n", __func__, i); #endif if (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, ReparentNotify, &e)) @@ -988,7 +988,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) nxagentChangeOption(Fullscreen, False); nxagentChangeOption(AllScreens, False); - nxagentFullscreenWindow = 0; + nxagentFullscreenWindow = None; resetAgentPosition = True; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 6f98ee57b..b2560a660 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -2579,7 +2579,7 @@ void nxagentMapDefaultWindows(void) * Ensure that the fullscreen window gets the focus. */ - if (nxagentFullscreenWindow != 0) + if (nxagentFullscreenWindow != None) { XSetInputFocus(nxagentDisplay, nxagentFullscreenWindow, RevertToParent, CurrentTime); diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/compext/Imakefile index 407baab80..ea34def78 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Imakefile @@ -30,16 +30,16 @@ OBJS = \ Z.o \ $(NULL) - INCLUDES = -I$(SERVERSRC)/include \ - -I$(XBUILDINCDIR) \ - -I../../../../../lib/include/X11 \ - `pkg-config --cflags-only-I pixman-1` \ - $$(pkg-config --exists 'zlib' >/dev/null 2>&1 && pkg-config --cflags-only-I 'zlib') \ - `pkg-config --cflags-only-I libpng` \ - $(NULL) +INCLUDES = -I$(SERVERSRC)/include \ + -I$(XBUILDINCDIR) \ + -I../../../../../lib/include/X11 \ + `pkg-config --cflags-only-I pixman-1` \ + $$(pkg-config --exists 'zlib' >/dev/null 2>&1 && pkg-config --cflags-only-I 'zlib') \ + `pkg-config --cflags-only-I libpng` \ + $(NULL) - LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln \ - $(NULL) +LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln \ + $(NULL) NormalLibraryObjectRule() NormalLibraryTarget(compext,$(OBJS)) diff --git a/nxdialog/bin/nxdialog b/nxdialog/bin/nxdialog index ab0dbf17f..4ef19dffc 100755 --- a/nxdialog/bin/nxdialog +++ b/nxdialog/bin/nxdialog @@ -8,7 +8,7 @@ # shebang line. # Copyright (C) 2008 Google Inc. -# Copyright (C) 2019 Ulrich Sibiller <uli42@gmx.de> +# Copyright (C) 2019-2021 Ulrich Sibiller <uli42@gmx.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,13 +29,13 @@ # Google project "neatx" (https://code.google.com/archive/p/neatx/). # List of changes: # - pulled in the few parts of the neatx python modules that are actually -# to make it a standlone script +# required to make it a standlone script # - added usage output # - dropped logging code, print errors to stderr # - can handle the "yesno" dialog type # - added missing docstrings # - pylint improvements -# - removed neatx entry from the pulldoww menu +# - removed neatx entry from the pulldown menu # - use PyGObject instead of PyGtk and thus Gtk3 # - replace optparse by argparse # - make code compatible to python2 and python3. @@ -46,11 +46,8 @@ # nxcomp library assumes this script is located in /usr/NX/bin/nxclient # # 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 -# -# pylint: disable=fixme, broad-except +# nxdialog --dialog yesno --message "text" --caption "title" --parent 0 +# nxdialog --dialog pulldown --message "text" --caption "title" --window 0x123456 --parent 0 from __future__ import print_function @@ -293,7 +290,7 @@ class NxDialogProgram(object): raise except Exception as expt: - sys.stderr.write("Caught exception: %s\n" % (expt)) + sys.stderr.write("Caught exception: %s" % (expt) + os.linesep) sys.exit(EXIT_FAILURE) @staticmethod @@ -366,23 +363,23 @@ class NxDialogProgram(object): """ Disconnect/terminate NX session upon user's request. """ if not self.options.dialog_type: - sys.stderr.write("Dialog type not supplied via --dialog\n") + sys.stderr.write("Dialog type not supplied via --dialog" + os.linesep) sys.exit(EXIT_FAILURE) dlgtype = self.options.dialog_type if dlgtype not in VALID_DLG_TYPES: - sys.stderr.write("Invalid dialog type '%s'\n" % (dlgtype)) + sys.stderr.write("Invalid dialog type '%s'" % (dlgtype) + os.linesep) sys.exit(EXIT_FAILURE) if dlgtype in (DLG_TYPE_PULLDOWN, DLG_TYPE_YESNOSUSPEND, DLG_TYPE_YESNO) and self.options.agentpid is None: - sys.stderr.write("Agent pid not supplied via --parent\n") + sys.stderr.write("Agent pid not supplied via --parent" + os.linesep) sys.exit(EXIT_FAILURE) if dlgtype == DLG_TYPE_PULLDOWN and not self.options.window: - sys.stderr.write("Window id not supplied via --window\n") + sys.stderr.write("Window id not supplied via --window" + os.linesep) sys.exit(EXIT_FAILURE) if self.options.caption: @@ -400,5 +397,4 @@ class NxDialogProgram(object): self.show_dialog(message_caption, message_text) - NxDialogProgram().main() |