summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorFabian Schillinger2010-11-01 17:35:27 +0100
committerFabian Schillinger2010-11-01 17:35:27 +0100
commitea3fb17345e5f82db9f2e98a8062e95797700ace (patch)
tree1da0d1a8ec9455364386af78762d0f6fed187824 /src/util
parentProcess start/stop/view functionality (diff)
parent[PVSGUI] No X required for --help and --version (diff)
downloadpvs-ea3fb17345e5f82db9f2e98a8062e95797700ace.tar.gz
pvs-ea3fb17345e5f82db9f2e98a8062e95797700ace.tar.xz
pvs-ea3fb17345e5f82db9f2e98a8062e95797700ace.zip
Merge branch 'master' of openslx.org:pvs
Conflicts: CMakeLists.txt src/core/pvsConnectionManager.cpp src/pvs.cpp src/pvs.h
Diffstat (limited to 'src/util')
-rw-r--r--src/util/clientGUIUtils.cpp3
-rwxr-xr-xsrc/util/clientGUIUtils.h12
-rwxr-xr-xsrc/util/clientGUIUtils_X11.cpp11
3 files changed, 24 insertions, 2 deletions
diff --git a/src/util/clientGUIUtils.cpp b/src/util/clientGUIUtils.cpp
index 4d4cc0d..ff002d3 100644
--- a/src/util/clientGUIUtils.cpp
+++ b/src/util/clientGUIUtils.cpp
@@ -2,7 +2,7 @@
BlankScreen::BlankScreen()
{
- dpy = XOpenDisplay(NULL);
+ dpy = X11Info::display();
scr = DefaultScreen(dpy);
assert(dpy);
blackColor = BlackPixel(dpy, DefaultScreen(dpy));
@@ -142,3 +142,4 @@ bool BlankScreen::unlock()
lockMsg.clear();
return !(locked = false);
}
+
diff --git a/src/util/clientGUIUtils.h b/src/util/clientGUIUtils.h
index b04d3fe..7f7ea47 100755
--- a/src/util/clientGUIUtils.h
+++ b/src/util/clientGUIUtils.h
@@ -25,4 +25,14 @@ private:
BlankScreen_Sysdep* _sysdep;
};
-#endif \ No newline at end of file
+#ifndef __WIN32__
+# include <X11/Xlib.h>
+
+class X11Info
+{
+public:
+ static Display* display();
+};
+#endif /* !__WIN32__ */
+
+#endif
diff --git a/src/util/clientGUIUtils_X11.cpp b/src/util/clientGUIUtils_X11.cpp
index 29c96f0..4b5afe0 100755
--- a/src/util/clientGUIUtils_X11.cpp
+++ b/src/util/clientGUIUtils_X11.cpp
@@ -166,3 +166,14 @@ bool BlankScreen::unlock()
_sysdep->lockMsg.clear();
return !(_sysdep->locked = false);
}
+
+static Display* _dpy = 0;
+
+Display* X11Info::display()
+{
+ if(!_dpy)
+ {
+ _dpy = XOpenDisplay(0);
+ }
+ return _dpy;
+}