OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/root_window_host_linux.h" | 5 #include "ui/aura/root_window_host_linux.h" |
6 | 6 |
7 #include <strings.h> | 7 #include <strings.h> |
8 #include <X11/cursorfont.h> | 8 #include <X11/cursorfont.h> |
9 #include <X11/extensions/Xfixes.h> | 9 #include <X11/extensions/Xfixes.h> |
10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 atom_cache_.GetAtom("_NET_WM_PID"), | 322 atom_cache_.GetAtom("_NET_WM_PID"), |
323 XA_CARDINAL, | 323 XA_CARDINAL, |
324 32, | 324 32, |
325 PropModeReplace, | 325 PropModeReplace, |
326 reinterpret_cast<unsigned char*>(&pid), 1); | 326 reinterpret_cast<unsigned char*>(&pid), 1); |
327 | 327 |
328 // crbug.com/120229 - set the window title so gtalk can find the primary root | 328 // crbug.com/120229 - set the window title so gtalk can find the primary root |
329 // window to broadcast. | 329 // window to broadcast. |
330 // TODO(jhorwich) Remove this once Chrome supports window-based broadcasting. | 330 // TODO(jhorwich) Remove this once Chrome supports window-based broadcasting. |
331 static int root_window_number = 0; | 331 static int root_window_number = 0; |
332 std::string name = StringPrintf("aura_root_%d", root_window_number++); | 332 std::string name = base::StringPrintf("aura_root_%d", root_window_number++); |
333 XStoreName(xdisplay_, xwindow_, name.c_str()); | 333 XStoreName(xdisplay_, xwindow_, name.c_str()); |
334 XRRSelectInput(xdisplay_, x_root_window_, | 334 XRRSelectInput(xdisplay_, x_root_window_, |
335 RRScreenChangeNotifyMask | RROutputChangeNotifyMask); | 335 RRScreenChangeNotifyMask | RROutputChangeNotifyMask); |
336 Env::GetInstance()->AddObserver(this); | 336 Env::GetInstance()->AddObserver(this); |
337 } | 337 } |
338 | 338 |
339 RootWindowHostLinux::~RootWindowHostLinux() { | 339 RootWindowHostLinux::~RootWindowHostLinux() { |
340 Env::GetInstance()->RemoveObserver(this); | 340 Env::GetInstance()->RemoveObserver(this); |
341 base::MessagePumpAuraX11::Current()->RemoveDispatcherForRootWindow(this); | 341 base::MessagePumpAuraX11::Current()->RemoveDispatcherForRootWindow(this); |
342 base::MessagePumpAuraX11::Current()->RemoveDispatcherForWindow(xwindow_); | 342 base::MessagePumpAuraX11::Current()->RemoveDispatcherForWindow(xwindow_); |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 return new RootWindowHostLinux(bounds); | 1049 return new RootWindowHostLinux(bounds); |
1050 } | 1050 } |
1051 | 1051 |
1052 // static | 1052 // static |
1053 gfx::Size RootWindowHost::GetNativeScreenSize() { | 1053 gfx::Size RootWindowHost::GetNativeScreenSize() { |
1054 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); | 1054 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); |
1055 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 1055 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
1056 } | 1056 } |
1057 | 1057 |
1058 } // namespace aura | 1058 } // namespace aura |
OLD | NEW |