| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/desktop_host.h" | 5 #include "ui/aura/desktop_host.h" |
| 6 | 6 |
| 7 #include <X11/cursorfont.h> | 7 #include <X11/cursorfont.h> |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 | 9 |
| 10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 } | 359 } |
| 360 | 360 |
| 361 base::MessagePumpDispatcher::DispatchStatus DesktopHostLinux::Dispatch( | 361 base::MessagePumpDispatcher::DispatchStatus DesktopHostLinux::Dispatch( |
| 362 XEvent* xev) { | 362 XEvent* xev) { |
| 363 bool handled = false; | 363 bool handled = false; |
| 364 | 364 |
| 365 CheckXEventForConsistency(xev); | 365 CheckXEventForConsistency(xev); |
| 366 | 366 |
| 367 switch (xev->type) { | 367 switch (xev->type) { |
| 368 case Expose: | 368 case Expose: |
| 369 desktop_->Draw(); | 369 desktop_->ScheduleDraw(); |
| 370 handled = true; | 370 handled = true; |
| 371 break; | 371 break; |
| 372 case KeyPress: { | 372 case KeyPress: { |
| 373 KeyEvent keydown_event(xev, false); | 373 KeyEvent keydown_event(xev, false); |
| 374 handled = desktop_->DispatchKeyEvent(&keydown_event); | 374 handled = desktop_->DispatchKeyEvent(&keydown_event); |
| 375 if (ShouldSendCharEventForKeyboardCode(keydown_event.key_code())) { | 375 if (ShouldSendCharEventForKeyboardCode(keydown_event.key_code())) { |
| 376 KeyEvent char_event(xev, true); | 376 KeyEvent char_event(xev, true); |
| 377 handled |= desktop_->DispatchKeyEvent(&char_event); | 377 handled |= desktop_->DispatchKeyEvent(&char_event); |
| 378 } | 378 } |
| 379 break; | 379 break; |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 return new DesktopHostLinux(bounds); | 609 return new DesktopHostLinux(bounds); |
| 610 } | 610 } |
| 611 | 611 |
| 612 // static | 612 // static |
| 613 gfx::Size DesktopHost::GetNativeScreenSize() { | 613 gfx::Size DesktopHost::GetNativeScreenSize() { |
| 614 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); | 614 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); |
| 615 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 615 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
| 616 } | 616 } |
| 617 | 617 |
| 618 } // namespace aura | 618 } // namespace aura |
| OLD | NEW |