Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: ui/gfx/x/x11_types.cc

Issue 297983005: linux_aura: Bail early if we can't connect to the X11 server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to TOT and resolve conflicts. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/x/x11_types.h ('k') | ui/gl/gl_surface_glx.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/x/x11_types.cc
diff --git a/ui/gfx/x/x11_types.cc b/ui/gfx/x/x11_types.cc
index 6c4f62db989be3c6946efea4119f51c2532f8ff1..54a0816c65236121dd6852a21a87777f03b43efb 100644
--- a/ui/gfx/x/x11_types.cc
+++ b/ui/gfx/x/x11_types.cc
@@ -6,17 +6,29 @@
#include <X11/Xlib.h>
+#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
+#include "ui/gfx/x/x11_switches.h"
namespace gfx {
XDisplay* GetXDisplay() {
static XDisplay* display = NULL;
if (!display)
- display = XOpenDisplay(NULL);
+ display = OpenNewXDisplay();
return display;
}
+XDisplay* OpenNewXDisplay() {
+#if defined(OS_CHROMEOS)
+ return XOpenDisplay(NULL);
+#else
+ std::string display_str = base::CommandLine::ForCurrentProcess()->
+ GetSwitchValueASCII(switches::kX11Display);
+ return XOpenDisplay(display_str.empty() ? NULL : display_str.c_str());
+#endif
+}
+
void PutARGBImage(XDisplay* display,
void* visual, int depth,
XID pixmap, void* pixmap_gc,
« no previous file with comments | « ui/gfx/x/x11_types.h ('k') | ui/gl/gl_surface_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698