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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 } | 587 } |
588 | 588 |
589 void RootWindowHostLinux::SetCursor(gfx::NativeCursor cursor) { | 589 void RootWindowHostLinux::SetCursor(gfx::NativeCursor cursor) { |
590 if (cursor == current_cursor_) | 590 if (cursor == current_cursor_) |
591 return; | 591 return; |
592 current_cursor_ = cursor; | 592 current_cursor_ = cursor; |
593 SetCursorInternal(cursor); | 593 SetCursorInternal(cursor); |
594 } | 594 } |
595 | 595 |
596 bool RootWindowHostLinux::QueryMouseLocation(gfx::Point* location_return) { | 596 bool RootWindowHostLinux::QueryMouseLocation(gfx::Point* location_return) { |
| 597 client::CursorClient* cursor_client = |
| 598 client::GetCursorClient(GetRootWindow()); |
| 599 if (cursor_client && !cursor_client->IsMouseEventsEnabled()) { |
| 600 *location_return = gfx::Point(0, 0); |
| 601 return false; |
| 602 } |
| 603 |
597 ::Window root_return, child_return; | 604 ::Window root_return, child_return; |
598 int root_x_return, root_y_return, win_x_return, win_y_return; | 605 int root_x_return, root_y_return, win_x_return, win_y_return; |
599 unsigned int mask_return; | 606 unsigned int mask_return; |
600 XQueryPointer(xdisplay_, | 607 XQueryPointer(xdisplay_, |
601 xwindow_, | 608 xwindow_, |
602 &root_return, | 609 &root_return, |
603 &child_return, | 610 &child_return, |
604 &root_x_return, &root_y_return, | 611 &root_x_return, &root_y_return, |
605 &win_x_return, &win_y_return, | 612 &win_x_return, &win_y_return, |
606 &mask_return); | 613 &mask_return); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 return new RootWindowHostLinux(bounds); | 1002 return new RootWindowHostLinux(bounds); |
996 } | 1003 } |
997 | 1004 |
998 // static | 1005 // static |
999 gfx::Size RootWindowHost::GetNativeScreenSize() { | 1006 gfx::Size RootWindowHost::GetNativeScreenSize() { |
1000 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); | 1007 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); |
1001 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 1008 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
1002 } | 1009 } |
1003 | 1010 |
1004 } // namespace aura | 1011 } // namespace aura |
OLD | NEW |