From 04ae78ac9b4c649e2069bcb538f8209ff35cf8df Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 7 Jan 2013 12:41:16 +0000 Subject: [PATCH] Added support for --show-cursor and --hide-cursor command line options, and P3D_SHOW_CURSOR env var that can be set to YES or NO. --- applications/present3D/present3D.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index 98654e1fb..8760e7069 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -539,6 +539,12 @@ int main( int argc, char **argv ) std::string cursorFileName( p3dCursor ? p3dCursor : ""); while (arguments.read("--cursor",cursorFileName)) {} + const char* p3dShowCursor = getenv("P3D_SHOW_CURSOR"); + std::string showCursor( p3dShowCursor ? p3dShowCursor : "YES"); + while (arguments.read("--show-cursor")) { showCursor="YES"; } + while (arguments.read("--hide-cursor")) { showCursor="NO"; } + + bool hideCursor = (showCursor=="No" || showCursor=="NO" || showCursor=="no"); while (arguments.read("--set-viewer")) { doSetViewer = true; } @@ -836,7 +842,7 @@ int main( int argc, char **argv ) } - if (!cursorFileName.empty()) + if (!cursorFileName.empty() || hideCursor) { // have to add a frame in here to avoid problems with X11 threading issue on switching off the cursor // not yet sure why it makes a difference, but it at least fixes the crash that would otherwise occur