summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-22 15:00:46 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-22 15:00:46 +0000
commit39cbe41d48e27c19821c048b4d5d461cf1b8faa8 (patch)
tree01c2e84b45505b9b261cb8dcf8baf529be9d4118 /ui
parente071c44a96a1ad7733c87c42f35a706973cb2afc (diff)
downloadchromium_src-39cbe41d48e27c19821c048b4d5d461cf1b8faa8.zip
chromium_src-39cbe41d48e27c19821c048b4d5d461cf1b8faa8.tar.gz
chromium_src-39cbe41d48e27c19821c048b4d5d461cf1b8faa8.tar.bz2
Consolidate access to X Display
Change ui::GetXDisplay to use the MessagePumpForUI class to get Display. This allows us to have two different implementation for x and gtk. Remove MessageLoop::GetDisplay from message loop API. Client should use ui::GetXDisplay instead. This will also be removed in near future, and client should get display from window it is dealing with. BUG=none TEST=none Review URL: http://codereview.chromium.org/7484006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93629 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/base/x/x11_util.cc8
-rw-r--r--ui/base/x/x11_util.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index 51f52e2..d7d51cf 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -20,6 +20,7 @@
#include "base/command_line.h"
#include "base/logging.h"
+#include "base/message_loop.h"
#include "base/stringprintf.h"
#include "base/string_number_conversions.h"
#include "base/threading/thread.h"
@@ -96,12 +97,7 @@ bool XDisplayExists() {
}
Display* GetXDisplay() {
- static Display* display = NULL;
-
- if (!display)
- display = gdk_x11_get_default_xdisplay();
-
- return display;
+ return base::MessagePumpForUI::GetDefaultXDisplay();
}
static SharedMemorySupport DoQuerySharedMemorySupport(Display* dpy) {
diff --git a/ui/base/x/x11_util.h b/ui/base/x/x11_util.h
index ab455a0..6728c1e 100644
--- a/ui/base/x/x11_util.h
+++ b/ui/base/x/x11_util.h
@@ -39,6 +39,10 @@ namespace ui {
// Check if there's an open connection to an X server.
UI_API bool XDisplayExists();
// Return an X11 connection for the current, primary display.
+
+// TODO(oshima|evan): This assume there is one display and dosn't work
+// undef mutiple displays/monitor environment. Remove this and change the
+// chrome codebase to get the display from window.
UI_API Display* GetXDisplay();
// X shared memory comes in three flavors: