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/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/extensions/Xfixes.h> | 9 #include <X11/extensions/Xfixes.h> |
10 #include <X11/extensions/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 UnConfineCursor(); | 341 UnConfineCursor(); |
342 | 342 |
343 XDestroyWindow(xdisplay_, xwindow_); | 343 XDestroyWindow(xdisplay_, xwindow_); |
344 | 344 |
345 // Clears XCursorCache. | 345 // Clears XCursorCache. |
346 ui::GetXCursor(ui::kCursorClearXCursorCache); | 346 ui::GetXCursor(ui::kCursorClearXCursorCache); |
347 | 347 |
348 XFreeCursor(xdisplay_, invisible_cursor_); | 348 XFreeCursor(xdisplay_, invisible_cursor_); |
349 } | 349 } |
350 | 350 |
351 base::MessagePumpDispatcher::DispatchStatus RootWindowHostLinux::Dispatch( | 351 base::DispatchStatus RootWindowHostLinux::Dispatch( |
352 XEvent* xev) { | 352 const base::NativeEvent& event) { |
| 353 XEvent* xev = event; |
353 bool handled = false; | 354 bool handled = false; |
354 | 355 |
355 // See crbug.com/109884. | 356 // See crbug.com/109884. |
356 // CheckXEventForConsistency(xev); | 357 // CheckXEventForConsistency(xev); |
357 | 358 |
358 switch (xev->type) { | 359 switch (xev->type) { |
359 case Expose: | 360 case Expose: |
360 root_window_->ScheduleFullDraw(); | 361 root_window_->ScheduleFullDraw(); |
361 handled = true; | 362 handled = true; |
362 break; | 363 break; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 } else { | 499 } else { |
499 break; | 500 break; |
500 } | 501 } |
501 } | 502 } |
502 | 503 |
503 MouseEvent mouseev(xev); | 504 MouseEvent mouseev(xev); |
504 handled = root_window_->DispatchMouseEvent(&mouseev); | 505 handled = root_window_->DispatchMouseEvent(&mouseev); |
505 break; | 506 break; |
506 } | 507 } |
507 } | 508 } |
508 return handled ? base::MessagePumpDispatcher::EVENT_PROCESSED : | 509 return handled ? base::EVENT_PROCESSED : base::EVENT_IGNORED; |
509 base::MessagePumpDispatcher::EVENT_IGNORED; | |
510 } | 510 } |
511 | 511 |
512 void RootWindowHostLinux::SetRootWindow(RootWindow* root_window) { | 512 void RootWindowHostLinux::SetRootWindow(RootWindow* root_window) { |
513 root_window_ = root_window; | 513 root_window_ = root_window; |
514 } | 514 } |
515 | 515 |
516 gfx::AcceleratedWidget RootWindowHostLinux::GetAcceleratedWidget() { | 516 gfx::AcceleratedWidget RootWindowHostLinux::GetAcceleratedWidget() { |
517 return xwindow_; | 517 return xwindow_; |
518 } | 518 } |
519 | 519 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 return new RootWindowHostLinux(bounds); | 709 return new RootWindowHostLinux(bounds); |
710 } | 710 } |
711 | 711 |
712 // static | 712 // static |
713 gfx::Size RootWindowHost::GetNativeScreenSize() { | 713 gfx::Size RootWindowHost::GetNativeScreenSize() { |
714 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); | 714 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); |
715 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 715 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
716 } | 716 } |
717 | 717 |
718 } // namespace aura | 718 } // namespace aura |
OLD | NEW |