Disabling RECORD by default

Keith Packard keithp at keithp.com
Mon Nov 23 15:31:09 PST 2015


Alan Coopersmith <alan.coopersmith at oracle.com> writes:

> Do we need to actually add specific +record & -record flags instead of just
> using the generic +extension RECORD and -extension RECORD flags?

Probably not.

From 528587382afb002e3efc8638e53fa4db77161307 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] Allow RECORD and XTEST to be controlled separately
 [v2]

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)

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/xquartz/X11Application.m |  8 ++++----
 include/globals.h           |  5 ++++-
 mi/miinitext.c              |  9 ++++++---
 os/utils.c                  | 10 +++++++---
 4 files changed, 21 insertions(+), 11 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/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 c4d013b..a09440e 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -122,7 +122,11 @@ __stdcall unsigned long GetTickCount(void);
 
 #include "picture.h"
 
-Bool noTestExtensions;
+Bool noXTestExtension;
+
+#ifdef XRECORD
+Bool noRecordExtension = TRUE;
+#endif
 
 #ifdef COMPOSITE
 Bool noCompositeExtension = FALSE;
@@ -574,7 +578,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");
@@ -947,7 +951,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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20151123/27006bec/attachment.sig>


More information about the xorg-devel mailing list