From: Michael Schuldt Date: Fri, 8 Jul 2011 09:40:48 +0000 (+0200) Subject: Introducing default display environment, to avoid fail of service startup X-Git-Tag: ivi-layer-management_version_0_9_1~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba3da0e96a26b9a048349e3787c23d79e3d6b547;p=profile%2Fivi%2Flayer-management.git Introducing default display environment, to avoid fail of service startup --- diff --git a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp index d376c11..48f4687 100644 --- a/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp +++ b/LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp @@ -80,7 +80,15 @@ XVisualInfo* X11WindowSystem::getDefaultVisual(Display *dpy) bool X11WindowSystem::OpenDisplayConnection() { - x11Display = XOpenDisplay(":0"); + char* displayEnvironment = getenv("DISPLAY"); + + if (displayEnvironment == NULL ) + { + displayEnvironment = ":0.0"; + setenv("DISPLAY",displayEnvironment,1); + } + + x11Display = XOpenDisplay(displayEnvironment); if (!x11Display) { LOG_ERROR("X11WindowSystem", "Couldn't open default display!");