kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=096316b47634077f1f97d7191622753d22616764

commit 096316b47634077f1f97d7191622753d22616764
Author: Kim Woelders <k...@woelders.dk>
Date:   Mon Feb 5 17:09:47 2018 +0100

    Introduce IMLIB2_SHM_OPT to enable overriding/testing SHM modes
---
 src/lib/ximage.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/lib/ximage.c b/src/lib/ximage.c
index 46b7eee..e54c7c2 100644
--- a/src/lib/ximage.c
+++ b/src/lib/ximage.c
@@ -44,6 +44,9 @@ TmpXError(Display * d, XErrorEvent * ev)
 static void
 ShmCheck(Display * d)
 {
+   const char         *s;
+   int                 val;
+
    /* if its there set x_does_shm flag */
    if (XShmQueryExtension(d))
      {
@@ -63,6 +66,21 @@ ShmCheck(Display * d)
    else
      {
         x_does_shm = 0;
+        return;
+     }
+
+   /* Modify SHM handling if requested */
+   s = getenv("IMLIB2_SHM_OPT");
+   if (s)
+     {
+        val = atoi(s);
+        if (val == 0)
+           x_does_shm = x_does_shm_fd = 0;      /* Disable SHM entirely */
+        else if (val == 1)
+           x_does_shm_fd = 0;   /* Disable SHM-FD */
+
+        printf("%s: x_does_shm=%d x_does_shm_fd=%d\n", __func__,
+               x_does_shm, x_does_shm_fd);
      }
 }
 

-- 


Reply via email to