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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 break; | 460 break; |
461 } | 461 } |
462 case MapNotify: { | 462 case MapNotify: { |
463 // If there's no window manager running, we need to assign the X input | 463 // If there's no window manager running, we need to assign the X input |
464 // focus to our host window. | 464 // focus to our host window. |
465 if (!IsWindowManagerPresent()) | 465 if (!IsWindowManagerPresent()) |
466 XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime); | 466 XSetInputFocus(xdisplay_, xwindow_, RevertToNone, CurrentTime); |
467 handled = true; | 467 handled = true; |
468 break; | 468 break; |
469 } | 469 } |
| 470 case MappingNotify: { |
| 471 if (xev->xmapping.request == MappingModifier || |
| 472 xev->xmapping.request == MappingKeyboard) |
| 473 XRefreshKeyboardMapping(&xev->xmapping); |
| 474 break; |
| 475 } |
470 case MotionNotify: { | 476 case MotionNotify: { |
471 // Discard all but the most recent motion event that targets the same | 477 // Discard all but the most recent motion event that targets the same |
472 // window with unchanged state. | 478 // window with unchanged state. |
473 XEvent last_event; | 479 XEvent last_event; |
474 while (XPending(xev->xany.display)) { | 480 while (XPending(xev->xany.display)) { |
475 XEvent next_event; | 481 XEvent next_event; |
476 XPeekEvent(xev->xany.display, &next_event); | 482 XPeekEvent(xev->xany.display, &next_event); |
477 if (next_event.type == MotionNotify && | 483 if (next_event.type == MotionNotify && |
478 next_event.xmotion.window == xev->xmotion.window && | 484 next_event.xmotion.window == xev->xmotion.window && |
479 next_event.xmotion.subwindow == xev->xmotion.subwindow && | 485 next_event.xmotion.subwindow == xev->xmotion.subwindow && |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 return new DesktopHostLinux(bounds); | 615 return new DesktopHostLinux(bounds); |
610 } | 616 } |
611 | 617 |
612 // static | 618 // static |
613 gfx::Size DesktopHost::GetNativeScreenSize() { | 619 gfx::Size DesktopHost::GetNativeScreenSize() { |
614 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); | 620 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); |
615 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 621 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
616 } | 622 } |
617 | 623 |
618 } // namespace aura | 624 } // namespace aura |
OLD | NEW |