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 <X11/cursorfont.h> | 7 #include <X11/cursorfont.h> |
8 #include <X11/extensions/Xfixes.h> | 8 #include <X11/extensions/Xfixes.h> |
9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
10 #include <X11/extensions/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 p.SetPoint(0, 0); | 504 p.SetPoint(0, 0); |
505 XWarpPointer( | 505 XWarpPointer( |
506 xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y()); | 506 xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y()); |
507 } | 507 } |
508 ConfineCursorToRootWindow(); | 508 ConfineCursorToRootWindow(); |
509 } | 509 } |
510 if (size_changed) | 510 if (size_changed) |
511 delegate_->OnHostResized(bounds.size()); | 511 delegate_->OnHostResized(bounds.size()); |
512 if (origin_changed) | 512 if (origin_changed) |
513 delegate_->OnHostMoved(bounds_.origin()); | 513 delegate_->OnHostMoved(bounds_.origin()); |
| 514 #if defined(OS_CHROMEOS) |
| 515 // TODO(oshima): Clear the root when the window is moved or |
| 516 // resized while the extended desktop is disabled. |
| 517 // crbug.com/152003. |
| 518 if (base::chromeos::IsRunningOnChromeOS()) { |
| 519 XGCValues gc_values = {0}; |
| 520 gc_values.foreground = BlackPixel(xdisplay_, DefaultScreen(xdisplay_)); |
| 521 GC gc = XCreateGC(xdisplay_, x_root_window_, GCForeground, &gc_values); |
| 522 XFillRectangle(xdisplay_, x_root_window_, gc, |
| 523 x_root_bounds_.x(), |
| 524 x_root_bounds_.y(), |
| 525 x_root_bounds_.width(), |
| 526 x_root_bounds_.height()); |
| 527 XFreeGC(xdisplay_, gc); |
| 528 } |
| 529 #endif |
514 break; | 530 break; |
515 } | 531 } |
516 case GenericEvent: | 532 case GenericEvent: |
517 DispatchXI2Event(event); | 533 DispatchXI2Event(event); |
518 break; | 534 break; |
519 case MapNotify: { | 535 case MapNotify: { |
520 // If there's no window manager running, we need to assign the X input | 536 // If there's no window manager running, we need to assign the X input |
521 // focus to our host window. | 537 // focus to our host window. |
522 if (!IsWindowManagerPresent() && focus_when_shown_) | 538 if (!IsWindowManagerPresent() && focus_when_shown_) |
523 XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime); | 539 XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime); |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostLinuxKey)); | 1035 ui::ViewProp::GetValue(accelerated_widget, kRootWindowHostLinuxKey)); |
1020 } | 1036 } |
1021 | 1037 |
1022 // static | 1038 // static |
1023 gfx::Size RootWindowHost::GetNativeScreenSize() { | 1039 gfx::Size RootWindowHost::GetNativeScreenSize() { |
1024 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); | 1040 ::Display* xdisplay = base::MessagePumpAuraX11::GetDefaultXDisplay(); |
1025 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 1041 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
1026 } | 1042 } |
1027 | 1043 |
1028 } // namespace aura | 1044 } // namespace aura |
OLD | NEW |