summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2013-07-02 15:56:11 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2013-07-06 11:30:33 +0100
commit4aae26152d38ea933442f3d103086644d81cc8e9 (patch)
tree5c97b623c079230e7d7a1cc9ef65087a105709ea
parent40578efeec58d6b4df9089f4252fb56abb92c449 (diff)
Add -noshm command line option to turn off SHM
Add -noshm command line option to turn off SHM for testing and performance evaluation.
-rw-r--r--man/xtow.man2
-rw-r--r--src/main.c17
2 files changed, 17 insertions, 2 deletions
diff --git a/man/xtow.man b/man/xtow.man
index debbe3c..b41963b 100644
--- a/man/xtow.man
+++ b/man/xtow.man
@@ -25,6 +25,8 @@ supported.
.TP 8
.B \-blur
If DWM is available, use the glass effect to blur the image beneath transparent areas.
+.B \-noshm
+Do not use MIT-SHM to transfer window images from the X server, even if available.
.SH "WINDOW PROPERTIES"
Partial conformance to ICCCM and EWMH standards.
diff --git a/src/main.c b/src/main.c
index 5c4ccbf..131ffaa 100644
--- a/src/main.c
+++ b/src/main.c
@@ -121,10 +121,11 @@ static void
help(void)
{
fprintf(stderr, "usage: xtow [options]\n");
- fprintf(stderr, "--nodwm do not use DWM, even if available\n");
fprintf(stderr, "--blur use glass effect to blur the image beneath transparent areas\n");
fprintf(stderr, "--display dpy display to manage windows on\n");
fprintf(stderr, "--help\n");
+ fprintf(stderr, "--nodwm do not use DWM, even if available\n");
+ fprintf(stderr, "--noshm do not use SHM, even if available\n");
exit(0);
}
@@ -139,6 +140,7 @@ int main(int argc, char **argv)
{
char *screen = NULL;
int nodwm = 0;
+ int noshm = 0;
while (1)
{
@@ -149,6 +151,7 @@ int main(int argc, char **argv)
{ "help", no_argument, 0, 'h' },
{ "blur", no_argument, 0, 'b' },
{ "nodwm", no_argument, 0, 'n' },
+ { "noshm", no_argument, 0, 's' },
{0, 0, 0, 0 },
};
@@ -169,6 +172,9 @@ int main(int argc, char **argv)
case 'n':
nodwm = 1;
break;
+ case 's':
+ noshm = 1;
+ break;
case 'v':
version();
break;
@@ -203,8 +209,15 @@ int main(int argc, char **argv)
pDwmEnableBlurBehindWindow = NULL;
}
+ xcwm_context_flags_t flags = 0;
+ if (noshm)
+ {
+ fprintf(stderr, "Use of MIT-SHM disabled by --noshm option\n");
+ flags = XCWM_DISABLE_SHM;
+ }
+
// create the global xcwm context
- context = xcwm_context_open(screen);
+ context = xcwm_context_open(screen, flags);
if (!context)
{
fprintf(stderr, "Could not create xcwm context\n");