Disabling RECORD by default

Peter Hutterer peter.hutterer at who-t.net
Tue Dec 1 20:31:15 PST 2015


On Mon, Nov 23, 2015 at 04:28:08PM -0800, Keith Packard wrote:
> Alan Coopersmith <alan.coopersmith at oracle.com> writes:
> 
> > You need to make a similar update to xserver/man/Xserver.man, which
> > currently says:
> >
> >         -tst    disables all testing extensions (e.g., XTEST,  XTrap,  XTestEx-
> >                 tension1, RECORD).
> 
> Changed to:
> 
> .TP 8
> .B \-tst
> disables XTEST extension.

disable _the_ XTEST extension? in at least two places. One comment, just to
be annoying: I'd prefer this split in two patches, with the second one just
toggling the true/false switch for RECORD and having the git subject line of
"Disable RECORD by default". Makes it much easier to find in the log than
hiding it in the first paragraph.
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net> otherwise

but note that syndaemon is a common user of RECORD, if it is disabled we
fall back to regular querying of the keyboard state with all its
drawbacks (unnecessary wakeups, missing of some key events, etc.)

with the two other patches you're breaking the backup option, so anyone not
using libinput will lose the disable-while-typing feature.

Cheers,
   Peter

> From ff5b0d12391932b13cd93fddc802a01bd5e52f2b Mon Sep 17 00:00:00 2001
> From: Keith Packard <keithp at keithp.com>
> Date: Mon, 23 Nov 2015 14:49:33 -0800
> Subject: [PATCH xserver 2/3] Allow RECORD and XTEST to be controlled
>  separately [v3]
> 
> RECORD and XTEST were both controlled by the -tst server option and
> XTEST extension selection. Split these out and then make RECORD be
> disabled by default.
> 
> [v2] Remove -record/+record options (Alan Coopersmith)
> [v3] Update man page description of -tst option (Alan Coopersmith)
> 
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
>  hw/xquartz/X11Application.m |  8 ++++----
>  include/globals.h           |  5 ++++-
>  man/Xserver.man             |  2 +-
>  mi/miinitext.c              |  9 ++++++---
>  os/utils.c                  | 10 +++++++---
>  5 files changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
> index d2c5d30..1348480 100644
> --- a/hw/xquartz/X11Application.m
> +++ b/hw/xquartz/X11Application.m
> @@ -82,7 +82,7 @@ static dispatch_queue_t eventTranslationQueue;
>  #endif
>  #endif
>  
> -extern Bool noTestExtensions;
> +extern Bool noXTestExtension;
>  extern Bool noRenderExtension;
>  extern BOOL serverRunning;
>  
> @@ -901,7 +901,7 @@ cfarray_to_nsarray(CFArrayRef in)
>      darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH
>                            default               :darwinDesiredDepth];
>  
> -    noTestExtensions = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
> +    noXTestExtension = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS
>                           default               :FALSE];
>  
>      noRenderExtension = ![self prefs_get_boolean:@PREFS_RENDER_EXTENSION
> @@ -1592,7 +1592,7 @@ handle_mouse:
>              }
>          }
>  
> -        if (!XQuartzServerVisible && noTestExtensions) {
> +        if (!XQuartzServerVisible && noXTestExtension) {
>  #if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
>              /* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */
>              xp_window_id wid = 0;
> @@ -1695,7 +1695,7 @@ handle_mouse:
>          /* If we're in the background, we need to send a MotionNotify event
>           * first, since we aren't getting them on background mouse motion
>           */
> -        if (!XQuartzServerVisible && noTestExtensions) {
> +        if (!XQuartzServerVisible && noXTestExtension) {
>              bgMouseLocationUpdated = FALSE;
>              DarwinSendPointerEvents(darwinPointer, MotionNotify, 0,
>                                      location.x, location.y,
> diff --git a/include/globals.h b/include/globals.h
> index 858c9a3..42f21ce 100644
> --- a/include/globals.h
> +++ b/include/globals.h
> @@ -23,7 +23,10 @@ extern _X_EXPORT int monitorResolution;
>  extern _X_EXPORT int defaultColorVisualClass;
>  
>  extern _X_EXPORT int GrabInProgress;
> -extern _X_EXPORT Bool noTestExtensions;
> +extern _X_EXPORT Bool noXTestExtension;
> +#ifdef XRECORD
> +extern _X_EXPORT Bool noRecordExtension;
> +#endif
>  extern _X_EXPORT char *SeatId;
>  extern _X_EXPORT char *ConnectionInfo;
>  extern _X_EXPORT sig_atomic_t inSignalContext;
> diff --git a/man/Xserver.man b/man/Xserver.man
> index 506e5bb..55a8d5b 100644
> --- a/man/Xserver.man
> +++ b/man/Xserver.man
> @@ -278,7 +278,7 @@ command line option.
>  sets default connection timeout in seconds.
>  .TP 8
>  .B \-tst
> -disables all testing extensions (e.g., XTEST, XTrap, XTestExtension1, RECORD).
> +disables XTEST extension.
>  .TP 8
>  .B tty\fIxx\fP
>  ignored, for servers started the ancient way (from init).
> diff --git a/mi/miinitext.c b/mi/miinitext.c
> index 5fc44e3..a089a2c 100644
> --- a/mi/miinitext.c
> +++ b/mi/miinitext.c
> @@ -149,6 +149,9 @@ static ExtensionToggle ExtensionToggleList[] = {
>  #ifdef RANDR
>      {"RANDR", &noRRExtension},
>  #endif
> +#ifdef XRECORD
> +    {"RECORD", &noRecordExtension},
> +#endif
>      {"RENDER", &noRenderExtension},
>  #ifdef XCSECURITY
>      {"SECURITY", &noSecurityExtension},
> @@ -179,7 +182,7 @@ static ExtensionToggle ExtensionToggleList[] = {
>  #ifdef XSELINUX
>      {"SELinux", &noSELinuxExtension},
>  #endif
> -    {"XTEST", &noTestExtensions},
> +    {"XTEST", &noXTestExtension},
>  #ifdef XV
>      {"XVideo", &noXvExtension},
>  #endif
> @@ -245,7 +248,7 @@ static const ExtensionModule staticExtensions[] = {
>  #endif
>      {XInputExtensionInit, "XInputExtension", NULL},
>  #ifdef XTEST
> -    {XTestExtensionInit, XTestExtensionName, &noTestExtensions},
> +    {XTestExtensionInit, XTestExtensionName, &noXTestExtension},
>  #endif
>      {BigReqExtensionInit, "BIG-REQUESTS", NULL},
>      {SyncExtensionInit, "SYNC", NULL},
> @@ -285,7 +288,7 @@ static const ExtensionModule staticExtensions[] = {
>      {DbeExtensionInit, "DOUBLE-BUFFER", &noDbeExtension},
>  #endif
>  #ifdef XRECORD
> -    {RecordExtensionInit, "RECORD", &noTestExtensions},
> +    {RecordExtensionInit, "RECORD", &noRecordExtension},
>  #endif
>  #ifdef DPMSExtension
>      {DPMSExtensionInit, DPMSExtensionName, &noDPMSExtension},
> diff --git a/os/utils.c b/os/utils.c
> index b45719e..e72f770 100644
> --- a/os/utils.c
> +++ b/os/utils.c
> @@ -123,7 +123,11 @@ __stdcall unsigned long GetTickCount(void);
>  
>  #include "picture.h"
>  
> -Bool noTestExtensions;
> +Bool noXTestExtension;
> +
> +#ifdef XRECORD
> +Bool noRecordExtension = TRUE;
> +#endif
>  
>  #ifdef COMPOSITE
>  Bool noCompositeExtension = FALSE;
> @@ -575,7 +579,7 @@ UseMsg(void)
>      ErrorF("-t #                   default pointer threshold (pixels/t)\n");
>      ErrorF("-terminate             terminate at server reset\n");
>      ErrorF("-to #                  connection time out\n");
> -    ErrorF("-tst                   disable testing extensions\n");
> +    ErrorF("-tst                   disable XTEST extension\n");
>      ErrorF("ttyxx                  server started from init on /dev/ttyxx\n");
>      ErrorF("v                      video blanking for screen-saver\n");
>      ErrorF("-v                     screen-saver without video blanking\n");
> @@ -948,7 +952,7 @@ ProcessCommandLine(int argc, char *argv[])
>                  UseMsg();
>          }
>          else if (strcmp(argv[i], "-tst") == 0) {
> -            noTestExtensions = TRUE;
> +            noXTestExtension = TRUE;
>          }
>          else if (strcmp(argv[i], "v") == 0)
>              defaultScreenSaverBlanking = PreferBlanking;
> -- 
> 2.6.1
> 
> 
> 
> -- 
> -keith



> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel



More information about the xorg-devel mailing list